Update serializers to be a subclass of
LazyExtraFieldsHyperlinkedModelSerializer to allow adding
more fields remotely.
Update URL fields to use MultiKwargHyperlinkedIdentityField.
Rename URL fields for uniformity.
Signed-off-by: Roberto Rosario <Roberto.Rosario.Gonzalez@mayan-edms.com>
Update the API routers registration to not duplicate
the document's URL parameter definition.
Signed-off-by: Roberto Rosario <Roberto.Rosario.Gonzalez@mayan-edms.com>
This refactor adds two new endpoints to view the OCR
content of versions and documents.
Signed-off-by: Roberto Rosario <Roberto.Rosario.Gonzalez@mayan-edms.com>
These views allow accesing the tags list of a document as
well as attaching or removing tags in bulk.
The URLs for tag list, attach and remove are added to the
DocumentSerializer.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This class is a mixin of LazyExtraFieldsSerializerMixin and
serializers.HyperlinkedModelSerializer. It allows adding fields
to a 3rd party app serializer without having to import the serializer.
Referencing is done using the dotted path of the serializer.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Rename the get_menu_links and get_menus_links to
navigation_resolve_menu.
Change the return value of the menu resolving to include
the resolved object.
Update the links display templates to show which object the
links belong to when there is more than one object.
Update the links display templates to show which menu
the links belong to when there is more than one menu.
Remove the sidebar menu and unify its links with the
secondary menu.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Update the ACL permission view to use the new AddRemoveView.
Add ACL created and ACL edit events.
Add permission adding and removal accesors to the ACL model.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Make sure to always used the base filtered source queryset.
Remove the grouped attribute which is subclass specific.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
View that use the MultipleObjectMixin can now fully operate
as single object or multiple object views.
Add the self.view_mode_single and self.view_mode_multiple flags.
Add support for single, singular and plural titles and success
messages via:
success_message_single, success_message_singular,
sucess_message_plural, title_single, title_singular and
title_plural class attributes.
Insert object_list and object as attributes of the view class
to avoid calling the queryset again.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Use the new AddRemove View for the Role's group and
permissions views as well as the Group's role views.
Convert the API to use viewsets.
Add more tests.
Add role created and edited events.
Add event subscription support to roles.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Add a new view based on AssignRemove with extra features
and filtering. AddRemoveView also has two new buttons:
Add all, Remove all.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
- Update groups add, remove and users add, remove methods trigger
only one event on the parent method and multiple on the child method.
- Add missing group_list, _add, _remove permissions.
- Monkey patch Django's User and Group model save method to
trigger the creation and edited events.
- Monkeypatch user sorting to silence warnings.
- Improve test mixins to allow reuse of view and API view
requests.
- Finish adding all API tests.
- Add events test from API view requests.
- Remove event commits from views.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
- Add back support for API views but using the
api_urlpatterns list. Needed for the current user
API until a dynamic route router is implemented that
can allow a viewset action to specify its entire URL.
- Make sure the user is authenticated before
trying to the user permissions.
- Improve how external_object_list options are read from
the class.
- None authenticated users will get a blank queryset if the
view doesn't require a permission.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Remove the APIRoot view.
Remove the Endpoint class.
Remove the EndpointSerializer.
Move API documentation generation from the root urls module
to the app's urls module.
Update the app API URL generation to be based on viewsets
instead of an custom api_urls list.
Remove MayanObjectPermissionsFilter and replace it with
MayanViewSetObjectPermissionsFilter which allows mapping
a required permission to a specific viewset action.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>