headlamp
headlamp copied to clipboard
frontend: Add create namespace ui
Add Create Namespace Feature to UI
fixes #1705 fixes #2055
Description
This PR introduces a new feature to the UI that allows users to create namespaces directly from the namespaces list view. A 'Create' button (represented by a + sign) has been added next to the title of the namespaces list view. Upon clicking this button, users are presented with a dialog box where they can input the name for the new namespace. Submitting this by clicking the 'Create' button will create the new namespace.
Changes
- [x] Added a 'Create' button (+ sign) next to the title of the namespaces list view.
- [x] Implemented a dialog box that prompts the user to enter the name of the new namespace.
- [x] Added functionality to create a new namespace upon clicking the 'Create' button in the dialog box.
Verification
- [x] Tested the 'Create' button to ensure it triggers the dialog box as expected.
- [x] Verified the dialog box accepts input and allows for the creation of a new namespace.
- [x] Confirmed that the new namespace appears in the namespaces list view upon creation.
Screenshots
- push to fix build failures and translations
- last push removes notes
last push
- [x] moved create namespace button and dialog to module
- [x] make create namespace process able to quit
- last push is still needing some fixes, when creating a namespace item it is almost instant at this current implementation.
maybe artificially adding a timer would allow it to be slow enough to react to a quit action?
rebased and changed Namespace to namespace
Fixed some changes and should be ready for review again
Added name input filter
Fixed start message to the correct use
The build Container and test job failed so I restarted it in case it was flaky.
The app job was skipped (maybe because the container test failed?), so I ran that again as well.
Prev push
- fixed (for now) the error when using namespace.test.ts would cause
npm run test
to fail due to "TypeError: makeKubeObject is not a function"
Push
-
fixes review comments
-
[ ] current push does not allow users to input empty string for a namespace name, need to implement a way to use a default name
- [ ] create an error for if namespace already exist
Currently trying to work around an issue for the storybook component, it seems that the storybook compile is running into the same circular dependency error that the namespace.test.ts was hitting (in short it would fail if we tried to create a unit test for the namespace functions in its own .test env)
- [ ] need to fix being able to use enter key to create
Push note
- [x] Fixed page reloading when pressing enter when writing name
- [ ] story component still broken
push note
-
Removed the <AuthVisible> comp around the create button as it is not working correctly with the params (example: this doesn't prevent the button from rendering)
-
[x] Fixed story comp not rendering
prev push
- [x] Adds working story components
The build storybook error is likely a bug due to the storybook vite build on the publisher side https://github.com/storybookjs/storybook/issues/26685
I may just remove the test for now until this is fixed for vite
I was able to find a fix, seems the latest update isn't vite compatible so rolled back to the previous version
- storybook/addons-interactions
7.6.20
Still can't seem to source that build error?
rebased to current main and updated the "@types/lodash": "^4.17.4",
to avoid compatibility error, its now "@types/lodash": "4.17.4",