Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update UI on region color change (DEV-215) #583

Merged
merged 4 commits into from Nov 11, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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();
}
}
}