Skip to content

fix(ui): allow creating a secret once the list is no longer empty - #151

Open
arminfauland wants to merge 1 commit into
Disane87:mainfrom
arminfauland:fix/secrets-create-button
Open

fix(ui): allow creating a secret once the list is no longer empty#151
arminfauland wants to merge 1 commit into
Disane87:mainfrom
arminfauland:fix/secrets-create-button

Conversation

@arminfauland

Copy link
Copy Markdown

Problem

The create secret button only exists inside the empty state:

@if (!loading() && !error() && secrets().length === 0) {
  <app-button action variant="secondary" (click)="openCreateModal()">
    {{ 'secrets.create_button' | transloco }}

openCreateModal() is referenced exactly once in the template. As soon as one secret exists the block stops rendering, and the secrets manager offers no other way to create another one.

The remaining routes are not discoverable:

  • the deep link /(modal:secrets/create/<name>)
  • the run dialog, which links there — but only when a workflow already references a missing secret

So a user who has set up their first secret and later wants a second one finds a dialog that can only list and edit.

Fix

Adds the same button above the list, so it is reachable in both states. Reuses the existing secrets.create_button key — no translation changes needed.

<div class="flex justify-end mb-3">
  <app-button variant="secondary" size="sm" (click)="openCreateModal()">
    {{ 'secrets.create_button' | transloco }}
  </app-button>
</div>

secondary and sm are both valid members of ButtonVariant / ButtonSize.

Verification

  • nx lint ui — passes
  • nx build ui — succeeds (the bundle-budget warning is pre-existing)
  • Found on a running instance: four secrets existed and the dialog offered no way to add a fifth.

The "create secret" button only existed inside the empty state:

    @if (!loading() && !error() && secrets().length === 0) {
      <app-button (click)="openCreateModal()">…

Once a single secret exists the block never renders, and the secrets
manager offers no other way to reach openCreateModal(). Creating a second
secret through the UI becomes impossible — the only remaining routes are
the deep link /(modal:secrets/create/<name>) or the run dialog, which
links there when a workflow references a missing secret.

Adds the same button above the list so it is available in both states.
Reuses the existing secrets.create_button translation key, so no i18n
changes are needed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LixHBPkhb8h5oDdMqSG4se
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.

1 participant