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 6843 context menu additional items #4819

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ValJed
Copy link
Contributor

@ValJed ValJed commented Dec 11, 2024

PRO-6843

Summary

I need to add in palette a new item in the context menu.
This item should not open any modal but just emit an event I could listen to know user clicked on it. So I cannot use customOperations here.

I just added the possibility to pass an array of extra items to a AposDocContextMenu component.
This one can be used to call an action like we already do, or to emit a simple event when closing to the parent, like I do with palette.

It allows me to do this in palette:

          <AposDocContextMenu
            :doc="docFields.data"
            :show-edit="false"
            :additional-menu-items="[{
              label: 'aposPalette:resetPalettePosition',
              action: 'reset-position',
              emitEvent: true
            }]"
            @close="menuCloseHandler"
          />
       ...
    menuCloseHandler(_doc, action) {
      if (action === 'reset-position') {
        this.resetPosition();
      }
    }

If I pass emitEvent it will simply emit close with the action as parameter.

What are the specific steps to test this change?

See above

What kind of change does this PR introduce?

  • 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

@ValJed ValJed requested review from boutell and haroun December 11, 2024 17:26
@ValJed ValJed force-pushed the pro-6843-context-menu-additional-items branch from e112914 to 6cd08f1 Compare December 12, 2024 09:38
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