diff --git a/frontend/src/app/projects/models/create-model/create-model.component.css b/frontend/src/app/projects/models/create-model/create-model.component.css deleted file mode 100644 index 8535c6938a..0000000000 --- a/frontend/src/app/projects/models/create-model/create-model.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/projects/models/create-model/create-model.component.ts b/frontend/src/app/projects/models/create-model/create-model.component.ts index 1716d12e92..cfdc9a9c3e 100644 --- a/frontend/src/app/projects/models/create-model/create-model.component.ts +++ b/frontend/src/app/projects/models/create-model/create-model.component.ts @@ -28,7 +28,6 @@ import { ManageT4CModelComponent } from '../model-source/t4c/manage-t4c-model/ma @Component({ selector: 'app-create-model', templateUrl: './create-model.component.html', - styleUrls: ['./create-model.component.css'], standalone: true, imports: [ MatStepper, diff --git a/frontend/src/app/projects/project-detail/model-overview/model-overview.component.css b/frontend/src/app/projects/project-detail/model-overview/model-overview.component.css deleted file mode 100644 index 082fa78f5a..0000000000 --- a/frontend/src/app/projects/project-detail/model-overview/model-overview.component.css +++ /dev/null @@ -1,8 +0,0 @@ -/* - * SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -.mat-card { - padding: 0 !important; -} diff --git a/frontend/src/app/projects/project-detail/model-overview/model-overview.component.html b/frontend/src/app/projects/project-detail/model-overview/model-overview.component.html index a082da6d5c..8c6f036f3f 100644 --- a/frontend/src/app/projects/project-detail/model-overview/model-overview.component.html +++ b/frontend/src/app/projects/project-detail/model-overview/model-overview.component.html @@ -3,221 +3,222 @@ ~ SPDX-License-Identifier: Apache-2.0 --> -
-
-

Models

- @if (projectUserService.verifyRole("manager")) { - +

Models

+ @if (projectUserService.verifyRole("manager")) { +
+ add +
+
+ @if (models !== undefined && models.length > 1) { + - } + } -
-
- @if ((modelService.models$ | async) === undefined) { - @for (card of [0, 1, 2]; track $index) { - - } + } +
+
+ @if ((modelService.models$ | async) === undefined) { + @for (card of [0, 1, 2]; track $index) { + } - @for (model of modelService.models$ | async; track model.id) { + } + @for (model of modelService.models$ | async; track model.id) { +
-
-
-
- {{ model.name }} -
- - {{ model.tool.name }} - @if (model.version) { - {{ model.version.name }} - } @else { - (Version not specified) - } - +
+
+ {{ model.name }}
+ + {{ model.tool.name }} + @if (model.version) { + {{ model.version.name }} + } @else { + (Version not specified) + } + +
-
-
-
-
Nature
- - @if (model.nature) { - {{ model.nature.name }} - } @else { - Not specified - } - -
+
+
+
+
Nature
+ + @if (model.nature) { + {{ model.nature.name }} + } @else { + Not specified + } +
-
-
-
Working mode
-
- {{ getPrimaryWorkingMode(model) }} -
+
+
+
+
Working mode
+
+ {{ getPrimaryWorkingMode(model) }}
-
-
- {{ model.description || "This model has no description." }} -
-
- @if (model.tool.name === "Capella") { - - } -
-
- @if (userService.user?.role === "administrator") { - - key - - } - @if (projectUserService.verifyRole("manager")) { - - settings - - +
+
+
+ {{ model.description || "This model has no description." }} +
+
+ @if (model.tool.name === "Capella") { + + } +
+
+ @if (userService.user?.role === "administrator") { + + key + + } + @if (projectUserService.verifyRole("manager")) { + + settings + + + + link + + @if (!project?.is_archived && project?.type !== "training") { - link + sync - @if (!project?.is_archived && project?.type !== "training") { - - sync - - } } + } - @if (model.git_models) { - + open_in_new + + @if (model.tool.name === "Capella") { + - } + image_search + } + } - @if ( - !project?.is_archived && - project?.type !== "training" && - model.t4c_models && - projectUserService.verifyPermission("write") - ) { - - screen_share - - } -
+ @if ( + !project?.is_archived && + project?.type !== "training" && + model.t4c_models && + projectUserService.verifyPermission("write") + ) { + + screen_share + + }
- } -
+
+ }
diff --git a/frontend/src/app/projects/project-detail/model-overview/model-overview.component.ts b/frontend/src/app/projects/project-detail/model-overview/model-overview.component.ts index 29e6881024..152afede00 100644 --- a/frontend/src/app/projects/project-detail/model-overview/model-overview.component.ts +++ b/frontend/src/app/projects/project-detail/model-overview/model-overview.component.ts @@ -36,7 +36,6 @@ import { ModelComplexityBadgeComponent } from './model-complexity-badge/model-co @Component({ selector: 'app-model-overview', templateUrl: './model-overview.component.html', - styleUrls: ['./model-overview.component.css'], standalone: true, imports: [ MatAnchor, diff --git a/frontend/src/app/projects/project-detail/project-details.component.html b/frontend/src/app/projects/project-detail/project-details.component.html index 9ff2654a66..471937ffbe 100644 --- a/frontend/src/app/projects/project-detail/project-details.component.html +++ b/frontend/src/app/projects/project-detail/project-details.component.html @@ -4,11 +4,12 @@ -->
-
+
+
@if (projectUserService.verifyRole("manager")) { diff --git a/frontend/src/app/projects/project-detail/project-details.component.ts b/frontend/src/app/projects/project-detail/project-details.component.ts index e2c74ac5a6..e32cfd994f 100644 --- a/frontend/src/app/projects/project-detail/project-details.component.ts +++ b/frontend/src/app/projects/project-detail/project-details.component.ts @@ -4,7 +4,7 @@ */ import { Component } from '@angular/core'; import { ProjectUserService } from 'src/app/projects/project-detail/project-users/service/project-user.service'; -import { CreateReadonlySessionComponent } from '../../sessions/user-sessions-wrapper/create-session/create-readonly-session/create-readonly-session.component'; +import { CreateReadonlySessionComponent } from '../../sessions/user-sessions-wrapper/create-sessions/create-readonly-session/create-readonly-session.component'; import { ProjectWrapperService } from '../service/project.service'; import { ModelOverviewComponent } from './model-overview/model-overview.component'; import { ProjectMetadataComponent } from './project-metadata/project-metadata.component'; diff --git a/frontend/src/app/sessions/user-sessions-wrapper/create-session/create-readonly-session/create-readonly-session.component.css b/frontend/src/app/sessions/user-sessions-wrapper/create-session/create-readonly-session/create-readonly-session.component.css deleted file mode 100644 index 5c672c4484..0000000000 --- a/frontend/src/app/sessions/user-sessions-wrapper/create-session/create-readonly-session/create-readonly-session.component.css +++ /dev/null @@ -1,12 +0,0 @@ -/* - * SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -.skeleton-loader { - gap: 10px; -} - -.skeleton-loader-element { - flex-basis: calc(50% - 5px); -} diff --git a/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-persistent-session/create-persistent-session.component.html b/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-persistent-session/create-persistent-session.component.html index 8d80805df7..b02760b71a 100644 --- a/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-persistent-session/create-persistent-session.component.html +++ b/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-persistent-session/create-persistent-session.component.html @@ -24,12 +24,11 @@

Persistent Workspace Session

formControlName="toolId" (selectionChange)="toolSelectionChange($event.value)" > - - {{ tool.name }} - + @for (tool of toolsWithWorkspaceEnabled | async; track tool.id) { + + {{ tool.name }} + + } Please select a valid tool. @@ -37,14 +36,17 @@

Persistent Workspace Session

Version - - {{ version.name }} - (recommended) - (deprecated) - + @for (version of this.versions; track version.id) { + + {{ version.name }} + @if (version.config.is_recommended) { + (recommended) + } + @if (version.config.is_deprecated) { + (deprecated) + } + + }
@@ -84,8 +86,14 @@

Persistent Workspace Session

type="submit" [disabled]="requestInProgress" > - Request a session with a persistent workspace - keyboard_arrow_right + + + Request session + keyboard_arrow_right +
diff --git a/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-persistent-session/create-persistent-session.stories.ts b/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-persistent-session/create-persistent-session.stories.ts index 954b990205..daa94b7360 100644 --- a/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-persistent-session/create-persistent-session.stories.ts +++ b/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-persistent-session/create-persistent-session.stories.ts @@ -22,7 +22,7 @@ const meta: Meta = { decorators: [ componentWrapperDecorator( (story) => - `
+ `
${story}
`, ), diff --git a/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-readonly-session/create-readonly-session-dialog.component.html b/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-readonly-session/create-readonly-session-dialog/create-readonly-session-dialog.component.html similarity index 100% rename from frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-readonly-session/create-readonly-session-dialog.component.html rename to frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-readonly-session/create-readonly-session-dialog/create-readonly-session-dialog.component.html diff --git a/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-readonly-session/create-readonly-session-dialog.component.ts b/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-readonly-session/create-readonly-session-dialog/create-readonly-session-dialog.component.ts similarity index 100% rename from frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-readonly-session/create-readonly-session-dialog.component.ts rename to frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-readonly-session/create-readonly-session-dialog/create-readonly-session-dialog.component.ts diff --git a/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-readonly-session/create-readonly-session-dialog.stories.ts b/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-readonly-session/create-readonly-session-dialog/create-readonly-session-dialog.stories.ts similarity index 100% rename from frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-readonly-session/create-readonly-session-dialog.stories.ts rename to frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-readonly-session/create-readonly-session-dialog/create-readonly-session-dialog.stories.ts diff --git a/frontend/src/app/sessions/user-sessions-wrapper/create-session/create-readonly-session/create-readonly-session.component.html b/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-readonly-session/create-readonly-session.component.html similarity index 71% rename from frontend/src/app/sessions/user-sessions-wrapper/create-session/create-readonly-session/create-readonly-session.component.html rename to frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-readonly-session/create-readonly-session.component.html index 1b3b967394..a4a4f3e4ba 100644 --- a/frontend/src/app/sessions/user-sessions-wrapper/create-session/create-readonly-session/create-readonly-session.component.html +++ b/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-readonly-session/create-readonly-session.component.html @@ -15,21 +15,26 @@

Read-Only Sessions

[formGroup]="toolSelectionForm" (ngSubmit)="requestReadonlySession()" > -
-
- + @if (tools === undefined) { +
+ @for (menu of [0, 1]; track menu) { +
+ +
+ }
-
+ } +
@@ -50,12 +55,11 @@

Read-Only Sessions

Version - - {{ version.name }} - + @for (version of this.relevantToolVersions; track version.id) { + + {{ version.name }} + + }
diff --git a/frontend/src/app/sessions/user-sessions-wrapper/create-session/create-readonly-session/create-readonly-session.component.ts b/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-readonly-session/create-readonly-session.component.ts similarity index 93% rename from frontend/src/app/sessions/user-sessions-wrapper/create-session/create-readonly-session/create-readonly-session.component.ts rename to frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-readonly-session/create-readonly-session.component.ts index a9b9b6e51d..dc621264f6 100644 --- a/frontend/src/app/sessions/user-sessions-wrapper/create-session/create-readonly-session/create-readonly-session.component.ts +++ b/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-readonly-session/create-readonly-session.component.ts @@ -19,22 +19,21 @@ import { MatSelect } from '@angular/material/select'; import { RouterLink } from '@angular/router'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; -import { combineLatest, filter, Observable, tap } from 'rxjs'; +import { combineLatest, filter, Observable } from 'rxjs'; import { Tool, ToolModel, ToolVersion } from 'src/app/openapi'; import { ModelWrapperService } from 'src/app/projects/models/service/model.service'; import { ProjectWrapperService } from 'src/app/projects/service/project.service'; import { UserSessionService } from 'src/app/sessions/service/user-session.service'; +import { CreateReadonlySessionDialogComponent } from 'src/app/sessions/user-sessions-wrapper/create-sessions/create-readonly-session/create-readonly-session-dialog/create-readonly-session-dialog.component'; import { ToolWrapperService, ToolVersionWithTool, } from 'src/app/settings/core/tools-settings/tool.service'; -import { CreateReadonlySessionDialogComponent } from '../../create-sessions/create-readonly-session/create-readonly-session-dialog.component'; @UntilDestroy() @Component({ selector: 'app-create-readonly-session', templateUrl: './create-readonly-session.component.html', - styleUrls: ['./create-readonly-session.component.css'], standalone: true, imports: [ FormsModule, @@ -56,7 +55,6 @@ export class CreateReadonlySessionComponent implements OnInit { models?: ModelWithCompatibility[]; relevantToolVersions?: ToolVersion[]; - allToolVersions?: ToolVersionWithTool[]; public toolSelectionForm = this.fb.group({ tool: this.fb.control(null, Validators.required), @@ -91,11 +89,7 @@ export class CreateReadonlySessionComponent implements OnInit { return combineLatest([ this.modelService.models$.pipe(untilDestroyed(this), filter(Boolean)), this.toolWrapperService.getVersionsForTools(), - ]).pipe( - tap(([_, versions]) => { - this.allToolVersions = versions; - }), - ); + ]); } resolveVersionCompatibility( @@ -113,7 +107,7 @@ export class CreateReadonlySessionComponent implements OnInit { this.findVersionByID(model.version.id, allVersions)!, ]; - for (const version of allVersions!) { + for (const version of allVersions) { if (version.config.compatible_versions.includes(model.version.id)) { extendedModel.compatibleVersions.push(version); } diff --git a/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-readonly-session/create-readonly-session.stories.ts b/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-readonly-session/create-readonly-session.stories.ts new file mode 100644 index 0000000000..07fca679d4 --- /dev/null +++ b/frontend/src/app/sessions/user-sessions-wrapper/create-sessions/create-readonly-session/create-readonly-session.stories.ts @@ -0,0 +1,27 @@ +/* + * SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors + * SPDX-License-Identifier: Apache-2.0 + */ +import { Meta, StoryObj } from '@storybook/angular'; +import { mockModel } from 'src/storybook/model'; +import { mockCapellaToolVersion } from 'src/storybook/tool'; +import { CreateReadonlySessionComponent } from './create-readonly-session.component'; + +const meta: Meta = { + title: 'Session Components/Create Readonly Session', + component: CreateReadonlySessionComponent, +}; + +export default meta; +type Story = StoryObj; + +export const Loading: Story = { + args: {}, +}; + +export const Loaded: Story = { + args: { + relevantToolVersions: [mockCapellaToolVersion], + models: [{ ...mockModel, compatibleVersions: [] }], + }, +}; diff --git a/frontend/src/app/users/user-settings/user-settings.component.html b/frontend/src/app/users/user-settings/user-settings.component.html index 520cdb10a2..10e82e5a56 100644 --- a/frontend/src/app/users/user-settings/user-settings.component.html +++ b/frontend/src/app/users/user-settings/user-settings.component.html @@ -23,7 +23,7 @@

Manage Users

search -
+
@for (role of userRoles; track role) {
{{ getUsersByRole(userWrapperService.users$ | async, role)?.length }}