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 onChanges() method in ResourceYaml.vue #12800

Merged

Conversation

rak-phillip
Copy link
Member

@rak-phillip rak-phillip commented Dec 5, 2024

Summary

This removes the onChanges() method from ResourceYaml.vue because the intent of the code is not clear and appears to provide no benefit in testing. This is a source of frustration for some users, making it impossible to add comments to YAML.

It appears that this function exists to automatically adjust the indentation of comment lines; it has failed to accomplish this task during testing. If users wish to format yaml, we should support this with an explicit action in the YAML editor, not something that is performed on every keypress.

Fixes #11226

Occurred changes and/or fixed issues

  • remove the onChanges() method from ResourceYaml.vue

Technical notes summary

  • this method doesn't appear to function
  • it is the root cause of clobbering user input

Areas or cases that should be tested

YAML editors throughout Dashboard: we want to make sure that we can edit, delete, and create lines. Ensure that Copy/Paste works. Make sure that no regressions arise as a result of this change, especially in scenarios related to indenting and comments.

Areas which could experience regressions

YAML Editor

Screenshot/Video

Before

2024-12-04.15-33-39.mp4

After

2024-12-04.17-02-25.mp4

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes

This removes the `onChanges()` method from `ResourceYaml.vue` because the intent of the code is not clear and appears to provide no benefit in testing. This is a source of frustration for some users, making it impossible to add comments to YAML. 

It appears that this function exists to automatically adjust the indentation of comment lines; it has failed to accomplish this task during testing, so it appears to be meaningless. If users wish to format yaml, we should support this with an explicit action in the YAML editor, not something that is performed on every keypress.

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
@rak-phillip rak-phillip added this to the v2.11.0 milestone Dec 5, 2024
@rak-phillip rak-phillip self-assigned this Dec 5, 2024
@rak-phillip rak-phillip merged commit 56fe8bf into rancher:master Dec 5, 2024
41 checks passed
@rak-phillip rak-phillip deleted the bugfix/11226-yaml-editor-comments branch December 5, 2024 19:15
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.

Malfunctioning of comment using # when creating GitRepo
2 participants