Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export: add context menu and batch operation #1

Merged
merged 4 commits into from
Aug 2, 2023

Conversation

falkodev
Copy link
Contributor

Add Export buttons for documents contextual menus and batch operations.

https://linear.app/apostrophecms/issue/PRO-4258/as-an-editor-i-can-see-a-download-button-in-docs-contextual-menus-and

Acceptance Criteria

A Download button is available from documents contextual menus.

A Download button is available from pieces batch operations.

If the option shareDocsDisableExport is true, these buttons must not appear for this module.

@linear
Copy link

linear bot commented Jul 28, 2023

PRO-4258 As an editor, I can see a Download button in docs contextual menus and batch operations

Following designs, this new module must add Download buttons for documents contextual menus and batch operations.

From:

  • Contextual Menu

image.png

image.png

To do that you must use the method addContextOperation called in the init method of your module.

Ex:

self.apos.doc.addContextOperation(self.__meta.name, {
  action: 'export',
  label: 'apostropheMyModule:export',
  modal: 'AposExportPiecesModal', // It will open this modal when clicked on.
});
  • Batch Operations

pieces-manager-download.png

To do that you must add a batchOperations property to your module, ex:

  batchOperations (self) {
    return {
      add: {
        export: {
          label: 'Export',
          messages: {
            progress: 'apostropheMyModule:downloading'
          },
          modal: 'AposExportPiecesModal'
        }
      },
      group: {
        more: {
          icon: 'dots-vertical-icon',
          operations: [ 'export' ]
        }
      }
    };
  },

A verification must be done for each module, if the current one has the option shareDocsDisableExport set to true, the button must not appear.

Permissions

A user that has at least one per-type permission should be able to export anything.

If you can see a doc you can export it.

Please check the PRO-4128 for additional permissions informations

Acceptance Criteria

  • A Download button is available from documents contextual menus.
  • A Download button is available from pieces batch operations.
  • If the option shareDocsDisableExport is true, these buttons must not appear for this module.

@falkodev falkodev self-assigned this Jul 31, 2023
@falkodev falkodev requested a review from haroun July 31, 2023 12:52
@falkodev falkodev marked this pull request as ready for review July 31, 2023 12:52
@falkodev falkodev requested a review from boutell July 31, 2023 14:10
@falkodev falkodev merged commit 7716679 into main Aug 2, 2023
9 checks passed
@falkodev falkodev deleted the pro-4258-export-button branch August 2, 2023 08:39
boutell added a commit that referenced this pull request Jan 24, 2024
fix oversights re: cleanup route
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants