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

fix(v2): Show error for unsaved data set rename #3328

Merged
merged 7 commits into from
Nov 22, 2024

Conversation

traeok
Copy link
Member

@traeok traeok commented Nov 19, 2024

Proposed changes

v2 port of the error dialog from #3326

Release Notes

Milestone: 2.18.1

Changelog:

  • Fixed an issue where renaming a data set with unsaved changes did not cancel the rename operation. Now, when renaming a data set with unsaved changes, you will be prompted to resolve them before continuing. #3328

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which adds or improves functionality)
  • Breaking change (a change that would cause existing functionality to not work as expected)
  • Documentation (Markdown, README updates)
  • Other (please specify above in "Proposed changes" section)

Checklist

General

  • I have read the CONTRIBUTOR GUIDANCE wiki
  • All PR dependencies have been merged and published (if applicable)
  • A GIF or screenshot is included in the PR for visual changes
  • The pre-publish command has been executed:
    • v2 and below: yarn workspace vscode-extension-for-zowe vscode:prepublish
    • v3: pnpm --filter vscode-extension-for-zowe vscode:prepublish

Code coverage

  • There is coverage for the code that I have added
  • I have added new test cases and they are passing
  • I have manually tested the changes

Deployment

  • I have added developer documentation (if applicable)
  • Documentation should be added to Zowe Docs
    • If you're an outside contributor, please post in the #zowe-doc Slack channel to coordinate documentation.
    • Otherwise, please check with the rest of the squad about any needed documentation before merging.
  • These changes may need ported to the appropriate branches (list here):

@traeok traeok changed the base branch from main to v2-lts November 19, 2024 14:28
Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.38%. Comparing base (a5a0cd7) to head (7705058).
Report is 1 commits behind head on v2-lts.

Additional details and impacted files
@@            Coverage Diff             @@
##           v2-lts    #3328      +/-   ##
==========================================
+ Coverage   93.36%   93.38%   +0.02%     
==========================================
  Files         105      105              
  Lines       11092    11117      +25     
  Branches     2426     2356      -70     
==========================================
+ Hits        10356    10382      +26     
+ Misses        735      734       -1     
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@traeok
Copy link
Member Author

traeok commented Nov 19, 2024

Not sure why SonarCloud and the Pull Request Size bot is having a bad time. I think it might have been because I changed the base branch after opening the PR.

That said, disregard the SonarCloud message as its not accurate. I've marked the SonarCloud message as outdated.

@traeok traeok marked this pull request as ready for review November 19, 2024 20:06
Copy link

📅 Suggested merge-by date: 12/3/2024

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
17.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@traeok traeok changed the title [V2] fix(ds): Show error for unsaved data set rename fix(v2): Show error for unsaved data set rename Nov 20, 2024
awharn
awharn previously approved these changes Nov 21, 2024
Copy link
Contributor

@anaxceron anaxceron left a comment

Choose a reason for hiding this comment

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

Made some comments on the changelog and other items.

packages/zowe-explorer/CHANGELOG.md Outdated Show resolved Hide resolved

expect(await TreeViewUtils.errorForUnsavedResource(ussNode)).toBe(true);
expect(blockMocks.errorMessage).toHaveBeenCalledWith(
"Unable to rename testFile.txt because you have unsaved changes in this file. " + "Please save your work and try again.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there an extra space between the period and the quotation marks in the first message? Not sure.

Copy link
Member Author

Choose a reason for hiding this comment

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

No extra spaces here - the text was simply split into two sections to avoid the "max length" limit that we have set for lines of code.

Copy link
Member

Choose a reason for hiding this comment

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

The + sign seems unnecessary here since the text isn't split across multiple lines:

Suggested change
"Unable to rename testFile.txt because you have unsaved changes in this file. " + "Please save your work and try again.",
"Unable to rename testFile.txt because you have unsaved changes in this file. Please save your work and try again.",

Copy link
Contributor

@anaxceron anaxceron left a comment

Choose a reason for hiding this comment

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

good stuff, @traeok, thank you!

Copy link
Member

@t1m0thyj t1m0thyj left a comment

Choose a reason for hiding this comment

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

This doesn't prevent me from renaming a member with unsaved changes. The V3 PR behaved as expected.

Copy link
Member

@t1m0thyj t1m0thyj left a comment

Choose a reason for hiding this comment

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

LGTM once I fixed my environment, thanks @traeok and sorry for the false alarm

@t1m0thyj t1m0thyj merged commit ed4f867 into v2-lts Nov 22, 2024
15 of 16 checks passed
@t1m0thyj t1m0thyj deleted the fix/v2/add-error-unsaved-ds-rename branch November 22, 2024 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

4 participants