Skip to content
This repository was archived by the owner on Mar 8, 2024. It is now read-only.

Commit cac87b2

Browse files
author
JWittmeyer
committed
Adds local storage removal for assume role & remove unnessecary rla data for annotators
1 parent 5fd1302 commit cac87b2

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/app/labeling/components/labeling.component.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ export class LabelingComponent implements OnInit, OnDestroy {
140140
if (this.recordLabelAssociations$) this.recordLabelAssociations$.unsubscribe();
141141
this.subscriptions$.forEach(element => element.unsubscribe());
142142
if (this.project) NotificationService.unsubscribeFromNotification(this, this.project.id)
143+
if (this.roleAssumed) localStorage.removeItem("huddleData");
143144
}
144145

145146

@@ -550,17 +551,17 @@ export class LabelingComponent implements OnInit, OnDestroy {
550551
this.recordLabelAssociations$ = this.recordLabelAssociations$
551552
.subscribe((recordLabelAssociations) => {
552553
if (!recordLabelAssociations) return;
553-
this.prepareRLADataForRole(recordLabelAssociations);
554-
this.extendRecordLabelAssociations(recordLabelAssociations);
555-
this.parseRlaToGroups(recordLabelAssociations)
554+
let rlaData = this.prepareRLADataForRole(recordLabelAssociations);
555+
this.extendRecordLabelAssociations(rlaData);
556+
this.parseRlaToGroups(rlaData)
556557
this.prepareFullRecord();
557558
this.prepareInformationExtractionDisplay();
558559
this.somethingLoading = false;
559560

560561
});
561562
}
562563

563-
prepareRLADataForRole(rlaData: any[]) {
564+
prepareRLADataForRole(rlaData: any[]): any[] {
564565
if (this.user.role == "ANNOTATOR") {
565566
rlaData.forEach((rla) => {
566567
if (rla.sourceId && rla.sourceId == this.getSourceId()) {
@@ -570,9 +571,9 @@ export class LabelingComponent implements OnInit, OnDestroy {
570571
rla.id = "irrelevant";
571572
}
572573
});
573-
rlaData = rlaData.filter(rla => rla.id != "irrelevant");
574+
return rlaData.filter(rla => rla.id != "irrelevant");
574575
}
575-
576+
return rlaData;
576577
}
577578

578579
getTokenizedRecord(recordId: string, fullRefresh: boolean = false) {

0 commit comments

Comments
 (0)