From d7bec78ed703b513fa5d24fd895d4781e51af3cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Kilchenmann?= Date: Fri, 15 Oct 2021 09:40:51 +0200 Subject: [PATCH] fix: disable edit/delete action in deactivated projects (DEV-52) (#550) * fix(resource): do not display edit buttons in deleted project * fix(project): do not display edit buttons in deleted project and use same style in list editor as we use in ontology editor * test: fix tests * fix(value): fix display-edit action buttons --- .../list-info-form.component.ts | 2 -- .../list-item-form.component.html | 2 +- .../list-item-form.component.spec.ts | 1 + .../list-item-form.component.ts | 5 ++++ .../list/list-item/list-item.component.html | 10 +++---- .../list/list-item/list-item.component.ts | 2 ++ src/app/project/list/list.component.html | 30 +++++++++++-------- src/app/project/list/list.component.scss | 13 -------- .../project/ontology/ontology.component.html | 13 ++++---- .../project/ontology/ontology.component.scss | 16 ---------- .../property-info.component.html | 2 +- .../property-info/property-info.component.ts | 2 ++ .../resource-class-info.component.html | 4 +-- .../resource-class-info.component.spec.ts | 2 +- .../resource-class-info.component.ts | 2 ++ .../display-edit/display-edit.component.html | 4 +-- .../display-edit.component.spec.ts | 4 ++- .../display-edit/display-edit.component.ts | 2 ++ .../properties/properties.component.html | 11 +++---- .../resource-list/resource-list.component.ts | 4 ++- src/assets/style/main.scss | 17 +++++++++++ 21 files changed, 80 insertions(+), 68 deletions(-) diff --git a/src/app/project/list/list-info-form/list-info-form.component.ts b/src/app/project/list/list-info-form/list-info-form.component.ts index affc8bda04..31d88f3cff 100644 --- a/src/app/project/list/list-info-form/list-info-form.component.ts +++ b/src/app/project/list/list-info-form/list-info-form.component.ts @@ -36,8 +36,6 @@ export class ListInfoFormComponent implements OnInit { loading: boolean; - project: ReadProject; - list: ListNodeInfo; labels: StringLiteral[]; diff --git a/src/app/project/list/list-item-form/list-item-form.component.html b/src/app/project/list/list-item-form/list-item-form.component.html index 3570be8ee9..0642f835c7 100644 --- a/src/app/project/list/list-item-form/list-item-form.component.html +++ b/src/app/project/list/list-item-form/list-item-form.component.html @@ -21,7 +21,7 @@ [placeholder]="labels | appStringifyStringLiteral:'all' | appTruncate: 128" [value]="labels" [readonly]="true" (dataChanged)="handleData($event)" [language]="language"> -
+
- + + +

List configuration

+ + +
- +
diff --git a/src/app/project/list/list.component.scss b/src/app/project/list/list.component.scss index 384c8a8322..6add7b4d2b 100644 --- a/src/app/project/list/list.component.scss +++ b/src/app/project/list/list.component.scss @@ -17,16 +17,3 @@ } } -.list-editor { - mat-toolbar-row { - button { - margin: 0% 0.5%; - padding: 1%; - min-width: 6%; - border-radius: 40px; - } - button:hover { - background-color: #ebebeb; - } - } -} diff --git a/src/app/project/ontology/ontology.component.html b/src/app/project/ontology/ontology.component.html index d1197c85db..406a7ec071 100644 --- a/src/app/project/ontology/ontology.component.html +++ b/src/app/project/ontology/ontology.component.html @@ -41,7 +41,7 @@

- +

-
+
diff --git a/src/app/project/ontology/ontology.component.scss b/src/app/project/ontology/ontology.component.scss index 4623804747..886c829c8f 100644 --- a/src/app/project/ontology/ontology.component.scss +++ b/src/app/project/ontology/ontology.component.scss @@ -122,19 +122,3 @@ $width: 340px; top: 80px; } -.mat-caption.space-reducer { - margin-top: 0; - margin-bottom: 6px; -} -.ontology-actions { - border-left: 1px solid $primary_200; - padding: 0 12px; - .mat-caption.space-reducer { - margin-top: -6px; - margin-bottom: 6px; - } -} - -button.space-reducer { - margin: 0; -} diff --git a/src/app/project/ontology/property-info/property-info.component.html b/src/app/project/ontology/property-info/property-info.component.html index d0c19ec094..65a6e95ee8 100644 --- a/src/app/project/ontology/property-info/property-info.component.html +++ b/src/app/project/ontology/property-info/property-info.component.html @@ -48,7 +48,7 @@
-
+
diff --git a/src/app/project/ontology/property-info/property-info.component.ts b/src/app/project/ontology/property-info/property-info.component.ts index 15c6cfbc1e..8019fcaf1b 100644 --- a/src/app/project/ontology/property-info/property-info.component.ts +++ b/src/app/project/ontology/property-info/property-info.component.ts @@ -87,6 +87,8 @@ export class PropertyInfoComponent implements OnChanges, AfterContentInit { @Input() projectCode: string; + @Input() projectStatus: boolean; + @Input() lastModificationDate?: string; // event emitter when the lastModificationDate changed; bidirectional binding with lastModificationDate parameter diff --git a/src/app/project/ontology/resource-class-info/resource-class-info.component.html b/src/app/project/ontology/resource-class-info/resource-class-info.component.html index c082f47f2b..269e0c5da0 100644 --- a/src/app/project/ontology/resource-class-info/resource-class-info.component.html +++ b/src/app/project/ontology/resource-class-info/resource-class-info.component.html @@ -16,7 +16,7 @@ - @@ -50,7 +50,7 @@ @@ -57,8 +57,8 @@

delete Delete resource - @@ -121,12 +121,13 @@

[displayValue]="val" [propArray]="resource.resProps" [canDelete]="deleteValueIsAllowed(prop)" + [projectStatus]="project?.status" (referredResourceClicked)="openResource($event)" (referredResourceHovered)="previewResource($event)">

-
+
-
+