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 operation #4251

Merged
merged 12 commits into from
Aug 7, 2023
Merged

Pro 4257 modal operation #4251

merged 12 commits into from
Aug 7, 2023

Conversation

falkodev
Copy link
Contributor

@falkodev falkodev commented Aug 3, 2023

Summary

Add the ability to have custom modals for batch operations, and align props between doc context menu custom modal and batch operation custom modal, in order to use the same component.

What are the specific steps to test this change?

Test with apostrophecms/import-export#2

What kind of change does this PR introduce?

(Check at least one)

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Build-related changes
  • Other

Make sure the PR fulfills these requirements:

  • It includes a) the existing issue ID being resolved, b) a convincing reason for adding this feature, or c) a clear description of the bug it resolves
  • The changelog is updated
  • Related documentation has been updated
  • Related tests have been updated

@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 haroun August 3, 2023 14:06
@falkodev falkodev requested a review from boutell August 4, 2023 10:02
@falkodev falkodev requested a review from boutell August 4, 2023 15:11
@falkodev falkodev requested a review from boutell August 7, 2023 07:45
@falkodev falkodev merged commit 5186f05 into main Aug 7, 2023
6 checks passed
@falkodev falkodev deleted the pro-4257-modal-operation branch August 7, 2023 12:46
haroun added a commit that referenced this pull request Aug 7, 2023
* main: (24 commits)
  Pro 4257 modal operation (#4251)
  Add request information when possible
  fixed tests
  eslint
  fix context operation module names
  Legacy util logger note
  CHANGELOG
  Dev docs env clarification
  Remove object assign for performance
  add missing keys
  add settings translations
  More performance
  Kill mongo warning
  Login structured logging
  Implement route errors
  Assign shorthand
  Performance optimization
  API errors draft
  Property order
  Handle messageAs and legacy log calls
  ...
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