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

MTV-1726: Edit VMs list in migration plan #1414

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jschuler
Copy link
Contributor

@jschuler jschuler commented Dec 16, 2024

https://issues.redhat.com/browse/MTV-1726

Design story:
https://issues.redhat.com/browse/HPUX-166

Provide users the possibility to add more VMs (not just delete) to an existing plan.
See this table below for when it is possible to do so.
Basically, whenever you can update plan mappings, you can also update plan VMs.

For the mappings section, I reused the plan details mappings tab section, since it can patch existing mappings

Plan status VMs status Can select to cancel Can select to remove Can edit plan VMs (add/remove) Can edit mappings Notes
Running TRUE FALSE FALSE FALSE
Succeeded FALSE FALSE FALSE FALSE no actions available
Failed At least 1 VM migrated FALSE TRUE FALSE FALSE can restart plan
Canceled At least 1 VM migrated FALSE TRUE FALSE FALSE can restart plan
Failed No VM migrated FALSE FALSE TRUE TRUE
Canceled No VM migrated FALSE FALSE TRUE TRUE
Ready FALSE FALSE TRUE TRUE
Error FALSE FALSE TRUE TRUE No VMs were migrated

See video of before (green border)/after:

Screen.Recording.2024-12-13.at.12.04.40.PM.mov

@@ -0,0 +1,149 @@
import React, { useState } from 'react';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is basically a copy of packages/forklift-console-plugin/src/components/page/StandardPageWithSelection.tsx but without selection, only expansion

@@ -0,0 +1 @@
export type PlanEditAction = 'PLAN' | 'VMS';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

it will allow us next (with small changes like this) to edit plans too

loadError: unknown;
loaded?: boolean;
loadError?: unknown;
planMappingsState: PlanMappingsSectionState;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I lifted the state up so that we can reuse planmappings from Edit VMs case


import '../create/PlanCreatePage.style.css';

export const PlanEditPage: React.FC<{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

initially copied from PlanCreatePage, but there were enough changes to make it its own component

@codecov-commenter
Copy link

codecov-commenter commented Dec 16, 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 (999f277).
Report is 164 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    #1414      +/-   ##
==========================================
- Coverage   36.81%   36.21%   -0.60%     
==========================================
  Files         158      159       +1     
  Lines        2548     2579      +31     
  Branches      599      615      +16     
==========================================
- 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.

[MTV-1686] Simplify/update migration plan status cell

Signed-off-by: Joachim Schuler <[email protected]>
Signed-off-by: Joachim Schuler <[email protected]>
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.

3 participants