Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feat: update UI on region color change (#583)
  • Loading branch information
mdelez committed Nov 11, 2021
1 parent be9d6f4 commit b497d0e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/app/workspace/resource/properties/properties.component.ts
Expand Up @@ -14,6 +14,7 @@ import {
PermissionUtil,
ProjectResponse,
PropertyDefinition,
ReadColorValue,
ReadLinkValue,
ReadProject,
ReadResource,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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');
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/workspace/resource/resource.component.html
Expand Up @@ -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>

Expand Down
6 changes: 6 additions & 0 deletions src/app/workspace/resource/resource.component.ts
Expand Up @@ -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.