ichec-angular-core 0.0.10 → 0.0.12
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/ichec-angular-core.mjs +374 -172
- package/fesm2022/ichec-angular-core.mjs.map +1 -1
- package/index.d.ts +120 -40
- package/package.json +9 -8
- package/styles/styles.scss +95 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { map, catchError, mergeMap, throwError, BehaviorSubject, mergeAll, tap } from 'rxjs';
|
|
2
2
|
import { HttpHeaders, HttpClient } from '@angular/common/http';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { InjectionToken, inject, Injectable,
|
|
4
|
+
import { InjectionToken, inject, Injectable, input, signal, Component, computed, output, viewChild } from '@angular/core';
|
|
5
5
|
import { NgIf, Location, NgFor } from '@angular/common';
|
|
6
6
|
import * as i3 from '@angular/router';
|
|
7
7
|
import { RouterModule, RouterOutlet, Router, ActivatedRoute } from '@angular/router';
|
|
@@ -18,7 +18,7 @@ import { MatSidenavModule } from '@angular/material/sidenav';
|
|
|
18
18
|
import * as i2$2 from '@angular/material/list';
|
|
19
19
|
import { MatListModule } from '@angular/material/list';
|
|
20
20
|
import * as i1$1 from '@angular/forms';
|
|
21
|
-
import { FormsModule } from '@angular/forms';
|
|
21
|
+
import { FormsModule, FormBuilder, ReactiveFormsModule } from '@angular/forms';
|
|
22
22
|
import * as i3$2 from '@angular/material/input';
|
|
23
23
|
import { MatInputModule } from '@angular/material/input';
|
|
24
24
|
import * as i4 from '@angular/material/form-field';
|
|
@@ -26,8 +26,8 @@ import { MatFormFieldModule } from '@angular/material/form-field';
|
|
|
26
26
|
import * as i2$3 from '@angular/material/card';
|
|
27
27
|
import { MatCardModule } from '@angular/material/card';
|
|
28
28
|
import * as i1$2 from '@angular/material/table';
|
|
29
|
-
import { MatTableModule } from '@angular/material/table';
|
|
30
|
-
import * as
|
|
29
|
+
import { MatTable, MatTableModule } from '@angular/material/table';
|
|
30
|
+
import * as i4$1 from '@angular/material/select';
|
|
31
31
|
import { MatSelectModule } from '@angular/material/select';
|
|
32
32
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
33
33
|
|
|
@@ -41,6 +41,9 @@ class PortalMember {
|
|
|
41
41
|
phone = "";
|
|
42
42
|
organization = "";
|
|
43
43
|
profile_url = "";
|
|
44
|
+
constructor(params = {}) {
|
|
45
|
+
Object.assign(this, params);
|
|
46
|
+
}
|
|
44
47
|
}
|
|
45
48
|
class Group {
|
|
46
49
|
name = "";
|
|
@@ -57,6 +60,18 @@ class Organization {
|
|
|
57
60
|
website = "";
|
|
58
61
|
country = "";
|
|
59
62
|
members = [];
|
|
63
|
+
constructor(params = {}) {
|
|
64
|
+
Object.assign(this, params);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
var ErrorCode;
|
|
69
|
+
(function (ErrorCode) {
|
|
70
|
+
ErrorCode[ErrorCode["UnknownError"] = 1] = "UnknownError";
|
|
71
|
+
})(ErrorCode || (ErrorCode = {}));
|
|
72
|
+
class ApiError {
|
|
73
|
+
code = 1;
|
|
74
|
+
text = "";
|
|
60
75
|
}
|
|
61
76
|
|
|
62
77
|
const ENDPOINT_URL = new InjectionToken("Default endpoint url");
|
|
@@ -270,31 +285,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImpor
|
|
|
270
285
|
}], ctorParameters: () => [] });
|
|
271
286
|
|
|
272
287
|
class TopBarComponent {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
userService;
|
|
276
|
-
leftNavService;
|
|
277
|
-
constructor() {
|
|
278
|
-
this.userService = inject(UserService);
|
|
279
|
-
this.leftNavService = inject(LeftNavService);
|
|
280
|
-
}
|
|
288
|
+
title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : []));
|
|
289
|
+
user = signal(null, ...(ngDevMode ? [{ debugName: "user" }] : []));
|
|
290
|
+
userService = inject(UserService);
|
|
291
|
+
leftNavService = inject(LeftNavService);
|
|
281
292
|
ngOnInit() {
|
|
282
293
|
this.userService.loggedInUser.subscribe(user => {
|
|
283
|
-
this.user
|
|
294
|
+
this.user.set(user);
|
|
284
295
|
});
|
|
285
296
|
}
|
|
286
297
|
onLogout() {
|
|
287
298
|
this.userService.logout();
|
|
288
299
|
}
|
|
289
300
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: TopBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
290
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
301
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: TopBarComponent, isStandalone: true, selector: "lib-top-bar", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "\n@if(user(); as user){\n<mat-toolbar style=\"height:60px\">\n <a mat-icon-button aria-label=\"Home\" [routerLink]=\"['home']\">\n <mat-icon>home</mat-icon>\n </a>\n <span>{{title()}}</span>\n <span class=\"topbar-spacer\"></span>\n <span>{{user.username}}</span>\n \n <button mat-icon-button aria-label=\"User Profile\" [matMenuTriggerFor]=\"profile_menu\">\n <mat-icon>person</mat-icon>\n </button>\n\n <mat-menu #profile_menu=\"matMenu\">\n <button mat-menu-item (click)=\"onLogout()\">Log Out</button>\n </mat-menu>\n</mat-toolbar>\n}\n", styles: [".topbar-spacer{flex:1 1 auto}\n"], dependencies: [{ kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: MatToolbarModule }, { kind: "component", type: i2.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i5.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i5.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i5.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }] });
|
|
291
302
|
}
|
|
292
303
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: TopBarComponent, decorators: [{
|
|
293
304
|
type: Component,
|
|
294
|
-
args: [{ selector: 'lib-top-bar', imports: [NgIf, RouterModule, MatToolbarModule, MatIconModule, MatButtonModule, MatMenuModule], template: "\n
|
|
295
|
-
}]
|
|
296
|
-
type: Input
|
|
297
|
-
}] } });
|
|
305
|
+
args: [{ selector: 'lib-top-bar', imports: [NgIf, RouterModule, MatToolbarModule, MatIconModule, MatButtonModule, MatMenuModule], template: "\n@if(user(); as user){\n<mat-toolbar style=\"height:60px\">\n <a mat-icon-button aria-label=\"Home\" [routerLink]=\"['home']\">\n <mat-icon>home</mat-icon>\n </a>\n <span>{{title()}}</span>\n <span class=\"topbar-spacer\"></span>\n <span>{{user.username}}</span>\n \n <button mat-icon-button aria-label=\"User Profile\" [matMenuTriggerFor]=\"profile_menu\">\n <mat-icon>person</mat-icon>\n </button>\n\n <mat-menu #profile_menu=\"matMenu\">\n <button mat-menu-item (click)=\"onLogout()\">Log Out</button>\n </mat-menu>\n</mat-toolbar>\n}\n", styles: [".topbar-spacer{flex:1 1 auto}\n"] }]
|
|
306
|
+
}] });
|
|
298
307
|
|
|
299
308
|
class LeftNavComponent {
|
|
300
309
|
_leftNavService = inject(LeftNavService);
|
|
@@ -312,8 +321,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImpor
|
|
|
312
321
|
const LOGIN_USER = new InjectionToken("Default login user - used for testing");
|
|
313
322
|
class LandingComponent {
|
|
314
323
|
loginUser = inject(LOGIN_USER);
|
|
315
|
-
loginError = "";
|
|
316
|
-
message = "";
|
|
324
|
+
loginError = signal("", ...(ngDevMode ? [{ debugName: "loginError" }] : []));
|
|
325
|
+
message = input(...(ngDevMode ? [undefined, { debugName: "message" }] : []));
|
|
317
326
|
userService = inject(UserService);
|
|
318
327
|
router = inject(Router);
|
|
319
328
|
ngOnInit() {
|
|
@@ -326,81 +335,68 @@ class LandingComponent {
|
|
|
326
335
|
}
|
|
327
336
|
}
|
|
328
337
|
login() {
|
|
329
|
-
this.loginError
|
|
338
|
+
this.loginError.set("");
|
|
330
339
|
return this.userService.login(this.loginUser.name, this.loginUser.password).subscribe({
|
|
331
340
|
next: () => this.onLoggedIn(),
|
|
332
341
|
error: (error) => this.onLoginError(error)
|
|
333
342
|
});
|
|
334
343
|
}
|
|
335
344
|
onLoginError(error) {
|
|
336
|
-
console.log("Got login error");
|
|
337
|
-
|
|
338
|
-
|
|
345
|
+
console.log("Got login error:", error);
|
|
346
|
+
if (error.statusText == "Unknown Error") {
|
|
347
|
+
this.loginError.set("There was an error logging in - server not reachable.");
|
|
348
|
+
}
|
|
349
|
+
else {
|
|
350
|
+
this.loginError.set("There was an error logging in.");
|
|
351
|
+
}
|
|
339
352
|
}
|
|
340
353
|
onLoggedIn() {
|
|
341
354
|
this.router.navigateByUrl("/home");
|
|
342
355
|
}
|
|
343
356
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: LandingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
344
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
357
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: LandingComponent, isStandalone: true, selector: "lib-landing", inputs: { message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "\n @if(message(); as message){\n <p>{{message}}</p>\n }\n \n <mat-card style=\"text-align:center;\">\n <form class=\"base-form\" #loginForm=\"ngForm\" (ngSubmit)=\"login()\">\n <mat-card-content>\n <mat-form-field class=\"form-field\">\n <input matInput\n placeholder=\"Username\"\n type=\"text\"\n [(ngModel)]=\"loginUser.name\"\n name=\"username\"\n required>\n </mat-form-field>\n <mat-form-field class=\"form-field\">\n <input matInput\n placeholder=\"Password\"\n type=\"password\"\n [(ngModel)]=\"loginUser.password\"\n name=\"password\"\n required>\n </mat-form-field>\n </mat-card-content>\n <div *ngIf=\"loginError\" class=\"error\">\n <mat-icon>error</mat-icon><p>{{loginError()}}</p>\n </div>\n <button mat-flat-button\n type=\"submit\"\n [disabled]=\"!loginForm.form.valid\">Log In</button>\n </form>\n </mat-card>\n\n\n \n", styles: [":host{display:flex;align-items:center;flex-grow:1;background-color:#a5b3c9;flex-direction:column}.base-form{padding:10px}.form-field{display:flex}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$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: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i2$3.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i2$3.MatCardContent, selector: "mat-card-content" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
345
358
|
}
|
|
346
359
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: LandingComponent, decorators: [{
|
|
347
360
|
type: Component,
|
|
348
|
-
args: [{ selector: 'lib-landing', imports: [FormsModule, MatCardModule, MatFormFieldModule, MatInputModule, MatButtonModule, MatIconModule, NgIf], template: "\n
|
|
349
|
-
}]
|
|
350
|
-
type: Input
|
|
351
|
-
}] } });
|
|
361
|
+
args: [{ selector: 'lib-landing', imports: [FormsModule, MatCardModule, MatFormFieldModule, MatInputModule, MatButtonModule, MatIconModule, NgIf], template: "\n @if(message(); as message){\n <p>{{message}}</p>\n }\n \n <mat-card style=\"text-align:center;\">\n <form class=\"base-form\" #loginForm=\"ngForm\" (ngSubmit)=\"login()\">\n <mat-card-content>\n <mat-form-field class=\"form-field\">\n <input matInput\n placeholder=\"Username\"\n type=\"text\"\n [(ngModel)]=\"loginUser.name\"\n name=\"username\"\n required>\n </mat-form-field>\n <mat-form-field class=\"form-field\">\n <input matInput\n placeholder=\"Password\"\n type=\"password\"\n [(ngModel)]=\"loginUser.password\"\n name=\"password\"\n required>\n </mat-form-field>\n </mat-card-content>\n <div *ngIf=\"loginError\" class=\"error\">\n <mat-icon>error</mat-icon><p>{{loginError()}}</p>\n </div>\n <button mat-flat-button\n type=\"submit\"\n [disabled]=\"!loginForm.form.valid\">Log In</button>\n </form>\n </mat-card>\n\n\n \n", styles: [":host{display:flex;align-items:center;flex-grow:1;background-color:#a5b3c9;flex-direction:column}.base-form{padding:10px}.form-field{display:flex}\n"] }]
|
|
362
|
+
}] });
|
|
352
363
|
|
|
353
364
|
class DetailView {
|
|
354
|
-
item;
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
this._route = _route;
|
|
361
|
-
this._location = _location;
|
|
362
|
-
this._userService = _userService;
|
|
363
|
-
this._restService = _restService;
|
|
365
|
+
item = signal(null, ...(ngDevMode ? [{ debugName: "item" }] : []));
|
|
366
|
+
route = inject(ActivatedRoute);
|
|
367
|
+
userService = inject(UserService);
|
|
368
|
+
restService;
|
|
369
|
+
constructor(restService) {
|
|
370
|
+
this.restService = restService;
|
|
364
371
|
}
|
|
365
372
|
onInit() {
|
|
366
373
|
this.getItem();
|
|
367
374
|
}
|
|
368
375
|
onItemAvailable() {
|
|
369
|
-
this.
|
|
376
|
+
this.userService.loggedInUser.subscribe(user => { if (user) {
|
|
370
377
|
this.onItemAndUserAvailable(user);
|
|
371
378
|
} });
|
|
372
379
|
}
|
|
373
380
|
onItemAndUserAvailable(_) { }
|
|
374
|
-
goBack() {
|
|
375
|
-
this._location.back();
|
|
376
|
-
}
|
|
377
381
|
getItem() {
|
|
378
|
-
const id = Number(this.
|
|
379
|
-
this.
|
|
380
|
-
.
|
|
381
|
-
this.item = item;
|
|
382
|
+
const id = Number(this.route.snapshot.paramMap.get('id'));
|
|
383
|
+
this.restService.getItem(id).subscribe(item => {
|
|
384
|
+
this.item.set(item);
|
|
382
385
|
this.onItemAvailable();
|
|
383
386
|
});
|
|
384
387
|
}
|
|
385
|
-
update() {
|
|
386
|
-
if (!this.item) {
|
|
387
|
-
return;
|
|
388
|
-
}
|
|
389
|
-
this._restService.putItem(this.item).subscribe(item => this.item = item);
|
|
390
|
-
}
|
|
391
388
|
}
|
|
392
389
|
|
|
393
390
|
class EditView {
|
|
394
|
-
|
|
395
|
-
createMode = false;
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
391
|
+
typename = "";
|
|
392
|
+
createMode = signal(false, ...(ngDevMode ? [{ debugName: "createMode" }] : []));
|
|
393
|
+
heading = computed(() => { const prefix = this.createMode() ? "New " : "Edit "; return prefix + this.typename; }, ...(ngDevMode ? [{ debugName: "heading" }] : []));
|
|
394
|
+
item = signal(null, ...(ngDevMode ? [{ debugName: "item" }] : []));
|
|
395
|
+
_route = inject(ActivatedRoute);
|
|
396
|
+
_location = inject(Location);
|
|
397
|
+
_userService = inject(UserService);
|
|
399
398
|
_restService;
|
|
400
|
-
constructor(
|
|
401
|
-
this._route = _route;
|
|
402
|
-
this._location = _location;
|
|
403
|
-
this._userService = _userService;
|
|
399
|
+
constructor(_restServce) {
|
|
404
400
|
this._restService = _restServce;
|
|
405
401
|
}
|
|
406
402
|
onInit() {
|
|
@@ -416,32 +412,44 @@ class EditView {
|
|
|
416
412
|
goBack() {
|
|
417
413
|
this._location.back();
|
|
418
414
|
}
|
|
415
|
+
submit() {
|
|
416
|
+
if (this.item()) {
|
|
417
|
+
this.save();
|
|
418
|
+
}
|
|
419
|
+
}
|
|
419
420
|
save() {
|
|
420
|
-
if (this.createMode) {
|
|
421
|
+
if (this.createMode()) {
|
|
421
422
|
this.createItem();
|
|
422
423
|
}
|
|
423
424
|
else {
|
|
424
425
|
this.updateItem();
|
|
425
426
|
}
|
|
426
427
|
}
|
|
428
|
+
cancel() {
|
|
429
|
+
this.goBack();
|
|
430
|
+
}
|
|
431
|
+
fetchRestOptions() {
|
|
432
|
+
this._restService.getOptions().subscribe(options => this.onOptions(options));
|
|
433
|
+
}
|
|
434
|
+
onUploadedFileReady(_file) {
|
|
435
|
+
}
|
|
436
|
+
onFileRead(_content) {
|
|
437
|
+
}
|
|
427
438
|
createItem() {
|
|
428
|
-
|
|
429
|
-
|
|
439
|
+
const item = this.item();
|
|
440
|
+
if (item) {
|
|
441
|
+
this._restService.postItem(item).subscribe(item => this.saveFiles(item));
|
|
430
442
|
}
|
|
431
|
-
this._restService.postItem(this.item).subscribe(item => this.saveFiles(item));
|
|
432
443
|
}
|
|
433
444
|
updateItem() {
|
|
434
|
-
|
|
435
|
-
|
|
445
|
+
const item = this.item();
|
|
446
|
+
if (item) {
|
|
447
|
+
this._restService.putItem(item).subscribe(item => this.saveFiles(item));
|
|
436
448
|
}
|
|
437
|
-
this._restService.putItem(this.item).subscribe(item => this.saveFiles(item));
|
|
438
449
|
}
|
|
439
450
|
saveFiles(item) {
|
|
440
451
|
this.onItemUpdated(item);
|
|
441
452
|
}
|
|
442
|
-
cancel() {
|
|
443
|
-
this.goBack();
|
|
444
|
-
}
|
|
445
453
|
isCreateRoute() {
|
|
446
454
|
const urls = this._route.snapshot.url;
|
|
447
455
|
if (!urls) {
|
|
@@ -456,37 +464,44 @@ class EditView {
|
|
|
456
464
|
}
|
|
457
465
|
getItem() {
|
|
458
466
|
if (this.isCreateRoute()) {
|
|
459
|
-
this.item
|
|
460
|
-
this.createMode
|
|
467
|
+
this.item.set(this.getTemplateItem());
|
|
468
|
+
this.createMode.set(true);
|
|
461
469
|
this.onItemAvailable();
|
|
462
470
|
}
|
|
463
471
|
else {
|
|
464
472
|
const id_str = this._route.snapshot.paramMap.get('id');
|
|
465
473
|
this._restService.getItem(Number(id_str))
|
|
466
474
|
.subscribe(item => {
|
|
467
|
-
this.item
|
|
475
|
+
this.item.set(item);
|
|
468
476
|
this.onItemAvailable();
|
|
469
477
|
});
|
|
470
478
|
}
|
|
471
479
|
}
|
|
472
480
|
onItemUpdated(item) {
|
|
473
|
-
this.item
|
|
481
|
+
this.item.set(item);
|
|
474
482
|
this.goBack();
|
|
475
483
|
}
|
|
484
|
+
onOptions(options) {
|
|
485
|
+
if (!options.actions) {
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
if ('POST' in options.actions) {
|
|
489
|
+
this.onPostActions(options.actions['POST']);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
onPostActions(_actions) {
|
|
493
|
+
}
|
|
476
494
|
}
|
|
477
495
|
|
|
478
496
|
class ListView {
|
|
479
497
|
user;
|
|
480
|
-
items = [];
|
|
498
|
+
items = signal([], ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
481
499
|
displayedColumns = [];
|
|
482
|
-
_route;
|
|
483
|
-
_location;
|
|
484
|
-
_userService;
|
|
500
|
+
_route = inject(ActivatedRoute);
|
|
501
|
+
_location = inject(Location);
|
|
502
|
+
_userService = inject(UserService);
|
|
485
503
|
_restService;
|
|
486
|
-
constructor(
|
|
487
|
-
this._route = _route;
|
|
488
|
-
this._location = _location;
|
|
489
|
-
this._userService = _userService;
|
|
504
|
+
constructor(_restService) {
|
|
490
505
|
this._restService = _restService;
|
|
491
506
|
}
|
|
492
507
|
onInit() {
|
|
@@ -501,12 +516,12 @@ class ListView {
|
|
|
501
516
|
});
|
|
502
517
|
}
|
|
503
518
|
else {
|
|
504
|
-
this._restService.get().subscribe(items => this.items
|
|
519
|
+
this._restService.get().subscribe(items => this.items.set(items));
|
|
505
520
|
}
|
|
506
521
|
}
|
|
507
522
|
onUserChange(user) {
|
|
508
523
|
this.user = user;
|
|
509
|
-
this._restService.getForUser(this.user).subscribe(items => this.items
|
|
524
|
+
this._restService.getForUser(this.user).subscribe(items => this.items.set(items));
|
|
510
525
|
}
|
|
511
526
|
isSelfList() {
|
|
512
527
|
const url_segments = this._route.snapshot.url;
|
|
@@ -522,126 +537,265 @@ class ListView {
|
|
|
522
537
|
}
|
|
523
538
|
}
|
|
524
539
|
|
|
540
|
+
class BackButtonComponent {
|
|
541
|
+
location = inject(Location);
|
|
542
|
+
goBack() {
|
|
543
|
+
this.location.back();
|
|
544
|
+
}
|
|
545
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: BackButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
546
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.1", type: BackButtonComponent, isStandalone: true, selector: "lib-back-button", ngImport: i0, template: "<a mat-icon-button class=\"padded-button\"\n (click)=\"goBack()\"\n (keydown)=\"goBack()\"\n tabindex=\"0\"\n role=\"button\">\n<mat-icon>arrow_back</mat-icon>\n</a>\n\n", styles: [".padded-button{padding:5px}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }] });
|
|
547
|
+
}
|
|
548
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: BackButtonComponent, decorators: [{
|
|
549
|
+
type: Component,
|
|
550
|
+
args: [{ selector: 'lib-back-button', imports: [MatIconModule, MatButtonModule], template: "<a mat-icon-button class=\"padded-button\"\n (click)=\"goBack()\"\n (keydown)=\"goBack()\"\n tabindex=\"0\"\n role=\"button\">\n<mat-icon>arrow_back</mat-icon>\n</a>\n\n", styles: [".padded-button{padding:5px}\n"] }]
|
|
551
|
+
}] });
|
|
552
|
+
|
|
553
|
+
class DetailHeaderComponent {
|
|
554
|
+
id = input(0, ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
555
|
+
text = input("", ...(ngDevMode ? [{ debugName: "text" }] : []));
|
|
556
|
+
route = input("", ...(ngDevMode ? [{ debugName: "route" }] : []));
|
|
557
|
+
fullRoute = computed(() => "/" + this.route() + "s/edit/", ...(ngDevMode ? [{ debugName: "fullRoute" }] : []));
|
|
558
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: DetailHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
559
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.1", type: DetailHeaderComponent, isStandalone: true, selector: "lib-detail-header", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, route: { classPropertyName: "route", publicName: "route", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"container\">\n <h3 class=\"header\">{{text()}}</h3>\n <a mat-mini-fab class=\"button\"\n [routerLink]=\"[fullRoute(), id()]\">\n <mat-icon>edit</mat-icon>\n </a>\n</div>\n", styles: [".container{width:100%;max-width:500px}.header{display:inline;width:100%;max-width:100px}.button{padding:10px}\n"], dependencies: [{ kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatMiniFabButton, selector: "button[mat-mini-fab], a[mat-mini-fab], button[matMiniFab], a[matMiniFab]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
560
|
+
}
|
|
561
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: DetailHeaderComponent, decorators: [{
|
|
562
|
+
type: Component,
|
|
563
|
+
args: [{ selector: 'lib-detail-header', imports: [RouterModule,
|
|
564
|
+
MatButtonModule,
|
|
565
|
+
MatIconModule], template: "<div class=\"container\">\n <h3 class=\"header\">{{text()}}</h3>\n <a mat-mini-fab class=\"button\"\n [routerLink]=\"[fullRoute(), id()]\">\n <mat-icon>edit</mat-icon>\n </a>\n</div>\n", styles: [".container{width:100%;max-width:500px}.header{display:inline;width:100%;max-width:100px}.button{padding:10px}\n"] }]
|
|
566
|
+
}] });
|
|
567
|
+
|
|
525
568
|
class UserDetailComponent extends DetailView {
|
|
569
|
+
typename = "user";
|
|
526
570
|
constructor() {
|
|
527
|
-
super(inject(
|
|
571
|
+
super(inject(UserService));
|
|
528
572
|
}
|
|
529
573
|
ngOnInit() {
|
|
530
574
|
this.onInit();
|
|
531
575
|
}
|
|
532
576
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: UserDetailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
533
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
577
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: UserDetailComponent, isStandalone: true, selector: "lib-user-detail", usesInheritance: true, ngImport: i0, template: "<lib-back-button></lib-back-button>\n\n<div class=\"content-container\">\n @if(item(); as item){\n <div class=\"item-detail-container\">\n\n <lib-detail-header\n [text]=\"item.username\"\n [id]=\"item.id\"\n [route]=\"typename\"></lib-detail-header>\n\n @if(item.profile_url){\n <div class=\"image-holder\">\n <img alt=\"User Profile Image\" src=\"{{item.url}}{{item.profile_url}}\" style=\"height:120px;\">\n </div> \n }\n \n <div class=\"item-field\">\n <span><b>Email: </b></span>\n {{item.email}}\n </div>\n \n <div class=\"item-field\">\n <span><b>First Name: </b></span>\n {{item.first_name}}\n </div>\n \n <div class=\"item-field\">\n <span><b>Last Name: </b></span>\n {{item.last_name}}\n </div>\n \n </div>\n }\n</div>\n", styles: [":host{flex-grow:1}\n"], dependencies: [{ kind: "component", type: BackButtonComponent, selector: "lib-back-button" }, { kind: "component", type: DetailHeaderComponent, selector: "lib-detail-header", inputs: ["id", "text", "route"] }] });
|
|
534
578
|
}
|
|
535
579
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: UserDetailComponent, decorators: [{
|
|
536
580
|
type: Component,
|
|
537
581
|
args: [{ selector: 'lib-user-detail', imports: [NgIf,
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
MatIconModule], template: "<div>\n <a mat-icon-button class=\"padded_button\"\n (click)=\"goBack()\"\n (keydown)=\"goBack()\"\n tabindex=\"0\"\n role=\"button\">\n <mat-icon>arrow_back</mat-icon>\n </a>\n</div>\n \n<div class=\"container\">\n <div *ngIf=\"item\" class=\"item_view\">\n \n <div style=\"width:100%; max-width:500px\">\n <h3 class=\"item_heading\">{{item.username}} </h3>\n <a mat-mini-fab\n class=\"btn-block\"\n [routerLink]=\"['/users/edit/', item.id]\">\n <mat-icon>edit</mat-icon>\n </a>\n </div>\n\n <div *ngIf=\"item.profile_url\" class=\"image_holder\">\n <img alt=\"User Profile Image\" src=\"{{item.url}}{{item.profile_url}}\" style=\"height:120px;\">\n </div> \n \n <div class=\"item_field\">\n <span><b>Email: </b></span>\n {{item.email}}\n </div>\n \n <div class=\"item_field\">\n <span><b>First Name: </b></span>\n {{item.first_name}}\n </div>\n \n <div class=\"item_field\">\n <span><b>Last Name: </b></span>\n {{item.last_name}}\n </div>\n \n </div> \n</div>\n", styles: [":host{flex-grow:1}.container{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:5px}.item_view{display:flex;justify-content:center;align-items:center;flex-direction:column;padding:5px}.image_holder{display:flex;justify-content:center;align-items:center;overflow:hidden;padding:5px}.item_heading{display:inline;width:100%;max-width:100px}.item_field,.padded_button{padding:5px}\n"] }]
|
|
582
|
+
BackButtonComponent,
|
|
583
|
+
DetailHeaderComponent], template: "<lib-back-button></lib-back-button>\n\n<div class=\"content-container\">\n @if(item(); as item){\n <div class=\"item-detail-container\">\n\n <lib-detail-header\n [text]=\"item.username\"\n [id]=\"item.id\"\n [route]=\"typename\"></lib-detail-header>\n\n @if(item.profile_url){\n <div class=\"image-holder\">\n <img alt=\"User Profile Image\" src=\"{{item.url}}{{item.profile_url}}\" style=\"height:120px;\">\n </div> \n }\n \n <div class=\"item-field\">\n <span><b>Email: </b></span>\n {{item.email}}\n </div>\n \n <div class=\"item-field\">\n <span><b>First Name: </b></span>\n {{item.first_name}}\n </div>\n \n <div class=\"item-field\">\n <span><b>Last Name: </b></span>\n {{item.last_name}}\n </div>\n \n </div>\n }\n</div>\n", styles: [":host{flex-grow:1}\n"] }]
|
|
541
584
|
}], ctorParameters: () => [] });
|
|
542
585
|
|
|
586
|
+
class FileUploadComponent {
|
|
587
|
+
files = input([], ...(ngDevMode ? [{ debugName: "files" }] : []));
|
|
588
|
+
previewLoaded = output();
|
|
589
|
+
fileUploaded = output();
|
|
590
|
+
onPreviewRead(name, content) {
|
|
591
|
+
this.previewLoaded.emit({ name: name, content: content });
|
|
592
|
+
}
|
|
593
|
+
onFileUpload(name, event) {
|
|
594
|
+
if (!event.target) {
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
const input_element = event.target;
|
|
598
|
+
if (input_element.files && input_element.files.length > 0) {
|
|
599
|
+
const file = input_element.files[0];
|
|
600
|
+
this.fileUploaded.emit({ name: name, file: file });
|
|
601
|
+
const record = this.files().find(f => f.name == name);
|
|
602
|
+
if (record && record.file_type == "image") {
|
|
603
|
+
this.readFile(name, file);
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
readFile(name, file) {
|
|
608
|
+
const reader = new FileReader();
|
|
609
|
+
reader.readAsDataURL(file);
|
|
610
|
+
reader.onload = () => {
|
|
611
|
+
if (reader.result) {
|
|
612
|
+
this.previewLoaded.emit({ name: name, content: reader.result });
|
|
613
|
+
}
|
|
614
|
+
;
|
|
615
|
+
};
|
|
616
|
+
}
|
|
617
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: FileUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
618
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: FileUploadComponent, isStandalone: true, selector: "lib-file-upload", inputs: { files: { classPropertyName: "files", publicName: "files", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { previewLoaded: "previewLoaded", fileUploaded: "fileUploaded" }, ngImport: i0, template: "<div class=\"container\">\n @for( file of files(); track file.name)\n {\n @if (file.local)\n {\n <div class=\"image_holder\">\n <p>Update {{file.display_name}}</p>\n <img alt=\"{{file.display_name}}\" src=\"{{file.local}}\" style=\"height:120px;\">\n </div> \n }\n @else\n {\n @if (file.remote){\n <div class=\"image_holder\">\n <p>Update {{file.display_name}}</p>\n <img alt=\"{{file.display_name}}\" src=\"{{file.remote}}\" style=\"height:120px;\">\n </div>\n }\n @else {\n <div>\n <span>Upload a {{file.display_name}}</span>\n </div> \n }\n \n }\n\n <div class=\"button-row\">\n <button mat-mini-fab (click)=\"fileInput.click()\">\n <mat-icon>attachment</mat-icon>\n </button>\n <input hidden type=\"file\" #fileInput (change)=\"onFileUpload(file.name, $event)\"/>\n </div> \n } \n</div>\n", styles: [".container{padding:10px;display:flex;justify-content:center;text-align:center;flex-direction:column;max-width:300px}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatMiniFabButton, selector: "button[mat-mini-fab], a[mat-mini-fab], button[matMiniFab], a[matMiniFab]", exportAs: ["matButton", "matAnchor"] }] });
|
|
619
|
+
}
|
|
620
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: FileUploadComponent, decorators: [{
|
|
621
|
+
type: Component,
|
|
622
|
+
args: [{ selector: 'lib-file-upload', imports: [MatIconModule, MatButtonModule], template: "<div class=\"container\">\n @for( file of files(); track file.name)\n {\n @if (file.local)\n {\n <div class=\"image_holder\">\n <p>Update {{file.display_name}}</p>\n <img alt=\"{{file.display_name}}\" src=\"{{file.local}}\" style=\"height:120px;\">\n </div> \n }\n @else\n {\n @if (file.remote){\n <div class=\"image_holder\">\n <p>Update {{file.display_name}}</p>\n <img alt=\"{{file.display_name}}\" src=\"{{file.remote}}\" style=\"height:120px;\">\n </div>\n }\n @else {\n <div>\n <span>Upload a {{file.display_name}}</span>\n </div> \n }\n \n }\n\n <div class=\"button-row\">\n <button mat-mini-fab (click)=\"fileInput.click()\">\n <mat-icon>attachment</mat-icon>\n </button>\n <input hidden type=\"file\" #fileInput (change)=\"onFileUpload(file.name, $event)\"/>\n </div> \n } \n</div>\n", styles: [".container{padding:10px;display:flex;justify-content:center;text-align:center;flex-direction:column;max-width:300px}\n"] }]
|
|
623
|
+
}] });
|
|
624
|
+
|
|
625
|
+
class FileRecord {
|
|
626
|
+
name = "";
|
|
627
|
+
display_name = "";
|
|
628
|
+
file_type = "standard";
|
|
629
|
+
file = null;
|
|
630
|
+
remote = "";
|
|
631
|
+
local = "";
|
|
632
|
+
constructor(params = {}) {
|
|
633
|
+
Object.assign(this, params);
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
|
|
543
637
|
class UserEditComponent extends EditView {
|
|
544
|
-
|
|
545
|
-
|
|
638
|
+
typename = "User";
|
|
639
|
+
files = signal([new FileRecord({ name: "image",
|
|
640
|
+
display_name: "Profile Image",
|
|
641
|
+
file_type: "image" })], ...(ngDevMode ? [{ debugName: "files" }] : []));
|
|
642
|
+
formBuilder = inject(FormBuilder);
|
|
643
|
+
form = this.formBuilder.group({
|
|
644
|
+
username: [''],
|
|
645
|
+
email: [''],
|
|
646
|
+
first_name: [''],
|
|
647
|
+
last_name: [''],
|
|
648
|
+
phone: ['']
|
|
649
|
+
});
|
|
546
650
|
constructor() {
|
|
547
|
-
super(inject(
|
|
651
|
+
super(inject(UserService));
|
|
548
652
|
}
|
|
549
653
|
ngOnInit() {
|
|
550
654
|
this.onInit();
|
|
551
655
|
}
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
if (this.image) {
|
|
557
|
-
this._restService.postFile(item.id, "image", this.image).subscribe(item => this.onItemUpdated(item));
|
|
656
|
+
onItemAvailable() {
|
|
657
|
+
const item = this.item();
|
|
658
|
+
if (!item) {
|
|
659
|
+
return;
|
|
558
660
|
}
|
|
559
|
-
|
|
560
|
-
|
|
661
|
+
this.form.setValue({
|
|
662
|
+
username: item.username,
|
|
663
|
+
email: item.email,
|
|
664
|
+
first_name: item.first_name,
|
|
665
|
+
last_name: item.last_name,
|
|
666
|
+
phone: item.phone
|
|
667
|
+
});
|
|
668
|
+
if (item.profile_url) {
|
|
669
|
+
this.files.update(files => { const file = files.find(f => f.name === "image"); if (file) {
|
|
670
|
+
file.remote = item.url + item.profile_url;
|
|
671
|
+
} ; return files; });
|
|
561
672
|
}
|
|
673
|
+
super.onItemAvailable();
|
|
562
674
|
}
|
|
563
675
|
submit() {
|
|
564
|
-
if (
|
|
565
|
-
this.
|
|
566
|
-
}
|
|
676
|
+
this.item.update((item) => { if (item) {
|
|
677
|
+
item = this.updateFromForm(item);
|
|
678
|
+
} return item; });
|
|
679
|
+
console.log(this.item());
|
|
680
|
+
super.submit();
|
|
681
|
+
}
|
|
682
|
+
updateFromForm(item) {
|
|
683
|
+
item.username = this.form.value.username || "";
|
|
684
|
+
item.email = this.form.value.email || "";
|
|
685
|
+
item.first_name = this.form.value.first_name || "";
|
|
686
|
+
item.last_name = this.form.value.last_name || "";
|
|
687
|
+
item.phone = this.form.value.phone || "";
|
|
688
|
+
return item;
|
|
567
689
|
}
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
690
|
+
getTemplateItem() {
|
|
691
|
+
return new PortalMember();
|
|
692
|
+
}
|
|
693
|
+
onPreviewLoaded(preview) {
|
|
694
|
+
this.files.update(files => { const file = files.find(f => f.name === preview.name); if (file) {
|
|
695
|
+
file.local = preview.content;
|
|
696
|
+
} ; return files; });
|
|
697
|
+
}
|
|
698
|
+
onFileUploaded(upload) {
|
|
699
|
+
this.files.update(files => { const file = files.find(f => f.name === upload.name); if (file) {
|
|
700
|
+
file.file = upload.file;
|
|
701
|
+
} ; return files; });
|
|
702
|
+
}
|
|
703
|
+
saveFiles(item) {
|
|
704
|
+
this.files().forEach(record => { if (record.file) {
|
|
705
|
+
this._restService.postFile(item.id, record.name, record.file).subscribe(item => this.onItemUpdated(item));
|
|
706
|
+
} ; });
|
|
581
707
|
}
|
|
582
708
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: UserEditComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
583
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
709
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: UserEditComponent, isStandalone: true, selector: "lib-user-edit", usesInheritance: true, ngImport: i0, template: "<lib-back-button></lib-back-button>\n\n<div class=\"content-container\">\n\n @if(item(); as item){\n <div class=\"item-edit-container\">\n\n <h1 class=\"item-edit-header\">{{heading()}}</h1>\n\n <form class=\"form-card\" [formGroup]=\"form\" (ngSubmit)=\"submit()\">\n <mat-form-field class=\"form-field-wide\">\n <mat-label>Username</mat-label>\n <input matInput\n placeholder=\"Username\"\n type=\"text\"\n formControlName=\"username\"\n name=\"username\">\n </mat-form-field>\n \n <mat-form-field class=\"form-field-wide\">\n <mat-label>Email</mat-label>\n <input matInput\n placeholder=\"Email\"\n type=\"text\"\n formControlName=\"email\"\n name=\"email\">\n </mat-form-field>\n\n <mat-form-field class=\"form-field\">\n <mat-label>First Name</mat-label>\n <input matInput\n placeholder=\"First Name\"\n type=\"text\"\n formControlName=\"first_name\"\n name=\"first_name\">\n </mat-form-field>\n \n <mat-form-field class=\"form-field\">\n <mat-label>Last Name</mat-label>\n <input matInput\n placeholder=\"Last Name\"\n type=\"text\"\n formControlName=\"last_name\"\n name=\"last_name\">\n </mat-form-field>\n\n <lib-file-upload [files]=\"files()\"\n (previewLoaded)=\"onPreviewLoaded($event)\"\n (fileUploaded)=\"onFileUploaded($event)\"></lib-file-upload>\n \n <div class=\"button_group\">\n <button mat-fab\n class=\"form_action_button\"\n type=\"submit\"\n [disabled]=\"!form.valid\">\n <mat-icon>save</mat-icon></button>\n \n <button mat-fab\n class=\"form_action_button\"\n (click)=\"cancel()\">\n <mat-icon>cancel</mat-icon></button>\n </div>\n \n </form>\n </div>\n }\n</div>\n", styles: [":host{flex-grow:1}.item_view{display:flex;justify-content:left;align-items:left;flex-direction:column}.checkbox_group{justify-content:left;display:flex;flex-direction:column}.button_group{margin:10px;display:flex;flex-direction:row;justify-content:center}.btn-block{padding:5px}.form_action_button{padding:5px;margin:5px}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$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: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatFabButton, selector: "button[mat-fab], a[mat-fab], button[matFab], a[matFab]", inputs: ["extended"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: BackButtonComponent, selector: "lib-back-button" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: FileUploadComponent, selector: "lib-file-upload", inputs: ["files"], outputs: ["previewLoaded", "fileUploaded"] }] });
|
|
584
710
|
}
|
|
585
711
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: UserEditComponent, decorators: [{
|
|
586
712
|
type: Component,
|
|
587
713
|
args: [{ selector: 'lib-user-edit', imports: [NgIf,
|
|
588
|
-
|
|
589
|
-
RouterModule,
|
|
714
|
+
ReactiveFormsModule,
|
|
590
715
|
MatButtonModule,
|
|
591
|
-
|
|
716
|
+
BackButtonComponent,
|
|
592
717
|
MatInputModule,
|
|
593
718
|
MatFormFieldModule,
|
|
594
719
|
MatIconModule,
|
|
595
|
-
|
|
720
|
+
FileUploadComponent
|
|
721
|
+
], template: "<lib-back-button></lib-back-button>\n\n<div class=\"content-container\">\n\n @if(item(); as item){\n <div class=\"item-edit-container\">\n\n <h1 class=\"item-edit-header\">{{heading()}}</h1>\n\n <form class=\"form-card\" [formGroup]=\"form\" (ngSubmit)=\"submit()\">\n <mat-form-field class=\"form-field-wide\">\n <mat-label>Username</mat-label>\n <input matInput\n placeholder=\"Username\"\n type=\"text\"\n formControlName=\"username\"\n name=\"username\">\n </mat-form-field>\n \n <mat-form-field class=\"form-field-wide\">\n <mat-label>Email</mat-label>\n <input matInput\n placeholder=\"Email\"\n type=\"text\"\n formControlName=\"email\"\n name=\"email\">\n </mat-form-field>\n\n <mat-form-field class=\"form-field\">\n <mat-label>First Name</mat-label>\n <input matInput\n placeholder=\"First Name\"\n type=\"text\"\n formControlName=\"first_name\"\n name=\"first_name\">\n </mat-form-field>\n \n <mat-form-field class=\"form-field\">\n <mat-label>Last Name</mat-label>\n <input matInput\n placeholder=\"Last Name\"\n type=\"text\"\n formControlName=\"last_name\"\n name=\"last_name\">\n </mat-form-field>\n\n <lib-file-upload [files]=\"files()\"\n (previewLoaded)=\"onPreviewLoaded($event)\"\n (fileUploaded)=\"onFileUploaded($event)\"></lib-file-upload>\n \n <div class=\"button_group\">\n <button mat-fab\n class=\"form_action_button\"\n type=\"submit\"\n [disabled]=\"!form.valid\">\n <mat-icon>save</mat-icon></button>\n \n <button mat-fab\n class=\"form_action_button\"\n (click)=\"cancel()\">\n <mat-icon>cancel</mat-icon></button>\n </div>\n \n </form>\n </div>\n }\n</div>\n", styles: [":host{flex-grow:1}.item_view{display:flex;justify-content:left;align-items:left;flex-direction:column}.checkbox_group{justify-content:left;display:flex;flex-direction:column}.button_group{margin:10px;display:flex;flex-direction:row;justify-content:center}.btn-block{padding:5px}.form_action_button{padding:5px;margin:5px}\n"] }]
|
|
596
722
|
}], ctorParameters: () => [] });
|
|
597
723
|
|
|
598
724
|
class UserComponent extends ListView {
|
|
599
725
|
constructor() {
|
|
600
|
-
super(inject(
|
|
726
|
+
super(inject(UserService));
|
|
601
727
|
}
|
|
602
728
|
ngOnInit() {
|
|
603
729
|
this.onInit();
|
|
604
730
|
}
|
|
605
731
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: UserComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
606
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: UserComponent, isStandalone: true, selector: "lib-user", usesInheritance: true, ngImport: i0, template: "<div class=\"container\">\n <mat-nav-list>\n @for (item of items; track item){\n <mat-card mat-list-item class=\"item-card\"
|
|
732
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: UserComponent, isStandalone: true, selector: "lib-user", usesInheritance: true, ngImport: i0, template: "<div class=\"content-container\">\n <mat-nav-list>\n @for (item of items(); track item.id){\n <mat-card mat-list-item class=\"item-card\" [routerLink]=\"['/users/detail/', item.id]\" [routerLinkActive]=\"['is-active']\">\n <mat-card-header>\n <mat-card-title-group style=\"padding:5px\">\n <mat-card-title>{{item.first_name}} {{item.last_name}}</mat-card-title>\n <mat-card-subtitle>{{item.username}}</mat-card-subtitle> \n </mat-card-title-group>\n </mat-card-header>\n \n <mat-card-content>\n <p>Email: {{item.email}} </p>\n </mat-card-content>\n </mat-card>\n }\n </mat-nav-list>\n\n</div>\n", styles: [":host{flex-grow:1}.mat-mdc-row .mat-mdc-cell{border-bottom:1px solid transparent;border-top:1px solid transparent;cursor:pointer}.mat-mdc-row:hover .mat-mdc-cell{border-color:currentColor}.is-active{font-weight:700}\n"], dependencies: [{ kind: "ngmodule", type: MatListModule }, { kind: "component", type: i2$2.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i2$3.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i2$3.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i2$3.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i2$3.MatCardSubtitle, selector: "mat-card-subtitle, [mat-card-subtitle], [matCardSubtitle]" }, { kind: "directive", type: i2$3.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "component", type: i2$3.MatCardTitleGroup, selector: "mat-card-title-group" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i3.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }] });
|
|
607
733
|
}
|
|
608
734
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: UserComponent, decorators: [{
|
|
609
735
|
type: Component,
|
|
610
736
|
args: [{ selector: 'lib-user', imports: [MatListModule, MatCardModule,
|
|
611
737
|
MatButtonModule,
|
|
612
738
|
MatIconModule,
|
|
613
|
-
RouterModule], template: "<div class=\"container\">\n <mat-nav-list>\n @for (item of items; track item){\n <mat-card mat-list-item class=\"item-card\"
|
|
739
|
+
RouterModule], template: "<div class=\"content-container\">\n <mat-nav-list>\n @for (item of items(); track item.id){\n <mat-card mat-list-item class=\"item-card\" [routerLink]=\"['/users/detail/', item.id]\" [routerLinkActive]=\"['is-active']\">\n <mat-card-header>\n <mat-card-title-group style=\"padding:5px\">\n <mat-card-title>{{item.first_name}} {{item.last_name}}</mat-card-title>\n <mat-card-subtitle>{{item.username}}</mat-card-subtitle> \n </mat-card-title-group>\n </mat-card-header>\n \n <mat-card-content>\n <p>Email: {{item.email}} </p>\n </mat-card-content>\n </mat-card>\n }\n </mat-nav-list>\n\n</div>\n", styles: [":host{flex-grow:1}.mat-mdc-row .mat-mdc-cell{border-bottom:1px solid transparent;border-top:1px solid transparent;cursor:pointer}.mat-mdc-row:hover .mat-mdc-cell{border-color:currentColor}.is-active{font-weight:700}\n"] }]
|
|
614
740
|
}], ctorParameters: () => [] });
|
|
615
741
|
|
|
742
|
+
class UserSelectComponent {
|
|
743
|
+
toAdd = signal(0, ...(ngDevMode ? [{ debugName: "toAdd" }] : []));
|
|
744
|
+
selected = input([], ...(ngDevMode ? [{ debugName: "selected" }] : []));
|
|
745
|
+
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
746
|
+
itemAdded = output();
|
|
747
|
+
itemRemoved = output();
|
|
748
|
+
table = viewChild(MatTable, ...(ngDevMode ? [{ debugName: "table" }] : []));
|
|
749
|
+
tableColumns = ["first_name", "last_name", "email", "remove"];
|
|
750
|
+
remove(id) {
|
|
751
|
+
this.itemRemoved.emit(id);
|
|
752
|
+
this.table()?.renderRows();
|
|
753
|
+
}
|
|
754
|
+
add() {
|
|
755
|
+
this.itemAdded.emit(this.toAdd());
|
|
756
|
+
this.table()?.renderRows();
|
|
757
|
+
}
|
|
758
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: UserSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
759
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: UserSelectComponent, isStandalone: true, selector: "lib-user-select", inputs: { selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemAdded: "itemAdded", itemRemoved: "itemRemoved" }, viewQueries: [{ propertyName: "table", first: true, predicate: MatTable, descendants: true, isSignal: true }], ngImport: i0, template: "<div class='select-container'>\n <p style=\"padding:5px\">\n <b>Members</b>\n </p>\n \n <div>\n <mat-form-field>\n <mat-label>Add Member</mat-label>\n <mat-select [(ngModel)]=\"toAdd\" name=\"to_add\">\n @for(item of options(); track item.id){\n <mat-option [value]=\"item.id\">{{item.username}}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n \n <button mat-mini-fab\n type=\"button\"\n class=\"form_action_button\"\n (click)=\"add()\">\n <mat-icon>add\n </mat-icon>\n </button>\n </div>\n\n @if(selected().length > 0){\n <table mat-table [dataSource]=\"selected()\" class=\"mat-elevation-z8\">\n\n <ng-container matColumnDef=\"first_name\">\n <th mat-header-cell *matHeaderCellDef>First Name\n </th>\n <td mat-cell *matCellDef=\"let element\">\n {{element.first_name}}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"last_name\">\n <th mat-header-cell *matHeaderCellDef>\n Last Name\n </th>\n <td mat-cell *matCellDef=\"let element\">\n {{element.last_name}}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"email\">\n <th mat-header-cell *matHeaderCellDef>\n Email\n </th>\n <td mat-cell *matCellDef=\"let element\">\n {{element.email}}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"remove\">\n <th mat-header-cell *matHeaderCellDef>Remove\n </th>\n <td mat-cell *matCellDef=\"let element\">\n <button mat-icon-button\n color=\"primary\"\n aria-label=\"Remove an item\"\n (click)=\"remove(element.id)\">\n <mat-icon>remove\n </mat-icon>\n </button>\n </td>\n </ng-container>\n\n <tr mat-header-row\n *matHeaderRowDef=\"tableColumns\">\n </tr>\n <tr mat-row\n *matRowDef=\"let row; columns: tableColumns;\">\n </tr>\n </table>\n }\n</div>\n", styles: [".select-container,.table_container{display:flex;text-align:center;justify-content:center;flex-direction:column}.form_action_button{padding:5px;margin:5px}\n"], dependencies: [{ kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i1$2.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i1$2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i1$2.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i1$2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i1$2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i1$2.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i1$2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i1$2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i1$2.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i1$2.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatMiniFabButton, selector: "button[mat-mini-fab], a[mat-mini-fab], button[matMiniFab], a[matMiniFab]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i4$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i4$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
760
|
+
}
|
|
761
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: UserSelectComponent, decorators: [{
|
|
762
|
+
type: Component,
|
|
763
|
+
args: [{ selector: 'lib-user-select', imports: [NgFor, NgIf, MatTableModule,
|
|
764
|
+
MatFormFieldModule,
|
|
765
|
+
MatButtonModule,
|
|
766
|
+
MatSelectModule,
|
|
767
|
+
MatIconModule,
|
|
768
|
+
FormsModule], template: "<div class='select-container'>\n <p style=\"padding:5px\">\n <b>Members</b>\n </p>\n \n <div>\n <mat-form-field>\n <mat-label>Add Member</mat-label>\n <mat-select [(ngModel)]=\"toAdd\" name=\"to_add\">\n @for(item of options(); track item.id){\n <mat-option [value]=\"item.id\">{{item.username}}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n \n <button mat-mini-fab\n type=\"button\"\n class=\"form_action_button\"\n (click)=\"add()\">\n <mat-icon>add\n </mat-icon>\n </button>\n </div>\n\n @if(selected().length > 0){\n <table mat-table [dataSource]=\"selected()\" class=\"mat-elevation-z8\">\n\n <ng-container matColumnDef=\"first_name\">\n <th mat-header-cell *matHeaderCellDef>First Name\n </th>\n <td mat-cell *matCellDef=\"let element\">\n {{element.first_name}}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"last_name\">\n <th mat-header-cell *matHeaderCellDef>\n Last Name\n </th>\n <td mat-cell *matCellDef=\"let element\">\n {{element.last_name}}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"email\">\n <th mat-header-cell *matHeaderCellDef>\n Email\n </th>\n <td mat-cell *matCellDef=\"let element\">\n {{element.email}}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"remove\">\n <th mat-header-cell *matHeaderCellDef>Remove\n </th>\n <td mat-cell *matCellDef=\"let element\">\n <button mat-icon-button\n color=\"primary\"\n aria-label=\"Remove an item\"\n (click)=\"remove(element.id)\">\n <mat-icon>remove\n </mat-icon>\n </button>\n </td>\n </ng-container>\n\n <tr mat-header-row\n *matHeaderRowDef=\"tableColumns\">\n </tr>\n <tr mat-row\n *matRowDef=\"let row; columns: tableColumns;\">\n </tr>\n </table>\n }\n</div>\n", styles: [".select-container,.table_container{display:flex;text-align:center;justify-content:center;flex-direction:column}.form_action_button{padding:5px;margin:5px}\n"] }]
|
|
769
|
+
}] });
|
|
770
|
+
|
|
616
771
|
class GroupDetailComponent extends DetailView {
|
|
772
|
+
typename = "group";
|
|
617
773
|
constructor() {
|
|
618
|
-
super(inject(
|
|
774
|
+
super(inject(GroupService));
|
|
775
|
+
}
|
|
776
|
+
ngOnInit() {
|
|
777
|
+
this.onInit();
|
|
619
778
|
}
|
|
620
779
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: GroupDetailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
621
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
780
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: GroupDetailComponent, isStandalone: true, selector: "lib-group-detail", usesInheritance: true, ngImport: i0, template: "<lib-back-button></lib-back-button>\n\n<div class=\"content-container\">\n @if(item(); as item) {\n <div class=\"item-detail-container\">\n\n <lib-detail-header\n [text]=\"item.name\"\n [id]=\"item.id\"\n [route]=\"typename\"></lib-detail-header>\n \n <div class=\"item-field\">{{item.name}}</div>\n </div>\n }\n</div>\n", styles: [":host{flex-grow:1}\n"], dependencies: [{ kind: "component", type: BackButtonComponent, selector: "lib-back-button" }, { kind: "component", type: DetailHeaderComponent, selector: "lib-detail-header", inputs: ["id", "text", "route"] }] });
|
|
622
781
|
}
|
|
623
782
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: GroupDetailComponent, decorators: [{
|
|
624
783
|
type: Component,
|
|
625
784
|
args: [{ selector: 'lib-group-detail', imports: [NgIf,
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
MatButtonModule,
|
|
629
|
-
MatCardModule,
|
|
630
|
-
MatInputModule,
|
|
631
|
-
MatFormFieldModule,
|
|
632
|
-
MatIconModule], template: "<div class=\"container\">\n <div>\n <a mat-icon-button class=\"btn-block\"\n (click)=\"goBack()\"\n (keydown)=\"goBack()\"\n tabindex=\"0\"\n role=\"button\"><mat-icon>arrow_back</mat-icon></a>\n </div>\n \n <div *ngIf=\"item\" class=\"item_view\">\n <div>\n <h1 class=\"mat-display-1\" style=\"display:inline\"> {{item.name}} </h1>\n <a mat-mini-fab class=\"btn-block\" [routerLink]=\"['/groups/edit/', item.id]\">\n <mat-icon>edit</mat-icon>\n </a> \n </div>\n <div class=\"form_field\">{{item.name}}</div>\n </div>\n \n</div>\n", styles: [".container{display:flex;flex-direction:column;padding:10px}.item_view{display:flex;justify-content:center;align-items:center;flex-direction:column;padding:10px}.form_field,.btn-block{padding:10px}\n"] }]
|
|
785
|
+
BackButtonComponent,
|
|
786
|
+
DetailHeaderComponent], template: "<lib-back-button></lib-back-button>\n\n<div class=\"content-container\">\n @if(item(); as item) {\n <div class=\"item-detail-container\">\n\n <lib-detail-header\n [text]=\"item.name\"\n [id]=\"item.id\"\n [route]=\"typename\"></lib-detail-header>\n \n <div class=\"item-field\">{{item.name}}</div>\n </div>\n }\n</div>\n", styles: [":host{flex-grow:1}\n"] }]
|
|
633
787
|
}], ctorParameters: () => [] });
|
|
634
788
|
|
|
635
789
|
class GroupComponent extends ListView {
|
|
636
790
|
displayedColumns = ['name'];
|
|
637
791
|
constructor() {
|
|
638
|
-
super(inject(
|
|
792
|
+
super(inject(GroupService));
|
|
639
793
|
}
|
|
640
794
|
ngOnInit() {
|
|
641
795
|
this.onInit();
|
|
642
796
|
}
|
|
643
797
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: GroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
644
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.1", type: GroupComponent, isStandalone: true, selector: "lib-group", usesInheritance: true, ngImport: i0, template: "<div class=\"container\">\n
|
|
798
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.1", type: GroupComponent, isStandalone: true, selector: "lib-group", usesInheritance: true, ngImport: i0, template: "<div class=\"tabular-list-container\">\n <div>\n <table mat-table [dataSource]=\"items()\" class=\"mat-elevation-z8\">\n <ng-container matColumnDef=\"name\">\n <th mat-header-cell *matHeaderCellDef>Name</th>\n <td mat-cell *matCellDef=\"let element\"> {{element.name}} </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"\n [routerLink]=\"['/groups/detail/', row.id]\"\n [routerLinkActive]=\"['is-active']\"\n ></tr>\n </table>\n </div>\n</div>\n", styles: [".mat-mdc-row .mat-mdc-cell{border-bottom:1px solid transparent;border-top:1px solid transparent;cursor:pointer}.mat-mdc-row:hover .mat-mdc-cell{border-color:currentColor}.is-active{font-weight:700}\n"], dependencies: [{ kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i1$2.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i1$2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i1$2.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i1$2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i1$2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i1$2.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i1$2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i1$2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i1$2.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i1$2.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i3.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }] });
|
|
645
799
|
}
|
|
646
800
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: GroupComponent, decorators: [{
|
|
647
801
|
type: Component,
|
|
@@ -650,19 +804,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImpor
|
|
|
650
804
|
MatButtonModule,
|
|
651
805
|
MatIconModule,
|
|
652
806
|
RouterModule
|
|
653
|
-
], template: "<div class=\"container\">\n
|
|
807
|
+
], template: "<div class=\"tabular-list-container\">\n <div>\n <table mat-table [dataSource]=\"items()\" class=\"mat-elevation-z8\">\n <ng-container matColumnDef=\"name\">\n <th mat-header-cell *matHeaderCellDef>Name</th>\n <td mat-cell *matCellDef=\"let element\"> {{element.name}} </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"\n [routerLink]=\"['/groups/detail/', row.id]\"\n [routerLinkActive]=\"['is-active']\"\n ></tr>\n </table>\n </div>\n</div>\n", styles: [".mat-mdc-row .mat-mdc-cell{border-bottom:1px solid transparent;border-top:1px solid transparent;cursor:pointer}.mat-mdc-row:hover .mat-mdc-cell{border-color:currentColor}.is-active{font-weight:700}\n"] }]
|
|
654
808
|
}], ctorParameters: () => [] });
|
|
655
809
|
|
|
656
810
|
class OrganizationComponent extends ListView {
|
|
657
811
|
displayedColumns = ['name', 'website', 'is_partner'];
|
|
658
812
|
constructor() {
|
|
659
|
-
super(inject(
|
|
813
|
+
super(inject(OrganizationService));
|
|
660
814
|
}
|
|
661
815
|
ngOnInit() {
|
|
662
816
|
this.onInit();
|
|
663
817
|
}
|
|
664
818
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: OrganizationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
665
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.1", type: OrganizationComponent, isStandalone: true, selector: "lib-organization", usesInheritance: true, ngImport: i0, template: "<div class=\"container\">\n
|
|
819
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.1", type: OrganizationComponent, isStandalone: true, selector: "lib-organization", usesInheritance: true, ngImport: i0, template: "<div class=\"tabular-list-container\">\n <div>\n <table mat-table [dataSource]=\"items()\" class=\"mat-elevation-z8\">\n <ng-container matColumnDef=\"name\">\n <th mat-header-cell *matHeaderCellDef>Name</th>\n <td mat-cell *matCellDef=\"let element\"> {{element.name}} </td>\n </ng-container>\n\n <ng-container matColumnDef=\"website\">\n <th mat-header-cell *matHeaderCellDef> Website </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.website}} </td>\n </ng-container>\n\n <ng-container matColumnDef=\"is_partner\">\n <th mat-header-cell *matHeaderCellDef> Is Partner </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.is_partner}} </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"\n [routerLink]=\"['/organizations/detail/', row.id]\"\n [routerLinkActive]=\"['is-active']\"\n ></tr>\n\n </table>\n </div>\n \n <div class=\"button-container\">\n <a mat-fab class=\"padded-button\" [routerLink]=\"['create']\">\n <mat-icon>add</mat-icon></a>\n </div>\n</div>\n", styles: [".mat-mdc-row .mat-mdc-cell{border-bottom:1px solid transparent;border-top:1px solid transparent;cursor:pointer}.mat-mdc-row:hover .mat-mdc-cell{border-color:currentColor}.is-active{font-weight:700}\n"], dependencies: [{ kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i1$2.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i1$2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i1$2.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i1$2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i1$2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i1$2.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i1$2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i1$2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i1$2.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i1$2.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatFabButton, selector: "button[mat-fab], a[mat-fab], button[matFab], a[matFab]", inputs: ["extended"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i3.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }] });
|
|
666
820
|
}
|
|
667
821
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: OrganizationComponent, decorators: [{
|
|
668
822
|
type: Component,
|
|
@@ -671,71 +825,119 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImpor
|
|
|
671
825
|
MatButtonModule,
|
|
672
826
|
MatIconModule,
|
|
673
827
|
RouterModule
|
|
674
|
-
], template: "<div class=\"container\">\n
|
|
828
|
+
], template: "<div class=\"tabular-list-container\">\n <div>\n <table mat-table [dataSource]=\"items()\" class=\"mat-elevation-z8\">\n <ng-container matColumnDef=\"name\">\n <th mat-header-cell *matHeaderCellDef>Name</th>\n <td mat-cell *matCellDef=\"let element\"> {{element.name}} </td>\n </ng-container>\n\n <ng-container matColumnDef=\"website\">\n <th mat-header-cell *matHeaderCellDef> Website </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.website}} </td>\n </ng-container>\n\n <ng-container matColumnDef=\"is_partner\">\n <th mat-header-cell *matHeaderCellDef> Is Partner </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.is_partner}} </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"\n [routerLink]=\"['/organizations/detail/', row.id]\"\n [routerLinkActive]=\"['is-active']\"\n ></tr>\n\n </table>\n </div>\n \n <div class=\"button-container\">\n <a mat-fab class=\"padded-button\" [routerLink]=\"['create']\">\n <mat-icon>add</mat-icon></a>\n </div>\n</div>\n", styles: [".mat-mdc-row .mat-mdc-cell{border-bottom:1px solid transparent;border-top:1px solid transparent;cursor:pointer}.mat-mdc-row:hover .mat-mdc-cell{border-color:currentColor}.is-active{font-weight:700}\n"] }]
|
|
675
829
|
}], ctorParameters: () => [] });
|
|
676
830
|
|
|
677
831
|
class OrganizationDetailComponent extends DetailView {
|
|
832
|
+
typename = "organization";
|
|
678
833
|
constructor() {
|
|
679
|
-
super(inject(
|
|
834
|
+
super(inject(OrganizationService));
|
|
835
|
+
}
|
|
836
|
+
ngOnInit() {
|
|
837
|
+
this.onInit();
|
|
680
838
|
}
|
|
681
839
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: OrganizationDetailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
682
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
840
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: OrganizationDetailComponent, isStandalone: true, selector: "lib-organization-detail", usesInheritance: true, ngImport: i0, template: "<lib-back-button></lib-back-button>\n\n<div class=\"content-container\">\n\n @if(item(); as item){\n <div class=\"item-detail-container\">\n\n <lib-detail-header\n [text]=\"item.name\"\n [id]=\"item.id\"\n [route]=\"typename\"></lib-detail-header>\n\n\n <div class=\"item-field\">\n {{item.description}}\n </div>\n \n <div class=\"item-field\">\n <h3>Address</h3>{{item.address}}\n </div>\n \n <div class=\"item-field\">\n <h3>Website</h3>{{item.website}}\n </div>\n </div>\n }\n</div>\n", styles: [":host{flex-grow:1}.padded_button{padding:5px}\n"], dependencies: [{ kind: "component", type: BackButtonComponent, selector: "lib-back-button" }, { kind: "component", type: DetailHeaderComponent, selector: "lib-detail-header", inputs: ["id", "text", "route"] }] });
|
|
683
841
|
}
|
|
684
842
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: OrganizationDetailComponent, decorators: [{
|
|
685
843
|
type: Component,
|
|
686
844
|
args: [{ selector: 'lib-organization-detail', imports: [NgIf,
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
MatButtonModule,
|
|
690
|
-
MatCardModule,
|
|
691
|
-
MatInputModule,
|
|
692
|
-
MatFormFieldModule,
|
|
693
|
-
MatIconModule], template: "<div class=\"container\">\n <div>\n <a mat-icon-button class=\"btn-block\"\n (click)=\"goBack()\"\n (keydown)=\"goBack()\"\n tabindex=\"0\"\n role=\"button\"><mat-icon>arrow_back</mat-icon></a>\n </div>\n \n <div *ngIf=\"item\" class=\"item_view\">\n <div>\n <h3 class=\"mat-display-1\" style=\"display:inline\"> {{item.name}} </h3> \n <a mat-mini-fab class=\"btn-block\" [routerLink]=\"['/organizations/edit/', item.id]\">\n <mat-icon>edit</mat-icon>\n </a>\n </div>\n <div class=\"form_field\">{{item.description}}</div>\n <div class=\"form_field\"><h3>Address</h3>{{item.address}}</div>\n <div class=\"form_field\"><h3>Website</h3>{{item.website}}</div>\n </div>\n \n</div>\n", styles: [".container{display:flex;flex-direction:column;padding:10px}.item_view{display:flex;justify-content:center;align-items:center;flex-direction:column;padding:10px}.form_field,.btn-block{padding:10px}\n"] }]
|
|
845
|
+
BackButtonComponent,
|
|
846
|
+
DetailHeaderComponent], template: "<lib-back-button></lib-back-button>\n\n<div class=\"content-container\">\n\n @if(item(); as item){\n <div class=\"item-detail-container\">\n\n <lib-detail-header\n [text]=\"item.name\"\n [id]=\"item.id\"\n [route]=\"typename\"></lib-detail-header>\n\n\n <div class=\"item-field\">\n {{item.description}}\n </div>\n \n <div class=\"item-field\">\n <h3>Address</h3>{{item.address}}\n </div>\n \n <div class=\"item-field\">\n <h3>Website</h3>{{item.website}}\n </div>\n </div>\n }\n</div>\n", styles: [":host{flex-grow:1}.padded_button{padding:5px}\n"] }]
|
|
694
847
|
}], ctorParameters: () => [] });
|
|
695
848
|
|
|
696
849
|
class OrganizationEditComponent extends EditView {
|
|
697
|
-
countryOptions = [];
|
|
850
|
+
countryOptions = signal([], ...(ngDevMode ? [{ debugName: "countryOptions" }] : []));
|
|
851
|
+
candidateMembers = signal([], ...(ngDevMode ? [{ debugName: "candidateMembers" }] : []));
|
|
852
|
+
selectedMembers = signal([], ...(ngDevMode ? [{ debugName: "selectedMembers" }] : []));
|
|
853
|
+
typename = "Organization";
|
|
854
|
+
formBuilder = inject(FormBuilder);
|
|
855
|
+
form = this.formBuilder.group({ name: [''],
|
|
856
|
+
acronym: [''],
|
|
857
|
+
description: [''],
|
|
858
|
+
address: [''],
|
|
859
|
+
website: [''],
|
|
860
|
+
country: [''] });
|
|
698
861
|
constructor() {
|
|
699
|
-
super(inject(
|
|
862
|
+
super(inject(OrganizationService));
|
|
700
863
|
}
|
|
701
864
|
ngOnInit() {
|
|
702
865
|
this.onInit();
|
|
703
|
-
this.
|
|
866
|
+
this.fetchRestOptions();
|
|
704
867
|
}
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
868
|
+
onItemAndUserAvailable(_) {
|
|
869
|
+
const item = this.item();
|
|
870
|
+
if (item) {
|
|
871
|
+
this.form.setValue({ name: item.name,
|
|
872
|
+
acronym: item.acronym,
|
|
873
|
+
description: item.description,
|
|
874
|
+
address: item.address,
|
|
875
|
+
website: item.website,
|
|
876
|
+
country: item.country
|
|
877
|
+
});
|
|
878
|
+
this._userService.get("?organization=" + item.id).subscribe(users => this.selectedMembers.set(users));
|
|
879
|
+
this._userService.get().subscribe(users => this.candidateMembers.set(users));
|
|
708
880
|
}
|
|
709
881
|
}
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
882
|
+
submit() {
|
|
883
|
+
this.item.update((item) => { if (item) {
|
|
884
|
+
item = this.updateFromForm(item);
|
|
885
|
+
} return item; });
|
|
886
|
+
super.submit();
|
|
887
|
+
}
|
|
888
|
+
updateFromForm(item) {
|
|
889
|
+
item.name = this.form.value.name || "";
|
|
890
|
+
item.acronym = this.form.value.acronym || "";
|
|
891
|
+
item.description = this.form.value.description || "";
|
|
892
|
+
item.address = this.form.value.address || "";
|
|
893
|
+
item.website = this.form.value.website || "";
|
|
894
|
+
item.country = this.form.value.country || "";
|
|
895
|
+
return item;
|
|
722
896
|
}
|
|
723
897
|
getTemplateItem() {
|
|
724
898
|
return new Organization();
|
|
725
899
|
}
|
|
900
|
+
onPostActions(actions) {
|
|
901
|
+
if ('country' in actions && actions['country'].choices) {
|
|
902
|
+
this.onCountryChoices(actions['country'].choices);
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
onCountryChoices(choices) {
|
|
906
|
+
this.countryOptions.update(() => choices.map(c => c.display_name));
|
|
907
|
+
}
|
|
908
|
+
onMemberRemoved(id) {
|
|
909
|
+
const url = this.selectedMembers().find(m => m.id == id).url;
|
|
910
|
+
this.selectedMembers.update(members => members.filter(m => m.id != id));
|
|
911
|
+
this.item.update(item => { if (item) {
|
|
912
|
+
item.members.filter(m => m != url);
|
|
913
|
+
} return item; });
|
|
914
|
+
}
|
|
915
|
+
onMemberAdded(id) {
|
|
916
|
+
const selected = this.candidateMembers().find(m => m.id == id);
|
|
917
|
+
if (selected) {
|
|
918
|
+
this.selectedMembers.update(members => { members.push(selected); return members; });
|
|
919
|
+
}
|
|
920
|
+
this.candidateMembers.update(members => members.filter(m => m.id != id));
|
|
921
|
+
const url = this.selectedMembers().find(m => m.id == id).url;
|
|
922
|
+
this.item.update(item => { if (item) {
|
|
923
|
+
item.members.push(url);
|
|
924
|
+
} return item; });
|
|
925
|
+
}
|
|
726
926
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: OrganizationEditComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
727
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
927
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.1", type: OrganizationEditComponent, isStandalone: true, selector: "lib-organization-edit", usesInheritance: true, ngImport: i0, template: "<lib-back-button></lib-back-button>\n\n<div class=\"content-container\">\n\n @if(item(); as item){\n <div class=\"item-edit-container\">\n \n <h1 class=\"item-edit-header\">{{heading()}}</h1>\n\n <form class=\"form-card\" [formGroup]=\"form\" (ngSubmit)=\"submit()\">\n\n <mat-form-field class=\"form-field-wide\">\n <mat-label *ngIf=\"!createMode()\" for=\"name\">Name</mat-label>\n <input matInput placeholder=\"Name\"\n type=\"text\"\n id=\"name\"\n formControlName=\"name\"\n name=\"name\"\n required>\n </mat-form-field>\n \n <mat-form-field class=\"form-field\">\n <mat-label *ngIf=\"!createMode()\" for=\"acronym\">Acronym</mat-label> \n <input matInput placeholder=\"Acronym\"\n type=\"text\"\n id=\"acronym\"\n formControlName=\"acronym\"\n name=\"acronym\">\n </mat-form-field>\n \n <mat-form-field class=\"form-field-wide\">\n <mat-label *ngIf=\"!createMode()\" for=\"description\">Description</mat-label>\n <textarea matInput placeholder=\"Description\"\n type=\"text\"\n id=\"description\"\n formControlName=\"description\"\n name=\"description\"\n class=\"medium-textarea\"\n required></textarea>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-wide\">\n <mat-label *ngIf=\"!createMode()\" for=\"address\">Address</mat-label>\n <textarea matInput placeholder=\"Address\"\n type=\"text\"\n id=\"address\"\n formControlName=\"address\"\n name=\"address\"\n required></textarea>\n </mat-form-field>\n\n <mat-form-field class=\"form-field\">\n <mat-label *ngIf=\"!createMode()\" for=\"country\">Country</mat-label>\n <mat-select formControlName=\"country\" name=\"country\" id=\"country\" required>\n @for(country of countryOptions(); track $index){\n <mat-option [value]=\"country\">{{country}}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n <lib-user-select [selected]=\"selectedMembers()\"\n [options]=\"candidateMembers()\"\n (itemAdded)=\"onMemberAdded($event)\"\n (itemRemoved)=\"onMemberRemoved($event)\">\n </lib-user-select>\n\n <div class=\"button_group\">\n <button mat-fab\n class=\"form_action_button\"\n type=\"submit\"\n [disabled]=\"!form.valid\">\n <mat-icon>save</mat-icon>\n </button>\n \n <button mat-fab\n class=\"form_action_button\"\n (click)=\"cancel()\">\n <mat-icon>cancel</mat-icon>\n </button>\n </div>\n \n </form>\n </div>\n }\n</div>\n", styles: [":host{flex-grow:1}.medium-textarea{min-height:150px}.checkbox_group{justify-content:left;display:flex;flex-direction:column}.button_group{margin:10px;display:flex;flex-direction:row;justify-content:center}.btn-block{padding:5px}.form_action_button{padding:5px;margin:5px}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: UserSelectComponent, selector: "lib-user-select", inputs: ["selected", "options"], outputs: ["itemAdded", "itemRemoved"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$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: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatFabButton, selector: "button[mat-fab], a[mat-fab], button[matFab], a[matFab]", inputs: ["extended"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i4$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i4$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: BackButtonComponent, selector: "lib-back-button" }] });
|
|
728
928
|
}
|
|
729
929
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: OrganizationEditComponent, decorators: [{
|
|
730
930
|
type: Component,
|
|
731
931
|
args: [{ selector: 'lib-organization-edit', imports: [NgIf, NgFor,
|
|
732
|
-
|
|
932
|
+
UserSelectComponent,
|
|
933
|
+
ReactiveFormsModule,
|
|
733
934
|
MatButtonModule,
|
|
734
935
|
MatInputModule,
|
|
735
936
|
MatSelectModule,
|
|
736
937
|
MatFormFieldModule,
|
|
737
938
|
MatIconModule,
|
|
738
|
-
MatCheckboxModule
|
|
939
|
+
MatCheckboxModule,
|
|
940
|
+
BackButtonComponent], template: "<lib-back-button></lib-back-button>\n\n<div class=\"content-container\">\n\n @if(item(); as item){\n <div class=\"item-edit-container\">\n \n <h1 class=\"item-edit-header\">{{heading()}}</h1>\n\n <form class=\"form-card\" [formGroup]=\"form\" (ngSubmit)=\"submit()\">\n\n <mat-form-field class=\"form-field-wide\">\n <mat-label *ngIf=\"!createMode()\" for=\"name\">Name</mat-label>\n <input matInput placeholder=\"Name\"\n type=\"text\"\n id=\"name\"\n formControlName=\"name\"\n name=\"name\"\n required>\n </mat-form-field>\n \n <mat-form-field class=\"form-field\">\n <mat-label *ngIf=\"!createMode()\" for=\"acronym\">Acronym</mat-label> \n <input matInput placeholder=\"Acronym\"\n type=\"text\"\n id=\"acronym\"\n formControlName=\"acronym\"\n name=\"acronym\">\n </mat-form-field>\n \n <mat-form-field class=\"form-field-wide\">\n <mat-label *ngIf=\"!createMode()\" for=\"description\">Description</mat-label>\n <textarea matInput placeholder=\"Description\"\n type=\"text\"\n id=\"description\"\n formControlName=\"description\"\n name=\"description\"\n class=\"medium-textarea\"\n required></textarea>\n </mat-form-field>\n\n <mat-form-field class=\"form-field-wide\">\n <mat-label *ngIf=\"!createMode()\" for=\"address\">Address</mat-label>\n <textarea matInput placeholder=\"Address\"\n type=\"text\"\n id=\"address\"\n formControlName=\"address\"\n name=\"address\"\n required></textarea>\n </mat-form-field>\n\n <mat-form-field class=\"form-field\">\n <mat-label *ngIf=\"!createMode()\" for=\"country\">Country</mat-label>\n <mat-select formControlName=\"country\" name=\"country\" id=\"country\" required>\n @for(country of countryOptions(); track $index){\n <mat-option [value]=\"country\">{{country}}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n <lib-user-select [selected]=\"selectedMembers()\"\n [options]=\"candidateMembers()\"\n (itemAdded)=\"onMemberAdded($event)\"\n (itemRemoved)=\"onMemberRemoved($event)\">\n </lib-user-select>\n\n <div class=\"button_group\">\n <button mat-fab\n class=\"form_action_button\"\n type=\"submit\"\n [disabled]=\"!form.valid\">\n <mat-icon>save</mat-icon>\n </button>\n \n <button mat-fab\n class=\"form_action_button\"\n (click)=\"cancel()\">\n <mat-icon>cancel</mat-icon>\n </button>\n </div>\n \n </form>\n </div>\n }\n</div>\n", styles: [":host{flex-grow:1}.medium-textarea{min-height:150px}.checkbox_group{justify-content:left;display:flex;flex-direction:column}.button_group{margin:10px;display:flex;flex-direction:row;justify-content:center}.btn-block{padding:5px}.form_action_button{padding:5px;margin:5px}\n"] }]
|
|
739
941
|
}], ctorParameters: () => [] });
|
|
740
942
|
|
|
741
943
|
/*
|
|
@@ -746,5 +948,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImpor
|
|
|
746
948
|
* Generated bundle index. Do not edit.
|
|
747
949
|
*/
|
|
748
950
|
|
|
749
|
-
export { DetailView, ENDPOINT_URL, EditView, Group, GroupComponent, GroupDetailComponent, GroupService, LOGIN_USER, LandingComponent, LeftNavComponent, LeftNavService, ListView, Organization, OrganizationComponent, OrganizationDetailComponent, OrganizationEditComponent, OrganizationService, PortalMember, RestService, TopBarComponent, UserComponent, UserDetailComponent, UserEditComponent, UserService };
|
|
951
|
+
export { ApiError, DetailView, ENDPOINT_URL, EditView, ErrorCode, Group, GroupComponent, GroupDetailComponent, GroupService, LOGIN_USER, LandingComponent, LeftNavComponent, LeftNavService, ListView, Organization, OrganizationComponent, OrganizationDetailComponent, OrganizationEditComponent, OrganizationService, PortalMember, RestService, TopBarComponent, UserComponent, UserDetailComponent, UserEditComponent, UserSelectComponent, UserService };
|
|
750
952
|
//# sourceMappingURL=ichec-angular-core.mjs.map
|