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

Remove Edit Event Definition button from events scoped as immutable #16515

Conversation

kingzacko1
Copy link
Contributor

@kingzacko1 kingzacko1 commented Sep 18, 2023

Description

  • Do not display Edit Event Definition button if the event definition is scoped as immutable. The edit option is already hidden from the More Actions menu.
  • Add a Duplicate Event Definition button to the ViewEventDefinition page toolbar

Motivation and Context

closes #15916

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

Copy link
Contributor

@ryan-carroll-graylog ryan-carroll-graylog left a comment

Choose a reason for hiding this comment

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

Looks good and tests successfully!

Nice call opening up to the edit page of the event definition copy when the duplicate button is clicked, makes the UX very seamless.

Copy link
Contributor

@danotorrey danotorrey left a comment

Choose a reason for hiding this comment

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

LGTM and tests successfully too!

@@ -104,6 +133,14 @@ const ViewEventDefinitionPage = () => {
notifications={notifications} />
</Col>
</Row>
{showDialog && (
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like the dialog is creating some sort of race condition where is trying to update the state of a component that isn't on the DOM. To solve the issue, move this block outside the DocumentTitle block and wrap both components in a fragment.

<>
  <DocumentTitle ....>
  </DocumentTitle>
  {showDialog && (
    <ConfirmDialog ....>
    </ConfirmDialog>
  )}
</>

@kingzacko1 kingzacko1 merged commit d5418ac into master Sep 27, 2023
5 checks passed
@kingzacko1 kingzacko1 deleted the 15916-cannot-assign-remove-or-edit-notification-in-illuminate-created-event-in-51x branch September 27, 2023 20:12
maxiadlovskii pushed a commit that referenced this pull request Oct 4, 2023
…16515)

* Remove Edit Event Definition button from events scoped as immutable
* Add duplicate button on View Event Definition page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot assign, remove, or edit notification in Illuminate created event in 5.1.x
4 participants