Skip to content

feat: Add profile creation and editing to the dashboard - #190

Open
gianlucam76 wants to merge 2 commits into
projectsveltos:mainfrom
gianlucam76:create-update-profile
Open

gianlucam76 wants to merge 2 commits into
projectsveltos:mainfrom
gianlucam76:create-update-profile

Conversation

@gianlucam76

Copy link
Copy Markdown
Member

Lets the dashboard create, edit and delete ClusterProfile/Profile instances instead of only viewing them, using the new POST/PUT/DELETE /profile endpoints added to ui-backend.

  • Create (/sveltos/profile/new, reachable via a new "New Profile" button on the Profiles page): Kind toggle (ClusterProfile/Profile), Name/Namespace, optional Tier and Depends On, a cluster selector, and one of three content flows: Helm chart, raw YAML, or a reference to an existing ConfigMap/Secret so content can be deliberately shared across profiles.
  • Edit (a new action on the profile detail page): loads the full spec as YAML and lets it be edited directly and saved back, rather than a second constrained form — this is what lets it work on any profile regardless of how it was originally created.
  • Delete: a confirmation dialog with an explicit, off by default option to also remove referenced ConfigMap/Secret content. That checkbox only appears when the profile actually references one; a Helm only profile no longer shows an irrelevant option. Nothing is inferred or guessed: the warning says plainly that other profiles referencing the same content cannot be detected.

No new dependencies. Reuses existing primitives throughout (TagInput for Depends On, ToggleGroup, Dialog, Checkbox, the existing mutation pattern via react-query). PageHeading gained a small optional actions slot rather than being duplicated for the new pages.

@gianlucam76

Copy link
Copy Markdown
Member Author
Screenshot 2026-09-25 at 14 50 44 Screenshot 2026-09-25 at 14 51 24 Screenshot 2026-09-25 at 14 51 51

Lets the dashboard create, edit and delete `ClusterProfile`/`Profile`
instances instead of only viewing them, using the new `POST`/`PUT`/`DELETE
/profile` endpoints added to `ui-backend`.

- **Create** (`/sveltos/profile/new`, reachable via a new "New Profile"
  button on the Profiles page): Kind toggle (ClusterProfile/Profile),
  Name/Namespace, optional Tier and Depends On, a cluster selector, and one
  of three content flows: Helm chart, raw YAML, or a reference to an
  existing ConfigMap/Secret so content can be deliberately shared across
  profiles.
- **Edit** (a new action on the profile detail page): loads the full spec
  as YAML and lets it be edited directly and saved back, rather than a
  second constrained form — this is what lets it work on any profile
  regardless of how it was originally created.
- **Delete**: a confirmation dialog with an explicit, off by default option
  to also remove referenced ConfigMap/Secret content. That checkbox only
  appears when the profile actually references one; a Helm only profile
  no longer shows an irrelevant option. Nothing is inferred or guessed:
  the warning says plainly that other profiles referencing the same
  content cannot be detected.

No new dependencies. Reuses existing primitives throughout (`TagInput` for
Depends On, `ToggleGroup`, `Dialog`, `Checkbox`, the existing mutation
pattern via `react-query`). `PageHeading` gained a small optional `actions`
slot rather than being duplicated for the new pages.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The form uses 19+ independent useState calls to manage form state,
we should consider using Yup for form validation and formik

Comment thread package.json

@Safouene1 Safouene1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall, excellent work on this PR! 🎉 The profile creation, editing, and deletion workflow is well-structured and comprehensive, a couple of minor tweaks since it's our first Form using proper libraries to handle validation and state management really matters

Replace the hand-rolled YAML serializer with js-yaml so the event YAML
view and the profile edit page share one implementation. Multi-line
values now render as block scalars and empty strings are quoted.
@gianlucam76

gianlucam76 commented Sep 28, 2026 •

Copy link
Copy Markdown
Member Author

@Safouene1 took care of one comment. Filed an issue for the other comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants