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

(feat): Add capacity and nodes step and review step to ODF wizard #9581

Merged
merged 1 commit into from Jul 22, 2021

Conversation

afreen23
Copy link
Contributor

@afreen23 afreen23 commented Jul 22, 2021

Screenshot from 2021-07-22 13-12-05
Screenshot from 2021-07-22 13-10-41
Screenshot from 2021-07-22 16-23-24
Screenshot from 2021-07-22 16-23-08

Signed-off-by: Afreen Rahman afrahman@redhat.com

@openshift-ci openshift-ci bot added component/ceph Related to ceph-storage-plugin kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 22, 2021
Comment on lines +144 to +148
<EnableTaintNodes
enableTaint={state.enableTaint}
setEnableTaint={() =>
dispatch({ type: ActionType.SET_ENABLE_TAINT, payload: !state.enableTaint })
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

refactored taint component , so it can be utilized by ODF UI when required.

@afreen23
Copy link
Contributor Author

Tests are failing due to i18n . Will fix them with next round of reviews.

);
};

export const EnableTaintNodes: React.FC<EnableTaintNodesProps> = ({
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here as previous PR. It is a boolean, We could make use of Switch instead of a checkbox. Could take a look into this later

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ack. its design related so I can only note it for now.
Thanks

nodeCount: nodes.length,
count: nodes.length,
})}{' '}
{t('ceph-storage-plugin~selected ({{cpu}} CPU and {{memory}} on ', {
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't see the totalcpu on the capacity and nodes page. Please check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yes, did not update the names.

nodes: WizardState['capacityAndNodes']['nodes'];
};

const SelectedCapacityAndNodes: React.FC<SelectedCapacityAndNodesProps> = ({
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const SelectedCapacityAndNodes: React.FC<SelectedCapacityAndNodesProps> = ({
const SelectedCapacityAndNodesArbiter: React.FC<SelectedCapacityAndNodesProps> = ({

or

Suggested change
const SelectedCapacityAndNodes: React.FC<SelectedCapacityAndNodesProps> = ({
const SelectedCapacityAndNodesNoProvisioner: React.FC<SelectedCapacityAndNodesProps> = ({

Both the components have very similiar names. We can name one something different

Copy link
Contributor Author

Choose a reason for hiding this comment

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

One is Select other is Selected as per designs:

<TextContent>
<Text component={TextVariants.small}>
<Trans ns="ceph-storage-plugin">
The available capacity is based on all attached disks associated with the selected
Copy link
Contributor

Choose a reason for hiding this comment

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

does it need to be externalised or does the Trans do the same thing ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, Trans is the translation component

Copy link
Contributor

@vbnrh vbnrh Jul 22, 2021

Choose a reason for hiding this comment

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

ok.. i don't see this line in ceph-storage-plugin file which is why i asked

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#9581 (comment)
Check now.

import { WizardNodeState, WizardState } from '../../reducer';
import './review-and-create-step.scss';

const NodesCard: React.FC<NodeCardProps> = ({ nodes }) =>
Copy link
Contributor

Choose a reason for hiding this comment

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

We can reuse this card from frontend/packages/ceph-storage-plugin/src/components/ocs-install/install-wizard/review-and-create.tsx , pass the classnames and improvise the state

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 am using this here since soon ocs one will be deprecated. We should not waste effort in maintaining older code.

Copy link
Contributor

Choose a reason for hiding this comment

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

ack

[AlertVariant.danger]: RedExclamationCircleIcon,
};

export const ReviewListTitle: React.FC<ReviewListTitleProps> = ({ text }) => (
Copy link
Contributor

Choose a reason for hiding this comment

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

reuse from frontend/packages/ceph-storage-plugin/src/components/ocs-install/install-wizard/review-and-create.tsx

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The css is different and also we will remove storage cluster related code post 4.10

Copy link
Contributor

Choose a reason for hiding this comment

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

ack


type ReviewListTitleProps = { text: string };

export const ReviewListBody: React.FC<ReviewListBodyProps> = ({
Copy link
Contributor

Choose a reason for hiding this comment

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

reuse from frontend/packages/ceph-storage-plugin/src/components/ocs-install/install-wizard/review-and-create.tsx

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same as above

Copy link
Contributor

Choose a reason for hiding this comment

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

ack

);
};

type ReviewListBodyProps = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Many of these variables can be reused from the other page

@vbnrh
Copy link
Contributor

vbnrh commented Jul 22, 2021

We need to revisit this later for refactoring the code structure. It has become very confusing to navigate. Lot of these components can be organised and repurposed for our case

@afreen23
Copy link
Contributor Author

We need to revisit this later for refactoring the code structure. It has become very confusing to navigate. Lot of these components can be organised and repurposed for our case

I think its simple navigation. You start from create step -> CapacityAndNodes => SelectedCapacityAndNodes and SelectCapacityAndNodes.
Each component has its own SelecCapacity/SelectedCapacity and SelecetdNodes/SelectNodes.

Pleas specify which part is confusing ? I will make changes if it sounds valid.

@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 22, 2021
@vbnrh
Copy link
Contributor

vbnrh commented Jul 22, 2021

We need to revisit this later for refactoring the code structure. It has become very confusing to navigate. Lot of these components can be organised and repurposed for our case

I think its simple navigation. You start from create step -> CapacityAndNodes => SelectedCapacityAndNodes and SelectCapacityAndNodes.
Each component has its own SelecCapacity/SelectedCapacity and SelecetdNodes/SelectNodes.

Pleas specify which part is confusing ? I will make changes if it sounds valid.

Ok. thanks for clearing it now . I was confused with why we have so many variants of same component. Basically n-1 issue.

- implements https://issues.redhat.com/browse/ODFE-86
- implements https://issues.redhat.com/browse/ODFE-87

- merged the steps of attached-devices and internal mode previously in OCS
- incorporated new UI changes for raw capacity

Signed-off-by: Afreen Rahman <afrahman@redhat.com>
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 22, 2021
@vbnrh
Copy link
Contributor

vbnrh commented Jul 22, 2021

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 22, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 22, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: afreen23, vbnrh

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

The pull request process is described 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

@openshift-merge-robot openshift-merge-robot merged commit c3a8424 into openshift:master Jul 22, 2021
@spadgett spadgett added this to the v4.9 milestone Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/ceph Related to ceph-storage-plugin kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants