@valtimo/teams 0.0.0-test
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/valtimo-teams.mjs +1018 -0
- package/fesm2022/valtimo-teams.mjs.map +1 -0
- package/index.d.ts +6 -0
- package/lib/components/team-detail/team-detail.component.d.ts +43 -0
- package/lib/components/team-detail/team-detail.component.d.ts.map +1 -0
- package/lib/components/team-detail-add-member-modal/team-detail-add-member-modal.component.d.ts +30 -0
- package/lib/components/team-detail-add-member-modal/team-detail-add-member-modal.component.d.ts.map +1 -0
- package/lib/components/team-detail-edit-modal/team-detail-edit-modal.component.d.ts +21 -0
- package/lib/components/team-detail-edit-modal/team-detail-edit-modal.component.d.ts.map +1 -0
- package/lib/components/teams-create-edit-modal/teams-create-edit-modal.component.d.ts +27 -0
- package/lib/components/teams-create-edit-modal/teams-create-edit-modal.component.d.ts.map +1 -0
- package/lib/components/teams-list/teams-list.component.d.ts +38 -0
- package/lib/components/teams-list/teams-list.component.d.ts.map +1 -0
- package/lib/permissions/index.d.ts +2 -0
- package/lib/permissions/index.d.ts.map +1 -0
- package/lib/permissions/team.permissions.d.ts +23 -0
- package/lib/permissions/team.permissions.d.ts.map +1 -0
- package/lib/services/index.d.ts +4 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/services/team-detail.service.d.ts +53 -0
- package/lib/services/team-detail.service.d.ts.map +1 -0
- package/lib/services/teams-api.service.d.ts +32 -0
- package/lib/services/teams-api.service.d.ts.map +1 -0
- package/lib/services/teams.service.d.ts +26 -0
- package/lib/services/teams.service.d.ts.map +1 -0
- package/lib/teams-routing.d.ts +9 -0
- package/lib/teams-routing.d.ts.map +1 -0
- package/lib/teams.module.d.ts +9 -0
- package/lib/teams.module.d.ts.map +1 -0
- package/package.json +24 -0
- package/public-api.d.ts +4 -0
- package/public-api.d.ts.map +1 -0
- package/valtimo-teams.d.ts.map +1 -0
|
@@ -0,0 +1,1018 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, Component, signal, Input, NgModule } from '@angular/core';
|
|
3
|
+
import * as i3$2 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i3 from '@valtimo/components';
|
|
6
|
+
import { runAfterCarbonModalClosed, DEFAULT_PAGINATION, ValtimoCdsModalDirective, AutoKeyInputComponent, ViewType, CarbonListModule, ConfirmationModalModule, OverflowMenuComponent, RenderInPageHeaderDirective, OverflowMenuOptionComponent } from '@valtimo/components';
|
|
7
|
+
import * as i2 from '@angular/common/http';
|
|
8
|
+
import { HttpParams } from '@angular/common/http';
|
|
9
|
+
import * as i1 from '@valtimo/shared';
|
|
10
|
+
import { BaseApiService, ROLE_USER } from '@valtimo/shared';
|
|
11
|
+
import { BehaviorSubject, filter, switchMap, map, tap, distinctUntilChanged, Subscription, combineLatest, catchError, of } from 'rxjs';
|
|
12
|
+
import * as i3$1 from '@angular/router';
|
|
13
|
+
import { RouterModule } from '@angular/router';
|
|
14
|
+
import * as i5 from '@ngx-translate/core';
|
|
15
|
+
import { TranslatePipe, TranslateModule } from '@ngx-translate/core';
|
|
16
|
+
import * as i4 from 'carbon-components-angular';
|
|
17
|
+
import { ModalModule, ButtonModule, InputModule, LayerModule, IconModule, ComboBoxModule, DialogModule } from 'carbon-components-angular';
|
|
18
|
+
import * as i2$1 from '@angular/forms';
|
|
19
|
+
import { Validators, ReactiveFormsModule } from '@angular/forms';
|
|
20
|
+
import * as i2$2 from '@valtimo/access-control';
|
|
21
|
+
import { AuthGuardService } from '@valtimo/security';
|
|
22
|
+
import { Add16, UserFollow16 } from '@carbon/icons';
|
|
23
|
+
import { map as map$1 } from 'rxjs/operators';
|
|
24
|
+
import * as i4$1 from 'carbon-components-angular/dropdown';
|
|
25
|
+
|
|
26
|
+
/*
|
|
27
|
+
* Copyright 2015-2026 Ritense BV, the Netherlands.
|
|
28
|
+
*
|
|
29
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
30
|
+
* you may not use this file except in compliance with the License.
|
|
31
|
+
* You may obtain a copy of the License at
|
|
32
|
+
*
|
|
33
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
34
|
+
*
|
|
35
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
36
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
37
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
38
|
+
* See the License for the specific language governing permissions and
|
|
39
|
+
* limitations under the License.
|
|
40
|
+
*/
|
|
41
|
+
class TeamsApiService extends BaseApiService {
|
|
42
|
+
constructor(configService, httpClient) {
|
|
43
|
+
super(httpClient, configService);
|
|
44
|
+
this.configService = configService;
|
|
45
|
+
this.httpClient = httpClient;
|
|
46
|
+
}
|
|
47
|
+
getCandidateUsers(teamKey) {
|
|
48
|
+
return this.httpClient.get(this.getApiUrl(`v1/team/${teamKey}/candidate-user`));
|
|
49
|
+
}
|
|
50
|
+
getTeams(params) {
|
|
51
|
+
let httpParams = new HttpParams();
|
|
52
|
+
if (params?.titleContains) {
|
|
53
|
+
httpParams = httpParams.set('titleContains', params.titleContains);
|
|
54
|
+
}
|
|
55
|
+
if (params?.page !== undefined) {
|
|
56
|
+
httpParams = httpParams.set('page', params.page.toString());
|
|
57
|
+
}
|
|
58
|
+
if (params?.size !== undefined) {
|
|
59
|
+
httpParams = httpParams.set('size', params.size.toString());
|
|
60
|
+
}
|
|
61
|
+
httpParams = httpParams.set('sort', params?.sort ?? 'title,asc');
|
|
62
|
+
return this.httpClient.get(this.getApiUrl('v1/team'), {
|
|
63
|
+
params: httpParams,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
getTeam(key) {
|
|
67
|
+
return this.httpClient.get(this.getApiUrl(`v1/team/${key}`));
|
|
68
|
+
}
|
|
69
|
+
createTeam(dto) {
|
|
70
|
+
return this.httpClient.post(this.getApiUrl('v1/team'), dto);
|
|
71
|
+
}
|
|
72
|
+
updateTeam(key, dto) {
|
|
73
|
+
return this.httpClient.put(this.getApiUrl(`v1/team/${key}`), dto);
|
|
74
|
+
}
|
|
75
|
+
deleteTeam(key) {
|
|
76
|
+
return this.httpClient.delete(this.getApiUrl(`v1/team/${key}`));
|
|
77
|
+
}
|
|
78
|
+
getTeamUsers(teamKey, params) {
|
|
79
|
+
let httpParams = new HttpParams();
|
|
80
|
+
if (params?.page !== undefined) {
|
|
81
|
+
httpParams = httpParams.set('page', params.page.toString());
|
|
82
|
+
}
|
|
83
|
+
if (params?.size !== undefined) {
|
|
84
|
+
httpParams = httpParams.set('size', params.size.toString());
|
|
85
|
+
}
|
|
86
|
+
return this.httpClient.get(this.getApiUrl(`v1/team/${teamKey}/user`), { params: httpParams });
|
|
87
|
+
}
|
|
88
|
+
addTeamUser(teamKey, dto) {
|
|
89
|
+
return this.httpClient.post(this.getApiUrl(`v1/team/${teamKey}/user`), dto);
|
|
90
|
+
}
|
|
91
|
+
removeTeamUser(teamKey, username) {
|
|
92
|
+
return this.httpClient.delete(this.getApiUrl(`v1/team/${teamKey}/user/${username}`));
|
|
93
|
+
}
|
|
94
|
+
getCurrentUserTeams() {
|
|
95
|
+
return this.httpClient.get(this.getApiUrl('v1/user/team'));
|
|
96
|
+
}
|
|
97
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TeamsApiService, deps: [{ token: i1.ConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
98
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TeamsApiService, providedIn: 'root' }); }
|
|
99
|
+
}
|
|
100
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TeamsApiService, decorators: [{
|
|
101
|
+
type: Injectable,
|
|
102
|
+
args: [{
|
|
103
|
+
providedIn: 'root',
|
|
104
|
+
}]
|
|
105
|
+
}], ctorParameters: () => [{ type: i1.ConfigService }, { type: i2.HttpClient }] });
|
|
106
|
+
|
|
107
|
+
/*
|
|
108
|
+
* Copyright 2015-2026 Ritense BV, the Netherlands.
|
|
109
|
+
*
|
|
110
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
111
|
+
* you may not use this file except in compliance with the License.
|
|
112
|
+
* You may obtain a copy of the License at
|
|
113
|
+
*
|
|
114
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
115
|
+
*
|
|
116
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
117
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
118
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
119
|
+
* See the License for the specific language governing permissions and
|
|
120
|
+
* limitations under the License.
|
|
121
|
+
*/
|
|
122
|
+
class TeamsService {
|
|
123
|
+
constructor() {
|
|
124
|
+
this._reload$ = new BehaviorSubject(null);
|
|
125
|
+
this.reload$ = this._reload$.asObservable();
|
|
126
|
+
this._showCreateEditModal$ = new BehaviorSubject(false);
|
|
127
|
+
this.showCreateEditModal$ = this._showCreateEditModal$.asObservable();
|
|
128
|
+
this._editingTeam$ = new BehaviorSubject(null);
|
|
129
|
+
this.editingTeam$ = this._editingTeam$.asObservable();
|
|
130
|
+
this._showDeleteModal$ = new BehaviorSubject(false);
|
|
131
|
+
this.showDeleteModal$ = this._showDeleteModal$.asObservable();
|
|
132
|
+
this._teamToDelete$ = new BehaviorSubject(null);
|
|
133
|
+
this.teamToDelete$ = this._teamToDelete$.asObservable();
|
|
134
|
+
this._loadedTeams$ = new BehaviorSubject([]);
|
|
135
|
+
this.loadedTeams$ = this._loadedTeams$.asObservable();
|
|
136
|
+
}
|
|
137
|
+
setLoadedTeams(teams) {
|
|
138
|
+
this._loadedTeams$.next(teams);
|
|
139
|
+
}
|
|
140
|
+
reload() {
|
|
141
|
+
this._reload$.next(null);
|
|
142
|
+
}
|
|
143
|
+
showCreateModal() {
|
|
144
|
+
this._editingTeam$.next(null);
|
|
145
|
+
this._showCreateEditModal$.next(true);
|
|
146
|
+
}
|
|
147
|
+
showEditModal(team) {
|
|
148
|
+
this._editingTeam$.next(team);
|
|
149
|
+
this._showCreateEditModal$.next(true);
|
|
150
|
+
}
|
|
151
|
+
hideCreateEditModal() {
|
|
152
|
+
this._showCreateEditModal$.next(false);
|
|
153
|
+
runAfterCarbonModalClosed(() => this._editingTeam$.next(null));
|
|
154
|
+
}
|
|
155
|
+
showDeleteConfirmation(team) {
|
|
156
|
+
this._teamToDelete$.next(team);
|
|
157
|
+
this._showDeleteModal$.next(true);
|
|
158
|
+
}
|
|
159
|
+
hideDeleteModal() {
|
|
160
|
+
this._showDeleteModal$.next(false);
|
|
161
|
+
this._teamToDelete$.next(null);
|
|
162
|
+
}
|
|
163
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TeamsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
164
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TeamsService }); }
|
|
165
|
+
}
|
|
166
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TeamsService, decorators: [{
|
|
167
|
+
type: Injectable
|
|
168
|
+
}] });
|
|
169
|
+
|
|
170
|
+
/*
|
|
171
|
+
* Copyright 2015-2026 Ritense BV, the Netherlands.
|
|
172
|
+
*
|
|
173
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
174
|
+
* you may not use this file except in compliance with the License.
|
|
175
|
+
* You may obtain a copy of the License at
|
|
176
|
+
*
|
|
177
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
178
|
+
*
|
|
179
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
180
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
181
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
182
|
+
* See the License for the specific language governing permissions and
|
|
183
|
+
* limitations under the License.
|
|
184
|
+
*/
|
|
185
|
+
class TeamDetailService {
|
|
186
|
+
get loadingTeam$() {
|
|
187
|
+
return this._loadingTeam$.asObservable();
|
|
188
|
+
}
|
|
189
|
+
get _route$() {
|
|
190
|
+
return this._routeSubject$.pipe(filter(route => route !== null));
|
|
191
|
+
}
|
|
192
|
+
get teamKey$() {
|
|
193
|
+
return this._route$.pipe(switchMap(route => route.paramMap.pipe(map(params => params.get('teamKey')), filter(key => !!key), tap(key => (this._teamKey = key)))));
|
|
194
|
+
}
|
|
195
|
+
get teamKey() {
|
|
196
|
+
return this._teamKey;
|
|
197
|
+
}
|
|
198
|
+
get team$() {
|
|
199
|
+
return this._team$.pipe(filter(team => team !== null));
|
|
200
|
+
}
|
|
201
|
+
get loadingMembers$() {
|
|
202
|
+
return this._loadingMembers$.asObservable();
|
|
203
|
+
}
|
|
204
|
+
get members$() {
|
|
205
|
+
return this._members$.asObservable();
|
|
206
|
+
}
|
|
207
|
+
constructor(teamsApiService, pageTitleService, router) {
|
|
208
|
+
this.teamsApiService = teamsApiService;
|
|
209
|
+
this.pageTitleService = pageTitleService;
|
|
210
|
+
this.router = router;
|
|
211
|
+
this._loadingTeam$ = new BehaviorSubject(true);
|
|
212
|
+
this._routeSubject$ = new BehaviorSubject(null);
|
|
213
|
+
this._team$ = new BehaviorSubject(null);
|
|
214
|
+
this._reload$ = new BehaviorSubject(null);
|
|
215
|
+
this._loadingMembers$ = new BehaviorSubject(true);
|
|
216
|
+
this._members$ = new BehaviorSubject([]);
|
|
217
|
+
this.membersPagination$ = new BehaviorSubject({ ...DEFAULT_PAGINATION });
|
|
218
|
+
this._membersPaginationParams$ = this.membersPagination$.pipe(map(p => ({ page: p.page, size: p.size })), distinctUntilChanged((a, b) => a.page === b.page && a.size === b.size));
|
|
219
|
+
this._reloadMembers$ = new BehaviorSubject(null);
|
|
220
|
+
this._showEditTeamModal$ = new BehaviorSubject(false);
|
|
221
|
+
this.showEditTeamModal$ = this._showEditTeamModal$.asObservable();
|
|
222
|
+
this._showDeleteTeamModal$ = new BehaviorSubject(false);
|
|
223
|
+
this.showDeleteTeamModal$ = this._showDeleteTeamModal$.asObservable();
|
|
224
|
+
this._showRemoveMemberModal$ = new BehaviorSubject(false);
|
|
225
|
+
this.showRemoveMemberModal$ = this._showRemoveMemberModal$.asObservable();
|
|
226
|
+
this._memberToRemove$ = new BehaviorSubject(null);
|
|
227
|
+
this.memberToRemove$ = this._memberToRemove$.asObservable();
|
|
228
|
+
this._subscriptions = new Subscription();
|
|
229
|
+
}
|
|
230
|
+
setRoute(route) {
|
|
231
|
+
this._routeSubject$.next(route);
|
|
232
|
+
this._subscriptions.add(this.teamKey$
|
|
233
|
+
.pipe(switchMap(key => this._reload$.pipe(tap(() => this._loadingTeam$.next(true)), switchMap(() => this.teamsApiService.getTeam(key)))), tap(team => {
|
|
234
|
+
this._team$.next(team);
|
|
235
|
+
this.pageTitleService.setCustomPageTitle(team.title);
|
|
236
|
+
this._loadingTeam$.next(false);
|
|
237
|
+
}))
|
|
238
|
+
.subscribe());
|
|
239
|
+
this._subscriptions.add(this.teamKey$
|
|
240
|
+
.pipe(switchMap(key => combineLatest([this._reloadMembers$, this._membersPaginationParams$]).pipe(tap(() => this._loadingMembers$.next(true)), switchMap(([_, params]) => this.teamsApiService.getTeamUsers(key, {
|
|
241
|
+
page: params.page - 1,
|
|
242
|
+
size: params.size,
|
|
243
|
+
})))), tap(page => {
|
|
244
|
+
this.membersPagination$.next({
|
|
245
|
+
...this.membersPagination$.getValue(),
|
|
246
|
+
collectionSize: page.totalElements,
|
|
247
|
+
});
|
|
248
|
+
this._members$.next(page.content);
|
|
249
|
+
this._loadingMembers$.next(false);
|
|
250
|
+
}))
|
|
251
|
+
.subscribe());
|
|
252
|
+
}
|
|
253
|
+
reload() {
|
|
254
|
+
this._reload$.next(null);
|
|
255
|
+
}
|
|
256
|
+
reloadMembers() {
|
|
257
|
+
this._reloadMembers$.next(null);
|
|
258
|
+
}
|
|
259
|
+
showEditTeamModal() {
|
|
260
|
+
this._showEditTeamModal$.next(true);
|
|
261
|
+
}
|
|
262
|
+
hideEditTeamModal() {
|
|
263
|
+
this._showEditTeamModal$.next(false);
|
|
264
|
+
}
|
|
265
|
+
showDeleteTeamModal() {
|
|
266
|
+
this._showDeleteTeamModal$.next(true);
|
|
267
|
+
}
|
|
268
|
+
hideDeleteTeamModal() {
|
|
269
|
+
this._showDeleteTeamModal$.next(false);
|
|
270
|
+
}
|
|
271
|
+
showRemoveMemberConfirmation(member) {
|
|
272
|
+
this._memberToRemove$.next(member);
|
|
273
|
+
this._showRemoveMemberModal$.next(true);
|
|
274
|
+
}
|
|
275
|
+
hideRemoveMemberModal() {
|
|
276
|
+
this._showRemoveMemberModal$.next(false);
|
|
277
|
+
this._memberToRemove$.next(null);
|
|
278
|
+
}
|
|
279
|
+
navigateToTeamsList() {
|
|
280
|
+
this.router.navigate(['/teams']);
|
|
281
|
+
}
|
|
282
|
+
ngOnDestroy() {
|
|
283
|
+
this._subscriptions.unsubscribe();
|
|
284
|
+
}
|
|
285
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TeamDetailService, deps: [{ token: TeamsApiService }, { token: i3.PageTitleService }, { token: i3$1.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
286
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TeamDetailService }); }
|
|
287
|
+
}
|
|
288
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TeamDetailService, decorators: [{
|
|
289
|
+
type: Injectable
|
|
290
|
+
}], ctorParameters: () => [{ type: TeamsApiService }, { type: i3.PageTitleService }, { type: i3$1.Router }] });
|
|
291
|
+
|
|
292
|
+
/*
|
|
293
|
+
* Copyright 2015-2026 Ritense BV, the Netherlands.
|
|
294
|
+
*
|
|
295
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
296
|
+
* you may not use this file except in compliance with the License.
|
|
297
|
+
* You may obtain a copy of the License at
|
|
298
|
+
*
|
|
299
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
300
|
+
*
|
|
301
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
302
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
303
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
304
|
+
* See the License for the specific language governing permissions and
|
|
305
|
+
* limitations under the License.
|
|
306
|
+
*/
|
|
307
|
+
|
|
308
|
+
/*
|
|
309
|
+
* Copyright 2015-2026 Ritense BV, the Netherlands.
|
|
310
|
+
*
|
|
311
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
312
|
+
* you may not use this file except in compliance with the License.
|
|
313
|
+
* You may obtain a copy of the License at
|
|
314
|
+
*
|
|
315
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
316
|
+
*
|
|
317
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
318
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
319
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
320
|
+
* See the License for the specific language governing permissions and
|
|
321
|
+
* limitations under the License.
|
|
322
|
+
*/
|
|
323
|
+
class TeamsCreateEditModalComponent {
|
|
324
|
+
get title() {
|
|
325
|
+
return this.formGroup.get('title');
|
|
326
|
+
}
|
|
327
|
+
get key() {
|
|
328
|
+
return this.formGroup.get('key');
|
|
329
|
+
}
|
|
330
|
+
get isEditMode() {
|
|
331
|
+
return this.editingTeam !== null;
|
|
332
|
+
}
|
|
333
|
+
get modalMode() {
|
|
334
|
+
return this.isEditMode ? 'edit' : 'add';
|
|
335
|
+
}
|
|
336
|
+
constructor(teamsApiService, teamsService, fb) {
|
|
337
|
+
this.teamsApiService = teamsApiService;
|
|
338
|
+
this.teamsService = teamsService;
|
|
339
|
+
this.fb = fb;
|
|
340
|
+
this.showModal$ = this.teamsService.showCreateEditModal$;
|
|
341
|
+
this.editingTeam = null;
|
|
342
|
+
this.formGroup = this.fb.group({
|
|
343
|
+
title: this.fb.control('', Validators.required),
|
|
344
|
+
key: this.fb.control('', Validators.required),
|
|
345
|
+
});
|
|
346
|
+
this.usedKeys = [];
|
|
347
|
+
this._subscriptions = new Subscription();
|
|
348
|
+
this._subscriptions.add(this.teamsService.editingTeam$.subscribe(team => {
|
|
349
|
+
this.editingTeam = team;
|
|
350
|
+
if (team) {
|
|
351
|
+
this.formGroup.patchValue({ title: team.title, key: team.key });
|
|
352
|
+
}
|
|
353
|
+
}));
|
|
354
|
+
this._subscriptions.add(this.teamsService.loadedTeams$
|
|
355
|
+
.pipe(map(teams => teams.map(t => t.key)))
|
|
356
|
+
.subscribe(keys => (this.usedKeys = keys)));
|
|
357
|
+
}
|
|
358
|
+
ngOnDestroy() {
|
|
359
|
+
this._subscriptions.unsubscribe();
|
|
360
|
+
}
|
|
361
|
+
onCloseModal() {
|
|
362
|
+
this.teamsService.hideCreateEditModal();
|
|
363
|
+
this.resetForm();
|
|
364
|
+
}
|
|
365
|
+
onSave() {
|
|
366
|
+
this.formGroup.disable();
|
|
367
|
+
const titleValue = this.title.value;
|
|
368
|
+
const keyValue = this.key.value;
|
|
369
|
+
const request$ = this.isEditMode
|
|
370
|
+
? this.teamsApiService.updateTeam(this.editingTeam.key, {
|
|
371
|
+
key: this.editingTeam.key,
|
|
372
|
+
title: titleValue,
|
|
373
|
+
})
|
|
374
|
+
: this.teamsApiService.createTeam({
|
|
375
|
+
key: keyValue,
|
|
376
|
+
title: titleValue,
|
|
377
|
+
});
|
|
378
|
+
request$
|
|
379
|
+
.pipe(catchError(() => {
|
|
380
|
+
this.formGroup.enable();
|
|
381
|
+
return of(null);
|
|
382
|
+
}))
|
|
383
|
+
.subscribe(result => {
|
|
384
|
+
if (result) {
|
|
385
|
+
this.teamsService.hideCreateEditModal();
|
|
386
|
+
this.resetForm();
|
|
387
|
+
this.teamsService.reload();
|
|
388
|
+
}
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
resetForm() {
|
|
392
|
+
runAfterCarbonModalClosed(() => {
|
|
393
|
+
this.formGroup.reset();
|
|
394
|
+
this.formGroup.enable();
|
|
395
|
+
this.editingTeam = null;
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TeamsCreateEditModalComponent, deps: [{ token: TeamsApiService }, { token: TeamsService }, { token: i2$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
399
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: TeamsCreateEditModalComponent, isStandalone: true, selector: "valtimo-teams-create-edit-modal", ngImport: i0, template: "<!--\n ~ Copyright 2015-2026 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal\n *ngIf=\"{showModal: showModal$ | async} as obs\"\n [open]=\"obs.showModal\"\n showFooter=\"true\"\n valtimoCdsModal\n (close)=\"onCloseModal()\"\n>\n <cds-modal-header showCloseButton=\"true\" (closeSelect)=\"onCloseModal()\">\n <h3 cdsModalHeaderHeading>\n {{\n (isEditMode ? 'teams.createEditModal.editTitle' : 'teams.createEditModal.createTitle')\n | translate\n }}\n </h3>\n <p cdsModalHeaderDescription *ngIf=\"!isEditMode\">\n {{ 'teams.createEditModal.createDescription' | translate }}\n </p>\n </cds-modal-header>\n\n <form\n [formGroup]=\"formGroup\"\n cdsModalContent\n class=\"valtimo-teams-create__content\"\n [cdsLayer]=\"1\"\n >\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"formGroup.disabled\" [invalid]=\"title.touched && title.invalid\">\n {{ 'teams.createEditModal.teamName' | translate }}\n\n <input\n formControlName=\"title\"\n cdsText\n placeholder=\"{{ 'teams.createEditModal.teamNamePlaceholder' | translate }}\"\n />\n </cds-label>\n </div>\n\n <valtimo-auto-key-input\n [mode]=\"modalMode\"\n [usedKeys]=\"usedKeys\"\n [sourceText]=\"title.value\"\n formControlName=\"key\"\n placeholderTranslationKey=\"interface.key\"\n >\n </valtimo-auto-key-input>\n </form>\n\n <cds-modal-footer>\n <button cdsButton=\"secondary\" (click)=\"onCloseModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button\n cdsButton=\"primary\"\n [disabled]=\"formGroup.invalid || formGroup.disabled\"\n (click)=\"onSave()\"\n >\n {{ (isEditMode ? 'teams.createEditModal.save' : 'teams.createEditModal.create') | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: [".valtimo-teams-create__content{display:flex;flex-direction:column;gap:16px}.cds--text-input__field-wrapper cds-label{width:100%}.cds--text-input__field-wrapper ::ng-deep .cds--label{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i3$2.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ModalModule }, { kind: "component", type: i4.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i4.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i4.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i4.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i4.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i4.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: InputModule }, { kind: "component", type: i4.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i4.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "ngmodule", type: LayerModule }, { kind: "directive", type: i4.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "directive", type: ValtimoCdsModalDirective, selector: "[valtimoCdsModal]", inputs: ["minContentHeight"] }, { kind: "component", type: AutoKeyInputComponent, selector: "valtimo-auto-key-input", inputs: ["labelTranslationKey", "placeholderTranslationKey", "mode", "usedKeys", "sourceText"] }] }); }
|
|
400
|
+
}
|
|
401
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TeamsCreateEditModalComponent, decorators: [{
|
|
402
|
+
type: Component,
|
|
403
|
+
args: [{ standalone: true, selector: 'valtimo-teams-create-edit-modal', imports: [
|
|
404
|
+
CommonModule,
|
|
405
|
+
ModalModule,
|
|
406
|
+
ButtonModule,
|
|
407
|
+
InputModule,
|
|
408
|
+
LayerModule,
|
|
409
|
+
ReactiveFormsModule,
|
|
410
|
+
TranslatePipe,
|
|
411
|
+
ValtimoCdsModalDirective,
|
|
412
|
+
AutoKeyInputComponent,
|
|
413
|
+
], template: "<!--\n ~ Copyright 2015-2026 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal\n *ngIf=\"{showModal: showModal$ | async} as obs\"\n [open]=\"obs.showModal\"\n showFooter=\"true\"\n valtimoCdsModal\n (close)=\"onCloseModal()\"\n>\n <cds-modal-header showCloseButton=\"true\" (closeSelect)=\"onCloseModal()\">\n <h3 cdsModalHeaderHeading>\n {{\n (isEditMode ? 'teams.createEditModal.editTitle' : 'teams.createEditModal.createTitle')\n | translate\n }}\n </h3>\n <p cdsModalHeaderDescription *ngIf=\"!isEditMode\">\n {{ 'teams.createEditModal.createDescription' | translate }}\n </p>\n </cds-modal-header>\n\n <form\n [formGroup]=\"formGroup\"\n cdsModalContent\n class=\"valtimo-teams-create__content\"\n [cdsLayer]=\"1\"\n >\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"formGroup.disabled\" [invalid]=\"title.touched && title.invalid\">\n {{ 'teams.createEditModal.teamName' | translate }}\n\n <input\n formControlName=\"title\"\n cdsText\n placeholder=\"{{ 'teams.createEditModal.teamNamePlaceholder' | translate }}\"\n />\n </cds-label>\n </div>\n\n <valtimo-auto-key-input\n [mode]=\"modalMode\"\n [usedKeys]=\"usedKeys\"\n [sourceText]=\"title.value\"\n formControlName=\"key\"\n placeholderTranslationKey=\"interface.key\"\n >\n </valtimo-auto-key-input>\n </form>\n\n <cds-modal-footer>\n <button cdsButton=\"secondary\" (click)=\"onCloseModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button\n cdsButton=\"primary\"\n [disabled]=\"formGroup.invalid || formGroup.disabled\"\n (click)=\"onSave()\"\n >\n {{ (isEditMode ? 'teams.createEditModal.save' : 'teams.createEditModal.create') | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: [".valtimo-teams-create__content{display:flex;flex-direction:column;gap:16px}.cds--text-input__field-wrapper cds-label{width:100%}.cds--text-input__field-wrapper ::ng-deep .cds--label{width:100%}\n"] }]
|
|
414
|
+
}], ctorParameters: () => [{ type: TeamsApiService }, { type: TeamsService }, { type: i2$1.FormBuilder }] });
|
|
415
|
+
|
|
416
|
+
/*
|
|
417
|
+
* Copyright 2015-2026 Ritense BV, the Netherlands.
|
|
418
|
+
*
|
|
419
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
420
|
+
* you may not use this file except in compliance with the License.
|
|
421
|
+
* You may obtain a copy of the License at
|
|
422
|
+
*
|
|
423
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
424
|
+
*
|
|
425
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
426
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
427
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
428
|
+
* See the License for the specific language governing permissions and
|
|
429
|
+
* limitations under the License.
|
|
430
|
+
*/
|
|
431
|
+
var TEAM_PERMISSION_ACTION;
|
|
432
|
+
(function (TEAM_PERMISSION_ACTION) {
|
|
433
|
+
TEAM_PERMISSION_ACTION["create"] = "create";
|
|
434
|
+
TEAM_PERMISSION_ACTION["modify"] = "modify";
|
|
435
|
+
TEAM_PERMISSION_ACTION["delete"] = "delete";
|
|
436
|
+
TEAM_PERMISSION_ACTION["assign"] = "assign";
|
|
437
|
+
})(TEAM_PERMISSION_ACTION || (TEAM_PERMISSION_ACTION = {}));
|
|
438
|
+
var TEAM_PERMISSION_RESOURCE;
|
|
439
|
+
(function (TEAM_PERMISSION_RESOURCE) {
|
|
440
|
+
TEAM_PERMISSION_RESOURCE["team"] = "com.ritense.team.domain.Team";
|
|
441
|
+
})(TEAM_PERMISSION_RESOURCE || (TEAM_PERMISSION_RESOURCE = {}));
|
|
442
|
+
var USER_PERMISSION_ACTION;
|
|
443
|
+
(function (USER_PERMISSION_ACTION) {
|
|
444
|
+
USER_PERMISSION_ACTION["view_list"] = "view_list";
|
|
445
|
+
})(USER_PERMISSION_ACTION || (USER_PERMISSION_ACTION = {}));
|
|
446
|
+
var USER_PERMISSION_RESOURCE;
|
|
447
|
+
(function (USER_PERMISSION_RESOURCE) {
|
|
448
|
+
USER_PERMISSION_RESOURCE["user"] = "com.ritense.valtimo.contract.authentication.User";
|
|
449
|
+
})(USER_PERMISSION_RESOURCE || (USER_PERMISSION_RESOURCE = {}));
|
|
450
|
+
const CAN_CREATE_TEAM_PERMISSION = {
|
|
451
|
+
action: TEAM_PERMISSION_ACTION.create,
|
|
452
|
+
resource: TEAM_PERMISSION_RESOURCE.team,
|
|
453
|
+
};
|
|
454
|
+
const CAN_MODIFY_TEAM_PERMISSION = {
|
|
455
|
+
action: TEAM_PERMISSION_ACTION.modify,
|
|
456
|
+
resource: TEAM_PERMISSION_RESOURCE.team,
|
|
457
|
+
};
|
|
458
|
+
const CAN_DELETE_TEAM_PERMISSION = {
|
|
459
|
+
action: TEAM_PERMISSION_ACTION.delete,
|
|
460
|
+
resource: TEAM_PERMISSION_RESOURCE.team,
|
|
461
|
+
};
|
|
462
|
+
const CAN_ASSIGN_TEAM_PERMISSION = {
|
|
463
|
+
action: TEAM_PERMISSION_ACTION.assign,
|
|
464
|
+
resource: TEAM_PERMISSION_RESOURCE.team,
|
|
465
|
+
};
|
|
466
|
+
const CAN_VIEW_USERS_PERMISSION = {
|
|
467
|
+
action: USER_PERMISSION_ACTION.view_list,
|
|
468
|
+
resource: USER_PERMISSION_RESOURCE.user,
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
/*
|
|
472
|
+
* Copyright 2015-2026 Ritense BV, the Netherlands.
|
|
473
|
+
*
|
|
474
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
475
|
+
* you may not use this file except in compliance with the License.
|
|
476
|
+
* You may obtain a copy of the License at
|
|
477
|
+
*
|
|
478
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
479
|
+
*
|
|
480
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
481
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
482
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
483
|
+
* See the License for the specific language governing permissions and
|
|
484
|
+
* limitations under the License.
|
|
485
|
+
*/
|
|
486
|
+
|
|
487
|
+
/*
|
|
488
|
+
* Copyright 2015-2026 Ritense BV, the Netherlands.
|
|
489
|
+
*
|
|
490
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
491
|
+
* you may not use this file except in compliance with the License.
|
|
492
|
+
* You may obtain a copy of the License at
|
|
493
|
+
*
|
|
494
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
495
|
+
*
|
|
496
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
497
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
498
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
499
|
+
* See the License for the specific language governing permissions and
|
|
500
|
+
* limitations under the License.
|
|
501
|
+
*/
|
|
502
|
+
class TeamsListComponent {
|
|
503
|
+
constructor(teamsApiService, teamsService, permissionService, router) {
|
|
504
|
+
this.teamsApiService = teamsApiService;
|
|
505
|
+
this.teamsService = teamsService;
|
|
506
|
+
this.permissionService = permissionService;
|
|
507
|
+
this.router = router;
|
|
508
|
+
this.$loading = signal(true);
|
|
509
|
+
this.canCreateTeam$ = this.permissionService.requestPermission(CAN_CREATE_TEAM_PERMISSION);
|
|
510
|
+
this.canModify = false;
|
|
511
|
+
this.canDelete = false;
|
|
512
|
+
this.permissionSubscription = new Subscription();
|
|
513
|
+
this.ACTION_ITEMS = [
|
|
514
|
+
{
|
|
515
|
+
label: 'interface.edit',
|
|
516
|
+
callback: this.onEditTeam.bind(this),
|
|
517
|
+
disabledCallback: () => !this.canModify,
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
label: 'interface.delete',
|
|
521
|
+
callback: this.onDeleteTeam.bind(this),
|
|
522
|
+
type: 'danger',
|
|
523
|
+
disabledCallback: () => !this.canDelete,
|
|
524
|
+
},
|
|
525
|
+
];
|
|
526
|
+
this.pagination$ = new BehaviorSubject({ ...DEFAULT_PAGINATION });
|
|
527
|
+
this.paginationParams$ = this.pagination$.pipe(map(p => ({ page: p.page, size: p.size })), distinctUntilChanged((a, b) => a.page === b.page && a.size === b.size));
|
|
528
|
+
this.teams$ = combineLatest([this.teamsService.reload$, this.paginationParams$]).pipe(tap(() => this.$loading.set(true)), switchMap(([_, params]) => this.teamsApiService.getTeams({ page: params.page - 1, size: params.size })), map(page => {
|
|
529
|
+
this.pagination$.next({
|
|
530
|
+
...this.pagination$.getValue(),
|
|
531
|
+
collectionSize: page.totalElements,
|
|
532
|
+
});
|
|
533
|
+
return page.content;
|
|
534
|
+
}), tap(teams => {
|
|
535
|
+
this.teamsService.setLoadedTeams(teams);
|
|
536
|
+
this.$loading.set(false);
|
|
537
|
+
}));
|
|
538
|
+
this.FIELDS = [
|
|
539
|
+
{ key: 'title', label: 'teams.listColumns.name' },
|
|
540
|
+
{ key: 'userCount', label: 'teams.listColumns.members', viewType: ViewType.NUMBER },
|
|
541
|
+
];
|
|
542
|
+
this.showDeleteModal$ = this.teamsService.showDeleteModal$;
|
|
543
|
+
this.teamToDelete$ = this.teamsService.teamToDelete$;
|
|
544
|
+
this.permissionSubscription.add(this.permissionService.requestPermission(CAN_MODIFY_TEAM_PERMISSION)
|
|
545
|
+
.subscribe(canModify => this.canModify = canModify));
|
|
546
|
+
this.permissionSubscription.add(this.permissionService.requestPermission(CAN_DELETE_TEAM_PERMISSION)
|
|
547
|
+
.subscribe(canDelete => this.canDelete = canDelete));
|
|
548
|
+
}
|
|
549
|
+
ngOnDestroy() {
|
|
550
|
+
this.permissionSubscription.unsubscribe();
|
|
551
|
+
}
|
|
552
|
+
onRowClick(team) {
|
|
553
|
+
this.router.navigate(['/teams', team.key]);
|
|
554
|
+
}
|
|
555
|
+
showCreateModal() {
|
|
556
|
+
this.teamsService.showCreateModal();
|
|
557
|
+
}
|
|
558
|
+
onEditTeam(team) {
|
|
559
|
+
this.teamsService.showEditModal(team);
|
|
560
|
+
}
|
|
561
|
+
onDeleteTeam(team) {
|
|
562
|
+
this.teamsService.showDeleteConfirmation(team);
|
|
563
|
+
}
|
|
564
|
+
onDeleteConfirm(team) {
|
|
565
|
+
this.teamsApiService.deleteTeam(team.key).subscribe(() => {
|
|
566
|
+
this.teamsService.reload();
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
onPaginationClicked(page) {
|
|
570
|
+
this.pagination$.next({ ...this.pagination$.getValue(), page });
|
|
571
|
+
}
|
|
572
|
+
onPaginationSet(size) {
|
|
573
|
+
const { collectionSize, page } = this.pagination$.getValue();
|
|
574
|
+
const resetPage = Math.ceil(+collectionSize / size) <= +page && +collectionSize > 0;
|
|
575
|
+
this.pagination$.next({
|
|
576
|
+
...this.pagination$.getValue(),
|
|
577
|
+
size,
|
|
578
|
+
...(resetPage && { page: 1 }),
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TeamsListComponent, deps: [{ token: TeamsApiService }, { token: TeamsService }, { token: i2$2.PermissionService }, { token: i3$1.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
582
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: TeamsListComponent, isStandalone: true, selector: "valtimo-teams-list", providers: [TeamsService], ngImport: i0, template: "<!--\n ~ Copyright 2015-2026 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n teams: teams$ | async,\n pagination: pagination$ | async,\n canCreateTeam: canCreateTeam$ | async,\n } as obs\"\n>\n <valtimo-carbon-list\n [fields]=\"FIELDS\"\n [items]=\"obs.teams\"\n [loading]=\"$loading()\"\n [actionItems]=\"ACTION_ITEMS\"\n [pagination]=\"obs.pagination\"\n paginationIdentifier=\"teams\"\n (rowClicked)=\"onRowClick($event)\"\n (paginationClicked)=\"onPaginationClicked($event)\"\n (paginationSet)=\"onPaginationSet($event)\"\n >\n <ng-container carbonToolbarContent [ngTemplateOutlet]=\"teamActions\"></ng-container>\n\n <valtimo-no-results\n [action]=\"teamActions\"\n [description]=\"'teams.noResults.description' | translate\"\n [title]=\"'teams.noResults.title' | translate\"\n ></valtimo-no-results>\n </valtimo-carbon-list>\n</ng-container>\n\n<ng-template #teamActions>\n <button\n cdsButton=\"primary\"\n [disabled]=\"(canCreateTeam$ | async) === false\"\n (click)=\"showCreateModal()\"\n >\n {{ 'teams.newTeam' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n</ng-template>\n\n<valtimo-teams-create-edit-modal></valtimo-teams-create-edit-modal>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"teams.deleteModal.content\"\n [outputOnConfirm]=\"teamToDelete$ | async\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"teams.deleteModal.title\"\n (confirmEvent)=\"onDeleteConfirm($event)\"\n></valtimo-confirmation-modal>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i3$2.AsyncPipe, name: "async" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i3.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "skeletonRowCount", "actions", "actionItems", "showActionItems", "header", "hideColumnHeader", "initialSortState", "sortState", "isSearchable", "enableSingleSelection", "lastColumnTemplate", "paginationIdentifier", "showSelectionColumn", "striped", "hideToolbar", "lockedTooltipTranslationKey", "movingRowsEnabled", "dragAndDrop", "dragAndDropDisabled"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged", "moveRow", "itemsReordered"] }, { kind: "component", type: i3.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title", "smallPadding", "collapseVertically", "alwaysRenderVertically"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i4.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i4.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "component", type: TeamsCreateEditModalComponent, selector: "valtimo-teams-create-edit-modal" }, { kind: "ngmodule", type: ConfirmationModalModule }, { kind: "component", type: i3.ConfirmationModalComponent, selector: "valtimo-confirmation-modal", inputs: ["titleTranslationKey", "title", "content", "contentTranslationKey", "confirmButtonText", "confirmButtonTextTranslationKey", "confirmButtonType", "showOptionalButton", "optionalButtonText", "optionalButtonTextTranslationKey", "optionalButtonType", "cancelButtonText", "cancelButtonTextTranslationKey", "cancelButtonType", "showModalSubject$", "outputOnConfirm", "outputOnOptional", "spacerAfterCancelButton"], outputs: ["confirmEvent", "optionalEvent", "cancelEvent"] }] }); }
|
|
583
|
+
}
|
|
584
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TeamsListComponent, decorators: [{
|
|
585
|
+
type: Component,
|
|
586
|
+
args: [{ standalone: true, selector: 'valtimo-teams-list', imports: [
|
|
587
|
+
CommonModule,
|
|
588
|
+
CarbonListModule,
|
|
589
|
+
TranslatePipe,
|
|
590
|
+
ButtonModule,
|
|
591
|
+
IconModule,
|
|
592
|
+
TeamsCreateEditModalComponent,
|
|
593
|
+
ConfirmationModalModule,
|
|
594
|
+
], providers: [TeamsService], template: "<!--\n ~ Copyright 2015-2026 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n teams: teams$ | async,\n pagination: pagination$ | async,\n canCreateTeam: canCreateTeam$ | async,\n } as obs\"\n>\n <valtimo-carbon-list\n [fields]=\"FIELDS\"\n [items]=\"obs.teams\"\n [loading]=\"$loading()\"\n [actionItems]=\"ACTION_ITEMS\"\n [pagination]=\"obs.pagination\"\n paginationIdentifier=\"teams\"\n (rowClicked)=\"onRowClick($event)\"\n (paginationClicked)=\"onPaginationClicked($event)\"\n (paginationSet)=\"onPaginationSet($event)\"\n >\n <ng-container carbonToolbarContent [ngTemplateOutlet]=\"teamActions\"></ng-container>\n\n <valtimo-no-results\n [action]=\"teamActions\"\n [description]=\"'teams.noResults.description' | translate\"\n [title]=\"'teams.noResults.title' | translate\"\n ></valtimo-no-results>\n </valtimo-carbon-list>\n</ng-container>\n\n<ng-template #teamActions>\n <button\n cdsButton=\"primary\"\n [disabled]=\"(canCreateTeam$ | async) === false\"\n (click)=\"showCreateModal()\"\n >\n {{ 'teams.newTeam' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n</ng-template>\n\n<valtimo-teams-create-edit-modal></valtimo-teams-create-edit-modal>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"teams.deleteModal.content\"\n [outputOnConfirm]=\"teamToDelete$ | async\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"teams.deleteModal.title\"\n (confirmEvent)=\"onDeleteConfirm($event)\"\n></valtimo-confirmation-modal>\n" }]
|
|
595
|
+
}], ctorParameters: () => [{ type: TeamsApiService }, { type: TeamsService }, { type: i2$2.PermissionService }, { type: i3$1.Router }] });
|
|
596
|
+
|
|
597
|
+
/*
|
|
598
|
+
* Copyright 2015-2026 Ritense BV, the Netherlands.
|
|
599
|
+
*
|
|
600
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
601
|
+
* you may not use this file except in compliance with the License.
|
|
602
|
+
* You may obtain a copy of the License at
|
|
603
|
+
*
|
|
604
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
605
|
+
*
|
|
606
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
607
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
608
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
609
|
+
* See the License for the specific language governing permissions and
|
|
610
|
+
* limitations under the License.
|
|
611
|
+
*/
|
|
612
|
+
class TeamDetailEditModalComponent {
|
|
613
|
+
get title() {
|
|
614
|
+
return this.formGroup.get('title');
|
|
615
|
+
}
|
|
616
|
+
constructor(teamsApiService, teamDetailService, fb) {
|
|
617
|
+
this.teamsApiService = teamsApiService;
|
|
618
|
+
this.teamDetailService = teamDetailService;
|
|
619
|
+
this.fb = fb;
|
|
620
|
+
this.showModal$ = this.teamDetailService.showEditTeamModal$;
|
|
621
|
+
this.formGroup = this.fb.group({
|
|
622
|
+
title: this.fb.control('', Validators.required),
|
|
623
|
+
});
|
|
624
|
+
this._teamSubscription = this.teamDetailService.showEditTeamModal$.subscribe(show => {
|
|
625
|
+
if (show) {
|
|
626
|
+
this.teamDetailService.team$.subscribe(team => {
|
|
627
|
+
this.formGroup.patchValue({ title: team.title });
|
|
628
|
+
});
|
|
629
|
+
}
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
ngOnDestroy() {
|
|
633
|
+
this._teamSubscription.unsubscribe();
|
|
634
|
+
}
|
|
635
|
+
onCloseModal() {
|
|
636
|
+
this.teamDetailService.hideEditTeamModal();
|
|
637
|
+
this.resetForm();
|
|
638
|
+
}
|
|
639
|
+
onSave() {
|
|
640
|
+
this.formGroup.disable();
|
|
641
|
+
this.teamsApiService
|
|
642
|
+
.updateTeam(this.teamDetailService.teamKey, {
|
|
643
|
+
key: this.teamDetailService.teamKey,
|
|
644
|
+
title: this.title.value,
|
|
645
|
+
})
|
|
646
|
+
.pipe(catchError(() => {
|
|
647
|
+
this.formGroup.enable();
|
|
648
|
+
return of(null);
|
|
649
|
+
}))
|
|
650
|
+
.subscribe(result => {
|
|
651
|
+
if (result) {
|
|
652
|
+
this.teamDetailService.hideEditTeamModal();
|
|
653
|
+
this.resetForm();
|
|
654
|
+
this.teamDetailService.reload();
|
|
655
|
+
}
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
resetForm() {
|
|
659
|
+
runAfterCarbonModalClosed(() => {
|
|
660
|
+
this.formGroup.reset();
|
|
661
|
+
this.formGroup.enable();
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TeamDetailEditModalComponent, deps: [{ token: TeamsApiService }, { token: TeamDetailService }, { token: i2$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
665
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: TeamDetailEditModalComponent, isStandalone: true, selector: "valtimo-team-detail-edit-modal", ngImport: i0, template: "<!--\n ~ Copyright 2015-2026 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal\n *ngIf=\"{showModal: showModal$ | async} as obs\"\n [open]=\"obs.showModal\"\n showFooter=\"true\"\n valtimoCdsModal\n (close)=\"onCloseModal()\"\n>\n <cds-modal-header showCloseButton=\"true\" (closeSelect)=\"onCloseModal()\">\n <h3 cdsModalHeaderHeading>\n {{ 'teams.createEditModal.editTitle' | translate }}\n </h3>\n </cds-modal-header>\n\n <form\n [formGroup]=\"formGroup\"\n cdsModalContent\n class=\"valtimo-team-edit__content\"\n [cdsLayer]=\"1\"\n >\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"formGroup.disabled\" [invalid]=\"title.touched && title.invalid\">\n {{ 'teams.createEditModal.teamName' | translate }}\n\n <input\n formControlName=\"title\"\n cdsText\n placeholder=\"{{ 'teams.createEditModal.teamNamePlaceholder' | translate }}\"\n />\n </cds-label>\n </div>\n </form>\n\n <cds-modal-footer>\n <button cdsButton=\"secondary\" (click)=\"onCloseModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button\n cdsButton=\"primary\"\n [disabled]=\"formGroup.invalid || formGroup.disabled\"\n (click)=\"onSave()\"\n >\n {{ 'teams.createEditModal.save' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: [".valtimo-team-edit__content{display:flex;flex-direction:column;gap:16px}.cds--text-input__field-wrapper cds-label{width:100%}.cds--text-input__field-wrapper ::ng-deep .cds--label{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i3$2.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ModalModule }, { kind: "component", type: i4.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i4.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i4.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i4.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i4.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i4.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: InputModule }, { kind: "component", type: i4.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i4.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "ngmodule", type: LayerModule }, { kind: "directive", type: i4.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "directive", type: ValtimoCdsModalDirective, selector: "[valtimoCdsModal]", inputs: ["minContentHeight"] }] }); }
|
|
666
|
+
}
|
|
667
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TeamDetailEditModalComponent, decorators: [{
|
|
668
|
+
type: Component,
|
|
669
|
+
args: [{ standalone: true, selector: 'valtimo-team-detail-edit-modal', imports: [
|
|
670
|
+
CommonModule,
|
|
671
|
+
ModalModule,
|
|
672
|
+
ButtonModule,
|
|
673
|
+
InputModule,
|
|
674
|
+
LayerModule,
|
|
675
|
+
ReactiveFormsModule,
|
|
676
|
+
TranslatePipe,
|
|
677
|
+
ValtimoCdsModalDirective,
|
|
678
|
+
], template: "<!--\n ~ Copyright 2015-2026 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal\n *ngIf=\"{showModal: showModal$ | async} as obs\"\n [open]=\"obs.showModal\"\n showFooter=\"true\"\n valtimoCdsModal\n (close)=\"onCloseModal()\"\n>\n <cds-modal-header showCloseButton=\"true\" (closeSelect)=\"onCloseModal()\">\n <h3 cdsModalHeaderHeading>\n {{ 'teams.createEditModal.editTitle' | translate }}\n </h3>\n </cds-modal-header>\n\n <form\n [formGroup]=\"formGroup\"\n cdsModalContent\n class=\"valtimo-team-edit__content\"\n [cdsLayer]=\"1\"\n >\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"formGroup.disabled\" [invalid]=\"title.touched && title.invalid\">\n {{ 'teams.createEditModal.teamName' | translate }}\n\n <input\n formControlName=\"title\"\n cdsText\n placeholder=\"{{ 'teams.createEditModal.teamNamePlaceholder' | translate }}\"\n />\n </cds-label>\n </div>\n </form>\n\n <cds-modal-footer>\n <button cdsButton=\"secondary\" (click)=\"onCloseModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button\n cdsButton=\"primary\"\n [disabled]=\"formGroup.invalid || formGroup.disabled\"\n (click)=\"onSave()\"\n >\n {{ 'teams.createEditModal.save' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: [".valtimo-team-edit__content{display:flex;flex-direction:column;gap:16px}.cds--text-input__field-wrapper cds-label{width:100%}.cds--text-input__field-wrapper ::ng-deep .cds--label{width:100%}\n"] }]
|
|
679
|
+
}], ctorParameters: () => [{ type: TeamsApiService }, { type: TeamDetailService }, { type: i2$1.FormBuilder }] });
|
|
680
|
+
|
|
681
|
+
/*
|
|
682
|
+
* Copyright 2015-2026 Ritense BV, the Netherlands.
|
|
683
|
+
*
|
|
684
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
685
|
+
* you may not use this file except in compliance with the License.
|
|
686
|
+
* You may obtain a copy of the License at
|
|
687
|
+
*
|
|
688
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
689
|
+
*
|
|
690
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
691
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
692
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
693
|
+
* See the License for the specific language governing permissions and
|
|
694
|
+
* limitations under the License.
|
|
695
|
+
*/
|
|
696
|
+
class TeamDetailAddMemberComponent {
|
|
697
|
+
constructor(teamsApiService, teamDetailService, iconService) {
|
|
698
|
+
this.teamsApiService = teamsApiService;
|
|
699
|
+
this.teamDetailService = teamDetailService;
|
|
700
|
+
this.iconService = iconService;
|
|
701
|
+
this.disabled = false;
|
|
702
|
+
this.availableUsers$ = new BehaviorSubject([]);
|
|
703
|
+
this.noUsersAvailable$ = this.availableUsers$.pipe(map$1(users => users.length === 0));
|
|
704
|
+
this.selectedUsername$ = new BehaviorSubject(null);
|
|
705
|
+
this.saving$ = new BehaviorSubject(false);
|
|
706
|
+
this.showComboBox$ = new BehaviorSubject(true);
|
|
707
|
+
this.subscription = new Subscription();
|
|
708
|
+
this.iconService.registerAll([Add16, UserFollow16]);
|
|
709
|
+
}
|
|
710
|
+
ngOnInit() {
|
|
711
|
+
this.fetchCandidateUsers();
|
|
712
|
+
}
|
|
713
|
+
ngOnDestroy() {
|
|
714
|
+
this.subscription.unsubscribe();
|
|
715
|
+
}
|
|
716
|
+
onUserSelect(event) {
|
|
717
|
+
if (!event?.id)
|
|
718
|
+
return;
|
|
719
|
+
this.selectedUsername$.next(event.id);
|
|
720
|
+
}
|
|
721
|
+
onComboBoxClear() {
|
|
722
|
+
this.selectedUsername$.next(null);
|
|
723
|
+
}
|
|
724
|
+
onAddToTeam() {
|
|
725
|
+
const username = this.selectedUsername$.getValue();
|
|
726
|
+
if (!username)
|
|
727
|
+
return;
|
|
728
|
+
this.saving$.next(true);
|
|
729
|
+
this.teamsApiService
|
|
730
|
+
.addTeamUser(this.teamDetailService.teamKey, { username })
|
|
731
|
+
.pipe(catchError(() => {
|
|
732
|
+
this.saving$.next(false);
|
|
733
|
+
return of(null);
|
|
734
|
+
}))
|
|
735
|
+
.subscribe(result => {
|
|
736
|
+
if (result) {
|
|
737
|
+
this.saving$.next(false);
|
|
738
|
+
this.selectedUsername$.next(null);
|
|
739
|
+
this.resetComboBox();
|
|
740
|
+
this.teamDetailService.reloadMembers();
|
|
741
|
+
this.fetchCandidateUsers();
|
|
742
|
+
}
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
onOpenChange(open) {
|
|
746
|
+
if (open) {
|
|
747
|
+
this.fetchCandidateUsers();
|
|
748
|
+
this.selectedUsername$.next(null);
|
|
749
|
+
this.resetComboBox();
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
fetchCandidateUsers() {
|
|
753
|
+
this.subscription.add(this.teamsApiService
|
|
754
|
+
.getCandidateUsers(this.teamDetailService.teamKey)
|
|
755
|
+
.pipe(map$1(users => users.map(user => ({
|
|
756
|
+
content: this.getUserLabel(user),
|
|
757
|
+
id: user.username ?? user.id,
|
|
758
|
+
selected: false,
|
|
759
|
+
}))))
|
|
760
|
+
.subscribe(items => this.availableUsers$.next(items)));
|
|
761
|
+
}
|
|
762
|
+
getUserLabel(user) {
|
|
763
|
+
const firstName = user.firstName?.trim();
|
|
764
|
+
const lastName = user.lastName?.trim();
|
|
765
|
+
if (firstName && lastName)
|
|
766
|
+
return `${firstName} ${lastName}`;
|
|
767
|
+
if (firstName)
|
|
768
|
+
return firstName;
|
|
769
|
+
if (lastName)
|
|
770
|
+
return lastName;
|
|
771
|
+
if (user.email)
|
|
772
|
+
return user.email;
|
|
773
|
+
return user.username ?? user.id;
|
|
774
|
+
}
|
|
775
|
+
resetComboBox() {
|
|
776
|
+
this.showComboBox$.next(false);
|
|
777
|
+
setTimeout(() => this.showComboBox$.next(true));
|
|
778
|
+
}
|
|
779
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TeamDetailAddMemberComponent, deps: [{ token: TeamsApiService }, { token: TeamDetailService }, { token: i4.IconService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
780
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: TeamDetailAddMemberComponent, isStandalone: true, selector: "valtimo-team-detail-add-member", inputs: { disabled: "disabled" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2026 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<v-overflow-menu placement=\"bottom-end\" [closeOnSelect]=\"false\" (openChange)=\"onOpenChange($event)\">\n <button overflowTrigger cdsButton=\"primary\" [disabled]=\"disabled\" class=\"add-member-button\">\n {{ 'teams.detail.addMember' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n\n <section\n overflowPane\n class=\"valtimo-team-add-member__pane\"\n (click)=\"$event.stopImmediatePropagation()\"\n *ngIf=\"{\n users: availableUsers$ | async,\n noUsersAvailable: noUsersAvailable$ | async,\n selectedUsername: selectedUsername$ | async,\n saving: saving$ | async,\n showComboBox: showComboBox$ | async,\n } as obs\"\n >\n <cds-combo-box\n *ngIf=\"obs.showComboBox\"\n [label]=\"'teams.detail.addMemberModal.selectMember' | translate\"\n [placeholder]=\"\n obs.noUsersAvailable\n ? ('teams.detail.addMemberModal.noUsersAvailable' | translate)\n : ('teams.detail.addMemberModal.selectMemberPlaceholder' | translate)\n \"\n [appendInline]=\"true\"\n [dropUp]=\"false\"\n [cdsLayer]=\"1\"\n [items]=\"obs.users || []\"\n [disabled]=\"obs.saving || obs.noUsersAvailable\"\n itemValueKey=\"id\"\n (selected)=\"onUserSelect($event)\"\n (clear)=\"onComboBoxClear()\"\n >\n <cds-dropdown-list onclick=\"event.stopPropagation()\"></cds-dropdown-list>\n </cds-combo-box>\n\n <button\n cdsButton=\"primary\"\n [cdsLayer]=\"1\"\n class=\"add-to-team-button\"\n [disabled]=\"!obs.selectedUsername || obs.saving || obs.noUsersAvailable\"\n (click)=\"onAddToTeam()\"\n >\n {{ 'teams.detail.addMemberModal.addToTeam' | translate }}\n <svg cdsIcon=\"user--follow\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n </section>\n</v-overflow-menu>\n", styles: [".valtimo-team-add-member__pane{padding:16px;display:flex;flex-direction:column;gap:16px;min-width:280px}.add-to-team-button{width:100%;max-width:100%}\n/*!\n * Copyright 2015-2026 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i3$2.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i4.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: ComboBoxModule }, { kind: "component", type: i4.ComboBox, selector: "cds-combo-box, ibm-combo-box", inputs: ["placeholder", "openMenuAria", "closeMenuAria", "clearSelectionsTitle", "clearSelectionsAria", "clearSelectionTitle", "clearSelectionAria", "id", "labelId", "items", "type", "size", "itemValueKey", "label", "hideLabel", "helperText", "appendInline", "invalid", "invalidText", "warn", "warnText", "maxLength", "theme", "selectionFeedback", "autocomplete", "dropUp", "disabled", "readonly", "fluid"], outputs: ["selected", "submit", "close", "search", "clear"] }, { kind: "component", type: i4$1.DropdownList, selector: "cds-dropdown-list, ibm-dropdown-list", inputs: ["ariaLabel", "items", "listTpl", "type", "showTitles"], outputs: ["select", "scroll", "blurIntent"] }, { kind: "ngmodule", type: DialogModule }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i4.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "ngmodule", type: LayerModule }, { kind: "directive", type: i4.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }, { kind: "component", type: OverflowMenuComponent, selector: "v-overflow-menu", inputs: ["open", "placement", "menuWidth", "offsetX", "offsetY", "closeOnSelect", "useHostAsReference", "portalToBody"], outputs: ["openChange"] }] }); }
|
|
781
|
+
}
|
|
782
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TeamDetailAddMemberComponent, decorators: [{
|
|
783
|
+
type: Component,
|
|
784
|
+
args: [{ standalone: true, selector: 'valtimo-team-detail-add-member', imports: [
|
|
785
|
+
CommonModule,
|
|
786
|
+
ButtonModule,
|
|
787
|
+
ComboBoxModule,
|
|
788
|
+
DialogModule,
|
|
789
|
+
IconModule,
|
|
790
|
+
LayerModule,
|
|
791
|
+
TranslateModule,
|
|
792
|
+
OverflowMenuComponent,
|
|
793
|
+
], template: "<!--\n ~ Copyright 2015-2026 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<v-overflow-menu placement=\"bottom-end\" [closeOnSelect]=\"false\" (openChange)=\"onOpenChange($event)\">\n <button overflowTrigger cdsButton=\"primary\" [disabled]=\"disabled\" class=\"add-member-button\">\n {{ 'teams.detail.addMember' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n\n <section\n overflowPane\n class=\"valtimo-team-add-member__pane\"\n (click)=\"$event.stopImmediatePropagation()\"\n *ngIf=\"{\n users: availableUsers$ | async,\n noUsersAvailable: noUsersAvailable$ | async,\n selectedUsername: selectedUsername$ | async,\n saving: saving$ | async,\n showComboBox: showComboBox$ | async,\n } as obs\"\n >\n <cds-combo-box\n *ngIf=\"obs.showComboBox\"\n [label]=\"'teams.detail.addMemberModal.selectMember' | translate\"\n [placeholder]=\"\n obs.noUsersAvailable\n ? ('teams.detail.addMemberModal.noUsersAvailable' | translate)\n : ('teams.detail.addMemberModal.selectMemberPlaceholder' | translate)\n \"\n [appendInline]=\"true\"\n [dropUp]=\"false\"\n [cdsLayer]=\"1\"\n [items]=\"obs.users || []\"\n [disabled]=\"obs.saving || obs.noUsersAvailable\"\n itemValueKey=\"id\"\n (selected)=\"onUserSelect($event)\"\n (clear)=\"onComboBoxClear()\"\n >\n <cds-dropdown-list onclick=\"event.stopPropagation()\"></cds-dropdown-list>\n </cds-combo-box>\n\n <button\n cdsButton=\"primary\"\n [cdsLayer]=\"1\"\n class=\"add-to-team-button\"\n [disabled]=\"!obs.selectedUsername || obs.saving || obs.noUsersAvailable\"\n (click)=\"onAddToTeam()\"\n >\n {{ 'teams.detail.addMemberModal.addToTeam' | translate }}\n <svg cdsIcon=\"user--follow\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n </section>\n</v-overflow-menu>\n", styles: [".valtimo-team-add-member__pane{padding:16px;display:flex;flex-direction:column;gap:16px;min-width:280px}.add-to-team-button{width:100%;max-width:100%}\n/*!\n * Copyright 2015-2026 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
794
|
+
}], ctorParameters: () => [{ type: TeamsApiService }, { type: TeamDetailService }, { type: i4.IconService }], propDecorators: { disabled: [{
|
|
795
|
+
type: Input
|
|
796
|
+
}] } });
|
|
797
|
+
|
|
798
|
+
/*
|
|
799
|
+
* Copyright 2015-2026 Ritense BV, the Netherlands.
|
|
800
|
+
*
|
|
801
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
802
|
+
* you may not use this file except in compliance with the License.
|
|
803
|
+
* You may obtain a copy of the License at
|
|
804
|
+
*
|
|
805
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
806
|
+
*
|
|
807
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
808
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
809
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
810
|
+
* See the License for the specific language governing permissions and
|
|
811
|
+
* limitations under the License.
|
|
812
|
+
*/
|
|
813
|
+
class TeamDetailComponent {
|
|
814
|
+
constructor(route, teamDetailService, teamsApiService, pageTitleService, permissionService) {
|
|
815
|
+
this.route = route;
|
|
816
|
+
this.teamDetailService = teamDetailService;
|
|
817
|
+
this.teamsApiService = teamsApiService;
|
|
818
|
+
this.pageTitleService = pageTitleService;
|
|
819
|
+
this.permissionService = permissionService;
|
|
820
|
+
this.$loadingMembers = signal(true);
|
|
821
|
+
this.members$ = this.teamDetailService.members$;
|
|
822
|
+
this.membersPagination$ = this.teamDetailService.membersPagination$;
|
|
823
|
+
this.showRemoveMemberModal$ = this.teamDetailService.showRemoveMemberModal$;
|
|
824
|
+
this.memberToRemove$ = this.teamDetailService.memberToRemove$;
|
|
825
|
+
this.showDeleteTeamModal$ = this.teamDetailService.showDeleteTeamModal$;
|
|
826
|
+
this.team$ = this.teamDetailService.team$;
|
|
827
|
+
this.teamContext$ = this.teamDetailService.teamKey$.pipe(map(teamKey => ({
|
|
828
|
+
identifier: teamKey,
|
|
829
|
+
resource: TEAM_PERMISSION_RESOURCE.team,
|
|
830
|
+
})));
|
|
831
|
+
this.canModifyTeam$ = this.teamContext$.pipe(switchMap(context => this.permissionService.requestPermission(CAN_MODIFY_TEAM_PERMISSION, context)));
|
|
832
|
+
this.canDeleteTeam$ = this.teamContext$.pipe(switchMap(context => this.permissionService.requestPermission(CAN_DELETE_TEAM_PERMISSION, context)));
|
|
833
|
+
this.canViewUsers$ = this.permissionService.requestPermission(CAN_VIEW_USERS_PERMISSION);
|
|
834
|
+
this.canAssign = false;
|
|
835
|
+
this.permissionSubscription = new Subscription();
|
|
836
|
+
this.canAddMember$ = combineLatest([
|
|
837
|
+
this.teamContext$.pipe(switchMap(context => this.permissionService.requestPermission(CAN_ASSIGN_TEAM_PERMISSION, context))),
|
|
838
|
+
this.canViewUsers$,
|
|
839
|
+
]).pipe(map(([canAssign, canViewUsers]) => canAssign && canViewUsers));
|
|
840
|
+
this.MEMBER_ACTION_ITEMS = [
|
|
841
|
+
{
|
|
842
|
+
label: 'teams.detail.removeMember',
|
|
843
|
+
callback: this.onRemoveMember.bind(this),
|
|
844
|
+
type: 'danger',
|
|
845
|
+
disabledCallback: () => !this.canAssign,
|
|
846
|
+
},
|
|
847
|
+
];
|
|
848
|
+
this.MEMBER_FIELDS = [
|
|
849
|
+
{ key: 'fullName', label: 'teams.detail.memberColumns.name' },
|
|
850
|
+
{ key: 'email', label: 'teams.detail.memberColumns.email' },
|
|
851
|
+
];
|
|
852
|
+
this.teamDetailService.setRoute(this.route);
|
|
853
|
+
this.permissionSubscription.add(this.teamDetailService.loadingMembers$.subscribe(loading => {
|
|
854
|
+
this.$loadingMembers.set(loading);
|
|
855
|
+
}));
|
|
856
|
+
this.permissionSubscription.add(this.teamContext$.pipe(switchMap(context => this.permissionService.requestPermission(CAN_ASSIGN_TEAM_PERMISSION, context))).subscribe(canAssign => this.canAssign = canAssign));
|
|
857
|
+
}
|
|
858
|
+
ngOnInit() {
|
|
859
|
+
this.pageTitleService.disableReset();
|
|
860
|
+
}
|
|
861
|
+
ngOnDestroy() {
|
|
862
|
+
this.pageTitleService.enableReset();
|
|
863
|
+
this.permissionSubscription.unsubscribe();
|
|
864
|
+
}
|
|
865
|
+
onEditTeam() {
|
|
866
|
+
this.teamDetailService.showEditTeamModal();
|
|
867
|
+
}
|
|
868
|
+
onDeleteTeam() {
|
|
869
|
+
this.teamDetailService.showDeleteTeamModal();
|
|
870
|
+
}
|
|
871
|
+
onDeleteTeamConfirm() {
|
|
872
|
+
this.permissionSubscription.add(this.teamsApiService.deleteTeam(this.teamDetailService.teamKey).subscribe(() => {
|
|
873
|
+
this.teamDetailService.navigateToTeamsList();
|
|
874
|
+
}));
|
|
875
|
+
}
|
|
876
|
+
onRemoveMember(member) {
|
|
877
|
+
this.teamDetailService.showRemoveMemberConfirmation(member);
|
|
878
|
+
}
|
|
879
|
+
onRemoveMemberConfirm(member) {
|
|
880
|
+
this.permissionSubscription.add(this.teamsApiService
|
|
881
|
+
.removeTeamUser(this.teamDetailService.teamKey, member.username)
|
|
882
|
+
.subscribe(() => {
|
|
883
|
+
this.teamDetailService.reloadMembers();
|
|
884
|
+
}));
|
|
885
|
+
}
|
|
886
|
+
onPaginationClicked(page) {
|
|
887
|
+
this.teamDetailService.membersPagination$.next({
|
|
888
|
+
...this.teamDetailService.membersPagination$.getValue(),
|
|
889
|
+
page,
|
|
890
|
+
});
|
|
891
|
+
}
|
|
892
|
+
onPaginationSet(size) {
|
|
893
|
+
const { collectionSize, page } = this.teamDetailService.membersPagination$.getValue();
|
|
894
|
+
const resetPage = Math.ceil(+collectionSize / size) <= +page && +collectionSize > 0;
|
|
895
|
+
this.teamDetailService.membersPagination$.next({
|
|
896
|
+
...this.teamDetailService.membersPagination$.getValue(),
|
|
897
|
+
size,
|
|
898
|
+
...(resetPage && { page: 1 }),
|
|
899
|
+
});
|
|
900
|
+
}
|
|
901
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TeamDetailComponent, deps: [{ token: i3$1.ActivatedRoute }, { token: TeamDetailService }, { token: TeamsApiService }, { token: i3.PageTitleService }, { token: i2$2.PermissionService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
902
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: TeamDetailComponent, isStandalone: true, selector: "valtimo-team-detail", providers: [TeamDetailService], ngImport: i0, template: "<!--\n ~ Copyright 2015-2026 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n members: members$ | async,\n pagination: membersPagination$ | async,\n canAddMember: canAddMember$ | async,\n } as obs\"\n>\n <valtimo-carbon-list\n [fields]=\"MEMBER_FIELDS\"\n [items]=\"obs.members\"\n [loading]=\"$loadingMembers()\"\n [actionItems]=\"MEMBER_ACTION_ITEMS\"\n [pagination]=\"obs.pagination\"\n paginationIdentifier=\"teamMembers\"\n (paginationClicked)=\"onPaginationClicked($event)\"\n (paginationSet)=\"onPaginationSet($event)\"\n >\n <div carbonToolbarContent>\n <valtimo-team-detail-add-member\n [disabled]=\"obs.canAddMember === false\"\n ></valtimo-team-detail-add-member>\n </div>\n\n <valtimo-no-results\n [description]=\"'teams.detail.noMembers.description' | translate\"\n [title]=\"'teams.detail.noMembers.title' | translate\"\n ></valtimo-no-results>\n </valtimo-carbon-list>\n</ng-container>\n\n<ng-container renderInPageHeader>\n <ng-template>\n <div\n class=\"team-detail__header\"\n *ngIf=\"{\n canModify: canModifyTeam$ | async,\n canDelete: canDeleteTeam$ | async,\n } as perms\"\n >\n <v-overflow-menu\n class=\"overflow-button\"\n [menuWidth]=\"250\"\n placement=\"bottom-end\"\n >\n <button overflowTrigger cdsButton=\"tertiary\">\n {{ 'teams.detail.more' | translate }}\n <svg class=\"cds--btn__icon\" cdsIcon=\"overflow-menu--vertical\" size=\"16\"></svg>\n </button>\n\n <v-overflow-menu-option (selected)=\"onEditTeam()\" [disabled]=\"!perms.canModify\">\n {{ 'teams.detail.editTeam' | translate }}\n </v-overflow-menu-option>\n\n <v-overflow-menu-option\n (selected)=\"onDeleteTeam()\"\n type=\"danger\"\n [disabled]=\"!perms.canDelete\"\n >\n {{ 'teams.detail.deleteTeam' | translate }}\n </v-overflow-menu-option>\n </v-overflow-menu>\n </div>\n </ng-template>\n</ng-container>\n\n<valtimo-team-detail-edit-modal></valtimo-team-detail-edit-modal>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"teams.detail.removeMember\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"teams.detail.removeMemberModal.content\"\n [outputOnConfirm]=\"memberToRemove$ | async\"\n [showModalSubject$]=\"showRemoveMemberModal$\"\n titleTranslationKey=\"teams.detail.removeMemberModal.title\"\n (confirmEvent)=\"onRemoveMemberConfirm($event)\"\n></valtimo-confirmation-modal>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"teams.deleteModal.content\"\n [outputOnConfirm]=\"team$ | async\"\n [showModalSubject$]=\"showDeleteTeamModal$\"\n titleTranslationKey=\"teams.deleteModal.title\"\n (confirmEvent)=\"onDeleteTeamConfirm()\"\n></valtimo-confirmation-modal>\n", styles: [":host ::ng-deep .team-detail__header{display:flex;align-items:center;gap:.75rem;justify-content:flex-end}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i3$2.AsyncPipe, name: "async" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i3.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "skeletonRowCount", "actions", "actionItems", "showActionItems", "header", "hideColumnHeader", "initialSortState", "sortState", "isSearchable", "enableSingleSelection", "lastColumnTemplate", "paginationIdentifier", "showSelectionColumn", "striped", "hideToolbar", "lockedTooltipTranslationKey", "movingRowsEnabled", "dragAndDrop", "dragAndDropDisabled"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged", "moveRow", "itemsReordered"] }, { kind: "component", type: i3.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title", "smallPadding", "collapseVertically", "alwaysRenderVertically"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i4.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i4.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "ngmodule", type: DialogModule }, { kind: "directive", type: RenderInPageHeaderDirective, selector: "[renderInPageHeader]", inputs: ["fullWidth"] }, { kind: "component", type: OverflowMenuComponent, selector: "v-overflow-menu", inputs: ["open", "placement", "menuWidth", "offsetX", "offsetY", "closeOnSelect", "useHostAsReference", "portalToBody"], outputs: ["openChange"] }, { kind: "component", type: OverflowMenuOptionComponent, selector: "v-overflow-menu-option", inputs: ["disabled", "type", "testId", "optionId"], outputs: ["selected"] }, { kind: "ngmodule", type: ConfirmationModalModule }, { kind: "component", type: i3.ConfirmationModalComponent, selector: "valtimo-confirmation-modal", inputs: ["titleTranslationKey", "title", "content", "contentTranslationKey", "confirmButtonText", "confirmButtonTextTranslationKey", "confirmButtonType", "showOptionalButton", "optionalButtonText", "optionalButtonTextTranslationKey", "optionalButtonType", "cancelButtonText", "cancelButtonTextTranslationKey", "cancelButtonType", "showModalSubject$", "outputOnConfirm", "outputOnOptional", "spacerAfterCancelButton"], outputs: ["confirmEvent", "optionalEvent", "cancelEvent"] }, { kind: "component", type: TeamDetailEditModalComponent, selector: "valtimo-team-detail-edit-modal" }, { kind: "component", type: TeamDetailAddMemberComponent, selector: "valtimo-team-detail-add-member", inputs: ["disabled"] }] }); }
|
|
903
|
+
}
|
|
904
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TeamDetailComponent, decorators: [{
|
|
905
|
+
type: Component,
|
|
906
|
+
args: [{ standalone: true, selector: 'valtimo-team-detail', imports: [
|
|
907
|
+
CommonModule,
|
|
908
|
+
CarbonListModule,
|
|
909
|
+
TranslatePipe,
|
|
910
|
+
ButtonModule,
|
|
911
|
+
IconModule,
|
|
912
|
+
DialogModule,
|
|
913
|
+
RenderInPageHeaderDirective,
|
|
914
|
+
OverflowMenuComponent,
|
|
915
|
+
OverflowMenuOptionComponent,
|
|
916
|
+
ConfirmationModalModule,
|
|
917
|
+
TeamDetailEditModalComponent,
|
|
918
|
+
TeamDetailAddMemberComponent,
|
|
919
|
+
], providers: [TeamDetailService], template: "<!--\n ~ Copyright 2015-2026 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n members: members$ | async,\n pagination: membersPagination$ | async,\n canAddMember: canAddMember$ | async,\n } as obs\"\n>\n <valtimo-carbon-list\n [fields]=\"MEMBER_FIELDS\"\n [items]=\"obs.members\"\n [loading]=\"$loadingMembers()\"\n [actionItems]=\"MEMBER_ACTION_ITEMS\"\n [pagination]=\"obs.pagination\"\n paginationIdentifier=\"teamMembers\"\n (paginationClicked)=\"onPaginationClicked($event)\"\n (paginationSet)=\"onPaginationSet($event)\"\n >\n <div carbonToolbarContent>\n <valtimo-team-detail-add-member\n [disabled]=\"obs.canAddMember === false\"\n ></valtimo-team-detail-add-member>\n </div>\n\n <valtimo-no-results\n [description]=\"'teams.detail.noMembers.description' | translate\"\n [title]=\"'teams.detail.noMembers.title' | translate\"\n ></valtimo-no-results>\n </valtimo-carbon-list>\n</ng-container>\n\n<ng-container renderInPageHeader>\n <ng-template>\n <div\n class=\"team-detail__header\"\n *ngIf=\"{\n canModify: canModifyTeam$ | async,\n canDelete: canDeleteTeam$ | async,\n } as perms\"\n >\n <v-overflow-menu\n class=\"overflow-button\"\n [menuWidth]=\"250\"\n placement=\"bottom-end\"\n >\n <button overflowTrigger cdsButton=\"tertiary\">\n {{ 'teams.detail.more' | translate }}\n <svg class=\"cds--btn__icon\" cdsIcon=\"overflow-menu--vertical\" size=\"16\"></svg>\n </button>\n\n <v-overflow-menu-option (selected)=\"onEditTeam()\" [disabled]=\"!perms.canModify\">\n {{ 'teams.detail.editTeam' | translate }}\n </v-overflow-menu-option>\n\n <v-overflow-menu-option\n (selected)=\"onDeleteTeam()\"\n type=\"danger\"\n [disabled]=\"!perms.canDelete\"\n >\n {{ 'teams.detail.deleteTeam' | translate }}\n </v-overflow-menu-option>\n </v-overflow-menu>\n </div>\n </ng-template>\n</ng-container>\n\n<valtimo-team-detail-edit-modal></valtimo-team-detail-edit-modal>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"teams.detail.removeMember\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"teams.detail.removeMemberModal.content\"\n [outputOnConfirm]=\"memberToRemove$ | async\"\n [showModalSubject$]=\"showRemoveMemberModal$\"\n titleTranslationKey=\"teams.detail.removeMemberModal.title\"\n (confirmEvent)=\"onRemoveMemberConfirm($event)\"\n></valtimo-confirmation-modal>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"teams.deleteModal.content\"\n [outputOnConfirm]=\"team$ | async\"\n [showModalSubject$]=\"showDeleteTeamModal$\"\n titleTranslationKey=\"teams.deleteModal.title\"\n (confirmEvent)=\"onDeleteTeamConfirm()\"\n></valtimo-confirmation-modal>\n", styles: [":host ::ng-deep .team-detail__header{display:flex;align-items:center;gap:.75rem;justify-content:flex-end}\n"] }]
|
|
920
|
+
}], ctorParameters: () => [{ type: i3$1.ActivatedRoute }, { type: TeamDetailService }, { type: TeamsApiService }, { type: i3.PageTitleService }, { type: i2$2.PermissionService }] });
|
|
921
|
+
|
|
922
|
+
/*
|
|
923
|
+
* Copyright 2015-2026 Ritense BV, the Netherlands.
|
|
924
|
+
*
|
|
925
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
926
|
+
* you may not use this file except in compliance with the License.
|
|
927
|
+
* You may obtain a copy of the License at
|
|
928
|
+
*
|
|
929
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
930
|
+
*
|
|
931
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
932
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
933
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
934
|
+
* See the License for the specific language governing permissions and
|
|
935
|
+
* limitations under the License.
|
|
936
|
+
*/
|
|
937
|
+
const routes = [
|
|
938
|
+
{
|
|
939
|
+
path: 'teams',
|
|
940
|
+
component: TeamsListComponent,
|
|
941
|
+
canActivate: [AuthGuardService],
|
|
942
|
+
data: { title: 'teams.title', roles: [ROLE_USER] },
|
|
943
|
+
},
|
|
944
|
+
{
|
|
945
|
+
path: 'teams/:teamKey',
|
|
946
|
+
component: TeamDetailComponent,
|
|
947
|
+
canActivate: [AuthGuardService],
|
|
948
|
+
data: { title: 'teams.detail.title', roles: [ROLE_USER], customPageTitle: true },
|
|
949
|
+
},
|
|
950
|
+
];
|
|
951
|
+
class TeamsRouting {
|
|
952
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TeamsRouting, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
953
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.20", ngImport: i0, type: TeamsRouting, imports: [CommonModule, i3$1.RouterModule], exports: [RouterModule] }); }
|
|
954
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TeamsRouting, imports: [CommonModule, RouterModule.forChild(routes), RouterModule] }); }
|
|
955
|
+
}
|
|
956
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TeamsRouting, decorators: [{
|
|
957
|
+
type: NgModule,
|
|
958
|
+
args: [{
|
|
959
|
+
declarations: [],
|
|
960
|
+
imports: [CommonModule, RouterModule.forChild(routes)],
|
|
961
|
+
exports: [RouterModule],
|
|
962
|
+
}]
|
|
963
|
+
}] });
|
|
964
|
+
|
|
965
|
+
/*
|
|
966
|
+
* Copyright 2015-2026 Ritense BV, the Netherlands.
|
|
967
|
+
*
|
|
968
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
969
|
+
* you may not use this file except in compliance with the License.
|
|
970
|
+
* You may obtain a copy of the License at
|
|
971
|
+
*
|
|
972
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
973
|
+
*
|
|
974
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
975
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
976
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
977
|
+
* See the License for the specific language governing permissions and
|
|
978
|
+
* limitations under the License.
|
|
979
|
+
*/
|
|
980
|
+
class TeamsModule {
|
|
981
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TeamsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
982
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.20", ngImport: i0, type: TeamsModule, imports: [TeamsRouting, TeamsListComponent] }); }
|
|
983
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TeamsModule, imports: [TeamsRouting, TeamsListComponent] }); }
|
|
984
|
+
}
|
|
985
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TeamsModule, decorators: [{
|
|
986
|
+
type: NgModule,
|
|
987
|
+
args: [{
|
|
988
|
+
declarations: [],
|
|
989
|
+
imports: [TeamsRouting, TeamsListComponent],
|
|
990
|
+
providers: [],
|
|
991
|
+
}]
|
|
992
|
+
}] });
|
|
993
|
+
|
|
994
|
+
/*
|
|
995
|
+
* Copyright 2015-2026 Ritense BV, the Netherlands.
|
|
996
|
+
*
|
|
997
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
998
|
+
* you may not use this file except in compliance with the License.
|
|
999
|
+
* You may obtain a copy of the License at
|
|
1000
|
+
*
|
|
1001
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1002
|
+
*
|
|
1003
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1004
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1005
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1006
|
+
* See the License for the specific language governing permissions and
|
|
1007
|
+
* limitations under the License.
|
|
1008
|
+
*/
|
|
1009
|
+
/*
|
|
1010
|
+
* Public API Surface of teams
|
|
1011
|
+
*/
|
|
1012
|
+
|
|
1013
|
+
/**
|
|
1014
|
+
* Generated bundle index. Do not edit.
|
|
1015
|
+
*/
|
|
1016
|
+
|
|
1017
|
+
export { CAN_ASSIGN_TEAM_PERMISSION, CAN_CREATE_TEAM_PERMISSION, CAN_DELETE_TEAM_PERMISSION, CAN_MODIFY_TEAM_PERMISSION, CAN_VIEW_USERS_PERMISSION, TEAM_PERMISSION_ACTION, TEAM_PERMISSION_RESOURCE, TeamDetailService, TeamsApiService, TeamsModule, TeamsService, USER_PERMISSION_ACTION, USER_PERMISSION_RESOURCE };
|
|
1018
|
+
//# sourceMappingURL=valtimo-teams.mjs.map
|