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

Pro 4257 modal property #2

Merged
merged 11 commits into from
Aug 4, 2023
Merged

Pro 4257 modal property #2

merged 11 commits into from
Aug 4, 2023

Conversation

falkodev
Copy link
Contributor

@falkodev falkodev commented Aug 3, 2023

Summary

https://linear.app/apostrophecms/issue/PRO-4257/as-a-developer-i-can-use-the-modal-property-in-my-batch-operations

  • Use the modal property in batch operations
  • Lay the groundwork for next ticket, where the modal should be the same (and the passed props too) between batch operations custom modal and doc context menu custom modal

What are the specific steps to test this change?

  • Go to a module with export enabled
  • Select multiple items and click "Export" in the batch operations menu
  • Close the modal, click on the context menu of one item and click "Export"

The modal should be the same. It will be completed in another ticket.

image

@linear
Copy link

linear bot commented Aug 3, 2023

PRO-4257 As a developer, I can use the modal property in my batch operations

Like for the method addContextOperation available in the module apostrophecms/doc, the batch operations must support the method modal, ex:

  batchOperations (self) {
    return {
      add: {
        export: {
          label: 'Download',
          modal: 'AposMyComponent'
        }
      }
    };
  }

This way, when clicking on the batch operation button, will be able to open a specific modal for more specific and complex behaviors.

We'll need this feature to be able to open the same export modal when clicking on the download button in batch operations than when clicking on the download button in the contextual menu of a single document.

You can base your work on the way it works currently for the addContextOperation method.

Acceptance Criteria

  • The new property modal is available in each batch operation action.
  • Whatever modal is opened when using this feature, it must at least get an array of IDs of the selected documents (to be able to perform needed API calls itself).

@falkodev falkodev requested a review from boutell August 4, 2023 10:03
@falkodev falkodev requested a review from boutell August 4, 2023 15:12
@@ -22,6 +22,6 @@ module.exports = {
};
}

self.apos.doc.addContextOperation(self.__meta.name, criteria);
self.apos.doc.addContextOperation(criteria);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

criteria is not a good name for this. operation would be good.

@falkodev falkodev requested a review from boutell August 4, 2023 16:00
@falkodev falkodev merged commit 5fe2d20 into main Aug 4, 2023
9 checks passed
@falkodev falkodev deleted the pro-4257-modal-property branch August 4, 2023 16:14
boutell added a commit that referenced this pull request Jan 24, 2024
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