Skip to content

Commit 6bcfdc1

Browse files
committed
feat(secret-managers): enhance secret manager options with type labels and improve clone environment modal functionality
1 parent 436da94 commit 6bcfdc1

File tree

4 files changed

+20
-26
lines changed

4 files changed

+20
-26
lines changed

apps/console-v5/src/routes/_authenticated/organization/$organizationId/cluster/$clusterId/settings/addons.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ const SECRET_MANAGER_USE_CASES: UseCaseOption[] = [
7474
]
7575

7676
const SECRET_MANAGER_OPTIONS: SecretManagerOption[] = [
77-
{ value: 'aws-manager', label: 'AWS Manager type', icon: 'AWS' },
78-
{ value: 'aws-parameter', label: 'AWS Parameter store', icon: 'AWS' },
79-
{ value: 'gcp-secret', label: 'GCP Secret manager', icon: 'GCP' },
80-
].map((option) => ({ ...option, typeLabel: option.label }))
77+
{ value: 'aws-manager', label: 'AWS Manager type', icon: 'AWS', typeLabel: 'AWS Manager type' },
78+
{ value: 'aws-parameter', label: 'AWS Parameter store', icon: 'AWS', typeLabel: 'AWS Parameter store' },
79+
{ value: 'gcp-secret', label: 'GCP Secret manager', icon: 'GCP', typeLabel: 'GCP Secret manager' },
80+
]
8181

8282
const BASE_SECRET_MANAGERS: SecretManagerItem[] = [
8383
{

libs/domains/environments/feature/src/lib/create-clone-environment-modal/create-clone-environment-modal.tsx

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ export type CloneMigrationUseCaseOption = {
3636
id: string
3737
label: string
3838
}
39+
type CloneUseCaseOverrides = {
40+
forceDifferentCluster?: boolean
41+
forceSelfManaged?: boolean
42+
sourceManagers?: SecretManagerDescriptor[]
43+
targetManagers?: SecretManagerDescriptor[]
44+
}
3945

4046
const SECRET_MANAGER_FIXTURES = {
4147
awsProd: { id: 'secret-manager-aws-prod', name: 'Prod secret manager', provider: 'AWS' as const },
@@ -157,24 +163,10 @@ function CloneMigrationHelperModal({
157163
<button
158164
type="button"
159165
onClick={() => handleSelect('migrate')}
160-
className={`${cardBase} ${
161-
selectedAction === 'migrate'
162-
? 'outline-brand-strong focus:outline-brand-strong'
163-
: 'outline-neutral focus:outline-neutral'
164-
}`}
166+
className={`${cardBase} outline-neutral focus:outline-neutral`}
165167
>
166-
<div
167-
className={`${iconBase} ${
168-
selectedAction === 'migrate'
169-
? 'bg-surface-brand-component text-brand'
170-
: 'bg-surface-neutral-component'
171-
}`}
172-
>
173-
<Icon
174-
iconName="right-left"
175-
iconStyle="regular"
176-
className={selectedAction === 'migrate' ? 'text-brand' : undefined}
177-
/>
168+
<div className={`${iconBase} bg-surface-neutral-component`}>
169+
<Icon iconName="right-left" iconStyle="regular" />
178170
</div>
179171
<div className="flex flex-col gap-1">
180172
<span className="text-sm font-medium text-neutral">Migrate to another secret manager</span>
@@ -430,7 +422,7 @@ export function CreateCloneEnvironmentModal({
430422
[clusters, environmentToClone?.cluster_id]
431423
)
432424
const isSelfManagedTarget = selectedCluster?.kubernetes === KubernetesEnum.SELF_MANAGED
433-
const useCaseOverrides = useMemo(() => {
425+
const useCaseOverrides = useMemo<CloneUseCaseOverrides>(() => {
434426
return match(selectedCaseId)
435427
.with('self-managed', () => ({
436428
forceDifferentCluster: true,
@@ -485,6 +477,10 @@ export function CreateCloneEnvironmentModal({
485477
}
486478

487479
const onSubmit = methods.handleSubmit(async ({ name, cluster, mode, project_id }) => {
480+
if (!cluster) {
481+
return
482+
}
483+
488484
if (environmentToClone) {
489485
const payload = {
490486
name,

libs/domains/services/feature/src/lib/service-variables-tabs/service-variables-external-secrets-tab.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ function AddSecretModal({
297297
render={({ field }) => (
298298
<InputSelect
299299
className="mb-3 w-full"
300-
name={field.name}
301300
label="Source"
302301
portal
303302
options={SECRET_SOURCES.map((option) => ({
@@ -327,7 +326,6 @@ function AddSecretModal({
327326
render={({ field }) => (
328327
<InputSelect
329328
className="mb-3 w-full"
330-
name={field.name}
331329
label="Reference"
332330
options={REFERENCE_OPTIONS.map((reference) => ({ label: reference, value: reference }))}
333331
value={field.value}
@@ -446,7 +444,6 @@ function AttachSecretsModal({ selectedCount, onClose, onAttach }: AttachSecretsM
446444
render={({ field }) => (
447445
<InputSelect
448446
className="mb-3 w-full"
449-
name={field.name}
450447
label="Source"
451448
portal
452449
options={SECRET_SOURCES.map((option) => ({
@@ -945,7 +942,6 @@ export function ExternalSecretsTab({ selectedCaseId = 'filled' }: ExternalSecret
945942
<div className="flex items-center gap-2">
946943
<TableFilterSearch
947944
className="h-8 w-[200px]"
948-
placeholder="Search secrets"
949945
value={search}
950946
onChange={(e) => setSearch(e.target.value)}
951947
/>

libs/shared/ui/src/lib/components/action-toolbar/action-toolbar.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ const toolbarButtonVariants = cva(['active:scale-100'], {
1515
color: {
1616
brand: [],
1717
neutral: [],
18+
neutralInverted: [],
1819
green: [],
1920
red: [],
21+
redInverted: [],
2022
yellow: [],
2123
current: [],
2224
},

0 commit comments

Comments
 (0)