From b497d0ead475d520ff3d02e620128cac4947694b Mon Sep 17 00:00:00 2001 From: mdelez <60604010+mdelez@users.noreply.github.com> Date: Thu, 11 Nov 2021 17:00:00 +0100 Subject: [PATCH] feat: update UI on region color change (#583) --- .../workspace/resource/properties/properties.component.ts | 6 ++++++ src/app/workspace/resource/resource.component.html | 2 +- src/app/workspace/resource/resource.component.ts | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/app/workspace/resource/properties/properties.component.ts b/src/app/workspace/resource/properties/properties.component.ts index e993a5d006..47924740a8 100644 --- a/src/app/workspace/resource/properties/properties.component.ts +++ b/src/app/workspace/resource/properties/properties.component.ts @@ -14,6 +14,7 @@ import { PermissionUtil, ProjectResponse, PropertyDefinition, + ReadColorValue, ReadLinkValue, ReadProject, ReadResource, @@ -113,6 +114,8 @@ export class PropertiesComponent implements OnInit, OnChanges, OnDestroy { */ @Output() referredResourceHovered: EventEmitter = new EventEmitter(); + @Output() regionColorChanged: EventEmitter = new EventEmitter(); + lastModificationDate: string; deletedResource = false; @@ -445,6 +448,9 @@ export class PropertiesComponent implements OnInit, OnChanges, OnDestroy { if (updatedValue instanceof ReadTextValueAsXml) { this._updateStandoffLinkValue(); } + if (updatedValue instanceof ReadColorValue) { + this.regionColorChanged.emit(); + } } else { console.error('No properties exist for this resource'); } diff --git a/src/app/workspace/resource/resource.component.html b/src/app/workspace/resource/resource.component.html index a71906d577..1c158b4343 100644 --- a/src/app/workspace/resource/resource.component.html +++ b/src/app/workspace/resource/resource.component.html @@ -60,7 +60,7 @@
+ [adminPermissions]="adminPermissions" [editPermissions]="editPermissions" [valueUuidToHighlight]="valueUuid" (regionColorChanged)="updateRegionColor()">
diff --git a/src/app/workspace/resource/resource.component.ts b/src/app/workspace/resource/resource.component.ts index 0b694fe9e0..5e8da74cd1 100644 --- a/src/app/workspace/resource/resource.component.ts +++ b/src/app/workspace/resource/resource.component.ts @@ -554,4 +554,10 @@ export class ResourceComponent implements OnInit, OnChanges, OnDestroy { this.getIncomingRegions(this.incomingResource ? this.incomingResource : this.resource, 0); this.openRegion(iri); } + + updateRegionColor(){ + if (this.stillImageComponent !== undefined) { + this.stillImageComponent.updateRegions(); + } + } }