-
Notifications
You must be signed in to change notification settings - Fork 176
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
frontend: Add create resource UI #1996
Conversation
d1de90b
to
fe2cec7
Compare
These are some nice set of changes thanks @skoeva I was wandering what all resources we are covering to have the create resource button on?? And what is the reasoning behind adding it to some and not to others if that's the case? |
@ashu8912 Currently covering config maps, secrets, leases, and runtime classes as those I already found with base templates in their associated directories, though if needed, we can add templates for more resources and cover those as well |
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.
Nice work!
I left a few notes for your consideration.
As well as a CreateResourceButton.stories.tsx, maybe a few small pieces could be unit tested, and perhaps an e2e test would be useful for the overall feature?
(ps. it also needs rebasing against main now)
(pps. good work on adding the kube-ish function, we should validate the data matches what we're expecting a bit more... especially since we need to fix a bunch of types still)
Probably you know this already... but the k8s website gives example yaml for each resource in their docs. But adding defaults for all the resources could be left for a future PR I reckon... it shouldn't block merging IMHO. |
4fda387
to
fe2cec7
Compare
2af16dd
to
205914c
Compare
2886872
to
51b00c8
Compare
ccb85e4
to
5268668
Compare
d3c178f
to
c0718f6
Compare
0514bad
to
4455ef0
Compare
4200496
to
46f4e67
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.
I have spotted something simple that needs to be improved in the code, but I have tested the feature again (creating a new item) and there's an inconsistency against the normal Create button:
When there's a failure to create a resource, the creation dialog should be brought back up again, and it's not in the case of this creation UI.
Steps to reproduce:
- Start creating a Node from the new + button
- Make sure you add an invalid name like my-super-node-
- Verify that it silently fails: no notification, and the dialog is not brought up. When then opening the dialog again, the error is there
46f4e67
to
45bf405
Compare
f3c729d
to
45bf405
Compare
Signed-off-by: Evangelos Skopelitis <[email protected]>
b112193
to
1a8c04b
Compare
1a8c04b
to
46c0349
Compare
These changes introduce a new UI feature that allows users to create resources from the associated list view. Clicking the 'Create' button opens up the EditorDialog used in the generic 'Create / Apply' button, now accepting generic YAML/JSON text rather than explicitly expecting an item that looks like a Kubernetes resource. The dialog box also includes a generic template for each resource. The apply logic for this new feature (as well as the original 'Create / Apply' button) has been consolidated in EditorDialog, with a flag allowing external components to utilize their own dispatch functionality. Fixes: #1820 Signed-off-by: Evangelos Skopelitis <[email protected]>
46c0349
to
9f454b2
Compare
These changes introduce a new UI feature that allows users to create resources from the associated list view. Clicking the 'Create' button opens up the
EditorDialog
used in the generic 'Create / Apply' button, now accepting generic YAML/JSON text rather than explicitly expecting an item that looks like a Kubernetes resource. The dialog box also includes a generic template for each resource. The apply logic for this new feature (as well as the original 'Create / Apply' button) has been consolidated in EditorDialog, with a flag allowing external components to utilize their own dispatch functionality.Fixes: #1820
Testing
Create resource button
cd app & npm start
) and navigate to a resource (e.g. Config Maps)EditorDialog changes
cd app & npm start
) and click the 'Create / Apply' buttonScreenshots