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

Commit ddcd4c1

Browse files
Demo user restrictions on front end (#33)
* Demo user restrictions on front end * Demo user check fix
1 parent c9b1c9c commit ddcd4c1

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

src/app/base/components/header/header.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
</a>
103103

104104
</div>
105-
<div class="flex justify-center overflow-visible">
105+
<div class="flex justify-center overflow-visible" *ngIf="!hideLogout">
106106
<div *ngIf="user" class=" mr-4">
107107
<kern-dropdown [dropdownOptions]="{
108108
optionArray: showConfigSettings ? ['Account Settings', 'Change config', 'Logout'] : ['Account Settings', 'Logout'],

src/app/projects/components/projects/projects.component.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@
2222
<span class="text-sm text-gray-900 tooltip tooltip-bottom text-gray-500"
2323
[attr.data-tip]="project.user.mail">{{project.user.firstName}}
2424
{{project.user.lastName}}</span>
25-
<span class="text-sm text-gray-500">on</span>
26-
<span class="text-sm text-gray-900 text-gray-500">{{project.date}}</span>
27-
<span class="text-sm text-gray-500">at</span>
28-
<span class="text-sm text-gray-900 text-gray-500">{{project.time}}</span>
25+
<ng-template [ngIf]="!isDemoUser">
26+
<span class="text-sm text-gray-500">on</span>
27+
<span class="text-sm text-gray-900 text-gray-500">{{project.date}}</span>
28+
<span class="text-sm text-gray-500">at</span>
29+
<span class="text-sm text-gray-900 text-gray-500">{{project.time}}</span>
30+
</ng-template>
2931
</div>
3032
<div class="my-2 grid grid-cols-3 gap-4 items-center lg:grid-cols-6">
3133
<div class="col-span-2">

src/app/projects/components/projects/projects.component.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ export class ProjectsComponent implements OnInit, OnDestroy {
8888
isManaged: boolean = true;
8989
isProjectInitial: boolean = false;
9090
previousValue: string;
91+
isDemoUser: boolean = false;
9192

9293
constructor(
9394
private projectApolloService: ProjectApolloService,
@@ -127,6 +128,15 @@ export class ProjectsComponent implements OnInit, OnDestroy {
127128
this.isManaged = ConfigManager.getIsManaged();
128129
}
129130
});
131+
this.checkIfDemoUser();
132+
}
133+
134+
checkIfDemoUser() {
135+
if (!ConfigManager.isInit()) {
136+
timer(250).subscribe(() => this.checkIfDemoUser());
137+
return;
138+
}
139+
this.isDemoUser = ConfigManager.getIsDemo() && !ConfigManager.getIsAdmin();
130140
}
131141

132142
createDefaultOrg(user) {

src/app/weak-supervision/components/weak-supervision/weak-supervision.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ <h1 class="text-lg text-gray-900 mb-2 text-center">Last Weak
232232
<input #modalCreateZS type="checkbox" id="zero-shot-modal" class="modal-toggle">
233233

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

238238
<div *ngIf="attributes && labelingTasksClassification"

0 commit comments

Comments
 (0)