ichec-angular-core 0.0.11 → 0.0.13
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 +319 -180
- package/fesm2022/ichec-angular-core.mjs.map +1 -1
- package/index.d.ts +125 -38
- 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,7 +26,7 @@ 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 {
|
|
29
|
+
import { MatTable, MatTableModule } from '@angular/material/table';
|
|
30
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';
|
|
@@ -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,9 @@ class Organization {
|
|
|
57
60
|
website = "";
|
|
58
61
|
country = "";
|
|
59
62
|
members = [];
|
|
63
|
+
constructor(params = {}) {
|
|
64
|
+
Object.assign(this, params);
|
|
65
|
+
}
|
|
60
66
|
}
|
|
61
67
|
|
|
62
68
|
var ErrorCode;
|
|
@@ -279,31 +285,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImpor
|
|
|
279
285
|
}], ctorParameters: () => [] });
|
|
280
286
|
|
|
281
287
|
class TopBarComponent {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
userService;
|
|
285
|
-
leftNavService;
|
|
286
|
-
constructor() {
|
|
287
|
-
this.userService = inject(UserService);
|
|
288
|
-
this.leftNavService = inject(LeftNavService);
|
|
289
|
-
}
|
|
288
|
+
title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : []));
|
|
289
|
+
user = signal(null, ...(ngDevMode ? [{ debugName: "user" }] : []));
|
|
290
|
+
userService = inject(UserService);
|
|
291
|
+
leftNavService = inject(LeftNavService);
|
|
290
292
|
ngOnInit() {
|
|
291
293
|
this.userService.loggedInUser.subscribe(user => {
|
|
292
|
-
this.user
|
|
294
|
+
this.user.set(user);
|
|
293
295
|
});
|
|
294
296
|
}
|
|
295
297
|
onLogout() {
|
|
296
298
|
this.userService.logout();
|
|
297
299
|
}
|
|
298
300
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: TopBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
299
|
-
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"] }] });
|
|
300
302
|
}
|
|
301
303
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: TopBarComponent, decorators: [{
|
|
302
304
|
type: Component,
|
|
303
|
-
args: [{ selector: 'lib-top-bar', imports: [NgIf, RouterModule, MatToolbarModule, MatIconModule, MatButtonModule, MatMenuModule], template: "\n
|
|
304
|
-
}]
|
|
305
|
-
type: Input
|
|
306
|
-
}] } });
|
|
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
|
+
}] });
|
|
307
307
|
|
|
308
308
|
class LeftNavComponent {
|
|
309
309
|
_leftNavService = inject(LeftNavService);
|
|
@@ -321,8 +321,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImpor
|
|
|
321
321
|
const LOGIN_USER = new InjectionToken("Default login user - used for testing");
|
|
322
322
|
class LandingComponent {
|
|
323
323
|
loginUser = inject(LOGIN_USER);
|
|
324
|
-
loginError = "";
|
|
325
|
-
message = "";
|
|
324
|
+
loginError = signal("", ...(ngDevMode ? [{ debugName: "loginError" }] : []));
|
|
325
|
+
message = input(...(ngDevMode ? [undefined, { debugName: "message" }] : []));
|
|
326
326
|
userService = inject(UserService);
|
|
327
327
|
router = inject(Router);
|
|
328
328
|
ngOnInit() {
|
|
@@ -335,81 +335,68 @@ class LandingComponent {
|
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
337
|
login() {
|
|
338
|
-
this.loginError
|
|
338
|
+
this.loginError.set("");
|
|
339
339
|
return this.userService.login(this.loginUser.name, this.loginUser.password).subscribe({
|
|
340
340
|
next: () => this.onLoggedIn(),
|
|
341
341
|
error: (error) => this.onLoginError(error)
|
|
342
342
|
});
|
|
343
343
|
}
|
|
344
344
|
onLoginError(error) {
|
|
345
|
-
console.log("Got login error");
|
|
346
|
-
|
|
347
|
-
|
|
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
|
+
}
|
|
348
352
|
}
|
|
349
353
|
onLoggedIn() {
|
|
350
354
|
this.router.navigateByUrl("/home");
|
|
351
355
|
}
|
|
352
356
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: LandingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
353
|
-
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"] }] });
|
|
354
358
|
}
|
|
355
359
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: LandingComponent, decorators: [{
|
|
356
360
|
type: Component,
|
|
357
|
-
args: [{ selector: 'lib-landing', imports: [FormsModule, MatCardModule, MatFormFieldModule, MatInputModule, MatButtonModule, MatIconModule, NgIf], template: "\n
|
|
358
|
-
}]
|
|
359
|
-
type: Input
|
|
360
|
-
}] } });
|
|
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
|
+
}] });
|
|
361
363
|
|
|
362
364
|
class DetailView {
|
|
363
|
-
item;
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
this._route = _route;
|
|
370
|
-
this._location = _location;
|
|
371
|
-
this._userService = _userService;
|
|
372
|
-
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;
|
|
373
371
|
}
|
|
374
372
|
onInit() {
|
|
375
373
|
this.getItem();
|
|
376
374
|
}
|
|
377
375
|
onItemAvailable() {
|
|
378
|
-
this.
|
|
376
|
+
this.userService.loggedInUser.subscribe(user => { if (user) {
|
|
379
377
|
this.onItemAndUserAvailable(user);
|
|
380
378
|
} });
|
|
381
379
|
}
|
|
382
380
|
onItemAndUserAvailable(_) { }
|
|
383
|
-
goBack() {
|
|
384
|
-
this._location.back();
|
|
385
|
-
}
|
|
386
381
|
getItem() {
|
|
387
|
-
const id = Number(this.
|
|
388
|
-
this.
|
|
389
|
-
.
|
|
390
|
-
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);
|
|
391
385
|
this.onItemAvailable();
|
|
392
386
|
});
|
|
393
387
|
}
|
|
394
|
-
update() {
|
|
395
|
-
if (!this.item) {
|
|
396
|
-
return;
|
|
397
|
-
}
|
|
398
|
-
this._restService.putItem(this.item).subscribe(item => this.item = item);
|
|
399
|
-
}
|
|
400
388
|
}
|
|
401
389
|
|
|
402
390
|
class EditView {
|
|
403
|
-
|
|
404
|
-
createMode = false;
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
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);
|
|
408
398
|
_restService;
|
|
409
|
-
constructor(
|
|
410
|
-
this._route = _route;
|
|
411
|
-
this._location = _location;
|
|
412
|
-
this._userService = _userService;
|
|
399
|
+
constructor(_restServce) {
|
|
413
400
|
this._restService = _restServce;
|
|
414
401
|
}
|
|
415
402
|
onInit() {
|
|
@@ -426,12 +413,12 @@ class EditView {
|
|
|
426
413
|
this._location.back();
|
|
427
414
|
}
|
|
428
415
|
submit() {
|
|
429
|
-
if (this.item) {
|
|
416
|
+
if (this.item()) {
|
|
430
417
|
this.save();
|
|
431
418
|
}
|
|
432
419
|
}
|
|
433
420
|
save() {
|
|
434
|
-
if (this.createMode) {
|
|
421
|
+
if (this.createMode()) {
|
|
435
422
|
this.createItem();
|
|
436
423
|
}
|
|
437
424
|
else {
|
|
@@ -444,37 +431,21 @@ class EditView {
|
|
|
444
431
|
fetchRestOptions() {
|
|
445
432
|
this._restService.getOptions().subscribe(options => this.onOptions(options));
|
|
446
433
|
}
|
|
447
|
-
onFileUpload(event) {
|
|
448
|
-
if (!event.target) {
|
|
449
|
-
return;
|
|
450
|
-
}
|
|
451
|
-
const input_element = event.target;
|
|
452
|
-
if (input_element.files && input_element.files.length > 0) {
|
|
453
|
-
this.onUploadedFileReady(input_element.files[0]);
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
readFile(file) {
|
|
457
|
-
const reader = new FileReader();
|
|
458
|
-
reader.readAsDataURL(file);
|
|
459
|
-
reader.onload = () => { if (reader.result) {
|
|
460
|
-
this.onFileRead(reader.result);
|
|
461
|
-
} ; };
|
|
462
|
-
}
|
|
463
434
|
onUploadedFileReady(_file) {
|
|
464
435
|
}
|
|
465
436
|
onFileRead(_content) {
|
|
466
437
|
}
|
|
467
438
|
createItem() {
|
|
468
|
-
|
|
469
|
-
|
|
439
|
+
const item = this.item();
|
|
440
|
+
if (item) {
|
|
441
|
+
this._restService.postItem(item).subscribe(item => this.saveFiles(item));
|
|
470
442
|
}
|
|
471
|
-
this._restService.postItem(this.item).subscribe(item => this.saveFiles(item));
|
|
472
443
|
}
|
|
473
444
|
updateItem() {
|
|
474
|
-
|
|
475
|
-
|
|
445
|
+
const item = this.item();
|
|
446
|
+
if (item) {
|
|
447
|
+
this._restService.putItem(item).subscribe(item => this.saveFiles(item));
|
|
476
448
|
}
|
|
477
|
-
this._restService.putItem(this.item).subscribe(item => this.saveFiles(item));
|
|
478
449
|
}
|
|
479
450
|
saveFiles(item) {
|
|
480
451
|
this.onItemUpdated(item);
|
|
@@ -493,21 +464,21 @@ class EditView {
|
|
|
493
464
|
}
|
|
494
465
|
getItem() {
|
|
495
466
|
if (this.isCreateRoute()) {
|
|
496
|
-
this.item
|
|
497
|
-
this.createMode
|
|
467
|
+
this.item.set(this.getTemplateItem());
|
|
468
|
+
this.createMode.set(true);
|
|
498
469
|
this.onItemAvailable();
|
|
499
470
|
}
|
|
500
471
|
else {
|
|
501
472
|
const id_str = this._route.snapshot.paramMap.get('id');
|
|
502
473
|
this._restService.getItem(Number(id_str))
|
|
503
474
|
.subscribe(item => {
|
|
504
|
-
this.item
|
|
475
|
+
this.item.set(item);
|
|
505
476
|
this.onItemAvailable();
|
|
506
477
|
});
|
|
507
478
|
}
|
|
508
479
|
}
|
|
509
480
|
onItemUpdated(item) {
|
|
510
|
-
this.item
|
|
481
|
+
this.item.set(item);
|
|
511
482
|
this.goBack();
|
|
512
483
|
}
|
|
513
484
|
onOptions(options) {
|
|
@@ -524,16 +495,13 @@ class EditView {
|
|
|
524
495
|
|
|
525
496
|
class ListView {
|
|
526
497
|
user;
|
|
527
|
-
items = [];
|
|
498
|
+
items = signal([], ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
528
499
|
displayedColumns = [];
|
|
529
|
-
_route;
|
|
530
|
-
_location;
|
|
531
|
-
_userService;
|
|
500
|
+
_route = inject(ActivatedRoute);
|
|
501
|
+
_location = inject(Location);
|
|
502
|
+
_userService = inject(UserService);
|
|
532
503
|
_restService;
|
|
533
|
-
constructor(
|
|
534
|
-
this._route = _route;
|
|
535
|
-
this._location = _location;
|
|
536
|
-
this._userService = _userService;
|
|
504
|
+
constructor(_restService) {
|
|
537
505
|
this._restService = _restService;
|
|
538
506
|
}
|
|
539
507
|
onInit() {
|
|
@@ -548,12 +516,12 @@ class ListView {
|
|
|
548
516
|
});
|
|
549
517
|
}
|
|
550
518
|
else {
|
|
551
|
-
this._restService.get().subscribe(items => this.items
|
|
519
|
+
this._restService.get().subscribe(items => this.items.set(items));
|
|
552
520
|
}
|
|
553
521
|
}
|
|
554
522
|
onUserChange(user) {
|
|
555
523
|
this.user = user;
|
|
556
|
-
this._restService.getForUser(this.user).subscribe(items => this.items
|
|
524
|
+
this._restService.getForUser(this.user).subscribe(items => this.items.set(items));
|
|
557
525
|
}
|
|
558
526
|
isSelfList() {
|
|
559
527
|
const url_segments = this._route.snapshot.url;
|
|
@@ -569,104 +537,226 @@ class ListView {
|
|
|
569
537
|
}
|
|
570
538
|
}
|
|
571
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
|
+
|
|
568
|
+
class FileUploadComponent {
|
|
569
|
+
files = input([], ...(ngDevMode ? [{ debugName: "files" }] : []));
|
|
570
|
+
previewLoaded = output();
|
|
571
|
+
fileUploaded = output();
|
|
572
|
+
onPreviewRead(name, content) {
|
|
573
|
+
this.previewLoaded.emit({ name: name, content: content });
|
|
574
|
+
}
|
|
575
|
+
onFileUpload(name, event) {
|
|
576
|
+
if (!event.target) {
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
const input_element = event.target;
|
|
580
|
+
if (input_element.files && input_element.files.length > 0) {
|
|
581
|
+
const file = input_element.files[0];
|
|
582
|
+
this.fileUploaded.emit({ name: name, file: file });
|
|
583
|
+
const record = this.files().find(f => f.name == name);
|
|
584
|
+
if (record && record.file_type == "image") {
|
|
585
|
+
this.readFile(name, file);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
readFile(name, file) {
|
|
590
|
+
const reader = new FileReader();
|
|
591
|
+
reader.readAsDataURL(file);
|
|
592
|
+
reader.onload = () => {
|
|
593
|
+
if (reader.result) {
|
|
594
|
+
this.previewLoaded.emit({ name: name, content: reader.result });
|
|
595
|
+
}
|
|
596
|
+
;
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: FileUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
600
|
+
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"] }] });
|
|
601
|
+
}
|
|
602
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: FileUploadComponent, decorators: [{
|
|
603
|
+
type: Component,
|
|
604
|
+
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"] }]
|
|
605
|
+
}] });
|
|
606
|
+
|
|
607
|
+
class FileRecord {
|
|
608
|
+
name = "";
|
|
609
|
+
display_name = "";
|
|
610
|
+
file_type = "standard";
|
|
611
|
+
file = null;
|
|
612
|
+
remote = "";
|
|
613
|
+
local = "";
|
|
614
|
+
constructor(params = {}) {
|
|
615
|
+
Object.assign(this, params);
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
|
|
572
619
|
class UserDetailComponent extends DetailView {
|
|
620
|
+
typename = "user";
|
|
573
621
|
constructor() {
|
|
574
|
-
super(inject(
|
|
622
|
+
super(inject(UserService));
|
|
575
623
|
}
|
|
576
624
|
ngOnInit() {
|
|
577
625
|
this.onInit();
|
|
578
626
|
}
|
|
579
627
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: UserDetailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
580
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
628
|
+
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"] }] });
|
|
581
629
|
}
|
|
582
630
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: UserDetailComponent, decorators: [{
|
|
583
631
|
type: Component,
|
|
584
632
|
args: [{ selector: 'lib-user-detail', imports: [NgIf,
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
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"] }]
|
|
633
|
+
BackButtonComponent,
|
|
634
|
+
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"] }]
|
|
588
635
|
}], ctorParameters: () => [] });
|
|
589
636
|
|
|
590
637
|
class UserEditComponent extends EditView {
|
|
591
|
-
|
|
592
|
-
|
|
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
|
+
});
|
|
593
650
|
constructor() {
|
|
594
|
-
super(inject(
|
|
651
|
+
super(inject(UserService));
|
|
595
652
|
}
|
|
596
653
|
ngOnInit() {
|
|
597
654
|
this.onInit();
|
|
598
655
|
}
|
|
656
|
+
onItemAvailable() {
|
|
657
|
+
const item = this.item();
|
|
658
|
+
if (!item) {
|
|
659
|
+
return;
|
|
660
|
+
}
|
|
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; });
|
|
672
|
+
}
|
|
673
|
+
super.onItemAvailable();
|
|
674
|
+
}
|
|
675
|
+
submit() {
|
|
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;
|
|
689
|
+
}
|
|
599
690
|
getTemplateItem() {
|
|
600
691
|
return new PortalMember();
|
|
601
692
|
}
|
|
602
|
-
|
|
603
|
-
this.
|
|
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; });
|
|
604
697
|
}
|
|
605
|
-
|
|
606
|
-
this.
|
|
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; });
|
|
607
702
|
}
|
|
608
703
|
saveFiles(item) {
|
|
609
|
-
if (
|
|
610
|
-
this._restService.postFile(item.id,
|
|
611
|
-
}
|
|
612
|
-
else {
|
|
613
|
-
this.onItemUpdated(item);
|
|
614
|
-
}
|
|
704
|
+
this.files().forEach(record => { if (record.file) {
|
|
705
|
+
this._restService.postFile(item.id, record.name, record.file).subscribe(item => this.onItemUpdated(item));
|
|
706
|
+
} ; });
|
|
615
707
|
}
|
|
616
708
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: UserEditComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
617
|
-
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"] }] });
|
|
618
710
|
}
|
|
619
711
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: UserEditComponent, decorators: [{
|
|
620
712
|
type: Component,
|
|
621
713
|
args: [{ selector: 'lib-user-edit', imports: [NgIf,
|
|
622
|
-
|
|
623
|
-
RouterModule,
|
|
714
|
+
ReactiveFormsModule,
|
|
624
715
|
MatButtonModule,
|
|
625
|
-
|
|
716
|
+
BackButtonComponent,
|
|
626
717
|
MatInputModule,
|
|
627
718
|
MatFormFieldModule,
|
|
628
719
|
MatIconModule,
|
|
629
|
-
|
|
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"] }]
|
|
630
722
|
}], ctorParameters: () => [] });
|
|
631
723
|
|
|
632
724
|
class UserComponent extends ListView {
|
|
633
725
|
constructor() {
|
|
634
|
-
super(inject(
|
|
726
|
+
super(inject(UserService));
|
|
635
727
|
}
|
|
636
728
|
ngOnInit() {
|
|
637
729
|
this.onInit();
|
|
638
730
|
}
|
|
639
731
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: UserComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
640
|
-
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"] }] });
|
|
641
733
|
}
|
|
642
734
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: UserComponent, decorators: [{
|
|
643
735
|
type: Component,
|
|
644
736
|
args: [{ selector: 'lib-user', imports: [MatListModule, MatCardModule,
|
|
645
737
|
MatButtonModule,
|
|
646
738
|
MatIconModule,
|
|
647
|
-
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"] }]
|
|
648
740
|
}], ctorParameters: () => [] });
|
|
649
741
|
|
|
650
742
|
class UserSelectComponent {
|
|
651
|
-
toAdd =
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
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" }] : []));
|
|
655
749
|
tableColumns = ["first_name", "last_name", "email", "remove"];
|
|
656
|
-
remove(
|
|
657
|
-
this.
|
|
658
|
-
this.table
|
|
750
|
+
remove(id) {
|
|
751
|
+
this.itemRemoved.emit(id);
|
|
752
|
+
this.table()?.renderRows();
|
|
659
753
|
}
|
|
660
754
|
add() {
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
}
|
|
664
|
-
this.items.push(this.toAdd);
|
|
665
|
-
this.toAdd = null;
|
|
666
|
-
this.table.renderRows();
|
|
755
|
+
this.itemAdded.emit(this.toAdd());
|
|
756
|
+
this.table()?.renderRows();
|
|
667
757
|
}
|
|
668
758
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: UserSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
669
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
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"] }] });
|
|
670
760
|
}
|
|
671
761
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: UserSelectComponent, decorators: [{
|
|
672
762
|
type: Component,
|
|
@@ -675,45 +765,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImpor
|
|
|
675
765
|
MatButtonModule,
|
|
676
766
|
MatSelectModule,
|
|
677
767
|
MatIconModule,
|
|
678
|
-
FormsModule], template: "<div
|
|
679
|
-
}]
|
|
680
|
-
type: Input
|
|
681
|
-
}], candidates: [{
|
|
682
|
-
type: Input
|
|
683
|
-
}], table: [{
|
|
684
|
-
type: ViewChild,
|
|
685
|
-
args: [MatTable]
|
|
686
|
-
}] } });
|
|
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
|
+
}] });
|
|
687
770
|
|
|
688
771
|
class GroupDetailComponent extends DetailView {
|
|
772
|
+
typename = "group";
|
|
689
773
|
constructor() {
|
|
690
|
-
super(inject(
|
|
774
|
+
super(inject(GroupService));
|
|
775
|
+
}
|
|
776
|
+
ngOnInit() {
|
|
777
|
+
this.onInit();
|
|
691
778
|
}
|
|
692
779
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: GroupDetailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
693
|
-
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"] }] });
|
|
694
781
|
}
|
|
695
782
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: GroupDetailComponent, decorators: [{
|
|
696
783
|
type: Component,
|
|
697
784
|
args: [{ selector: 'lib-group-detail', imports: [NgIf,
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
MatButtonModule,
|
|
701
|
-
MatCardModule,
|
|
702
|
-
MatInputModule,
|
|
703
|
-
MatFormFieldModule,
|
|
704
|
-
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"] }]
|
|
705
787
|
}], ctorParameters: () => [] });
|
|
706
788
|
|
|
707
789
|
class GroupComponent extends ListView {
|
|
708
790
|
displayedColumns = ['name'];
|
|
709
791
|
constructor() {
|
|
710
|
-
super(inject(
|
|
792
|
+
super(inject(GroupService));
|
|
711
793
|
}
|
|
712
794
|
ngOnInit() {
|
|
713
795
|
this.onInit();
|
|
714
796
|
}
|
|
715
797
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: GroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
716
|
-
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"] }] });
|
|
717
799
|
}
|
|
718
800
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: GroupComponent, decorators: [{
|
|
719
801
|
type: Component,
|
|
@@ -722,19 +804,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImpor
|
|
|
722
804
|
MatButtonModule,
|
|
723
805
|
MatIconModule,
|
|
724
806
|
RouterModule
|
|
725
|
-
], 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"] }]
|
|
726
808
|
}], ctorParameters: () => [] });
|
|
727
809
|
|
|
728
810
|
class OrganizationComponent extends ListView {
|
|
729
811
|
displayedColumns = ['name', 'website', 'is_partner'];
|
|
730
812
|
constructor() {
|
|
731
|
-
super(inject(
|
|
813
|
+
super(inject(OrganizationService));
|
|
732
814
|
}
|
|
733
815
|
ngOnInit() {
|
|
734
816
|
this.onInit();
|
|
735
817
|
}
|
|
736
818
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: OrganizationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
737
|
-
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"] }] });
|
|
738
820
|
}
|
|
739
821
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: OrganizationComponent, decorators: [{
|
|
740
822
|
type: Component,
|
|
@@ -743,37 +825,75 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImpor
|
|
|
743
825
|
MatButtonModule,
|
|
744
826
|
MatIconModule,
|
|
745
827
|
RouterModule
|
|
746
|
-
], 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"] }]
|
|
747
829
|
}], ctorParameters: () => [] });
|
|
748
830
|
|
|
749
831
|
class OrganizationDetailComponent extends DetailView {
|
|
832
|
+
typename = "organization";
|
|
750
833
|
constructor() {
|
|
751
|
-
super(inject(
|
|
834
|
+
super(inject(OrganizationService));
|
|
835
|
+
}
|
|
836
|
+
ngOnInit() {
|
|
837
|
+
this.onInit();
|
|
752
838
|
}
|
|
753
839
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: OrganizationDetailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
754
|
-
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"] }] });
|
|
755
841
|
}
|
|
756
842
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: OrganizationDetailComponent, decorators: [{
|
|
757
843
|
type: Component,
|
|
758
844
|
args: [{ selector: 'lib-organization-detail', imports: [NgIf,
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
MatButtonModule,
|
|
762
|
-
MatCardModule,
|
|
763
|
-
MatInputModule,
|
|
764
|
-
MatFormFieldModule,
|
|
765
|
-
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"] }]
|
|
766
847
|
}], ctorParameters: () => [] });
|
|
767
848
|
|
|
768
849
|
class OrganizationEditComponent extends EditView {
|
|
769
|
-
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: [''] });
|
|
770
861
|
constructor() {
|
|
771
|
-
super(inject(
|
|
862
|
+
super(inject(OrganizationService));
|
|
772
863
|
}
|
|
773
864
|
ngOnInit() {
|
|
774
865
|
this.onInit();
|
|
775
866
|
this.fetchRestOptions();
|
|
776
867
|
}
|
|
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));
|
|
880
|
+
}
|
|
881
|
+
}
|
|
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;
|
|
896
|
+
}
|
|
777
897
|
getTemplateItem() {
|
|
778
898
|
return new Organization();
|
|
779
899
|
}
|
|
@@ -783,22 +903,41 @@ class OrganizationEditComponent extends EditView {
|
|
|
783
903
|
}
|
|
784
904
|
}
|
|
785
905
|
onCountryChoices(choices) {
|
|
786
|
-
this.countryOptions
|
|
787
|
-
|
|
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; });
|
|
788
925
|
}
|
|
789
926
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: OrganizationEditComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
790
|
-
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" }] });
|
|
791
928
|
}
|
|
792
929
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImport: i0, type: OrganizationEditComponent, decorators: [{
|
|
793
930
|
type: Component,
|
|
794
931
|
args: [{ selector: 'lib-organization-edit', imports: [NgIf, NgFor,
|
|
795
|
-
|
|
932
|
+
UserSelectComponent,
|
|
933
|
+
ReactiveFormsModule,
|
|
796
934
|
MatButtonModule,
|
|
797
935
|
MatInputModule,
|
|
798
936
|
MatSelectModule,
|
|
799
937
|
MatFormFieldModule,
|
|
800
938
|
MatIconModule,
|
|
801
|
-
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"] }]
|
|
802
941
|
}], ctorParameters: () => [] });
|
|
803
942
|
|
|
804
943
|
/*
|
|
@@ -809,5 +948,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.1", ngImpor
|
|
|
809
948
|
* Generated bundle index. Do not edit.
|
|
810
949
|
*/
|
|
811
950
|
|
|
812
|
-
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 };
|
|
951
|
+
export { ApiError, BackButtonComponent, DetailHeaderComponent, DetailView, ENDPOINT_URL, EditView, ErrorCode, FileRecord, FileUploadComponent, Group, GroupComponent, GroupDetailComponent, GroupService, LOGIN_USER, LandingComponent, LeftNavComponent, LeftNavService, ListView, Organization, OrganizationComponent, OrganizationDetailComponent, OrganizationEditComponent, OrganizationService, PortalMember, RestService, TopBarComponent, UserComponent, UserDetailComponent, UserEditComponent, UserSelectComponent, UserService };
|
|
813
952
|
//# sourceMappingURL=ichec-angular-core.mjs.map
|