Skip to content
Permalink
Browse files
feat: update UI on region color change (#583)
  • Loading branch information
mdelez committed Nov 11, 2021
1 parent be9d6f4 commit b497d0ead475d520ff3d02e620128cac4947694b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
@@ -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<ReadLinkValue> = new EventEmitter<ReadLinkValue>();

@Output() regionColorChanged: EventEmitter<ReadColorValue> = new EventEmitter<ReadColorValue>();

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');
}
@@ -60,7 +60,7 @@
<div class="region-property" *ngFor="let annotation of annotationResources" [id]="annotation.res.id"
[class.active]="annotation.res.id === selectedRegion">
<app-properties [resource]="annotation" [displayProjectInfo]="false" [isAnnotation]="true"
[adminPermissions]="adminPermissions" [editPermissions]="editPermissions" [valueUuidToHighlight]="valueUuid">
[adminPermissions]="adminPermissions" [editPermissions]="editPermissions" [valueUuidToHighlight]="valueUuid" (regionColorChanged)="updateRegionColor()">
</app-properties>
</div>

@@ -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();
}
}
}

0 comments on commit b497d0e

Please sign in to comment.