diff --git a/.grenrc.js b/.grenrc.js new file mode 100644 index 0000000000..f9c9d076f2 --- /dev/null +++ b/.grenrc.js @@ -0,0 +1,12 @@ +module.exports = { + "dataSource": "commits", + "prefix": "", + "includeMessages": "all", + "changelogFilename": "CHANGELOG.md", + "groupBy": { + "Enhancements:": ["feat"], + "Bug Fixes:": ["fix"], + "Documentation:": ["docs"], + "Other": ["chore", "refactor"] + } +}; diff --git a/src/app/app-global.ts b/src/app/app-global.ts index 0a1fe1eaa9..ccacf97587 100644 --- a/src/app/app-global.ts +++ b/src/app/app-global.ts @@ -6,7 +6,7 @@ export class AppGlobal { public static projectNav: MenuItem[] = [ { label: 'Project information', - route: 'board', + route: 'info', icon: 'assignment' }, { @@ -15,9 +15,9 @@ export class AppGlobal { icon: 'group' }, { - label: 'Groups', - route: 'groups', - icon: 'supervised_user_circle' + label: 'Permission groups', + route: 'permissions', + icon: 'lock_open' }, { label: 'Data model', diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index e97486a711..863dcfb2c0 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -27,6 +27,8 @@ import { UsersComponent } from './system/users/users.component'; import { StatusComponent } from './system/status/status.component'; import { ResourceComponent } from './workspace/resource/resource.component'; import { CookiePolicyComponent } from './main/cookie-policy/cookie-policy.component'; +import { GroupsComponent } from './system/groups/groups.component'; +import { PermissionComponent } from './project/permission/permission.component'; const routes: Routes = [ { @@ -49,10 +51,10 @@ const routes: Routes = [ { path: '', pathMatch: 'full', - redirectTo: 'board' + redirectTo: 'info' }, { - path: 'board', + path: 'info', component: BoardComponent }, { @@ -60,6 +62,11 @@ const routes: Routes = [ component: CollaborationComponent, canActivate: [AuthGuard] }, + { + path: 'permissions', + component: PermissionComponent, + canActivate: [AuthGuard] + }, { path: 'ontologies', component: OntologyComponent, diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 9c67a15172..f231b07247 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -61,6 +61,10 @@ import { GridComponent } from './main/grid/grid.component'; import { ResourceComponent } from './workspace/resource/resource.component'; import { CookiePolicyComponent } from './main/cookie-policy/cookie-policy.component'; import { InfoMenuComponent } from './main/info-menu/info-menu.component'; +import { GroupsComponent } from './system/groups/groups.component'; +import { GroupsListComponent } from './system/groups/groups-list/groups-list.component'; +import { PermissionComponent } from './project/permission/permission.component'; +import { AddGroupComponent } from './project/permission/add-group/add-group.component'; // translate: AoT requires an exported function for factories export function HttpLoaderFactory(httpClient: HttpClient) { @@ -113,7 +117,6 @@ export function initializeApp(appInitService: AppInitService) { ResourceComponent, ExpertSearchComponent, AdvancedSearchComponent, - DashboardComponent, DialogComponent, SystemComponent, @@ -123,7 +126,11 @@ export function initializeApp(appInitService: AppInitService) { DialogHeaderComponent, GridComponent, CookiePolicyComponent, - InfoMenuComponent + InfoMenuComponent, + GroupsComponent, + GroupsListComponent, + PermissionComponent, + AddGroupComponent ], imports: [ AppRoutingModule, diff --git a/src/app/main/header/header.component.html b/src/app/main/header/header.component.html index 7119e65a76..cf36639d4e 100644 --- a/src/app/main/header/header.component.html +++ b/src/app/main/header/header.component.html @@ -3,26 +3,26 @@ - - - - + + + - diff --git a/src/app/main/header/header.component.scss b/src/app/main/header/header.component.scss index 92142af169..932dfc9a67 100644 --- a/src/app/main/header/header.component.scss +++ b/src/app/main/header/header.component.scss @@ -1,5 +1,5 @@ .logo { - margin-left: -16px; + // margin-left: -16px; .mat-icon { height: 40px; @@ -9,7 +9,7 @@ } &.small { - margin-left: 12px; + // margin-left: 12px; width: 40px; } } diff --git a/src/app/main/info-menu/info-menu.component.html b/src/app/main/info-menu/info-menu.component.html index a478755a18..9c2fcff16a 100644 --- a/src/app/main/info-menu/info-menu.component.html +++ b/src/app/main/info-menu/info-menu.component.html @@ -1,5 +1,5 @@ diff --git a/src/app/main/info-menu/info-menu.component.spec.ts b/src/app/main/info-menu/info-menu.component.spec.ts index b595d77b52..eca948f009 100644 --- a/src/app/main/info-menu/info-menu.component.spec.ts +++ b/src/app/main/info-menu/info-menu.component.spec.ts @@ -1,7 +1,7 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { MatButtonModule, MatIconModule, MatListModule, MatMenuModule } from '@angular/material'; -import { KuiCoreConfig, KuiCoreConfigToken } from '@knora/core'; +import { KuiCoreConfig, KuiCoreConfigToken, KuiCoreModule } from '@knora/core'; import { InfoMenuComponent } from './info-menu.component'; @@ -14,6 +14,7 @@ describe('InfoMenuComponent', () => { declarations: [InfoMenuComponent], imports: [ HttpClientTestingModule, + KuiCoreModule, MatButtonModule, MatIconModule, MatListModule, diff --git a/src/app/main/info-menu/info-menu.component.ts b/src/app/main/info-menu/info-menu.component.ts index 78f341a4db..d6129f3ea5 100644 --- a/src/app/main/info-menu/info-menu.component.ts +++ b/src/app/main/info-menu/info-menu.component.ts @@ -2,7 +2,7 @@ import { HttpClient, HttpResponse } from '@angular/common/http'; import { Component, Inject, OnInit } from '@angular/core'; import { MatIconRegistry } from '@angular/material'; import { DomSanitizer } from '@angular/platform-browser'; -import { ApiService, KuiCoreConfig, KuiCoreConfigToken } from '@knora/core'; +import { KuiCoreConfig, KuiCoreConfigToken } from '@knora/core'; import { MenuItem } from '../declarations/menu-item'; declare let require: any; @@ -25,18 +25,18 @@ export class InfoMenuComponent implements OnInit { versions: MenuItem[] = [ { - label: 'Kuirl v ' + this.appVersion, + label: '', icon: 'kuirl_icon', route: 'https://github.com/dhlab-basel/Kuirl/releases/tag/v' + this.appVersion }, { - label: 'Knora v ', + label: 'Knora v', icon: 'knora_icon', route: 'https://github.com/dhlab-basel/Knora/releases/tag/v' } ]; - constructor (private _apiService: ApiService, + constructor ( @Inject(KuiCoreConfigToken) public config: KuiCoreConfig, private _domSanitizer: DomSanitizer, private _matIconRegistry: MatIconRegistry, @@ -61,7 +61,9 @@ export class InfoMenuComponent implements OnInit { ngOnInit() { - this._http.get>(this.config.api + '/v2/authentication', { observe: 'response' }) + this.versions[0].label = this.config.name + ' v' + this.appVersion; + + this._http.get>(this.config.api + '/admin/projects', { observe: 'response' }) .subscribe( (resp: HttpResponse) => { // console.log('Stackoverflow', resp.headers.get('Server')); @@ -80,6 +82,10 @@ export class InfoMenuComponent implements OnInit { readVersion(v: string) { + if (!v) { + return; + } + const versions: string[] = v.split(' '); this.apiVersion = versions[0].split('/')[1]; diff --git a/src/app/project/collaboration/collaboration.component.ts b/src/app/project/collaboration/collaboration.component.ts index 3a935df9bd..81c8d55f8f 100644 --- a/src/app/project/collaboration/collaboration.component.ts +++ b/src/app/project/collaboration/collaboration.component.ts @@ -1,10 +1,10 @@ -import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core'; +import { Component, OnInit, ViewChild } from '@angular/core'; import { Title } from '@angular/platform-browser'; import { ActivatedRoute, Params } from '@angular/router'; +import { Session } from '@knora/authentication'; import { ApiServiceError, Project, ProjectsService, User } from '@knora/core'; import { CacheService } from '../../main/cache/cache.service'; import { AddUserComponent } from './add-user/add-user.component'; -import { Session } from '@knora/authentication'; @Component({ selector: 'app-collaboration', @@ -38,17 +38,17 @@ export class CollaborationComponent implements OnInit { @ViewChild('addUserComponent') addUser: AddUserComponent; - constructor(private _cache: CacheService, - private _projectsService: ProjectsService, - private _route: ActivatedRoute, - private _titleService: Title) { + constructor (private _cache: CacheService, + private _projectsService: ProjectsService, + private _route: ActivatedRoute, + private _titleService: Title) { // get the shortcode of the current project this._route.parent.paramMap.subscribe((params: Params) => { this.projectcode = params.get('shortcode'); }); -// this.projectcode = this._route.parent.snapshot.params.shortcode; + // this.projectcode = this._route.parent.snapshot.params.shortcode; // set the page title this._titleService.setTitle('Project ' + this.projectcode + ' | Collaboration'); @@ -82,33 +82,33 @@ export class CollaborationComponent implements OnInit { // get the project data from cache this._cache - .get( - this.projectcode, - this._projectsService.getProjectByShortcode( - this.projectcode - ) + .get( + this.projectcode, + this._projectsService.getProjectByShortcode( + this.projectcode ) - .subscribe( - (result: Project) => { - this.project = result; - - // is logged-in user projectAdmin? - this.projectAdmin = this.sysAdmin - ? this.sysAdmin - : this.session.user.projectAdmin.some(e => e === this.project.id); - - // get from cache: list of project members and groups - if (this.projectAdmin) { - this.refresh(); - } - - this.loading = false; - }, - (error: ApiServiceError) => { - console.error(error); - this.loading = false; + ) + .subscribe( + (result: Project) => { + this.project = result; + + // is logged-in user projectAdmin? + this.projectAdmin = this.sysAdmin + ? this.sysAdmin + : this.session.user.projectAdmin.some(e => e === this.project.id); + + // get from cache: list of project members and groups + if (this.projectAdmin) { + this.refresh(); } - ); + + this.loading = false; + }, + (error: ApiServiceError) => { + console.error(error); + this.loading = false; + } + ); } /** diff --git a/src/app/project/collaboration/select-group/select-group.component.html b/src/app/project/collaboration/select-group/select-group.component.html index 986b6722d8..86e9258f06 100644 --- a/src/app/project/collaboration/select-group/select-group.component.html +++ b/src/app/project/collaboration/select-group/select-group.component.html @@ -1,5 +1,5 @@ - {{group.name}} diff --git a/src/app/project/permission/add-group/add-group.component.html b/src/app/project/permission/add-group/add-group.component.html new file mode 100644 index 0000000000..94d9a73b48 --- /dev/null +++ b/src/app/project/permission/add-group/add-group.component.html @@ -0,0 +1,3 @@ +

+ add-group works! +

diff --git a/src/app/project/permission/add-group/add-group.component.scss b/src/app/project/permission/add-group/add-group.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/app/project/permission/add-group/add-group.component.spec.ts b/src/app/project/permission/add-group/add-group.component.spec.ts new file mode 100644 index 0000000000..e78989208a --- /dev/null +++ b/src/app/project/permission/add-group/add-group.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AddGroupComponent } from './add-group.component'; + +describe('AddGroupComponent', () => { + let component: AddGroupComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ AddGroupComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AddGroupComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/project/permission/add-group/add-group.component.ts b/src/app/project/permission/add-group/add-group.component.ts new file mode 100644 index 0000000000..7b843af1bb --- /dev/null +++ b/src/app/project/permission/add-group/add-group.component.ts @@ -0,0 +1,22 @@ +import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; + +@Component({ + selector: 'app-add-group', + templateUrl: './add-group.component.html', + styleUrls: ['./add-group.component.scss'] +}) +export class AddGroupComponent implements OnInit { + + @Input() projectcode: string; + + @Output() refreshParent: EventEmitter = new EventEmitter(); + + constructor () { } + + ngOnInit() { + } + + buildForm(): void { + + } +} diff --git a/src/app/project/permission/permission.component.html b/src/app/project/permission/permission.component.html new file mode 100644 index 0000000000..ceeca2bbde --- /dev/null +++ b/src/app/project/permission/permission.component.html @@ -0,0 +1,25 @@ +
+ + + + + + + + +
+ + + + + + + +
+ +
+ +
+ +
diff --git a/src/app/project/permission/permission.component.scss b/src/app/project/permission/permission.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/app/project/permission/permission.component.spec.ts b/src/app/project/permission/permission.component.spec.ts new file mode 100644 index 0000000000..2019f4eb6a --- /dev/null +++ b/src/app/project/permission/permission.component.spec.ts @@ -0,0 +1,107 @@ +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ActivatedRoute } from '@angular/router'; +import { RouterTestingModule } from '@angular/router/testing'; +import { KuiActionModule } from '@knora/action'; +import { Session } from '@knora/authentication'; +import { KuiCoreConfig, KuiCoreConfigToken } from '@knora/core'; +import { of } from 'rxjs'; +import { ErrorComponent } from 'src/app/main/error/error.component'; +import { GroupsListComponent } from 'src/app/system/groups/groups-list/groups-list.component'; +import { AddGroupComponent } from './add-group/add-group.component'; +import { PermissionComponent } from './permission.component'; + + +describe('PermissionComponent', () => { + let component: PermissionComponent; + let fixture: ComponentFixture; + + const shortcode = '0001'; + + const currentTestSession: Session = { + id: 1555226377250, + user: { + jwt: '', + lang: 'en', + name: 'root', + projectAdmin: [], + sysAdmin: false + } + }; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ + PermissionComponent, + AddGroupComponent, + GroupsListComponent, + ErrorComponent + ], + imports: [ + HttpClientTestingModule, + KuiActionModule, + RouterTestingModule + ], + providers: [ + { + provide: ActivatedRoute, + useValue: { + parent: { + paramMap: of({ + get: (param: string) => { + if (param === 'shortcode') { + return shortcode; + } + } + }) + } + } + }, + { + provide: KuiCoreConfigToken, + useValue: KuiCoreConfig + } + ] + }) + .compileComponents(); + })); + + // mock localStorage + beforeEach(() => { + let store = {}; + + spyOn(localStorage, 'getItem').and.callFake( + (key: string): String => { + return store[key] || null; + } + ); + spyOn(localStorage, 'removeItem').and.callFake( + (key: string): void => { + delete store[key]; + } + ); + spyOn(localStorage, 'setItem').and.callFake( + (key: string, value: string): string => { + return (store[key] = value); + } + ); + spyOn(localStorage, 'clear').and.callFake(() => { + store = {}; + }); + }); + + beforeEach(() => { + localStorage.setItem('session', JSON.stringify(currentTestSession)); + + fixture = TestBed.createComponent(PermissionComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(localStorage.getItem('session')).toBe( + JSON.stringify(currentTestSession) + ); + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/project/permission/permission.component.ts b/src/app/project/permission/permission.component.ts new file mode 100644 index 0000000000..2fdc103ded --- /dev/null +++ b/src/app/project/permission/permission.component.ts @@ -0,0 +1,86 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Title } from '@angular/platform-browser'; +import { ActivatedRoute, Params } from '@angular/router'; +import { Session } from '@knora/authentication'; +import { Group, Project, ProjectsService } from '@knora/core'; +import { CacheService } from 'src/app/main/cache/cache.service'; +import { AddGroupComponent } from './add-group/add-group.component'; + +@Component({ + selector: 'app-permission', + templateUrl: './permission.component.html', + styleUrls: ['./permission.component.scss'] +}) +export class PermissionComponent implements OnInit { + + // loading for progess indicator + loading: boolean; + + // permissions of logged-in user + session: Session; + sysAdmin: boolean = false; + projectAdmin: boolean = false; + + // project shortcode; as identifier in project cache service + projectcode: string; + + // project data + project: Project; + + // project members + projectGroups: Group[] = []; + + @ViewChild('addGroupComponent') addGroup: AddGroupComponent; + + constructor (private _cache: CacheService, + private _projectsService: ProjectsService, + private _route: ActivatedRoute, + private _titleService: Title) { + + // get the shortcode of the current project + this._route.parent.paramMap.subscribe((params: Params) => { + this.projectcode = params.get('shortcode'); + }); + + // set the page title + this._titleService.setTitle('Project ' + this.projectcode + ' | Permission Groups'); + + } + + ngOnInit() { + + // get information about the logged-in user + this.session = JSON.parse(localStorage.getItem('session')); + // is the logged-in user system admin? + this.sysAdmin = this.session.user.sysAdmin; + + // default value for projectAdmin + this.projectAdmin = this.sysAdmin; + + } + + + /** + * build the list of members + */ + initList(): void { + + } + /** + * refresh list of members after adding a new user to the team + */ + refresh(): void { + // referesh the component + this.loading = true; + // update the cache + this._cache.del('members_of_' + this.projectcode); + + this.initList(); + + // refresh child component: add user + if (this.addGroup) { + this.addGroup.buildForm(); + } + } + +} diff --git a/src/app/system/groups/groups-list/groups-list.component.html b/src/app/system/groups/groups-list/groups-list.component.html new file mode 100644 index 0000000000..0780982ee9 --- /dev/null +++ b/src/app/system/groups/groups-list/groups-list.component.html @@ -0,0 +1 @@ + diff --git a/src/app/system/groups/groups-list/groups-list.component.scss b/src/app/system/groups/groups-list/groups-list.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/app/system/groups/groups-list/groups-list.component.spec.ts b/src/app/system/groups/groups-list/groups-list.component.spec.ts new file mode 100644 index 0000000000..a482a3d7b0 --- /dev/null +++ b/src/app/system/groups/groups-list/groups-list.component.spec.ts @@ -0,0 +1,33 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { GroupsListComponent } from './groups-list.component'; +import { KuiActionModule } from '@knora/action'; +import { RouterTestingModule } from '@angular/router/testing'; + +describe('GroupsListComponent', () => { + let component: GroupsListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ + GroupsListComponent + ], + imports: [ + KuiActionModule, + RouterTestingModule + ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(GroupsListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/system/groups/groups-list/groups-list.component.ts b/src/app/system/groups/groups-list/groups-list.component.ts new file mode 100644 index 0000000000..b40a82f840 --- /dev/null +++ b/src/app/system/groups/groups-list/groups-list.component.ts @@ -0,0 +1,21 @@ +import { Component, OnInit } from '@angular/core'; +import { KuiMessageData } from '@knora/action'; + +@Component({ + selector: 'app-groups-list', + templateUrl: './groups-list.component.html', + styleUrls: ['./groups-list.component.scss'] +}) +export class GroupsListComponent implements OnInit { + + message: KuiMessageData = { + status: 200, + statusText: 'The list of permission groups is not yet implemented. But we are working on it.' + }; + + constructor () { } + + ngOnInit() { + } + +} diff --git a/src/app/system/groups/groups.component.html b/src/app/system/groups/groups.component.html new file mode 100644 index 0000000000..d5b59bdf7b --- /dev/null +++ b/src/app/system/groups/groups.component.html @@ -0,0 +1,5 @@ + + +
+ +
diff --git a/src/app/system/groups/groups.component.scss b/src/app/system/groups/groups.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/app/system/groups/groups.component.spec.ts b/src/app/system/groups/groups.component.spec.ts new file mode 100644 index 0000000000..718feb97d3 --- /dev/null +++ b/src/app/system/groups/groups.component.spec.ts @@ -0,0 +1,35 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { GroupsComponent } from './groups.component'; +import { KuiActionModule } from '@knora/action'; +import { GroupsListComponent } from './groups-list/groups-list.component'; +import { RouterTestingModule } from '@angular/router/testing'; + +describe('GroupsComponent', () => { + let component: GroupsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ + GroupsComponent, + GroupsListComponent + ], + imports: [ + KuiActionModule, + RouterTestingModule + ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(GroupsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/system/groups/groups.component.ts b/src/app/system/groups/groups.component.ts new file mode 100644 index 0000000000..04cf82b624 --- /dev/null +++ b/src/app/system/groups/groups.component.ts @@ -0,0 +1,17 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-groups', + templateUrl: './groups.component.html', + styleUrls: ['./groups.component.scss'] +}) +export class GroupsComponent implements OnInit { + + loading: boolean = false; + + constructor () { } + + ngOnInit() { + } + +} diff --git a/src/app/system/projects/projects-list/projects-list.component.ts b/src/app/system/projects/projects-list/projects-list.component.ts index b8203eec20..9afa787f7f 100644 --- a/src/app/system/projects/projects-list/projects-list.component.ts +++ b/src/app/system/projects/projects-list/projects-list.component.ts @@ -128,6 +128,9 @@ export class ProjectsListComponent implements OnInit { this._projectsService.deleteProject(id).subscribe( (result: Project) => { this.refreshParent.emit(); + // update project cache + this._cache.del(result.shortcode); + this._cache.get(result.shortcode, this._projectsService.getProjectByShortcode(result.shortcode)); }, (error: ApiServiceError) => { // this.errorMessage = error; @@ -140,6 +143,9 @@ export class ProjectsListComponent implements OnInit { this._projectsService.activateProject(id).subscribe( (result: Project) => { this.refreshParent.emit(); + // update project cache + this._cache.del(result.shortcode); + this._cache.get(result.shortcode, this._projectsService.getProjectByShortcode(result.shortcode)); }, (error: ApiServiceError) => { // this.errorMessage = error; diff --git a/src/app/system/users/users-list/users-list.component.html b/src/app/system/users/users-list/users-list.component.html index 500fe8b490..e549c392b2 100644 --- a/src/app/system/users/users-list/users-list.component.html +++ b/src/app/system/users/users-list/users-list.component.html @@ -64,7 +64,7 @@
- diff --git a/src/app/system/users/users-list/users-list.component.ts b/src/app/system/users/users-list/users-list.component.ts index 09c67f6d68..cddfccc808 100644 --- a/src/app/system/users/users-list/users-list.component.ts +++ b/src/app/system/users/users-list/users-list.component.ts @@ -422,4 +422,17 @@ export class UsersListComponent implements OnInit { } ); } + + disableMenu(): boolean { + + // disable menu in case of: + // project.status = false + if (this.project && this.project.status === false) { + return true; + } else { + return (!this.sysAdmin && !this.projectAdmin); + } + + + } } diff --git a/src/app/user/dashboard/dashboard.component.html b/src/app/user/dashboard/dashboard.component.html index 4a17fec51f..842dba592a 100644 --- a/src/app/user/dashboard/dashboard.component.html +++ b/src/app/user/dashboard/dashboard.component.html @@ -2,11 +2,18 @@
- +
+

Welcome {{user?.givenName}} {{user?.familyName}}

+ +

Here you'll find your latest work, your projects, and collections.

+ +
+ +
+ +
+
diff --git a/src/app/user/dashboard/dashboard.component.scss b/src/app/user/dashboard/dashboard.component.scss index a9454d6dfd..0a0fc2c58c 100644 --- a/src/app/user/dashboard/dashboard.component.scss +++ b/src/app/user/dashboard/dashboard.component.scss @@ -1,3 +1,7 @@ +.app-headline { + margin: 64px 0; +} + .toggle-view { - margin-bottom: 16px; -} \ No newline at end of file + margin-bottom: 16px; +} diff --git a/src/app/user/user-menu/user-menu.component.html b/src/app/user/user-menu/user-menu.component.html index 8fe427ac51..defcf0a6ec 100644 --- a/src/app/user/user-menu/user-menu.component.html +++ b/src/app/user/user-menu/user-menu.component.html @@ -30,7 +30,7 @@ - +