Skip to content

Commit 97034a5

Browse files
committed
Merge stage for release 1.2.0
2 parents 9d78e10 + f92a99f commit 97034a5

File tree

203 files changed

+4957
-1127
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

203 files changed

+4957
-1127
lines changed

package-lock.json

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"all": "0.0.0",
3636
"animate.css": "^4.1.1",
3737
"bootstrap": "5.0.0-alpha2",
38+
"chart.js": "^3.7.1",
3839
"file-saver": "^2.0.2",
3940
"guid-typescript": "^1.0.9",
4041
"jwt-decode": "^2.2.0",

src/app/admin/admin-routing.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { UsersComponent } from './users/users.component';
1515
import { ApiKeyComponent } from './api-key/api-key.component';
1616
import { ApiKeyListComponent } from './api-key/api-key-list/api-key-list.component';
1717
import { ApiKeyEditComponent } from './api-key/api-key-edit/api-key-edit.component';
18+
import { AcceptUserComponent } from './users/accept-user/accept-user.component';
1819

1920

2021
const adminRoutes: Routes = [
@@ -32,6 +33,7 @@ const adminRoutes: Routes = [
3233
{ path: 'new-user', component: UserEditComponent },
3334
{ path: ':user-id', component: UserDetailComponent },
3435
{ path: ':user-id/edit-user', component: UserEditComponent },
36+
{ path: 'accept-user/:user-id/:org-id', component: AcceptUserComponent }
3537
]
3638
},
3739
{

src/app/admin/admin.module.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ import { ApiKeyComponent } from './api-key/api-key.component';
3232
import { ApiKeyListComponent } from './api-key/api-key-list/api-key-list.component';
3333
import { ApiKeyTableComponent } from './api-key/api-key-list/api-key-table/api-key-table.component';
3434
import { ApiKeyEditComponent } from './api-key/api-key-edit/api-key-edit.component';
35+
import { AwaitingUsersTableComponent } from './users/user-list/awaiting-users-table/awaiting-users-table.component';
36+
import { AcceptUserComponent } from './users/accept-user/accept-user.component';
3537

3638
@NgModule({
3739
declarations: [
@@ -54,6 +56,8 @@ import { ApiKeyEditComponent } from './api-key/api-key-edit/api-key-edit.compone
5456
ApiKeyListComponent,
5557
ApiKeyTableComponent,
5658
ApiKeyEditComponent,
59+
AwaitingUsersTableComponent,
60+
AcceptUserComponent,
5761
],
5862
imports: [
5963
AdminRoutingModule,

src/app/admin/api-key/api-key-list/api-key-list.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
[title]="'NAV.API-KEY' | translate"
33
[ctaLabel]="'API-KEY.CREATE-NEW-API-KEY' | translate"
44
[ctaRouterLink]="'new-api-key'"
5+
[canEdit]="canEdit"
56
>
67
</app-top-bar>
78
<div class="container-fluid">

src/app/admin/api-key/api-key-list/api-key-list.component.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { Component, Input, OnInit } from '@angular/core';
22
import { Title } from '@angular/platform-browser';
33
import { TranslateService } from '@ngx-translate/core';
44
import { SharedVariableService } from '@shared/shared-variable/shared-variable.service';
5+
import { MeService } from '@shared/services/me.service';
6+
import { OrganizationAccessScope } from '@shared/enums/access-scopes';
57

68
@Component({
79
selector: 'app-api-key-list',
@@ -10,11 +12,13 @@ import { SharedVariableService } from '@shared/shared-variable/shared-variable.s
1012
})
1113
export class ApiKeyListComponent implements OnInit {
1214
@Input() organisationId: number;
15+
canEdit: boolean;
1316

1417
constructor(
1518
public translate: TranslateService,
1619
private titleService: Title,
17-
private globalService: SharedVariableService
20+
private globalService: SharedVariableService,
21+
private meService: MeService
1822
) {
1923
translate.use('da');
2024
}
@@ -24,5 +28,6 @@ export class ApiKeyListComponent implements OnInit {
2428
this.titleService.setTitle(translations['TITLE.API-KEY']);
2529
});
2630
this.organisationId = this.globalService.getSelectedOrganisationId();
31+
this.canEdit = this.meService.hasAccessToTargetOrganization(OrganizationAccessScope.UserAdministrationWrite, this.organisationId);
2732
}
2833
}

src/app/admin/api-key/api-key-list/api-key-table/api-key-table.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
8686
</table>
8787
<mat-paginator
88-
[pageSizeOptions]="[5, 10, 20]"
88+
[pageSizeOptions]="pageSizeOptions"
8989
[pageSize]="pageSize"
9090
[length]="resultsLength"
9191
showFirstLastButtons

src/app/admin/api-key/api-key-list/api-key-table/api-key-table.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import { merge, Observable, of } from 'rxjs';
99
import { catchError, map, startWith, switchMap } from 'rxjs/operators';
1010
import { ApiKeyGetManyResponse, ApiKeyResponse } from '../../api-key.model';
1111
import { ApiKeyService } from '../../api-key.service';
12+
import { OrganizationAccessScope } from '@shared/enums/access-scopes';
13+
import { DefaultPageSizeOptions } from '@shared/constants/page.constants';
1214

1315
@Component({
1416
selector: 'app-api-key-table',
@@ -29,6 +31,7 @@ export class ApiKeyTableComponent implements AfterViewInit {
2931
@ViewChild(MatSort) sort: MatSort;
3032
resultsLength = 0;
3133
public pageSize = environment.tablePageSize;
34+
pageSizeOptions = DefaultPageSizeOptions;
3235

3336
constructor(
3437
private meService: MeService,
@@ -81,7 +84,8 @@ export class ApiKeyTableComponent implements AfterViewInit {
8184
}
8285

8386
canAccess(_element: ApiKeyResponse) {
84-
return this.meService.hasAdminAccessInTargetOrganization(
87+
return this.meService.hasAccessToTargetOrganization(
88+
OrganizationAccessScope.UserAdministrationWrite,
8589
this.organisationId
8690
);
8791
}

src/app/admin/organisation/organisation-detail/organisation-detail.component.html

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
<div [hidden]="!organisation" *ngIf="organisation">
2-
<app-top-bar [data]="organisation" [backButton]="backButton" [subPage]="true" [addDetailDowndown]="true"
3-
[dropDownButton]="dropdownButton" (deleteSelectedInDropdown)="clickDelete()">
2+
<app-top-bar
3+
[data]="organisation"
4+
[backButton]="backButton"
5+
[subPage]="true"
6+
[addDetailDowndown]="true"
7+
[dropDownButton]="dropdownButton"
8+
(deleteSelectedInDropdown)="clickDelete()"
9+
[canEdit]="canEdit"
10+
>
411
</app-top-bar>
512
<div class="container-fluid">
613
<div class="row">
@@ -34,4 +41,4 @@ <h3>
3441
</div>
3542
</div>
3643
</div>
37-
</div>
44+
</div>

src/app/admin/organisation/organisation-detail/organisation-detail.component.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import { DropdownButton } from '@shared/models/dropdown-button.model';
1515
import { ApplicationService } from '@applications/application.service';
1616
import { environment } from '@environments/environment';
1717
import { Title } from '@angular/platform-browser';
18+
import { MeService } from '@shared/services/me.service';
19+
import { OrganizationAccessScope } from '@shared/enums/access-scopes';
1820

1921
@Component({
2022
selector: 'app-organisation-detail',
@@ -41,6 +43,7 @@ export class OrganisationDetailComponent implements OnInit, OnChanges, OnDestroy
4143
id: number;
4244
subscription: Subscription;
4345
permissions: PermissionResponse[];
46+
canEdit: boolean;
4447

4548
constructor(
4649
public translate: TranslateService,
@@ -49,7 +52,8 @@ export class OrganisationDetailComponent implements OnInit, OnChanges, OnDestroy
4952
private permissionsService: PermissionService,
5053
private deleteDialogService: DeleteDialogService,
5154
private location: Location,
52-
private titleService: Title
55+
private titleService: Title,
56+
private meService: MeService
5357
) { }
5458

5559
ngOnChanges(changes: SimpleChanges): void {
@@ -71,8 +75,10 @@ export class OrganisationDetailComponent implements OnInit, OnChanges, OnDestroy
7175
.subscribe(translations => {
7276
this.backButton.label = translations['NAV.ORGANISATIONS'];
7377
this.dropdownButton.label = translations['ORGANISATION.DROPDOWN'];
74-
this.titleService.setTitle(translations['TITLE.ORGANIZATION'])
78+
this.titleService.setTitle(translations['TITLE.ORGANIZATION']);
7579
});
80+
81+
this.canEdit = this.meService.hasAccessToTargetOrganization(OrganizationAccessScope.UserAdministrationWrite);
7682
}
7783

7884
ngOnDestroy() {
@@ -119,6 +125,6 @@ export class OrganisationDetailComponent implements OnInit, OnChanges, OnDestroy
119125
}
120126
});
121127
}
122-
})
128+
});
123129
}
124130
}

0 commit comments

Comments
 (0)