Skip to content

Commit f9cc48d

Browse files
Merge branch 'stage' for release v1.4.0
2 parents 800a551 + 7b3c2ce commit f9cc48d

File tree

98 files changed

+18774
-2132
lines changed

Some content is hidden

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

98 files changed

+18774
-2132
lines changed

package-lock.json

Lines changed: 16131 additions & 14 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
@@ -50,6 +50,7 @@
5050
"rxjs": "~6.6.7",
5151
"tslib": "^2.0.0",
5252
"tslint": "~6.1.0",
53+
"ua-parser-js": "^1.0.33",
5354
"zone.js": "~0.11.4"
5455
},
5556
"devDependencies": {
Lines changed: 86 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,86 @@
1-
import { NgModule } from '@angular/core';
2-
import { Routes, RouterModule } from '@angular/router';
3-
import { OrganisationDetailComponent } from './organisation/organisation-detail/organisation-detail.component';
4-
import { OrganisationEditComponent } from './organisation/organisation-edit/organisation-edit.component';
5-
import { OrganisationListComponent } from './organisation/organisation-list/organisation-list.component';
6-
import { OrganisationComponent } from './organisation/organisation.component';
7-
import { PermissionDetailComponent } from './permission/permission-detail/permission-detail.component';
8-
import { PermissionEditComponent } from './permission/permission-edit/permission-edit.component';
9-
import { PermissionListComponent } from './permission/permission-list/permission-list.component';
10-
import { PermissionComponent } from './permission/permission.component';
11-
import { UserDetailComponent } from './users/user-detail/user-detail.component';
12-
import { UserEditComponent } from './users/user-edit/user-edit.component';
13-
import { UserListComponent } from './users/user-list/user-list.component';
14-
import { UsersComponent } from './users/users.component';
15-
import { ApiKeyComponent } from './api-key/api-key.component';
16-
import { ApiKeyListComponent } from './api-key/api-key-list/api-key-list.component';
17-
import { ApiKeyEditComponent } from './api-key/api-key-edit/api-key-edit.component';
18-
import { AcceptUserComponent } from './users/accept-user/accept-user.component';
19-
20-
21-
const adminRoutes: Routes = [
22-
{
23-
path: 'organisations', component: OrganisationComponent, children: [
24-
{ path: '', component: OrganisationListComponent },
25-
{ path: 'new-organisation', component: OrganisationEditComponent },
26-
{ path: ':org-id', component: OrganisationDetailComponent },
27-
{ path: ':org-id/edit-organisation', component: OrganisationEditComponent },
28-
]
29-
},
30-
{
31-
path: 'users', component: UsersComponent, children: [
32-
{ path: '', component: UserListComponent },
33-
{ path: 'organization/:organization-id', component: UserListComponent },
34-
{ path: 'new-user', component: UserEditComponent },
35-
{ path: ':user-id', component: UserDetailComponent },
36-
{ path: ':user-id/edit-user', component: UserEditComponent },
37-
{ path: 'accept-user/:user-id/:org-id', component: AcceptUserComponent }
38-
]
39-
},
40-
{
41-
path: 'permissions',
42-
component: PermissionComponent,
43-
children: [
44-
{ path: '', component: PermissionListComponent },
45-
{ path: 'new-permission', component: PermissionEditComponent },
46-
{ path: ':permission-id', component: PermissionDetailComponent },
47-
{
48-
path: ':permission-id/edit-permission',
49-
component: PermissionEditComponent,
50-
},
51-
],
52-
},
53-
{
54-
path: 'api-key',
55-
component: ApiKeyComponent,
56-
children: [
57-
{ path: '', component: ApiKeyListComponent },
58-
{ path: 'new-api-key', component: ApiKeyEditComponent },
59-
{
60-
path: ':api-key-id/edit-api-key',
61-
component: ApiKeyEditComponent,
62-
},
63-
],
64-
},
65-
66-
67-
];
68-
69-
@NgModule({
70-
imports: [RouterModule.forChild(adminRoutes)],
71-
exports: [RouterModule]
72-
})
73-
export class AdminRoutingModule { }
1+
import { NgModule } from '@angular/core';
2+
import { Routes, RouterModule } from '@angular/router';
3+
import { OrganisationDetailComponent } from './organisation/organisation-detail/organisation-detail.component';
4+
import { OrganisationEditComponent } from './organisation/organisation-edit/organisation-edit.component';
5+
import { OrganisationListComponent } from './organisation/organisation-list/organisation-list.component';
6+
import { OrganisationComponent } from './organisation/organisation.component';
7+
import { PermissionDetailComponent } from './permission/permission-detail/permission-detail.component';
8+
import { PermissionEditComponent } from './permission/permission-edit/permission-edit.component';
9+
import { PermissionListComponent } from './permission/permission-list/permission-list.component';
10+
import { PermissionComponent } from './permission/permission.component';
11+
import { UserDetailComponent } from './users/user-detail/user-detail.component';
12+
import { UserEditComponent } from './users/user-edit/user-edit.component';
13+
import { UserListComponent } from './users/user-list/user-list.component';
14+
import { UsersComponent } from './users/users.component';
15+
import { ApiKeyComponent } from './api-key/api-key.component';
16+
import { ApiKeyListComponent } from './api-key/api-key-list/api-key-list.component';
17+
import { ApiKeyEditComponent } from './api-key/api-key-edit/api-key-edit.component';
18+
import { AcceptUserComponent } from './users/accept-user/accept-user.component';
19+
import { UserTableTabComponent } from '@app/admin/users/user-list/user-table-tab/user-table-tab.component';
20+
import { AwaitingUsersTableTabComponent } from '@app/admin/users/user-list/awaiting-user-tab/awaiting-users-table-tab.component';
21+
22+
const adminRoutes: Routes = [
23+
{
24+
path: 'organisations',
25+
component: OrganisationComponent,
26+
children: [
27+
{ path: '', component: OrganisationListComponent },
28+
{ path: 'new-organisation', component: OrganisationEditComponent },
29+
{ path: ':org-id', component: OrganisationDetailComponent },
30+
{
31+
path: ':org-id/edit-organisation',
32+
component: OrganisationEditComponent,
33+
},
34+
],
35+
},
36+
{
37+
path: 'users',
38+
component: UsersComponent,
39+
children: [
40+
{
41+
path: '',
42+
component: UserListComponent,
43+
children: [
44+
{ path: 'existing', component: UserTableTabComponent },
45+
{ path: 'awaiting', component: AwaitingUsersTableTabComponent },
46+
],
47+
},
48+
{ path: 'organization/:organization-id', component: UserListComponent },
49+
{ path: 'new-user', component: UserEditComponent },
50+
{ path: ':user-id', component: UserDetailComponent },
51+
{ path: ':user-id/edit-user', component: UserEditComponent },
52+
{ path: 'accept-user/:user-id/:org-id', component: AcceptUserComponent },
53+
],
54+
},
55+
{
56+
path: 'permissions',
57+
component: PermissionComponent,
58+
children: [
59+
{ path: '', component: PermissionListComponent },
60+
{ path: 'new-permission', component: PermissionEditComponent },
61+
{ path: ':permission-id', component: PermissionDetailComponent },
62+
{
63+
path: ':permission-id/edit-permission',
64+
component: PermissionEditComponent,
65+
},
66+
],
67+
},
68+
{
69+
path: 'api-key',
70+
component: ApiKeyComponent,
71+
children: [
72+
{ path: '', component: ApiKeyListComponent },
73+
{ path: 'new-api-key', component: ApiKeyEditComponent },
74+
{
75+
path: ':api-key-id/edit-api-key',
76+
component: ApiKeyEditComponent,
77+
},
78+
],
79+
},
80+
];
81+
82+
@NgModule({
83+
imports: [RouterModule.forChild(adminRoutes)],
84+
exports: [RouterModule],
85+
})
86+
export class AdminRoutingModule {}

src/app/admin/admin.module.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ import { ApiKeyTableComponent } from './api-key/api-key-list/api-key-table/api-k
3434
import { ApiKeyEditComponent } from './api-key/api-key-edit/api-key-edit.component';
3535
import { AwaitingUsersTableComponent } from './users/user-list/awaiting-users-table/awaiting-users-table.component';
3636
import { AcceptUserComponent } from './users/accept-user/accept-user.component';
37+
import { UserTableTabComponent } from './users/user-list/user-table-tab/user-table-tab.component';
38+
import { AwaitingUsersTableTabComponent } from './users/user-list/awaiting-user-tab/awaiting-users-table-tab.component';
3739

3840
@NgModule({
3941
declarations: [
@@ -58,6 +60,8 @@ import { AcceptUserComponent } from './users/accept-user/accept-user.component';
5860
ApiKeyEditComponent,
5961
AwaitingUsersTableComponent,
6062
AcceptUserComponent,
63+
UserTableTabComponent,
64+
AwaitingUsersTableTabComponent,
6165
],
6266
imports: [
6367
AdminRoutingModule,

src/app/admin/permission/permission-edit/permission-edit.component.ts

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ import { TranslateService } from '@ngx-translate/core';
66
import { ReplaySubject, Subject, Subscription } from 'rxjs';
77
import { Location } from '@angular/common';
88
import { PermissionService } from '../permission.service';
9-
import { PermissionRequest, PermissionType, PermissionTypes } from '../permission.model';
9+
import {
10+
PermissionRequest,
11+
PermissionType,
12+
PermissionTypes,
13+
} from '../permission.model';
1014
import { OrganisationResponse } from '../../organisation/organisation.model';
1115
import { OrganisationService } from '../../organisation/organisation.service';
1216
import { UserService } from '../../users/user.service';
@@ -80,8 +84,7 @@ export class PermissionEditComponent implements OnInit, OnDestroy {
8084
private location: Location,
8185
private errormEssageService: ErrorMessageService,
8286
private meService: MeService
83-
) {
84-
}
87+
) {}
8588

8689
ngOnInit(): void {
8790
this.getOrganizations();
@@ -167,7 +170,7 @@ export class PermissionEditComponent implements OnInit, OnDestroy {
167170

168171
private getOrganizations() {
169172
this.organisationSubscription = this.organisationService
170-
.getMultiple()
173+
.getMultiple(1000, 0, 'name', 'asc')
171174
.subscribe(
172175
(orgs) => {
173176
this.organisations = orgs.data;
@@ -179,15 +182,17 @@ export class PermissionEditComponent implements OnInit, OnDestroy {
179182
}
180183

181184
private getUsers() {
182-
this.userSubscription = this.userService.getMultiple().subscribe(
183-
(users) => {
184-
this.users = users.data;
185-
this.filteredUsersMulti.next(this.users.slice());
186-
},
187-
(error: HttpErrorResponse) => {
188-
this.showError(error);
189-
}
190-
);
185+
this.userSubscription = this.userService
186+
.getMultiple(1000, 0, 'name', 'asc')
187+
.subscribe(
188+
(users) => {
189+
this.users = users.data;
190+
this.filteredUsersMulti.next(this.users.slice());
191+
},
192+
(error: HttpErrorResponse) => {
193+
this.showError(error);
194+
}
195+
);
191196
}
192197

193198
public compare(o1: any, o2: any): boolean {
@@ -207,7 +212,9 @@ export class PermissionEditComponent implements OnInit, OnDestroy {
207212
.getApplicationsByOrganizationId(organizationId)
208213
.subscribe(
209214
(res) => {
210-
this.applications = res.data;
215+
this.applications = res.data.sort((a, b) =>
216+
a.name.localeCompare(b.name, 'en', { numeric: true })
217+
);
211218
this.filteredApplicationsMulti.next(this.applications.slice());
212219
},
213220
(error: HttpErrorResponse) => {
@@ -251,7 +258,6 @@ export class PermissionEditComponent implements OnInit, OnDestroy {
251258
);
252259
this.applicationMultiCtrl.setValue(this.permission.applicationIds);
253260
}
254-
255261
},
256262
(error: HttpErrorResponse) => {
257263
this.showError(error);

src/app/admin/users/user-detail/user-detail.component.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { OrganizationAccessScope } from '@shared/enums/access-scopes';
1616
@Component({
1717
selector: 'app-user-detail',
1818
templateUrl: './user-detail.component.html',
19-
styleUrls: ['./user-detail.component.scss']
19+
styleUrls: ['./user-detail.component.scss'],
2020
})
2121
export class UserDetailComponent implements OnInit, OnDestroy {
2222
isLoadingResults = true;
@@ -30,7 +30,7 @@ export class UserDetailComponent implements OnInit, OnDestroy {
3030
user: UserResponse;
3131
public backButton: BackButton = {
3232
label: '',
33-
routerLink: '/admin/users',
33+
routerLink: undefined,
3434
};
3535
public buttons: QuickActionButton[] = [
3636
{
@@ -53,7 +53,7 @@ export class UserDetailComponent implements OnInit, OnDestroy {
5353
private userService: UserService,
5454
private router: Router,
5555
private meService: MeService
56-
) { }
56+
) {}
5757

5858
ngOnInit(): void {
5959
this.translate.use('da');
@@ -66,12 +66,15 @@ export class UserDetailComponent implements OnInit, OnDestroy {
6666
isErasable: false,
6767
};
6868
}
69-
this.translate.get(['NAV.USERS', 'USERS.DETAIL.DROPDOWN'])
70-
.subscribe(translations => {
69+
this.translate
70+
.get(['NAV.USERS', 'USERS.DETAIL.DROPDOWN'])
71+
.subscribe((translations) => {
7172
this.backButton.label = translations['NAV.USERS'];
7273
this.dropdownButton.label = translations['USERS.DETAIL.DROPDOWN'];
7374
});
74-
this.canEdit = this.meService.hasAccessToTargetOrganization(OrganizationAccessScope.UserAdministrationWrite);
75+
this.canEdit = this.meService.hasAccessToTargetOrganization(
76+
OrganizationAccessScope.UserAdministrationWrite
77+
);
7578
}
7679

7780
private getUser(id: number) {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<div class="jumbotron--table">
2+
<app-top-bar-table
3+
[component]="true"
4+
[title]="'USERS.AWAITING-USERS' | translate"
5+
></app-top-bar-table>
6+
<app-awaiting-users-table></app-awaiting-users-table>
7+
</div>

src/app/admin/users/user-list/awaiting-user-tab/awaiting-users-table-tab.component.scss

Whitespace-only changes.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Component, OnInit } from '@angular/core';
2+
import { SharedVariableService } from '@shared/shared-variable/shared-variable.service';
3+
4+
@Component({
5+
selector: 'app-awaiting-user-tab',
6+
templateUrl: './awaiting-users-table-tab.component.html',
7+
styleUrls: ['./awaiting-users-table-tab.component.scss'],
8+
})
9+
export class AwaitingUsersTableTabComponent implements OnInit {
10+
organizationId: number;
11+
constructor(private globalService: SharedVariableService) {
12+
this.organizationId = this.globalService.getSelectedOrganisationId();
13+
}
14+
15+
ngOnInit(): void {}
16+
}

src/app/admin/users/user-list/awaiting-users-table/awaiting-users-table.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
mat-table
1010
[dataSource]="users"
1111
matSort
12-
matSortActive="id"
12+
matSortActive="name"
1313
matSortDirection="asc"
1414
matSortDisableClear
1515
>

0 commit comments

Comments
 (0)