headlamp icon indicating copy to clipboard operation
headlamp copied to clipboard

frontend: Add create namespace ui

Open vyncent-t opened this issue 1 year ago • 17 comments

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

image image

vyncent-t avatar Feb 19 '24 20:02 vyncent-t

  • push to fix build failures and translations

vyncent-t avatar Feb 19 '24 21:02 vyncent-t

  • last push removes notes

vyncent-t avatar Feb 27 '24 18:02 vyncent-t

last push

  • [x] moved create namespace button and dialog to module
  • [x] make create namespace process able to quit

vyncent-t avatar Feb 27 '24 18:02 vyncent-t

  • 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?

vyncent-t avatar Feb 28 '24 18:02 vyncent-t

rebased and changed Namespace to namespace

vyncent-t avatar Apr 19 '24 15:04 vyncent-t

Fixed some changes and should be ready for review again

vyncent-t avatar May 20 '24 19:05 vyncent-t

Added name input filter

vyncent-t avatar May 21 '24 21:05 vyncent-t

Fixed start message to the correct use

vyncent-t avatar May 29 '24 16:05 vyncent-t

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.

illume avatar Jun 19 '24 11:06 illume

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"

vyncent-t avatar Jun 21 '24 17:06 vyncent-t

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

vyncent-t avatar Jun 21 '24 21:06 vyncent-t

  • [ ] create an error for if namespace already exist

vyncent-t avatar Jun 24 '24 13:06 vyncent-t

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)

image

vyncent-t avatar Jun 25 '24 17:06 vyncent-t

  • [ ] need to fix being able to use enter key to create

vyncent-t avatar Jun 26 '24 14:06 vyncent-t

Push note

  • [x] Fixed page reloading when pressing enter when writing name
  • [ ] story component still broken

vyncent-t avatar Jun 26 '24 15:06 vyncent-t

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) image

  • [x] Fixed story comp not rendering

vyncent-t avatar Jun 26 '24 17:06 vyncent-t

prev push

  • [x] Adds working story components

vyncent-t avatar Jun 26 '24 19:06 vyncent-t

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

vyncent-t avatar Jul 01 '24 19:07 vyncent-t

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

vyncent-t avatar Jul 02 '24 15:07 vyncent-t

Still can't seem to source that build error?

vyncent-t avatar Jul 08 '24 16:07 vyncent-t

rebased to current main and updated the "@types/lodash": "^4.17.4", to avoid compatibility error, its now "@types/lodash": "4.17.4",

vyncent-t avatar Jul 10 '24 17:07 vyncent-t