[SM-554] hide admin onboarding items from non-admin (#4843)

* hide onboarding items if not admin

* fix inconsistent padding
This commit is contained in:
Will Martin 2023-02-24 08:58:00 -05:00 committed by GitHub
parent b7f465e552
commit da9f4e1fb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -10,11 +10,12 @@
icon="bwi-cli" icon="bwi-cli"
[completed]="view.tasks.createServiceAccount" [completed]="view.tasks.createServiceAccount"
> >
<span> <span class="tw-pl-1">
{{ "downloadThe" | i18n }} <a bitLink routerLink="">{{ "smCLI" | i18n }}</a> {{ "downloadThe" | i18n }} <a bitLink routerLink="">{{ "smCLI" | i18n }}</a>
</span> </span>
</sm-onboarding-task> </sm-onboarding-task>
<sm-onboarding-task <sm-onboarding-task
*ngIf="userIsAdmin"
[title]="'importSecrets' | i18n" [title]="'importSecrets' | i18n"
[route]="['settings', 'import']" [route]="['settings', 'import']"
icon="bwi-download" icon="bwi-download"
@ -27,6 +28,7 @@
[completed]="view.tasks.createSecret" [completed]="view.tasks.createSecret"
></sm-onboarding-task> ></sm-onboarding-task>
<sm-onboarding-task <sm-onboarding-task
*ngIf="userIsAdmin"
[title]="'createProject' | i18n" [title]="'createProject' | i18n"
(click)="openNewProjectDialog()" (click)="openNewProjectDialog()"
icon="bwi-collection" icon="bwi-collection"

View File

@ -57,6 +57,7 @@ export class OverviewComponent implements OnInit, OnDestroy {
private tableSize = 10; private tableSize = 10;
private organizationId: string; private organizationId: string;
protected organizationName: string; protected organizationName: string;
protected userIsAdmin: boolean;
protected view$: Observable<{ protected view$: Observable<{
allProjects: ProjectListView[]; allProjects: ProjectListView[];
@ -96,6 +97,7 @@ export class OverviewComponent implements OnInit, OnDestroy {
.subscribe((org) => { .subscribe((org) => {
this.organizationId = org.id; this.organizationId = org.id;
this.organizationName = org.name; this.organizationName = org.name;
this.userIsAdmin = org.isAdmin;
}); });
const projects$ = combineLatest([ const projects$ = combineLatest([