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

Allow editing plan hooks and mappings only for specific plan's statuses #1394

Conversation

sgratch
Copy link
Collaborator

@sgratch sgratch commented Nov 27, 2024

Reference: https://issues.redhat.com/browse/MTV-1713

Enable editing of plan hooks (under Hooks tab) or plan mappings (under Mappings tab) fields only for the following plan statuses: 'Unknown', 'Canceled', 'Error', 'Failed', 'vmError', 'Warning', 'Ready '

Disable the edit option for those Hooks, Mappings tabs fields for all other plan statuses.

Screenshots

Before - an example for an archived plan

Screenshot from 2024-11-27 19-46-56

Screenshot from 2024-11-27 19-47-21

After - an example for an archived plan

Screenshot from 2024-11-27 19-42-26

Screenshot from 2024-12-02 21-43-50

@sgratch sgratch requested a review from yaacov November 27, 2024 17:48
@sgratch
Copy link
Collaborator Author

sgratch commented Nov 27, 2024

cc: @RichardHoch
Can you please review the text messages as appear in screenshots attached to the main comment #1394 (comment)

@codecov-commenter
Copy link

codecov-commenter commented Nov 27, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 36.21%. Comparing base (13484d0) to head (052d676).
Report is 136 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1394      +/-   ##
==========================================
- Coverage   36.81%   36.21%   -0.60%     
==========================================
  Files         158      159       +1     
  Lines        2548     2579      +31     
  Branches      599      614      +15     
==========================================
- Hits          938      934       -4     
- Misses       1428     1450      +22     
- Partials      182      195      +13     

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

@sgratch sgratch added the bug Categorizes issue or PR as related to a bug. label Nov 27, 2024
@sgratch sgratch added this to the 2.8.0 milestone Nov 27, 2024
@@ -1,6 +1,6 @@
import { V1beta1Plan } from '@kubev2v/types';

export const hasPlanEditable = (plan: V1beta1Plan) => {
export const hasPlanIncludedCompleteRunningVMs = (plan: V1beta1Plan) => {

Choose a reason for hiding this comment

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

nitpick - naming suggestions: hasASuccessfullyMigratedVM, hasACompleteRunningVM, or hasSomeCompleteRunningVMs

The function is operating on the plan argument, so I don't think plan needs to be part of the function name.

@@ -74,7 +74,7 @@
"Clear all filters": "Clear all filters",
"Click the pencil for setting provider web UI link": "Click the pencil for setting provider web UI link",
"Click the update credentials button to save your changes, button is disabled until a change is detected.": "Click the update credentials button to save your changes, button is disabled until a change is detected.",
"Click the update hooks button to save your changes, button is disabled until a change is detected.": "Click the update hooks button to save your changes, button is disabled until a change is detected.",
"Click the update hooks button to save your changes, button is disabled until a change is detected or when the plan status does not enable editing.": "Click the update hooks button to save your changes, button is disabled until a change is detected or when the plan status does not enable editing.",

Choose a reason for hiding this comment

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

Do you think it would make sense to display different messages based on the reason the button is disabled instead of explaining both sets of criteria to them since we know when it's disabled due to a status. Ex: Plans in <status> status are not editable or something like that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

Screenshots:

Screenshot from 2024-12-02 21-40-18

Screenshot from 2024-12-02 21-40-36

Screenshot from 2024-12-02 21-43-50

@sgratch sgratch force-pushed the plan-hooks-and-mapping-editing-based-on-plan-status branch 2 times, most recently from ef03be7 to 73b5c6a Compare December 2, 2024 19:43
Reference: https://issues.redhat.com/browse/MTV-1713

Enable editing of plan hooks (under Hooks tab) or plan mappings (under Mappings tab) fields only for the following plan statuses:
'Unknown', 'Canceled', 'Error', 'Failed', 'vmError', 'Warning', 'Ready '

Disable the edit option for those Hooks, Mappings tabs fields for all other plan statuses.

Signed-off-by: Sharon Gratch <[email protected]>
@sgratch sgratch force-pushed the plan-hooks-and-mapping-editing-based-on-plan-status branch from 73b5c6a to 052d676 Compare December 2, 2024 19:51
Copy link

sonarqubecloud bot commented Dec 2, 2024

@sgratch sgratch requested a review from pcbailey December 2, 2024 20:00
@pcbailey
Copy link

pcbailey commented Dec 3, 2024

lgtm. Do we need to wait on the docs team to review the copy?

@sgratch
Copy link
Collaborator Author

sgratch commented Dec 3, 2024

lgtm. Do we need to wait on the docs team to review the copy?

If doc team doesn't comment till merging the PR then I prefer not to block by waiting and ping them later on once they document this part or have time.
If changes are required later then we'll fix them in a follow up.

@sgratch sgratch merged commit c3eeb85 into kubev2v:main Dec 3, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants