From 09c11d36b506ae66d89add0d19236d6f428a9929 Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Tue, 10 Sep 2024 16:00:32 +0200 Subject: [PATCH] feat: Allow renaming of T4C instances in the frontend --- .../edit-t4c-instance.component.css | 4 -- .../edit-t4c-instance.component.ts | 2 - .../edit-t4c-instance.stories.ts | 44 ++++++++++++++++++- 3 files changed, 43 insertions(+), 7 deletions(-) delete mode 100644 frontend/src/app/settings/modelsources/t4c-settings/edit-t4c-instance/edit-t4c-instance.component.css diff --git a/frontend/src/app/settings/modelsources/t4c-settings/edit-t4c-instance/edit-t4c-instance.component.css b/frontend/src/app/settings/modelsources/t4c-settings/edit-t4c-instance/edit-t4c-instance.component.css deleted file mode 100644 index 8535c6938..000000000 --- a/frontend/src/app/settings/modelsources/t4c-settings/edit-t4c-instance/edit-t4c-instance.component.css +++ /dev/null @@ -1,4 +0,0 @@ -/* - * SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors - * SPDX-License-Identifier: Apache-2.0 - */ diff --git a/frontend/src/app/settings/modelsources/t4c-settings/edit-t4c-instance/edit-t4c-instance.component.ts b/frontend/src/app/settings/modelsources/t4c-settings/edit-t4c-instance/edit-t4c-instance.component.ts index bcf80c627..3fb191fee 100644 --- a/frontend/src/app/settings/modelsources/t4c-settings/edit-t4c-instance/edit-t4c-instance.component.ts +++ b/frontend/src/app/settings/modelsources/t4c-settings/edit-t4c-instance/edit-t4c-instance.component.ts @@ -42,7 +42,6 @@ import { T4CInstanceSettingsComponent } from '../t4c-instance-settings/t4c-insta @Component({ selector: 'app-edit-t4c-instance', templateUrl: './edit-t4c-instance.component.html', - styleUrls: ['./edit-t4c-instance.component.css'], standalone: true, imports: [ NgIf, @@ -152,7 +151,6 @@ export class EditT4CInstanceComponent implements OnInit, OnDestroy { enableEditing(): void { this.editing = true; this.form.enable(); - this.form.controls.name.disable(); this.form.controls.password.patchValue(''); this.form.controls.password.removeValidators(Validators.required); diff --git a/frontend/src/app/settings/modelsources/t4c-settings/edit-t4c-instance/edit-t4c-instance.stories.ts b/frontend/src/app/settings/modelsources/t4c-settings/edit-t4c-instance/edit-t4c-instance.stories.ts index c7b690e80..a48678f72 100644 --- a/frontend/src/app/settings/modelsources/t4c-settings/edit-t4c-instance/edit-t4c-instance.stories.ts +++ b/frontend/src/app/settings/modelsources/t4c-settings/edit-t4c-instance/edit-t4c-instance.stories.ts @@ -23,7 +23,7 @@ export const AddInstance: Story = { args: {}, }; -export const ModifyExistingInstance: Story = { +export const ExistingInstance: Story = { args: { existing: true, capellaVersions: [mockToolVersion], @@ -42,3 +42,45 @@ export const ModifyExistingInstance: Story = { }), ], }; + +export const EditExistingInstance: Story = { + args: { + existing: true, + editing: true, + capellaVersions: [mockToolVersion], + }, + decorators: [ + moduleMetadata({ + providers: [ + { + provide: T4CInstanceWrapperService, + useFactory: () => + new MockT4CInstanceWrapperService(mockT4CInstance, [ + mockT4CInstance, + ]), + }, + ], + }), + ], +}; + +export const ArchivedInstance: Story = { + args: { + existing: true, + isArchived: true, + capellaVersions: [mockToolVersion], + }, + decorators: [ + moduleMetadata({ + providers: [ + { + provide: T4CInstanceWrapperService, + useFactory: () => + new MockT4CInstanceWrapperService(mockT4CInstance, [ + mockT4CInstance, + ]), + }, + ], + }), + ], +};