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

Demo user restrictions on front end #33

Merged
merged 3 commits into from
Aug 15, 2022
Merged
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
2 changes: 1 addition & 1 deletion src/app/base/components/header/header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
</a>

</div>
<div class="flex justify-center overflow-visible">
<div class="flex justify-center overflow-visible" *ngIf="!hideLogout">
<div *ngIf="user" class=" mr-4">
<kern-dropdown [dropdownOptions]="{
optionArray: showConfigSettings ? ['Account Settings', 'Change config', 'Logout'] : ['Account Settings', 'Logout'],
Expand Down
10 changes: 6 additions & 4 deletions src/app/projects/components/projects/projects.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@
<span class="text-sm text-gray-900 tooltip tooltip-bottom text-gray-500"
[attr.data-tip]="project.user.mail">{{project.user.firstName}}
{{project.user.lastName}}</span>
<span class="text-sm text-gray-500">on</span>
<span class="text-sm text-gray-900 text-gray-500">{{project.date}}</span>
<span class="text-sm text-gray-500">at</span>
<span class="text-sm text-gray-900 text-gray-500">{{project.time}}</span>
<ng-template [ngIf]="!isDemoUser">
<span class="text-sm text-gray-500">on</span>
<span class="text-sm text-gray-900 text-gray-500">{{project.date}}</span>
<span class="text-sm text-gray-500">at</span>
<span class="text-sm text-gray-900 text-gray-500">{{project.time}}</span>
</ng-template>
</div>
<div class="my-2 grid grid-cols-3 gap-4 items-center lg:grid-cols-6">
<div class="col-span-2">
Expand Down
10 changes: 10 additions & 0 deletions src/app/projects/components/projects/projects.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export class ProjectsComponent implements OnInit, OnDestroy {
isManaged: boolean = true;
isProjectInitial: boolean = false;
previousValue: string;
isDemoUser: boolean = false;

constructor(
private projectApolloService: ProjectApolloService,
Expand Down Expand Up @@ -127,6 +128,15 @@ export class ProjectsComponent implements OnInit, OnDestroy {
this.isManaged = ConfigManager.getIsManaged();
}
});
this.checkIfDemoUser();
}

checkIfDemoUser() {
if (!ConfigManager.isInit()) {
timer(250).subscribe(() => this.checkIfDemoUser());
return;
}
this.isDemoUser = ConfigManager.getIsDemo() && !ConfigManager.getIsAdmin();
}

createDefaultOrg(user) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ <h1 class="text-lg text-gray-900 mb-2 text-center">Last Weak
<input #modalCreateZS type="checkbox" id="zero-shot-modal" class="modal-toggle">

<div class="modal">
<div class="modal-box text-black bg-white justify-center modal-configuration">
<div class="modal-box text-black bg-white justify-center modal-configuration" style="overflow: initial;">
<h1 class="text-lg text-gray-900 mb-2 text-center mb-4">Add new zero shot classification</h1>

<div *ngIf="attributes && labelingTasksClassification"
Expand Down