From 2fccf17132f37821859cf2056c62c66acb8efa83 Mon Sep 17 00:00:00 2001 From: hashicc <191911133+hashicc@users.noreply.github.com> Date: Mon, 17 Nov 2025 11:38:20 -0500 Subject: [PATCH 1/2] =?UTF-8?q?chore:=20=F0=9F=A4=96=20use=20statically=20?= =?UTF-8?q?defined=20cred=20store=20components?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/credential-store/index.hbs | 13 +++++----- .../components/form/credential-store/index.js | 24 +++++++++++++++++++ 2 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 ui/admin/app/components/form/credential-store/index.js diff --git a/ui/admin/app/components/form/credential-store/index.hbs b/ui/admin/app/components/form/credential-store/index.hbs index e1c09f760e..28db884af3 100644 --- a/ui/admin/app/components/form/credential-store/index.hbs +++ b/ui/admin/app/components/form/credential-store/index.hbs @@ -4,11 +4,10 @@ }} {{#if @model.type}} - {{component - (concat 'form/credential-store/' @model.type) - model=@model - submit=@submit - cancel=@cancel - changeType=@changeType - }} + {{/if}} \ No newline at end of file diff --git a/ui/admin/app/components/form/credential-store/index.js b/ui/admin/app/components/form/credential-store/index.js new file mode 100644 index 0000000000..e0752e1475 --- /dev/null +++ b/ui/admin/app/components/form/credential-store/index.js @@ -0,0 +1,24 @@ +import Component from '@glimmer/component'; +import { assert } from '@ember/debug'; +import { + TYPE_CREDENTIAL_STORE_STATIC, + TYPE_CREDENTIAL_STORE_VAULT, +} from 'api/models/credential-store'; +import staticCredentialStoreComponent from './static'; +import vaultCredentialStoreComponent from './vault'; + +const modelTypeToComponent = { + [TYPE_CREDENTIAL_STORE_STATIC]: staticCredentialStoreComponent, + [TYPE_CREDENTIAL_STORE_VAULT]: vaultCredentialStoreComponent, +}; + +export default class FormCredentialStoreIndex extends Component { + get credentialStoreFormComponent() { + const component = modelTypeToComponent[this.args.model.type]; + assert( + `Mapped component must exist for credential store type: ${this.args.model.type}`, + component, + ); + return component; + } +} From fc7934e4fb5002ac7b4846bd0ab045345bad4fca Mon Sep 17 00:00:00 2001 From: hashicc <191911133+hashicc@users.noreply.github.com> Date: Mon, 17 Nov 2025 16:39:25 +0000 Subject: [PATCH 2/2] Add missing copyright headers --- ui/admin/app/components/form/credential-store/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/admin/app/components/form/credential-store/index.js b/ui/admin/app/components/form/credential-store/index.js index e0752e1475..31199e0c73 100644 --- a/ui/admin/app/components/form/credential-store/index.js +++ b/ui/admin/app/components/form/credential-store/index.js @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import Component from '@glimmer/component'; import { assert } from '@ember/debug'; import {