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 15 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.

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

The user can only edit the VMs in an existing plan when the plan is in Ready state (so not running/failed/error etc.)

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

@jschuler jschuler Dec 16, 2024

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

This variation is needed for Edit VMs case since there should be no checkboxes, just expandable rows.

@@ -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

Attention: Patch coverage is 50.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 36.36%. Comparing base (13484d0) to head (6b527bf).
Report is 212 commits behind head on main.

Files with missing lines Patch % Lines
...ackages/forklift-console-plugin/src/utils/fetch.ts 44.44% 5 Missing ⚠️
...kages/forklift-console-plugin/src/utils/isEmpty.ts 50.00% 1 Missing ⚠️

❗ 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.36%   -0.46%     
==========================================
  Files         158      157       -1     
  Lines        2548     2533      -15     
  Branches      599      597       -2     
==========================================
- Hits          938      921      -17     
- Misses       1428     1430       +2     
  Partials      182      182              

☔ 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]>
@yaacov
Copy link
Member

yaacov commented Dec 29, 2024

@sgratch please review

@jschuler happy holidays, @sgratch the maintainer, asked to review big PRs so we will wait for her review.

Signed-off-by: Joachim Schuler <[email protected]>
@jschuler jschuler requested a review from sgratch January 10, 2025 20:08
Copy link
Collaborator

@metalice metalice left a comment

Choose a reason for hiding this comment

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

Hey @jschuler

I went over the PR, following our best practices, and I didn't comment on everything as I trust that you will understand from the comments that I did add and adjust in all the places that it fit. If something isn't clear, just let me know over Slack

) : (
<Button
onClick={onClick}
variant="plain"
Copy link
Collaborator

Choose a reason for hiding this comment

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

u can use ButtonVariant from PF

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 pre-existing code? I would say these kinds of changes are generally out-of-scope

Copy link
Collaborator

Choose a reason for hiding this comment

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

You are right, but its a process of bringing this project to a better level

Copy link
Contributor Author

Choose a reason for hiding this comment

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

on second thought, is it necessary? we have typescript types

@sgratch sgratch added the enhancement Categorizes issue or PR as related to a new feature. label Jan 17, 2025
@@ -0,0 +1,117 @@
import React 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.

Originally from here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lifted up since it's used in multiple locations now

@sgratch sgratch added this to the next milestone Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants