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): Setup create storage system wizard #9438
(feat): Setup create storage system wizard #9438
Conversation
92b28f0
to
86c9c39
Compare
/assign @vbnrh |
...es/ceph-storage-plugin/src/components/create-storage-system/create-storage-system-footer.tsx
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,10 @@ | |||
export type ExternalProvider = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be moved inside ceph-storage-plugin/src/types
instead of a separate dir.
the dir odf-external-providers
seems odd to be sitting at the root of the plugin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file and folder is to allow external providers to add their components e.g flash system.
I am keeping it separate so that I can add more details to it and maintain separate components for the external system.
import { ExternalProvider } from './types'; | ||
import { RHCS, StorageClusterIdentifier } from '../constants/create-storage-system'; | ||
|
||
export const ODF_EXTERNAL_PROVIDERS: ExternalProvider[] = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, these constants could be moved to ceph-storage-plugin/src/constants/create-storage-system.ts
. Doesn't seem like this needs a separate place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vbnrh we don't want to do that.
This file and folder is to allow external providers to add their components e.g flash system.
I am keeping it separate so that I can add more details to it and maintain separate components for the external system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we ditch the dir and keep the files like external-provider.ts, external-provider-types ? Should accomplish the same unless you're trying to add lot of more files in later PRs into the dir
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we want to add support for each of providers to have their own folder and add their dedicated step.
frontend/packages/ceph-storage-plugin/src/components/create-storage-system/reducer.ts
Show resolved
Hide resolved
.../packages/ceph-storage-plugin/src/components/create-storage-system/create-storage-system.tsx
Outdated
Show resolved
Hide resolved
.../packages/ceph-storage-plugin/src/components/create-storage-system/create-storage-system.tsx
Outdated
Show resolved
Hide resolved
...rage-plugin/src/components/create-storage-system/create-storage-system-steps/create-steps.ts
Outdated
Show resolved
Hide resolved
nonRhcsExternalProviderStep, | ||
{ | ||
canJumpTo: count >= 3, | ||
...commonSteps.reviewAndCreate, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small confusion, if storagecluster is already there, we are just showing the step for creating storageclass and then moving to review and create ?
Is it just to create FlashSystem CR ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the same be applicable to other cases if storagecluster exists or not ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is Storage system creation, if OCS Storage System is already there we do not want to create that one.
RHCS itself uses Storage Cluster - an OCS Storage System, hence its only for external vendors
currentStep: StepState; | ||
backingStorage: { | ||
type: BackingStorageType; | ||
externalProvider: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
externalProvider: string; | |
externalProvider?: string; |
Optional right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the state of the component. it's set by the external storage dropdown.
By default one external Provider will always be set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok makes sense :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
externalProvider: string; | |
externalProvider: RHCS | IBM_FLASH; |
Reduce the scope of values that can be assigned to external providers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expect some of changes in another PR.
Otherwise it will increase the scope. the next PR will standardize contribution mechanism for plugins.
86c9c39
to
d674885
Compare
currentStep: StepState; | ||
backingStorage: { | ||
type: BackingStorageType; | ||
externalProvider: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok makes sense :)
frontend/packages/ceph-storage-plugin/src/components/create-storage-system/reducer.ts
Show resolved
Hide resolved
...rage-plugin/src/components/create-storage-system/create-storage-system-steps/create-steps.ts
Outdated
Show resolved
Hide resolved
frontend/packages/ceph-storage-plugin/src/components/create-storage-system/payloads.ts
Outdated
Show resolved
Hide resolved
frontend/packages/ceph-storage-plugin/src/components/create-storage-system/payloads.ts
Outdated
Show resolved
Hide resolved
frontend/packages/ceph-storage-plugin/src/odf-external-providers/external-providers.ts
Show resolved
Hide resolved
import { ExternalProvider } from './types'; | ||
import { RHCS, StorageClusterIdentifier } from '../constants/create-storage-system'; | ||
|
||
export const ODF_EXTERNAL_PROVIDERS: ExternalProvider[] = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we ditch the dir and keep the files like external-provider.ts, external-provider-types ? Should accomplish the same unless you're trying to add lot of more files in later PRs into the dir
currentStep: StepState; | ||
backingStorage: { | ||
type: BackingStorageType; | ||
externalProvider: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
externalProvider: string; | |
externalProvider: RHCS | IBM_FLASH; |
Reduce the scope of values that can be assigned to external providers
3f8e73d
to
d84001a
Compare
I also wanted that, but this is rendered inside the div rendered by PF wizard. In order to center this , we need to center the wizard body which will then mess with other flows where we we do not want to do that.
But the issue with that one is, I need to maintain error states for the different steps in the parent component. |
I just tested the PR, Couple of issues i noticed
Reference to how it is rendered on BucketClass creation page |
It takes in the name of resource you passing the url. If you check the previous version of code, you can see. Rest I have fixed @vbnrh |
I see we are only selecting a couple of static items but using a browser native list makes it inconsistent with dropdowns in the same page and other wizard pages . @yuvalgalanti Thoughts ? |
We should not be choosing components purely based on aesthetics. We should consider the components which are semantically applicable for a UI element. Its is actually a select list option hence makes sense to use it here. Dropdown just renders the |
d84001a
to
e1eaf7c
Compare
Do we have any other places where FormSelect is being used ? if so we can proceed with it otherwise we better change it or make it look like the above dropdown. As more external providers are added, the design will only look more glaringly different over time. I agree with your notion of using the proper component but Openshift team has always valued design consistency over what is logical which is why we have always made sure of all the text, capitalisation, colours, looks. |
Yep! I can see it used over a couple of places. |
e1eaf7c
to
18298e1
Compare
.../create-storage-system/create-storage-system-steps/backing-storage-step/backing-storage.scss
Show resolved
Hide resolved
/approve /assign @bipuladh @cloudbehl for the lgtm |
2d06224
to
c772153
Compare
...s/create-storage-system/create-storage-system-steps/backing-storage-step/backing-storage.tsx
Show resolved
Hide resolved
frontend/packages/ceph-storage-plugin/src/odf-external-providers/external-providers.ts
Outdated
Show resolved
Hide resolved
/* name is a unique identifier that will be used in naming StorageSystems and sub-StorageSystems | ||
e.g `odf-<name>-storage-system`. | ||
*/ | ||
id: ExternalProviderId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need both id
and kind
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For nicer names and ease in reference. Its only the reference point for a provider
kind
I have kept but it can be dropped further since it can be constructed easily from apiVersion, apiGroup and kind.
frontend/packages/ceph-storage-plugin/src/components/create-storage-system/reducer.ts
Outdated
Show resolved
Hide resolved
const onStorageClassSelect = (sc: StorageClassResourceKind) => | ||
dispatch({ | ||
type: 'wizard/setStorageClass', | ||
payload: { name: sc?.metadata?.name, provisioner: sc?.provisioner }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
payload: { name: sc?.metadata?.name, provisioner: sc?.provisioner }, | |
payload: { name: sc.metadata.name, provisioner: sc.provisioner }, |
These are always defined, right? If a user selects a storage class then the object is present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, there is an option for no default storage/ no stoarge class class which is an empty object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in that case as well the sc.provisioner will be added after figuring out the default storage class from the backend.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant no storage class, updated!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Y'all can check @vbnrh 's comment, he posted the error as well.
#9438 (comment)
...s/create-storage-system/create-storage-system-steps/backing-storage-step/backing-storage.tsx
Outdated
Show resolved
Hide resolved
.../packages/ceph-storage-plugin/src/components/create-storage-system/create-storage-system.tsx
Outdated
Show resolved
Hide resolved
0fce634
to
1a40cf9
Compare
frontend/packages/ceph-storage-plugin/locales/en/ceph-storage-plugin.json
Show resolved
Hide resolved
frontend/packages/ceph-storage-plugin/locales/en/ceph-storage-plugin.json
Show resolved
Hide resolved
const onStorageClassSelect = (sc: StorageClassResourceKind) => | ||
dispatch({ | ||
type: 'wizard/setStorageClass', | ||
payload: { name: sc?.metadata?.name, provisioner: sc?.provisioner }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in that case as well the sc.provisioner will be added after figuring out the default storage class from the backend.
...s/create-storage-system/create-storage-system-steps/backing-storage-step/backing-storage.tsx
Show resolved
Hide resolved
...s/create-storage-system/create-storage-system-steps/backing-storage-step/backing-storage.tsx
Show resolved
Hide resolved
...s/create-storage-system/create-storage-system-steps/backing-storage-step/backing-storage.tsx
Show resolved
Hide resolved
...s/create-storage-system/create-storage-system-steps/backing-storage-step/backing-storage.tsx
Show resolved
Hide resolved
1a40cf9
to
f070cf5
Compare
.../packages/ceph-storage-plugin/src/components/create-storage-system/create-storage-system.tsx
Outdated
Show resolved
Hide resolved
return validateBackingStorageStep(type, storageClass, externalProvider); | ||
case StepsId.CreateLocalVolumeSet: | ||
case StepsId.CapacityAndNodes: | ||
case StepsId.ConnectionDetails: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
case StepsId.ConnectionDetails: | |
case StepsId.ConnectionDetails: |
How are providers supposed to add their validation logic here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its for RHCS. RHCS has a very different view compared to external vendors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The external vendors only use create storage class step, that only we will be standardizing.
|
||
return ( | ||
<> | ||
{showErrorAlert && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{showErrorAlert && ( | |
{!_.isEmpty(requestError) && ( |
We only need one state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or simply requestError && (
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check the code below:
actionClose={<AlertActionCloseButton onClose={() => setShowErrorAlert(false)} />}
The state is for close button on alert and also using it to show alert.
} from '@patternfly/react-core'; | ||
import './create-storage-system.scss'; | ||
|
||
export const CreateStorageSystemHeader: React.FC<CreateStorageSystemHeaderProps> = ({ url, t }) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use PageHeading
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PageHeading
is a very heavy component , and also not certain whether its part of sdk or not.(when I was coding this)
Plus, as per the recent changes, it would be the case that we can drop this header when the new operand extension would come.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we use PageHeading Operand Extension is going to take time. Page heading is going to be part of the SDK. As dashboards can't exist without PageHeading
. The other reason to use PageHeading
and an important one is to maintain style consistency across Pages with headers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PageHeading
itself wont be required with the operand extension.
frontend/packages/ceph-storage-plugin/src/components/create-storage-system/reducer.ts
Outdated
Show resolved
Hide resolved
frontend/packages/ceph-storage-plugin/src/components/create-storage-system/header.tsx
Outdated
Show resolved
Hide resolved
f070cf5
to
bd20139
Compare
- Adds Backing Storage step - implements a wizard with [incrementally enabled steps](https://www.patternfly.org/v4/components/wizard/#incrementally-enabled-steps) - This step creates the Storage System for an external Provider other than RHCS on clicking Next. - This step otherwise, allow choosing the backing storage for Storage Cluster. The Storage Cluster is hidden from UI but it is created internally by wizard flow. The creation of storage cluster happens in the last step. - https://issues.redhat.com/browse/ODFE-83 Signed-off-by: Afreen Rahman <afrahman@redhat.com>
bd20139
to
9386f1f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: afreen23, bipuladh, cloudbehl, 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 |
point 1: you are totally right lets make this filed wider |
this is fixed
this is a pf form select -> https://www.patternfly.org/v4/components/form-select
|
The PR covers the following:
Adds Backing Storage
implements a wizard with incrementally enabled steps
This step creates the Storage System for an external Provider other than RHCS on clicking Next
This step otherwise, allow choosing the backing storage for Storage Cluster. The Storage Cluster is hidden from UI but it is created internally by wizard flow. The creation of a storage cluster happens in the last step and is not covered in this PR.
https://issues.redhat.com/browse/ODFE-83
UXD: https://marvelapp.com/prototype/g1h86ga/screen/78847971
Testing Pr:
Use the following URL to see the Storage System wizard.
Screenshots: