Skip to content

Commit

Permalink
Merge pull request #549 from MauroDataMapper/gh-545
Browse files Browse the repository at this point in the history
Set the access when configuring the code set table
  • Loading branch information
pjmonks authored May 27, 2022
2 parents e66c07a + e2b0ede commit fddb2ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/app/code-set/code-set/code-set.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
SPDX-License-Identifier: Apache-2.0
-->
<div
<div *ngIf="codeSetModel"
class="full-width"
data-cy="catalogue-item-container"
[attr.data-catalogue-item-id]="codeSetModel.id"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ export class CodeSetTermsTableComponent implements OnInit, AfterViewInit {
}

ngOnInit() {
if (this.access && this.access.showEdit) {
this.displayedColumns = ['terminology', 'term', 'definition', 'btns'];
} else {
this.displayedColumns = ['terminology', 'term', 'definition'];
}
this.isLoadingResults = false;
}

Expand Down Expand Up @@ -108,6 +103,12 @@ export class CodeSetTermsTableComponent implements OnInit, AfterViewInit {

this.records = data;
this.access = this.securityHandler.elementAccess(this.codeSet);
if (this.codeSet.availableActions.includes('update') && !this.codeSet.finalised) {
this.displayedColumns = ['terminology', 'term', 'definition', 'btns'];
} else {
this.displayedColumns = ['terminology', 'term', 'definition'];
}

});
this.changeRef.detectChanges();
}
Expand Down

0 comments on commit fddb2ec

Please sign in to comment.