-
-
- sync
- cloud_off
- cloud_queue
- block
- cloud_upload
- sync_problem
-
-
-
-
- {{ repository.name }}
+
-
-
+
diff --git a/frontend/src/app/settings/modelsources/t4c-settings/t4c-instance-settings/t4c-instance-settings.component.ts b/frontend/src/app/settings/modelsources/t4c-settings/t4c-instance-settings/t4c-instance-settings.component.ts
index a19e3f258..c338b4ffd 100644
--- a/frontend/src/app/settings/modelsources/t4c-settings/t4c-instance-settings/t4c-instance-settings.component.ts
+++ b/frontend/src/app/settings/modelsources/t4c-settings/t4c-instance-settings/t4c-instance-settings.component.ts
@@ -33,6 +33,7 @@ import { MatTooltip } from '@angular/material/tooltip';
import { CreateT4CRepository, T4CInstance } from 'src/app/openapi';
import {
ExtendedT4CRepository,
+ ExtendedT4CRepositoryStatus,
T4CRepositoryWrapperService,
} from 'src/app/settings/modelsources/t4c-settings/service/t4c-repos/t4c-repo.service';
import { T4CRepoDeletionDialogComponent } from './t4c-repo-deletion-dialog/t4c-repo-deletion-dialog.component';
@@ -134,4 +135,34 @@ export class T4CInstanceSettingsComponent implements OnChanges, OnDestroy {
.recreateRepository(repository.instance.id, repository.id)
.subscribe();
}
+
+ mapStatusToText(status: ExtendedT4CRepositoryStatus | null): StatusMapping {
+ switch (status) {
+ case 'LOADING':
+ return {
+ icon: 'sync',
+ text: 'Hang tight while we refresh the list.',
+ };
+ case 'INITIAL':
+ return { icon: 'cloud_upload', text: 'Repository is started.' };
+ case 'INSTANCE_UNREACHABLE':
+ return { icon: 'sync_problem', text: 'The instance is unreachable.' };
+ case 'NOT_FOUND':
+ return {
+ icon: 'block',
+ text: 'Repository not found on the TeamForCapella server.',
+ };
+ case 'OFFLINE':
+ return { icon: 'cloud_off', text: 'Repository is offline.' };
+ case 'ONLINE':
+ return { icon: 'cloud_queue', text: 'Repository is up & running' };
+ case null:
+ return { icon: 'error', text: 'Unknown status' };
+ }
+ }
+}
+
+interface StatusMapping {
+ icon: string;
+ text: string;
}
diff --git a/frontend/src/app/settings/modelsources/t4c-settings/t4c-instance-settings/t4c-instance-settings.docs.mdx b/frontend/src/app/settings/modelsources/t4c-settings/t4c-instance-settings/t4c-instance-settings.docs.mdx
index e91bd8654..184163ff6 100644
--- a/frontend/src/app/settings/modelsources/t4c-settings/t4c-instance-settings/t4c-instance-settings.docs.mdx
+++ b/frontend/src/app/settings/modelsources/t4c-settings/t4c-instance-settings/t4c-instance-settings.docs.mdx
@@ -17,3 +17,11 @@ This is an example story for the component:
+
+Here is another example where the form to create a new repository is visible:
+
+
+
+
+
+
diff --git a/frontend/src/app/settings/modelsources/t4c-settings/t4c-instance-settings/t4c-instance-settings.stories.ts b/frontend/src/app/settings/modelsources/t4c-settings/t4c-instance-settings/t4c-instance-settings.stories.ts
index 31dbe9f30..96a67260d 100644
--- a/frontend/src/app/settings/modelsources/t4c-settings/t4c-instance-settings/t4c-instance-settings.stories.ts
+++ b/frontend/src/app/settings/modelsources/t4c-settings/t4c-instance-settings/t4c-instance-settings.stories.ts
@@ -72,3 +72,25 @@ export const Repositories: Story = {
}),
],
};
+
+export const AddRepositories: Story = {
+ args: {},
+ decorators: [
+ moduleMetadata({
+ providers: [
+ {
+ provide: T4CRepositoryWrapperService,
+ useFactory: () =>
+ new MockT4CRepositoryWrapperService([
+ {
+ id: 1,
+ name: 'test',
+ instance: mockT4CInstance,
+ status: 'ONLINE',
+ },
+ ]),
+ },
+ ],
+ }),
+ ],
+};