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

Disable edit tag "save changes" button if no changes have been made #138500

Merged
merged 4 commits into from
Aug 12, 2022

Conversation

hop-dev
Copy link
Contributor

@hop-dev hop-dev commented Aug 10, 2022

Summary

Closes #138493 which was raised by Fleet QA.

In the edit tag modal, disable the "save changes" button until the user makes changes to the tag

save_changes_btn.mov

@hop-dev hop-dev added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc release_note:skip Skip the PR/issue when compiling release notes backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Aug 10, 2022
@hop-dev hop-dev self-assigned this Aug 10, 2022
@hop-dev hop-dev requested a review from a team as a code owner August 10, 2022 11:40
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

@hop-dev hop-dev changed the title ]Disable edit tag "save changes" button if no changes have been made Disable edit tag "save changes" button if no changes have been made Aug 10, 2022
const initialName = useMemo(() => tag.name, []);

const initialTag = useMemo(() => tag, []);
const tagHasBeenModified = useMemo(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seemed a shame to import lodash isEqual here to compare 3 properties of an object so kept it simple

@hop-dev hop-dev enabled auto-merge (squash) August 10, 2022 11:42
Copy link
Contributor

@rudolf rudolf left a comment

Choose a reason for hiding this comment

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

Changes looks good. Could you add a test in x-pack/test/saved_object_tagging/functional/tests/edit.ts ?

@hop-dev
Copy link
Contributor Author

hop-dev commented Aug 11, 2022

@rudolf I've added the tests 👍

@hop-dev hop-dev requested a review from rudolf August 11, 2022 10:45
@hop-dev
Copy link
Contributor Author

hop-dev commented Aug 11, 2022

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
savedObjectsTagging 40.6KB 40.8KB +212.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @hop-dev

Copy link
Contributor

@rudolf rudolf left a comment

Choose a reason for hiding this comment

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

👍 Thanks!

@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.4

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

@hop-dev hop-dev deleted the 138493-disable-save-changes-btn branch August 12, 2022 10:17
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v8.4.0 v8.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fleet]: 'Save Changes' button is shown enabled on 'Edit X tag' pop-up even when no changes are made on it
5 participants