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

Node resource table and modals #3565

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dpanshug
Copy link
Contributor

@dpanshug dpanshug commented Dec 11, 2024

RHOAIENG-16256

Description

Added table and modal for Node resource for Hardware profile

Screenshot 2024-12-24 at 2 33 46 PM
Screenshot 2024-12-24 at 2 20 50 PM
Screenshot 2024-12-24 at 2 26 36 PM
Screenshot 2024-12-24 at 2 26 46 PM
Screenshot 2024-12-24 at 2 27 18 PM

How Has This Been Tested?

Currently this table and modal are standalone components and are not used anywhere, to tests you can import <ManageNodeResourceSection /> to any form page, like i have tested this in ManageAcceleratorProfile

Test Impact

Add unit tests for validation utility functions

Request review criteria:

Self checklist (all need to be checked):

  • The developer has manually tested the changes and verified that the changes work
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has added tests or explained why testing cannot be added (unit or cypress tests for related changes)

If you have UI changes:

  • Included any necessary screenshots or gifs if it was a UI change.
  • Included tags to the UX team if it was a UI/UX change.

After the PR is posted & before it merges:

  • The developer has tested their solution on a cluster by using the image produced by the PR to main

@vconzola

@dpanshug
Copy link
Contributor Author

dpanshug commented Dec 11, 2024

WIP: needs some clarification around UX and data validation
discussing here: https://redhat-internal.slack.com/archives/C07C0FNHVPT/p1733920395039179

Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 22.13740% with 102 lines in your changes missing coverage. Please review.

Project coverage is 84.90%. Comparing base (5d3efb2) to head (b0426f6).
Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
...eProfiles/nodeResource/ManageNodeResourceModal.tsx 3.22% 30 Missing ⚠️
...s/hardwareProfiles/nodeResource/CountFormField.tsx 4.34% 22 Missing ⚠️
...hardwareProfiles/nodeResource/NodeResourceForm.tsx 4.54% 21 Missing ⚠️
...ardwareProfiles/nodeResource/NodeResourceTable.tsx 34.61% 17 Missing ⚠️
...ges/hardwareProfiles/ManageNodeResourceSection.tsx 0.00% 10 Missing ⚠️
...wareProfiles/nodeResource/NodeResourceTableRow.tsx 83.33% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3565      +/-   ##
==========================================
- Coverage   85.20%   84.90%   -0.31%     
==========================================
  Files        1381     1402      +21     
  Lines       31592    32168     +576     
  Branches     8832     9020     +188     
==========================================
+ Hits        26919    27311     +392     
- Misses       4673     4857     +184     
Files with missing lines Coverage Δ
...d/src/pages/hardwareProfiles/nodeResource/const.ts 100.00% <100.00%> (ø)
...d/src/pages/hardwareProfiles/nodeResource/utils.ts 100.00% <100.00%> (ø)
...wareProfiles/nodeResource/NodeResourceTableRow.tsx 83.33% <83.33%> (ø)
...ges/hardwareProfiles/ManageNodeResourceSection.tsx 0.00% <0.00%> (ø)
...ardwareProfiles/nodeResource/NodeResourceTable.tsx 34.61% <34.61%> (ø)
...hardwareProfiles/nodeResource/NodeResourceForm.tsx 4.54% <4.54%> (ø)
...s/hardwareProfiles/nodeResource/CountFormField.tsx 4.34% <4.34%> (ø)
...eProfiles/nodeResource/ManageNodeResourceModal.tsx 3.22% <3.22%> (ø)

... and 57 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 065da14...b0426f6. Read the comment docs.

Copy link
Contributor

openshift-ci bot commented Dec 12, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign manosnoam for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@dpanshug dpanshug changed the title [WIP] Node resource table and modals Node resource table and modals Dec 12, 2024
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress This PR is in WIP state label Dec 12, 2024
@dpanshug dpanshug force-pushed the node-table branch 2 times, most recently from 13a9f2d to 60d87b6 Compare December 12, 2024 12:47
@dpanshug
Copy link
Contributor Author

@kaedward @vconzola i have updated the mocks, please review the error message for field validation.

@dpanshug dpanshug force-pushed the node-table branch 2 times, most recently from fd5b060 to fd8a726 Compare December 12, 2024 13:02
frontend/src/types.ts Outdated Show resolved Hide resolved
@vconzola
Copy link

I believe there should be a space between the numbers and the units in the table, e.g., "1 GiB", not "1GiB", bur defer to @kaedward. Also, the units in the table should match the units in the dropdown, e.g., "GiB", not "Gi".

@Gkrumbach07
Copy link
Member

Could you also update the other table node table to now use your view only table

@DaoDaoNoCode
Copy link
Member

I think all the tables should use compact variant.

@dpanshug dpanshug force-pushed the node-table branch 2 times, most recently from c2f6c05 to 6580679 Compare December 18, 2024 10:42
@dpanshug
Copy link
Contributor Author

I believe there should be a space between the numbers and the units in the table, e.g., "1 GiB", not "1GiB", bur defer to @kaedward. Also, the units in the table should match the units in the dropdown, e.g., "GiB", not "Gi".

@vconzola this formatting is consistent across the Dashboard, and you can see the same approach on the spawner page under cluster storage. Do you recommend we change it?

@vconzola
Copy link

@dpanshug Please keep the units and spacing consistent with what's in the dashboard today - don't change it. I thought I got it right everywhere in the mockups, but I guess not. Apologies for the confusion.

<FormGroup label="Resource identifier" fieldId="resource-identifier">
<TextInput
value={identifier.identifier || ''}
onChange={(_, value) => setIdentifier('identifier', value)}
Copy link
Member

@DaoDaoNoCode DaoDaoNoCode Dec 18, 2024

Choose a reason for hiding this comment

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

This field should also be disabled if it's CPU or RAM based on what I saw in the mockups (Or probably disable it based on the identifier field, WDYT? @Gkrumbach07 )

const [isNodeResourceModalOpen, setIsNodeResourceModalOpen] = React.useState<boolean>(false);
return (
<>
<FormSection
Copy link
Member

@DaoDaoNoCode DaoDaoNoCode Dec 18, 2024

Choose a reason for hiding this comment

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

In the mockup, there is a description under this section title. Also, the button is a link style below the table but not next to the section title. However, the description is missed here in this PR and the button becomes the secondary button next to the title.

I am OK with changing the edit and delete icon to the kebab menu. However, I am not sure about the description and also the add button because it can affect how we show the empty state.

Can you check and help confirm that @vconzola?

Screenshot 2024-12-18 at 5 16 54 PM

Choose a reason for hiding this comment

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

Please implement as shown in the mockup including the description, the action icons in place of a kebab and the link button for Add resource. Thanks.

Copy link
Member

Choose a reason for hiding this comment

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

@dpanshug Please refer to the implementation here

Copy link
Member

Choose a reason for hiding this comment

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

this is not the latest mocks. did you verify with the latest

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vconzola For the button we have discussed before here. Can you confirm if it should be in table toolbar or the bottom of the table when the table is not empty?

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.

4 participants