Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/app/constraints-rules/constraints-rules.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ <h4 class="marginless">
fxLayoutAlign="flex-end center"
fxLayoutAlign.xs="flex-start center"
>

<ng-template [ngIf]="isLoggedIn">
<div class="mt-1">
<button
mat-flat-button
Expand All @@ -89,7 +91,9 @@ <h4 class="marginless">
>
<span class="fas fa-download"></span> Export
</button>

</div>
</ng-template>
</div>
</div>
</mat-expansion-panel-header>
Expand Down
4 changes: 4 additions & 0 deletions src/app/constraints-rules/constraints-rules.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
} from '@angular/animations';
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { SharedService } from '../services/shared.service';
import {
AddRuleModalComponent,
AddRuleModalConfig,
Expand Down Expand Up @@ -91,13 +92,15 @@ export class ConstraintsRulesComponent implements OnInit {

clickButton = false;
filteredOpen = false;
isLoggedIn = false;

canAddRules: boolean;
canDeleteRules: boolean;

constructor(
public dialog: MatDialog,
private editing: EditingService,
private sharedService: SharedService,
protected resourcesService: MdmResourcesService,
protected messageHandler: MessageHandlerService
) {
Expand All @@ -106,6 +109,7 @@ export class ConstraintsRulesComponent implements OnInit {
this.languages.push({ displayName: 'All', value: 'all' });
this.isLoadingResults = true;
this.selectedLanguage = this.languages.find((x) => x.value === 'all');
this.isLoggedIn = this.sharedService.isLoggedIn();
}

ngOnInit(): void {
Expand Down
6 changes: 5 additions & 1 deletion src/app/dataModel/data-model.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,19 @@
fxLayoutAlign="flex-end center"
fxLayoutAlign.xs="flex-start center"
>

<ng-template [ngIf]="isLoggedIn && canEdit">
<button
mat-flat-button
color="primary"
type="button"
(click)="addDataClass()"
>
<span class="fas fa-plus" aria-hidden="true"></span>
<span class="fas fa-plus" aria-hidden="true"></span>
Add Data Class
</button>
</ng-template>

</div>
</div>
</div>
Expand Down
6 changes: 6 additions & 0 deletions src/app/dataModel/data-model.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ export class DataModelComponent
historyItemCount = 0;
isLoadingHistory = true;
showEditDescription = false;
isLoggedIn = false;
canEdit = false;

constructor(
private resourcesService: MdmResourcesService,
Expand Down Expand Up @@ -118,6 +120,8 @@ export class DataModelComponent
this.title.setTitle('Data Model');

this.dataModelDetails(this.parentId, this.showFinalised);

this.isLoggedIn = this.sharedService.isLoggedIn();
}

save(saveItems: Array<DefaultProfileItem>) {
Expand Down Expand Up @@ -236,6 +240,8 @@ export class DataModelComponent
}
});
}

this.canEdit = this.dataModel.availableActions.includes('update');
}

async DataModelPermissions(id: any) {
Expand Down