@posiwise/user-module 0.0.193 → 0.0.194
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AsyncPipe, CommonModule, CurrencyPipe, DatePipe, DecimalPipe, NgClass, UpperCasePipe } from "@angular/common";
|
|
1
|
+
import { AsyncPipe, CommonModule, CurrencyPipe, DatePipe, DecimalPipe, NgClass, NgTemplateOutlet, UpperCasePipe } from "@angular/common";
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
-
import { ChangeDetectorRef, Component, DestroyRef, Directive, ElementRef, EventEmitter, HostListener, Injectable, Input, NgModule, Output, Pipe, Renderer2, ViewChild, inject } from "@angular/core";
|
|
3
|
+
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, DestroyRef, Directive, ElementRef, EventEmitter, HostListener, Injectable, Input, NgModule, Output, Pipe, Renderer2, ViewChild, computed, inject, signal } from "@angular/core";
|
|
4
4
|
import * as i1 from "@angular/forms";
|
|
5
|
-
import { FormBuilder, FormsModule, NgControl, ReactiveFormsModule, Validators } from "@angular/forms";
|
|
5
|
+
import { FormBuilder, FormControl, FormGroup, FormsModule, NgControl, ReactiveFormsModule, Validators } from "@angular/forms";
|
|
6
6
|
import { Router, RouterLink, RouterModule, RouterOutlet } from "@angular/router";
|
|
7
7
|
import * as i2$1 from "@angular-magic/ngx-gp-autocomplete";
|
|
8
8
|
import { NgxGpAutocompleteModule } from "@angular-magic/ngx-gp-autocomplete";
|
|
@@ -40,9 +40,10 @@ import { TranslocoPipe, TranslocoService } from "@jsverse/transloco";
|
|
|
40
40
|
import { StatusCodes } from "http-status-codes";
|
|
41
41
|
import { getDomain } from "tldts";
|
|
42
42
|
import { AppBaseComponent } from "@posiwise/app-base-component";
|
|
43
|
+
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
44
|
+
import { catchError, finalize, map as map$1, mergeMap, switchMap } from "rxjs/operators";
|
|
43
45
|
import cloneDeep from "lodash/cloneDeep";
|
|
44
46
|
import sortBy from "lodash/sortBy";
|
|
45
|
-
import { catchError, map as map$1, mergeMap, switchMap } from "rxjs/operators";
|
|
46
47
|
import { GetUser, getUser } from "@posiwise/app-store";
|
|
47
48
|
import { Store } from "@ngrx/store";
|
|
48
49
|
import { HttpErrorResponse } from "@angular/common/http";
|
|
@@ -53,7 +54,6 @@ import { InputIcon } from "primeng/inputicon";
|
|
|
53
54
|
import { ResizableColumn, SortIcon, SortableColumn, Table } from "primeng/table";
|
|
54
55
|
import { Ripple } from "primeng/ripple";
|
|
55
56
|
import moment from "moment";
|
|
56
|
-
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
57
57
|
import { AutoComplete } from "primeng/autocomplete";
|
|
58
58
|
import { Tab, TabList, Tabs } from "primeng/tabs";
|
|
59
59
|
var AccountComponent = class AccountComponent {
|
|
@@ -441,13 +441,591 @@ var AccountAvatarSlug = class extends AccountSecurityForms {
|
|
|
441
441
|
this.cdr.markForCheck();
|
|
442
442
|
});
|
|
443
443
|
}
|
|
444
|
-
dataURLtoBlob(dataUrl) {
|
|
445
|
-
return dataUrlToBlob(dataUrl);
|
|
446
|
-
}
|
|
447
|
-
onClose() {
|
|
448
|
-
this.modalService.dismissAll();
|
|
449
|
-
}
|
|
444
|
+
dataURLtoBlob(dataUrl) {
|
|
445
|
+
return dataUrlToBlob(dataUrl);
|
|
446
|
+
}
|
|
447
|
+
onClose() {
|
|
448
|
+
this.modalService.dismissAll();
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
function sortByLabel(items, label) {
|
|
452
|
+
const text = (item) => (label(item) ?? "").replace(/[_-]+/g, " ").trim();
|
|
453
|
+
return [...items].sort((a, b) => text(a).localeCompare(text(b), void 0, {
|
|
454
|
+
sensitivity: "base",
|
|
455
|
+
numeric: true
|
|
456
|
+
}));
|
|
457
|
+
}
|
|
458
|
+
function changedCredentials(rows) {
|
|
459
|
+
return rows.filter((row) => row?.value && !String(row.value).startsWith("***"));
|
|
460
|
+
}
|
|
461
|
+
function credentialsByName(items) {
|
|
462
|
+
const groups = /* @__PURE__ */ new Map();
|
|
463
|
+
for (const item of items) groups.set(item.name, [...groups.get(item.name) ?? [], item]);
|
|
464
|
+
return groups;
|
|
465
|
+
}
|
|
466
|
+
var RequestFailure = class {
|
|
467
|
+
constructor(error) {
|
|
468
|
+
this.error = error;
|
|
469
|
+
}
|
|
470
|
+
};
|
|
471
|
+
function runAllThenReport(requests) {
|
|
472
|
+
if (!requests.length) return of([]);
|
|
473
|
+
return forkJoin(requests.map((request) => request.pipe(catchError((error) => of(new RequestFailure(error)))))).pipe(switchMap((results) => {
|
|
474
|
+
const failure = results.find((result) => result instanceof RequestFailure);
|
|
475
|
+
return failure ? throwError(() => failure.error) : of(results);
|
|
476
|
+
}));
|
|
477
|
+
}
|
|
478
|
+
var ClearMaskedOnFocusDirective = class ClearMaskedOnFocusDirective {
|
|
479
|
+
constructor() {
|
|
480
|
+
this.control = inject(NgControl, {
|
|
481
|
+
optional: true,
|
|
482
|
+
self: true
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
onFocus(event) {
|
|
486
|
+
const input = event.target;
|
|
487
|
+
const value = input?.value ?? "";
|
|
488
|
+
if (/\*{3,}/.test(value)) {
|
|
489
|
+
this.control?.control?.setValue("");
|
|
490
|
+
input.value = "";
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
static {
|
|
494
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
495
|
+
minVersion: "12.0.0",
|
|
496
|
+
version: "22.2.3",
|
|
497
|
+
ngImport: i0,
|
|
498
|
+
type: ClearMaskedOnFocusDirective,
|
|
499
|
+
deps: [],
|
|
500
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
static {
|
|
504
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
505
|
+
minVersion: "14.0.0",
|
|
506
|
+
version: "22.2.3",
|
|
507
|
+
type: ClearMaskedOnFocusDirective,
|
|
508
|
+
isStandalone: true,
|
|
509
|
+
selector: "input[pwClearMaskedOnFocus]",
|
|
510
|
+
host: { listeners: { "focus": "onFocus($event)" } },
|
|
511
|
+
ngImport: i0
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
516
|
+
minVersion: "12.0.0",
|
|
517
|
+
version: "22.2.3",
|
|
518
|
+
ngImport: i0,
|
|
519
|
+
type: ClearMaskedOnFocusDirective,
|
|
520
|
+
decorators: [{
|
|
521
|
+
type: Directive,
|
|
522
|
+
args: [{ selector: "input[pwClearMaskedOnFocus]" }]
|
|
523
|
+
}],
|
|
524
|
+
propDecorators: { onFocus: [{
|
|
525
|
+
type: HostListener,
|
|
526
|
+
args: ["focus", ["$event"]]
|
|
527
|
+
}] }
|
|
528
|
+
});
|
|
529
|
+
const ACRONYMS = /* @__PURE__ */ new Set([
|
|
530
|
+
"id",
|
|
531
|
+
"url",
|
|
532
|
+
"api",
|
|
533
|
+
"aws",
|
|
534
|
+
"smtp",
|
|
535
|
+
"ssl",
|
|
536
|
+
"tls",
|
|
537
|
+
"iam",
|
|
538
|
+
"sso",
|
|
539
|
+
"sdk",
|
|
540
|
+
"jwt",
|
|
541
|
+
"oauth"
|
|
542
|
+
]);
|
|
543
|
+
var SubscriptionNameByIdPipe = class SubscriptionNameByIdPipe {
|
|
544
|
+
transform(subs, id) {
|
|
545
|
+
if (!subs || id == null) return "";
|
|
546
|
+
const found = subs.find((s) => String(s.id) === String(id));
|
|
547
|
+
return found?.organisation || found?.organization || found?.name || "";
|
|
548
|
+
}
|
|
549
|
+
static {
|
|
550
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
551
|
+
minVersion: "12.0.0",
|
|
552
|
+
version: "22.2.3",
|
|
553
|
+
ngImport: i0,
|
|
554
|
+
type: SubscriptionNameByIdPipe,
|
|
555
|
+
deps: [],
|
|
556
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
static {
|
|
560
|
+
this.ɵpipe = i0.ɵɵngDeclarePipe({
|
|
561
|
+
minVersion: "14.0.0",
|
|
562
|
+
version: "22.2.3",
|
|
563
|
+
ngImport: i0,
|
|
564
|
+
type: SubscriptionNameByIdPipe,
|
|
565
|
+
isStandalone: true,
|
|
566
|
+
name: "subscriptionNameById"
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
};
|
|
570
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
571
|
+
minVersion: "12.0.0",
|
|
572
|
+
version: "22.2.3",
|
|
573
|
+
ngImport: i0,
|
|
574
|
+
type: SubscriptionNameByIdPipe,
|
|
575
|
+
decorators: [{
|
|
576
|
+
type: Pipe,
|
|
577
|
+
args: [{ name: "subscriptionNameById" }]
|
|
578
|
+
}]
|
|
579
|
+
});
|
|
580
|
+
var CredentialAvatarHuePipe = class CredentialAvatarHuePipe {
|
|
581
|
+
transform(value) {
|
|
582
|
+
if (!value) return 215;
|
|
583
|
+
let hash = 0;
|
|
584
|
+
for (let i = 0; i < value.length; i++) hash = hash * 31 + value.charCodeAt(i) | 0;
|
|
585
|
+
return Math.abs(hash) % 360;
|
|
586
|
+
}
|
|
587
|
+
static {
|
|
588
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
589
|
+
minVersion: "12.0.0",
|
|
590
|
+
version: "22.2.3",
|
|
591
|
+
ngImport: i0,
|
|
592
|
+
type: CredentialAvatarHuePipe,
|
|
593
|
+
deps: [],
|
|
594
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
static {
|
|
598
|
+
this.ɵpipe = i0.ɵɵngDeclarePipe({
|
|
599
|
+
minVersion: "14.0.0",
|
|
600
|
+
version: "22.2.3",
|
|
601
|
+
ngImport: i0,
|
|
602
|
+
type: CredentialAvatarHuePipe,
|
|
603
|
+
isStandalone: true,
|
|
604
|
+
name: "credentialAvatarHue"
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
};
|
|
608
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
609
|
+
minVersion: "12.0.0",
|
|
610
|
+
version: "22.2.3",
|
|
611
|
+
ngImport: i0,
|
|
612
|
+
type: CredentialAvatarHuePipe,
|
|
613
|
+
decorators: [{
|
|
614
|
+
type: Pipe,
|
|
615
|
+
args: [{ name: "credentialAvatarHue" }]
|
|
616
|
+
}]
|
|
617
|
+
});
|
|
618
|
+
var HumanizeCredentialNamePipe = class HumanizeCredentialNamePipe {
|
|
619
|
+
transform(value) {
|
|
620
|
+
if (!value) return "";
|
|
621
|
+
return value.replace(/[_-]+/g, " ").split(" ").filter(Boolean).map((word) => ACRONYMS.has(word.toLowerCase()) ? word.toUpperCase() : word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
|
|
622
|
+
}
|
|
623
|
+
static {
|
|
624
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
625
|
+
minVersion: "12.0.0",
|
|
626
|
+
version: "22.2.3",
|
|
627
|
+
ngImport: i0,
|
|
628
|
+
type: HumanizeCredentialNamePipe,
|
|
629
|
+
deps: [],
|
|
630
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
631
|
+
});
|
|
632
|
+
}
|
|
633
|
+
static {
|
|
634
|
+
this.ɵpipe = i0.ɵɵngDeclarePipe({
|
|
635
|
+
minVersion: "14.0.0",
|
|
636
|
+
version: "22.2.3",
|
|
637
|
+
ngImport: i0,
|
|
638
|
+
type: HumanizeCredentialNamePipe,
|
|
639
|
+
isStandalone: true,
|
|
640
|
+
name: "humanizeCredentialName"
|
|
641
|
+
});
|
|
642
|
+
}
|
|
643
|
+
};
|
|
644
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
645
|
+
minVersion: "12.0.0",
|
|
646
|
+
version: "22.2.3",
|
|
647
|
+
ngImport: i0,
|
|
648
|
+
type: HumanizeCredentialNamePipe,
|
|
649
|
+
decorators: [{
|
|
650
|
+
type: Pipe,
|
|
651
|
+
args: [{ name: "humanizeCredentialName" }]
|
|
652
|
+
}]
|
|
653
|
+
});
|
|
654
|
+
const NAME_KEYS = { personal_smtp: "PersonalSmtp" };
|
|
655
|
+
const FIELD_KEYS = {
|
|
656
|
+
address: "Address",
|
|
657
|
+
port: "Port",
|
|
658
|
+
user_name: "UserName",
|
|
659
|
+
password: "Password",
|
|
660
|
+
from_email: "FromEmail"
|
|
661
|
+
};
|
|
662
|
+
const humanize = new HumanizeCredentialNamePipe();
|
|
663
|
+
function credentialGroups(rows) {
|
|
664
|
+
return [...credentialsByName(rows)].map(([name, fields]) => ({
|
|
665
|
+
name,
|
|
666
|
+
rows: fields,
|
|
667
|
+
configured: fields.some((field) => field.configured)
|
|
668
|
+
}));
|
|
669
|
+
}
|
|
670
|
+
function credentialNameKey(name, part) {
|
|
671
|
+
return NAME_KEYS[name] ? `User.Credentials.${NAME_KEYS[name]}.${part}` : null;
|
|
672
|
+
}
|
|
673
|
+
function credentialTypeOptions(groups, translate) {
|
|
674
|
+
return sortByLabel(groups.map(({ name }) => {
|
|
675
|
+
const key = credentialNameKey(name, "Title");
|
|
676
|
+
return {
|
|
677
|
+
name,
|
|
678
|
+
label: key ? translate(key) : humanize.transform(name)
|
|
679
|
+
};
|
|
680
|
+
}), (option) => option.label);
|
|
681
|
+
}
|
|
682
|
+
function credentialFieldKey(field) {
|
|
683
|
+
return FIELD_KEYS[field] ? `User.Credentials.Field.${FIELD_KEYS[field]}.Label` : null;
|
|
684
|
+
}
|
|
685
|
+
function credentialPlaceholder(field) {
|
|
686
|
+
if (field === "port") return null;
|
|
687
|
+
if (FIELD_KEYS[field]) return { key: `User.Credentials.Field.${FIELD_KEYS[field]}.Placeholder` };
|
|
688
|
+
return {
|
|
689
|
+
key: "User.Credentials.Field.GenericPlaceholder",
|
|
690
|
+
params: { field: humanize.transform(field).split(" ").map((word) => word === word.toUpperCase() ? word : word.toLowerCase()).join(" ") }
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
function enteredValues(rows, values) {
|
|
694
|
+
return changedCredentials(rows.map((row) => ({
|
|
695
|
+
credentialId: row.credential_id,
|
|
696
|
+
value: `${values[row.credential_id] ?? ""}`.trim()
|
|
697
|
+
})));
|
|
698
|
+
}
|
|
699
|
+
function credentialForm(rows) {
|
|
700
|
+
return new FormGroup(Object.fromEntries(rows.map((row) => [`${row.credential_id}`, new FormControl(row.configured ? row.value ?? "" : "")])));
|
|
701
|
+
}
|
|
702
|
+
var AccountUserCredentialsComponent = class AccountUserCredentialsComponent {
|
|
703
|
+
constructor() {
|
|
704
|
+
this.userService = inject(UserService);
|
|
705
|
+
this.confirmDialog = inject(ConfirmDialogService);
|
|
706
|
+
this.destroyRef = inject(DestroyRef);
|
|
707
|
+
this.transloco = inject(TranslocoService);
|
|
708
|
+
this.subscriptions = signal([], ...ngDevMode ? [{ debugName: "subscriptions" }] : /* istanbul ignore next */ []);
|
|
709
|
+
this.groups = signal([], ...ngDevMode ? [{ debugName: "groups" }] : /* istanbul ignore next */ []);
|
|
710
|
+
this.selectedName = signal(null, ...ngDevMode ? [{ debugName: "selectedName" }] : /* istanbul ignore next */ []);
|
|
711
|
+
this.editing = signal(false, ...ngDevMode ? [{ debugName: "editing" }] : /* istanbul ignore next */ []);
|
|
712
|
+
this.showForm = signal(false, ...ngDevMode ? [{ debugName: "showForm" }] : /* istanbul ignore next */ []);
|
|
713
|
+
this.form = signal(credentialForm([]), ...ngDevMode ? [{ debugName: "form" }] : /* istanbul ignore next */ []);
|
|
714
|
+
this.loading = signal(true, ...ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []);
|
|
715
|
+
this.saving = signal(false, ...ngDevMode ? [{ debugName: "saving" }] : /* istanbul ignore next */ []);
|
|
716
|
+
this.subscriptionControl = new FormControl(null);
|
|
717
|
+
this.saved = computed(() => this.groups().filter((group) => group.configured), ...ngDevMode ? [{ debugName: "saved" }] : /* istanbul ignore next */ []);
|
|
718
|
+
this.addable = computed(() => this.groups().filter((group) => !group.configured), ...ngDevMode ? [{ debugName: "addable" }] : /* istanbul ignore next */ []);
|
|
719
|
+
this.typeOptions = computed(() => credentialTypeOptions(this.addable(), (key) => this.transloco.translate(key)), ...ngDevMode ? [{ debugName: "typeOptions" }] : /* istanbul ignore next */ []);
|
|
720
|
+
this.selected = computed(() => this.groups().find((group) => group.name === this.selectedName()), ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
|
|
721
|
+
this.nameKey = credentialNameKey;
|
|
722
|
+
this.fieldKey = credentialFieldKey;
|
|
723
|
+
this.placeholder = credentialPlaceholder;
|
|
724
|
+
}
|
|
725
|
+
ngOnInit() {
|
|
726
|
+
this.subscriptionControl.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((id) => this.loadCredentials(id));
|
|
727
|
+
this.userService.getUserSubscriptions(this.userId).subscribe({
|
|
728
|
+
next: ({ result }) => {
|
|
729
|
+
this.subscriptions.set(result?.subscriptions ?? []);
|
|
730
|
+
const first = this.subscriptions()[0]?.id ?? null;
|
|
731
|
+
if (first) this.subscriptionControl.setValue(first);
|
|
732
|
+
else this.loading.set(false);
|
|
733
|
+
},
|
|
734
|
+
error: () => this.loading.set(false)
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
open(group) {
|
|
738
|
+
this.editing.set(!!group);
|
|
739
|
+
this.select(group?.name ?? null);
|
|
740
|
+
this.showForm.set(true);
|
|
741
|
+
}
|
|
742
|
+
select(name) {
|
|
743
|
+
this.selectedName.set(name);
|
|
744
|
+
this.form.set(credentialForm(this.selected()?.rows ?? []));
|
|
745
|
+
}
|
|
746
|
+
cancel() {
|
|
747
|
+
this.showForm.set(false);
|
|
748
|
+
this.selectedName.set(null);
|
|
749
|
+
}
|
|
750
|
+
save() {
|
|
751
|
+
const group = this.selected();
|
|
752
|
+
const subscriptionId = this.subscriptionControl.value;
|
|
753
|
+
const entries = group ? enteredValues(group.rows, this.form().getRawValue()) : [];
|
|
754
|
+
if (!entries.length || !subscriptionId) return;
|
|
755
|
+
this.run(runAllThenReport(entries.map((e) => this.userService.saveUserCredential(subscriptionId, e.credentialId, e.value))));
|
|
756
|
+
}
|
|
757
|
+
remove(group) {
|
|
758
|
+
const subscriptionId = this.subscriptionControl.value;
|
|
759
|
+
const saved = group.rows.filter((row) => row.configured);
|
|
760
|
+
if (!subscriptionId || !saved.length) return;
|
|
761
|
+
this.confirmDialog.confirmDelete({
|
|
762
|
+
titleKey: "User.Credentials.RemoveTitle",
|
|
763
|
+
textKey: "User.Credentials.RemoveText",
|
|
764
|
+
confirmLabelKey: "User.Credentials.Remove"
|
|
765
|
+
}).then((ok) => {
|
|
766
|
+
if (ok) this.run(runAllThenReport(saved.map((row) => this.userService.deleteUserCredential(subscriptionId, row.credential_id))));
|
|
767
|
+
});
|
|
768
|
+
}
|
|
769
|
+
run(request) {
|
|
770
|
+
this.saving.set(true);
|
|
771
|
+
request.pipe(finalize(() => this.saving.set(false))).subscribe({ next: () => {
|
|
772
|
+
this.cancel();
|
|
773
|
+
this.loadCredentials(this.subscriptionControl.value);
|
|
774
|
+
} });
|
|
775
|
+
}
|
|
776
|
+
loadCredentials(subscriptionId) {
|
|
777
|
+
if (!subscriptionId) return;
|
|
778
|
+
this.cancel();
|
|
779
|
+
this.loadRequest?.unsubscribe();
|
|
780
|
+
this.loading.set(true);
|
|
781
|
+
this.groups.set([]);
|
|
782
|
+
this.loadRequest = this.userService.getUserCredentials(subscriptionId).pipe(finalize(() => this.loading.set(false))).subscribe({ next: ({ result }) => this.groups.set(credentialGroups(result ?? [])) });
|
|
783
|
+
}
|
|
784
|
+
static {
|
|
785
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
786
|
+
minVersion: "12.0.0",
|
|
787
|
+
version: "22.2.3",
|
|
788
|
+
ngImport: i0,
|
|
789
|
+
type: AccountUserCredentialsComponent,
|
|
790
|
+
deps: [],
|
|
791
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
792
|
+
});
|
|
793
|
+
}
|
|
794
|
+
static {
|
|
795
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
796
|
+
minVersion: "17.0.0",
|
|
797
|
+
version: "22.2.3",
|
|
798
|
+
type: AccountUserCredentialsComponent,
|
|
799
|
+
isStandalone: true,
|
|
800
|
+
selector: "pw-account-user-credentials",
|
|
801
|
+
inputs: { userId: "userId" },
|
|
802
|
+
ngImport: i0,
|
|
803
|
+
template: "@if (subscriptions().length > 0) {\n <section id=\"user-credentials\"\n class=\"card p-4 h-auto\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Credentials.Title' | transloco }}</h2>\n <p>{{ 'User.Credentials.Description' | transloco }}</p>\n </div>\n <div class=\"col-12 col-md-4\">\n <pw-input-container [label]=\"'User.Credentials.Subscription' | transloco\"\n name=\"credential_subscription\"\n controlId=\"user-credentials-subscription\"\n [useAriaLabelledbyOnly]=\"true\">\n <p-select\n [attr.aria-labelledby]=\"'user-credentials-subscription-label'\"\n [options]=\"subscriptions()\"\n optionLabel=\"organisation\"\n optionValue=\"id\"\n appendTo=\"body\"\n [formControl]=\"subscriptionControl\"\n placeholder=\"{{ 'User.Credentials.SelectSubscription' | transloco }}\">\n </p-select>\n </pw-input-container>\n </div>\n <div class=\"col-12\">\n <pw-loader [isVisible]=\"loading()\"></pw-loader>\n @if (!loading()) {\n @if (groups().length === 0) {\n <p class=\"text-muted\">{{ 'User.Credentials.NoneAvailable' | transloco }}</p>\n } @else if (showForm()) {\n <form class=\"user-credentials-form\"\n [formGroup]=\"form()\"\n (ngSubmit)=\"save()\">\n @if (editing() && selected(); as group) {\n <h3><ng-container *ngTemplateOutlet=\"titleOf; context: { $implicit: group.name }\"></ng-container></h3>\n } @else {\n <div class=\"row\">\n <div class=\"col-12 col-md-4\">\n <pw-input-container [label]=\"'User.Credentials.Type' | transloco\"\n name=\"credential_type\"\n controlId=\"user-credentials-type\"\n [useAriaLabelledbyOnly]=\"true\">\n <p-select\n [attr.aria-labelledby]=\"'user-credentials-type-label'\"\n [options]=\"typeOptions()\"\n optionLabel=\"label\"\n optionValue=\"name\"\n appendTo=\"body\"\n [placeholder]=\"'User.Credentials.SelectType' | transloco\"\n (onChange)=\"select($event.value)\">\n </p-select>\n </pw-input-container>\n </div>\n </div>\n }\n @if (selected(); as group) {\n @if (nameKey(group.name, 'Description'); as descriptionKey) {\n <p class=\"text-muted\">{{ descriptionKey | transloco }}</p>\n } @else if (group.rows[0].description) {\n <p class=\"text-muted\">{{ group.rows[0].description }}</p>\n }\n <div class=\"row\">\n @for (row of group.rows; track row.credential_id) {\n <div class=\"col-12 col-md-4\">\n @let hint = placeholder(row.field);\n <pw-input-container [label]=\"fieldKey(row.field) ? (fieldKey(row.field) | transloco) : (row.field | humanizeCredentialName)\"\n [name]=\"row.field\"\n [controlId]=\"'user-credential-' + row.credential_id\">\n <input class=\"form-control\"\n [id]=\"'user-credential-' + row.credential_id\"\n type=\"text\"\n pwClearMaskedOnFocus\n [formControlName]=\"'' + row.credential_id\"\n autocomplete=\"off\"\n [placeholder]=\"hint ? (hint.key | transloco: hint.params) : ''\"/>\n </pw-input-container>\n </div>\n }\n </div>\n }\n <div class=\"d-flex gap-2 mt-2\">\n <button type=\"button\"\n class=\"btn btn-outline-default\"\n [disabled]=\"saving()\"\n (click)=\"cancel()\">\n {{ 'User.Credentials.Cancel' | transloco }}\n </button>\n @if (selected()) {\n <button type=\"submit\"\n class=\"btn btn-primary\"\n [disabled]=\"saving()\">\n {{ 'User.Credentials.Save' | transloco }}\n </button>\n }\n </div>\n </form>\n } @else {\n @if (saved().length === 0) {\n <p class=\"text-muted\">{{ 'User.Credentials.Empty' | transloco }}</p>\n }\n <ul class=\"credential-grid\">\n @for (group of saved(); track group.name) {\n @let title = nameKey(group.name, 'Title') ? (nameKey(group.name, 'Title')! | transloco) : (group.name | humanizeCredentialName);\n <li class=\"credential-card\">\n <header class=\"credential-card-header\" [style.--avatar-hue]=\"group.name | credentialAvatarHue\">\n <span class=\"credential-avatar\" aria-hidden=\"true\">{{ title.charAt(0) }}</span>\n <h3 class=\"credential-card-title\">{{ title }}</h3>\n <div class=\"credential-card-actions\">\n <button type=\"button\"\n class=\"credential-icon-btn\"\n [attr.aria-label]=\"'User.Credentials.Edit' | transloco\"\n [disabled]=\"saving()\"\n (click)=\"open(group)\">\n <i class=\"fa fa-pen\" aria-hidden=\"true\"></i>\n </button>\n <button type=\"button\"\n class=\"credential-icon-btn credential-icon-btn--danger\"\n [attr.aria-label]=\"'User.Credentials.Remove' | transloco\"\n [disabled]=\"saving()\"\n (click)=\"remove(group)\">\n <i class=\"fa fa-trash\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </header>\n <dl class=\"credential-card-fields\">\n @for (row of group.rows; track row.credential_id) {\n @if (row.configured) {\n <div class=\"credential-card-row\">\n <dt>{{ fieldKey(row.field) ? (fieldKey(row.field) | transloco) : (row.field | humanizeCredentialName) }}</dt>\n <dd><code class=\"credential-card-value\">{{ row.value }}</code></dd>\n </div>\n }\n }\n </dl>\n </li>\n }\n </ul>\n @if (addable().length > 0) {\n <button type=\"button\"\n class=\"btn btn-outline-primary btn-sm mt-3\"\n (click)=\"open()\">\n <i class=\"fa fa-plus-circle\" aria-hidden=\"true\"></i>\n {{ 'User.Credentials.Add' | transloco }}\n </button>\n }\n }\n }\n </div>\n </div>\n </section>\n}\n<ng-template #titleOf let-name>{{ nameKey(name, 'Title') ? (nameKey(name, 'Title') | transloco) : (name | humanizeCredentialName) }}</ng-template>\n",
|
|
804
|
+
styles: [".credential-grid{list-style:none;padding:0;margin:16px 0 0;width:100%;display:grid;gap:16px;grid-template-columns:repeat(auto-fill,minmax(min(360px,100%),1fr))}.credential-card{background:#fff;border:1px solid #e2e5ea;border-radius:10px;display:flex;flex-direction:column;overflow:hidden;transition:border-color .15s ease-out}.credential-card:hover{border-color:#cfd4dc}.credential-card-header{display:flex;align-items:center;gap:12px;padding:14px 16px;background:hsl(var(--avatar-hue, 215),60%,97%);border-bottom:1px solid hsl(var(--avatar-hue, 215),40%,90%)}.credential-avatar{width:36px;height:36px;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;font-size:15px;font-weight:700;line-height:1;color:hsl(var(--avatar-hue, 215),60%,28%);background:hsl(var(--avatar-hue, 215),70%,92%);border:1px solid hsl(var(--avatar-hue, 215),50%,82%);flex-shrink:0;text-transform:uppercase}.credential-card-header h3.credential-card-title{font-size:15px;font-weight:600;line-height:1;height:36px;color:#1a1d21;margin:0!important;padding:0!important;flex:1 1 auto;min-width:0;display:flex;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.credential-icon-btn{appearance:none;background:transparent;border:1px solid transparent;border-radius:6px;width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;color:#5a6473;cursor:pointer;transition:background-color .12s ease-out,color .12s ease-out,border-color .12s ease-out}.credential-icon-btn .fa{font-size:13px}.credential-icon-btn:hover,.credential-icon-btn:focus-visible{background-color:#fff;color:#1a1d21;border-color:#e2e5ea;outline:none}.credential-icon-btn--danger:hover,.credential-icon-btn--danger:focus-visible{color:var(--bs-danger, #dc3545)}.credential-card-actions{display:inline-flex;gap:4px}.credential-card-fields{margin:0;padding:4px 16px 12px;display:flex;flex-direction:column}.credential-card-row{display:grid;grid-template-columns:minmax(120px,1fr) minmax(0,2fr);align-items:center;gap:12px;padding:10px 0;border-bottom:1px dashed #eef0f3}.credential-card-row:last-child{border-bottom:0}.credential-card-row dt{font-size:11px;font-weight:500;color:#5a6473;letter-spacing:.05em;text-transform:uppercase;margin:0}.credential-card-row dd{margin:0;min-width:0;text-align:right}.credential-card-value{font-size:12.5px;font-weight:500;color:#5a6473;background:#f7f8fa;border:1px solid #e2e5ea;border-radius:4px;padding:3px 8px;display:inline-block;max-width:100%;word-break:break-all;line-height:1.5;-webkit-user-select:all;user-select:all}@media(max-width:575px){.credential-card-row{grid-template-columns:1fr;gap:4px}.credential-card-row dd{text-align:left}}\n"],
|
|
805
|
+
dependencies: [
|
|
806
|
+
{
|
|
807
|
+
kind: "directive",
|
|
808
|
+
type: NgTemplateOutlet,
|
|
809
|
+
selector: "[ngTemplateOutlet]",
|
|
810
|
+
inputs: [
|
|
811
|
+
"ngTemplateOutletContext",
|
|
812
|
+
"ngTemplateOutlet",
|
|
813
|
+
"ngTemplateOutletInjector"
|
|
814
|
+
]
|
|
815
|
+
},
|
|
816
|
+
{
|
|
817
|
+
kind: "ngmodule",
|
|
818
|
+
type: ReactiveFormsModule
|
|
819
|
+
},
|
|
820
|
+
{
|
|
821
|
+
kind: "directive",
|
|
822
|
+
type: i1.ɵNgNoValidate,
|
|
823
|
+
selector: "form:not([ngNoForm]):not([ngNativeValidate])"
|
|
824
|
+
},
|
|
825
|
+
{
|
|
826
|
+
kind: "directive",
|
|
827
|
+
type: i1.DefaultValueAccessor,
|
|
828
|
+
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
829
|
+
},
|
|
830
|
+
{
|
|
831
|
+
kind: "directive",
|
|
832
|
+
type: i1.NgControlStatus,
|
|
833
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
834
|
+
},
|
|
835
|
+
{
|
|
836
|
+
kind: "directive",
|
|
837
|
+
type: i1.NgControlStatusGroup,
|
|
838
|
+
selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
|
|
839
|
+
},
|
|
840
|
+
{
|
|
841
|
+
kind: "directive",
|
|
842
|
+
type: i1.FormControlDirective,
|
|
843
|
+
selector: "[formControl]",
|
|
844
|
+
inputs: [
|
|
845
|
+
"formControl",
|
|
846
|
+
"disabled",
|
|
847
|
+
"ngModel"
|
|
848
|
+
],
|
|
849
|
+
outputs: ["ngModelChange"],
|
|
850
|
+
exportAs: ["ngForm"]
|
|
851
|
+
},
|
|
852
|
+
{
|
|
853
|
+
kind: "directive",
|
|
854
|
+
type: i1.FormGroupDirective,
|
|
855
|
+
selector: "[formGroup]",
|
|
856
|
+
inputs: ["formGroup"],
|
|
857
|
+
outputs: ["ngSubmit"],
|
|
858
|
+
exportAs: ["ngForm"]
|
|
859
|
+
},
|
|
860
|
+
{
|
|
861
|
+
kind: "directive",
|
|
862
|
+
type: i1.FormControlName,
|
|
863
|
+
selector: "[formControlName]",
|
|
864
|
+
inputs: [
|
|
865
|
+
"formControlName",
|
|
866
|
+
"disabled",
|
|
867
|
+
"ngModel"
|
|
868
|
+
],
|
|
869
|
+
outputs: ["ngModelChange"]
|
|
870
|
+
},
|
|
871
|
+
{
|
|
872
|
+
kind: "component",
|
|
873
|
+
type: Select,
|
|
874
|
+
selector: "p-select",
|
|
875
|
+
inputs: [
|
|
876
|
+
"id",
|
|
877
|
+
"scrollHeight",
|
|
878
|
+
"filter",
|
|
879
|
+
"panelStyle",
|
|
880
|
+
"panelStyleClass",
|
|
881
|
+
"readonly",
|
|
882
|
+
"editable",
|
|
883
|
+
"tabindex",
|
|
884
|
+
"placeholder",
|
|
885
|
+
"loadingIcon",
|
|
886
|
+
"filterPlaceholder",
|
|
887
|
+
"filterLocale",
|
|
888
|
+
"inputId",
|
|
889
|
+
"dataKey",
|
|
890
|
+
"filterBy",
|
|
891
|
+
"filterFields",
|
|
892
|
+
"autofocus",
|
|
893
|
+
"resetFilterOnHide",
|
|
894
|
+
"checkmark",
|
|
895
|
+
"dropdownIcon",
|
|
896
|
+
"loading",
|
|
897
|
+
"optionLabel",
|
|
898
|
+
"optionValue",
|
|
899
|
+
"optionDisabled",
|
|
900
|
+
"optionGroupLabel",
|
|
901
|
+
"optionGroupChildren",
|
|
902
|
+
"group",
|
|
903
|
+
"showClear",
|
|
904
|
+
"emptyFilterMessage",
|
|
905
|
+
"emptyMessage",
|
|
906
|
+
"lazy",
|
|
907
|
+
"virtualScroll",
|
|
908
|
+
"virtualScrollItemSize",
|
|
909
|
+
"virtualScrollOptions",
|
|
910
|
+
"overlayOptions",
|
|
911
|
+
"ariaFilterLabel",
|
|
912
|
+
"ariaLabel",
|
|
913
|
+
"ariaLabelledBy",
|
|
914
|
+
"filterMatchMode",
|
|
915
|
+
"tooltip",
|
|
916
|
+
"tooltipPosition",
|
|
917
|
+
"tooltipPositionStyle",
|
|
918
|
+
"tooltipStyleClass",
|
|
919
|
+
"focusOnHover",
|
|
920
|
+
"selectOnFocus",
|
|
921
|
+
"multiple",
|
|
922
|
+
"autoOptionFocus",
|
|
923
|
+
"autofocusFilter",
|
|
924
|
+
"filterValue",
|
|
925
|
+
"options",
|
|
926
|
+
"appendTo",
|
|
927
|
+
"motionOptions"
|
|
928
|
+
],
|
|
929
|
+
outputs: [
|
|
930
|
+
"onChange",
|
|
931
|
+
"onFilter",
|
|
932
|
+
"onFocus",
|
|
933
|
+
"onBlur",
|
|
934
|
+
"onClick",
|
|
935
|
+
"onShow",
|
|
936
|
+
"onHide",
|
|
937
|
+
"onClear",
|
|
938
|
+
"onLazyLoad"
|
|
939
|
+
]
|
|
940
|
+
},
|
|
941
|
+
{
|
|
942
|
+
kind: "component",
|
|
943
|
+
type: InputContainerComponent,
|
|
944
|
+
selector: "pw-input-container",
|
|
945
|
+
inputs: [
|
|
946
|
+
"name",
|
|
947
|
+
"controlId",
|
|
948
|
+
"useAriaLabelledbyOnly",
|
|
949
|
+
"label",
|
|
950
|
+
"labelClass",
|
|
951
|
+
"tooltipPosition",
|
|
952
|
+
"required",
|
|
953
|
+
"errorMsg",
|
|
954
|
+
"isReadOnly",
|
|
955
|
+
"showTooltip",
|
|
956
|
+
"tooltipText",
|
|
957
|
+
"showTriangle",
|
|
958
|
+
"afterLabel",
|
|
959
|
+
"showAfterLabel",
|
|
960
|
+
"showTriangleText",
|
|
961
|
+
"isLeftTooltip"
|
|
962
|
+
]
|
|
963
|
+
},
|
|
964
|
+
{
|
|
965
|
+
kind: "component",
|
|
966
|
+
type: AppLoaderComponent,
|
|
967
|
+
selector: "pw-loader",
|
|
968
|
+
inputs: [
|
|
969
|
+
"isVisible",
|
|
970
|
+
"closeOnOutsideClick",
|
|
971
|
+
"autoCloseTimeOut"
|
|
972
|
+
]
|
|
973
|
+
},
|
|
974
|
+
{
|
|
975
|
+
kind: "directive",
|
|
976
|
+
type: ClearMaskedOnFocusDirective,
|
|
977
|
+
selector: "input[pwClearMaskedOnFocus]"
|
|
978
|
+
},
|
|
979
|
+
{
|
|
980
|
+
kind: "pipe",
|
|
981
|
+
type: HumanizeCredentialNamePipe,
|
|
982
|
+
name: "humanizeCredentialName"
|
|
983
|
+
},
|
|
984
|
+
{
|
|
985
|
+
kind: "pipe",
|
|
986
|
+
type: CredentialAvatarHuePipe,
|
|
987
|
+
name: "credentialAvatarHue"
|
|
988
|
+
},
|
|
989
|
+
{
|
|
990
|
+
kind: "pipe",
|
|
991
|
+
type: TranslocoPipe,
|
|
992
|
+
name: "transloco"
|
|
993
|
+
}
|
|
994
|
+
],
|
|
995
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
996
|
+
});
|
|
997
|
+
}
|
|
450
998
|
};
|
|
999
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1000
|
+
minVersion: "12.0.0",
|
|
1001
|
+
version: "22.2.3",
|
|
1002
|
+
ngImport: i0,
|
|
1003
|
+
type: AccountUserCredentialsComponent,
|
|
1004
|
+
decorators: [{
|
|
1005
|
+
type: Component,
|
|
1006
|
+
args: [{
|
|
1007
|
+
selector: "pw-account-user-credentials",
|
|
1008
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1009
|
+
imports: [
|
|
1010
|
+
NgTemplateOutlet,
|
|
1011
|
+
ReactiveFormsModule,
|
|
1012
|
+
Select,
|
|
1013
|
+
InputContainerComponent,
|
|
1014
|
+
AppLoaderComponent,
|
|
1015
|
+
HumanizeCredentialNamePipe,
|
|
1016
|
+
CredentialAvatarHuePipe,
|
|
1017
|
+
ClearMaskedOnFocusDirective,
|
|
1018
|
+
TranslocoPipe
|
|
1019
|
+
],
|
|
1020
|
+
template: "@if (subscriptions().length > 0) {\n <section id=\"user-credentials\"\n class=\"card p-4 h-auto\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Credentials.Title' | transloco }}</h2>\n <p>{{ 'User.Credentials.Description' | transloco }}</p>\n </div>\n <div class=\"col-12 col-md-4\">\n <pw-input-container [label]=\"'User.Credentials.Subscription' | transloco\"\n name=\"credential_subscription\"\n controlId=\"user-credentials-subscription\"\n [useAriaLabelledbyOnly]=\"true\">\n <p-select\n [attr.aria-labelledby]=\"'user-credentials-subscription-label'\"\n [options]=\"subscriptions()\"\n optionLabel=\"organisation\"\n optionValue=\"id\"\n appendTo=\"body\"\n [formControl]=\"subscriptionControl\"\n placeholder=\"{{ 'User.Credentials.SelectSubscription' | transloco }}\">\n </p-select>\n </pw-input-container>\n </div>\n <div class=\"col-12\">\n <pw-loader [isVisible]=\"loading()\"></pw-loader>\n @if (!loading()) {\n @if (groups().length === 0) {\n <p class=\"text-muted\">{{ 'User.Credentials.NoneAvailable' | transloco }}</p>\n } @else if (showForm()) {\n <form class=\"user-credentials-form\"\n [formGroup]=\"form()\"\n (ngSubmit)=\"save()\">\n @if (editing() && selected(); as group) {\n <h3><ng-container *ngTemplateOutlet=\"titleOf; context: { $implicit: group.name }\"></ng-container></h3>\n } @else {\n <div class=\"row\">\n <div class=\"col-12 col-md-4\">\n <pw-input-container [label]=\"'User.Credentials.Type' | transloco\"\n name=\"credential_type\"\n controlId=\"user-credentials-type\"\n [useAriaLabelledbyOnly]=\"true\">\n <p-select\n [attr.aria-labelledby]=\"'user-credentials-type-label'\"\n [options]=\"typeOptions()\"\n optionLabel=\"label\"\n optionValue=\"name\"\n appendTo=\"body\"\n [placeholder]=\"'User.Credentials.SelectType' | transloco\"\n (onChange)=\"select($event.value)\">\n </p-select>\n </pw-input-container>\n </div>\n </div>\n }\n @if (selected(); as group) {\n @if (nameKey(group.name, 'Description'); as descriptionKey) {\n <p class=\"text-muted\">{{ descriptionKey | transloco }}</p>\n } @else if (group.rows[0].description) {\n <p class=\"text-muted\">{{ group.rows[0].description }}</p>\n }\n <div class=\"row\">\n @for (row of group.rows; track row.credential_id) {\n <div class=\"col-12 col-md-4\">\n @let hint = placeholder(row.field);\n <pw-input-container [label]=\"fieldKey(row.field) ? (fieldKey(row.field) | transloco) : (row.field | humanizeCredentialName)\"\n [name]=\"row.field\"\n [controlId]=\"'user-credential-' + row.credential_id\">\n <input class=\"form-control\"\n [id]=\"'user-credential-' + row.credential_id\"\n type=\"text\"\n pwClearMaskedOnFocus\n [formControlName]=\"'' + row.credential_id\"\n autocomplete=\"off\"\n [placeholder]=\"hint ? (hint.key | transloco: hint.params) : ''\"/>\n </pw-input-container>\n </div>\n }\n </div>\n }\n <div class=\"d-flex gap-2 mt-2\">\n <button type=\"button\"\n class=\"btn btn-outline-default\"\n [disabled]=\"saving()\"\n (click)=\"cancel()\">\n {{ 'User.Credentials.Cancel' | transloco }}\n </button>\n @if (selected()) {\n <button type=\"submit\"\n class=\"btn btn-primary\"\n [disabled]=\"saving()\">\n {{ 'User.Credentials.Save' | transloco }}\n </button>\n }\n </div>\n </form>\n } @else {\n @if (saved().length === 0) {\n <p class=\"text-muted\">{{ 'User.Credentials.Empty' | transloco }}</p>\n }\n <ul class=\"credential-grid\">\n @for (group of saved(); track group.name) {\n @let title = nameKey(group.name, 'Title') ? (nameKey(group.name, 'Title')! | transloco) : (group.name | humanizeCredentialName);\n <li class=\"credential-card\">\n <header class=\"credential-card-header\" [style.--avatar-hue]=\"group.name | credentialAvatarHue\">\n <span class=\"credential-avatar\" aria-hidden=\"true\">{{ title.charAt(0) }}</span>\n <h3 class=\"credential-card-title\">{{ title }}</h3>\n <div class=\"credential-card-actions\">\n <button type=\"button\"\n class=\"credential-icon-btn\"\n [attr.aria-label]=\"'User.Credentials.Edit' | transloco\"\n [disabled]=\"saving()\"\n (click)=\"open(group)\">\n <i class=\"fa fa-pen\" aria-hidden=\"true\"></i>\n </button>\n <button type=\"button\"\n class=\"credential-icon-btn credential-icon-btn--danger\"\n [attr.aria-label]=\"'User.Credentials.Remove' | transloco\"\n [disabled]=\"saving()\"\n (click)=\"remove(group)\">\n <i class=\"fa fa-trash\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </header>\n <dl class=\"credential-card-fields\">\n @for (row of group.rows; track row.credential_id) {\n @if (row.configured) {\n <div class=\"credential-card-row\">\n <dt>{{ fieldKey(row.field) ? (fieldKey(row.field) | transloco) : (row.field | humanizeCredentialName) }}</dt>\n <dd><code class=\"credential-card-value\">{{ row.value }}</code></dd>\n </div>\n }\n }\n </dl>\n </li>\n }\n </ul>\n @if (addable().length > 0) {\n <button type=\"button\"\n class=\"btn btn-outline-primary btn-sm mt-3\"\n (click)=\"open()\">\n <i class=\"fa fa-plus-circle\" aria-hidden=\"true\"></i>\n {{ 'User.Credentials.Add' | transloco }}\n </button>\n }\n }\n }\n </div>\n </div>\n </section>\n}\n<ng-template #titleOf let-name>{{ nameKey(name, 'Title') ? (nameKey(name, 'Title') | transloco) : (name | humanizeCredentialName) }}</ng-template>\n",
|
|
1021
|
+
styles: [".credential-grid{list-style:none;padding:0;margin:16px 0 0;width:100%;display:grid;gap:16px;grid-template-columns:repeat(auto-fill,minmax(min(360px,100%),1fr))}.credential-card{background:#fff;border:1px solid #e2e5ea;border-radius:10px;display:flex;flex-direction:column;overflow:hidden;transition:border-color .15s ease-out}.credential-card:hover{border-color:#cfd4dc}.credential-card-header{display:flex;align-items:center;gap:12px;padding:14px 16px;background:hsl(var(--avatar-hue, 215),60%,97%);border-bottom:1px solid hsl(var(--avatar-hue, 215),40%,90%)}.credential-avatar{width:36px;height:36px;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;font-size:15px;font-weight:700;line-height:1;color:hsl(var(--avatar-hue, 215),60%,28%);background:hsl(var(--avatar-hue, 215),70%,92%);border:1px solid hsl(var(--avatar-hue, 215),50%,82%);flex-shrink:0;text-transform:uppercase}.credential-card-header h3.credential-card-title{font-size:15px;font-weight:600;line-height:1;height:36px;color:#1a1d21;margin:0!important;padding:0!important;flex:1 1 auto;min-width:0;display:flex;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.credential-icon-btn{appearance:none;background:transparent;border:1px solid transparent;border-radius:6px;width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;color:#5a6473;cursor:pointer;transition:background-color .12s ease-out,color .12s ease-out,border-color .12s ease-out}.credential-icon-btn .fa{font-size:13px}.credential-icon-btn:hover,.credential-icon-btn:focus-visible{background-color:#fff;color:#1a1d21;border-color:#e2e5ea;outline:none}.credential-icon-btn--danger:hover,.credential-icon-btn--danger:focus-visible{color:var(--bs-danger, #dc3545)}.credential-card-actions{display:inline-flex;gap:4px}.credential-card-fields{margin:0;padding:4px 16px 12px;display:flex;flex-direction:column}.credential-card-row{display:grid;grid-template-columns:minmax(120px,1fr) minmax(0,2fr);align-items:center;gap:12px;padding:10px 0;border-bottom:1px dashed #eef0f3}.credential-card-row:last-child{border-bottom:0}.credential-card-row dt{font-size:11px;font-weight:500;color:#5a6473;letter-spacing:.05em;text-transform:uppercase;margin:0}.credential-card-row dd{margin:0;min-width:0;text-align:right}.credential-card-value{font-size:12.5px;font-weight:500;color:#5a6473;background:#f7f8fa;border:1px solid #e2e5ea;border-radius:4px;padding:3px 8px;display:inline-block;max-width:100%;word-break:break-all;line-height:1.5;-webkit-user-select:all;user-select:all}@media(max-width:575px){.credential-card-row{grid-template-columns:1fr;gap:4px}.credential-card-row dd{text-align:left}}\n"]
|
|
1022
|
+
}]
|
|
1023
|
+
}],
|
|
1024
|
+
propDecorators: { userId: [{
|
|
1025
|
+
type: Input,
|
|
1026
|
+
args: [{ required: true }]
|
|
1027
|
+
}] }
|
|
1028
|
+
});
|
|
451
1029
|
var AccountDetailsComponent = class AccountDetailsComponent extends AccountAvatarSlug {
|
|
452
1030
|
constructor() {
|
|
453
1031
|
super(...arguments);
|
|
@@ -563,7 +1141,7 @@ var AccountDetailsComponent = class AccountDetailsComponent extends AccountAvata
|
|
|
563
1141
|
}],
|
|
564
1142
|
usesInheritance: true,
|
|
565
1143
|
ngImport: i0,
|
|
566
|
-
template: "<div class=\"w-100 text-center\">\n @if (!isLoaded) {\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n }\n</div>\n<div class=\"row gx-3 mb-3\">\n <div class=\"col-md-4\">\n <section class=\"card p-4 h-100 d-flex flex-column\">\n <h2>{{ 'User.Profile.Avatar' | transloco }}</h2>\n <div class=\"text-center d-flex flex-column justify-content-center flex-grow-1 mt-1\">\n <div class=\"image-container\">\n <img [src]=\"image\"\n width=\"150\"\n height=\"150\"\n class=\"image rounded-circle\"\n [alt]=\"'User.Profile.ProfilePicture' | transloco\"\n (error)=\"handleImageError($event, 'assets/img/icons/male.png')\" />\n <div class=\"overlay\"\n (keydown.enter)=\"openModal(content)\"\n (click)=\"openModal(content)\">\n <div class=\"overlay-text\">{{ 'User.Profile.Change' | transloco }}</div>\n </div>\n </div>\n <h4 class=\"mt-2\">{{ user?.first_name }} {{ user?.last_name }}</h4>\n <a [attr.aria-label]=\"'User.Profile.EditAvatar' | transloco\"\n class=\"d-inline-block mb-2\"\n (click)=\"openModal(content)\">\n {{ 'User.Profile.EditAvatar' | transloco }}</a>\n </div>\n </section>\n </div>\n <div class=\"col-md-8\">\n <section id=\"user-profile\"\n class=\"card p-4 overflow-visible h-100\">\n <form [formGroup]=\"profileForm\"\n (ngSubmit)=\"onProfileFormSubmit()\">\n <h2>{{ 'User.Profile.UserProfile' | transloco }}</h2>\n <div class=\"row mt-3\">\n <div class=\"col-sm-12 col-md-6 col-lg-6\">\n <pw-input-container [label]=\"'Label.FirstName' | transloco\"\n name=\"first_name\"\n controlId=\"account-first_name\"\n errorMsg=\"User.Account.Details.Validation.FirstName\">\n <input type=\"text\"\n id=\"account-first_name\"\n class=\"form-control\"\n formControlName=\"first_name\"\n autocomplete=\"given-name\" name=\"input_first_name_9\"\n [attr.aria-label]=\"'Label.FirstName' | transloco\"/>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.PreferredName' | transloco\"\n name=\"preferred_name\"\n controlId=\"account-preferred_name\"\n errorMsg=\"User.Account.Details.Validation.PreferredName\">\n <input type=\"text\"\n id=\"account-preferred_name\"\n class=\"form-control\"\n formControlName=\"preferred_name\"\n autocomplete=\"username\" name=\"input_preferred_name_10\"\n [attr.aria-label]=\"'User.Account.Details.PreferredName' | transloco\"/>\n </pw-input-container>\n @if (countries$ | async; as countries) {\n <pw-input-container [label]=\"'User.Subscriptions.Details.Country' | transloco\"\n name=\"country\"\n controlId=\"account-country\"\n [useAriaLabelledbyOnly]=\"true\"\n errorMsg=\"User.Subscriptions.Details.Validation.Country\">\n <p-select\n [attr.aria-labelledby]=\"'account-country-label'\"\n [options]=\"countries\"\n optionLabel=\"name\"\n optionValue=\"code\"\n formControlName=\"country\"\n (onChange)=\"getRegion($event.value)\"\n placeholder=\"{{ 'User.Profile.SelectCountry' | transloco }}\">\n </p-select>\n </pw-input-container>\n }\n <pw-input-container [label]=\"'User.Account.Details.Province' | transloco\"\n name=\"province\"\n controlId=\"account-province\"\n errorMsg=\"User.Account.Details.Validation.Province\">\n <input type=\"text\"\n id=\"account-province\"\n class=\"form-control\"\n formControlName=\"province\"\n autocomplete=\"postal-code\" name=\"input_province_11\"\n [attr.aria-label]=\"'User.Account.Details.Province' | transloco\"/>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.WebsiteUrl' | transloco\"\n name=\"website_url\"\n controlId=\"account-website_url\"\n errorMsg=\"User.Account.Details.Validation.Website\">\n <input type=\"text\"\n id=\"account-website_url\"\n class=\"form-control\"\n formControlName=\"website_url\"\n autocomplete=\"url\" name=\"input_website_url_12\"\n [attr.aria-label]=\"'User.Account.Details.WebsiteUrl' | transloco\"/>\n </pw-input-container>\n </div>\n <div class=\"col-sm-12 col-md-6 col-lg-6\">\n <pw-input-container [label]=\"'Label.LastName' | transloco\"\n name=\"last_name\"\n controlId=\"account-last_name\"\n errorMsg=\"User.Account.Details.Validation.LastName\">\n <input type=\"text\"\n id=\"account-last_name\"\n class=\"form-control\"\n formControlName=\"last_name\"\n autocomplete=\"family-name\" name=\"input_last_name_13\"\n [attr.aria-label]=\"'Label.LastName' | transloco\"/>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.DateOfBirth' | transloco\"\n name=\"dob\"\n controlId=\"account-dob\"\n errorMsg=\"User.Account.Details.Validation.DateOfBirth\">\n <div class=\"input-group\">\n <input class=\"form-control\"\n id=\"account-dob\"\n name=\"dob\"\n [placeholder]=\"'User.Account.Details.DateOfBirthPlaceholder' | transloco\"\n formControlName=\"dob\"\n ngbDatepicker\n #d=\"ngbDatepicker\"\n [minDate]=\"{ day: 1, month: 1, year: 1950 }\"\n [maxDate]=\"{ day: 31, month: 12, year: 2018 }\"\n [attr.aria-label]=\"'User.Account.Details.DateOfBirth' | transloco\" />\n <button class=\"btn btn-primary\"\n type=\"button\"\n id=\"account-dob-trigger\"\n [attr.aria-label]=\"'User.Account.Details.OpenDatePicker' | transloco\"\n (click)=\"d.toggle()\">\n <i class=\"fa fa-calendar\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.State' | transloco\"\n name=\"state\"\n controlId=\"account-state\"\n [useAriaLabelledbyOnly]=\"true\"\n errorMsg=\"User.Account.Details.Validation.State\">\n <p-select\n [attr.aria-labelledby]=\"'account-state-label'\"\n [options]=\"states\"\n [(ngModel)]=\"selectedState\"\n optionLabel=\"name\"\n optionValue=\"code\"\n formControlName=\"state\"\n [placeholder]=\"'User.Profile.SelectState' | transloco\">\n </p-select>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.Location' | transloco\"\n name=\"location\"\n controlId=\"account-location\"\n [useAriaLabelledbyOnly]=\"true\">\n <input ngx-gp-autocomplete\n id=\"account-location\"\n name=\"location\"\n class=\"form-control\"\n [attr.aria-labelledby]=\"'account-location-label'\"\n #places=\"ngx-places\"\n formControlName=\"location\"\n (onAddressChange)=\"handleAddressChange($event)\"\n [attr.aria-label]=\"'User.Account.Details.Location' | transloco\" />\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.PhoneNumber' | transloco\"\n name=\"phone_number\"\n controlId=\"account-phone_number\"\n errorMsg=\"User.Account.Details.Validation.PhoneNumber\">\n <input type=\"text\"\n id=\"account-phone_number\"\n class=\"form-control\"\n formControlName=\"phone_number\"\n autocomplete=\"tel\" name=\"input_phone_number_16\"\n [attr.aria-label]=\"'User.Account.Details.PhoneNumber' | transloco\"/>\n </pw-input-container>\n </div>\n <pw-sticky-actions>\n <button class=\"btn btn-raised btn-primary\" [buttonBusy]=\"profileBusyButton\">\n {{ 'Button.Save' | transloco }}\n </button>\n </pw-sticky-actions>\n </div>\n </form>\n </section>\n </div>\n</div>\n<div class=\"row gx-3 mb-3\">\n <div class=\"col-md-6\">\n <section id=\"email-section\"\n class=\"card p-4 h-100\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Account.RegisteredEmail' | transloco }}</h2>\n <section id=\"email-form\">\n <form [formGroup]=\"emailForm\"\n (ngSubmit)=\"onEmailFormSubmit()\">\n <!-- Email Address -->\n <div class=\"mt-0\">\n <span id=\"account-primary-email-label\" class=\"me-3 pw-label-style\">{{ 'User.Account.PrimaryEmail' | transloco }}:\n </span>\n <strong>{{ validatedEmail }}</strong>\n <div class=\"mt-1\">\n @if (!toggleEmail) {\n <a class=\"btn btn-raised btn-outline-primary\"\n [attr.aria-label]=\"'User.Account.ChangeEmail' | transloco\"\n (click)=\"shouldUserChangeEmail()\">\n {{ 'User.Account.ChangeEmail' | transloco }}</a>\n }\n @if (toggleEmail) {\n <div class=\"row\">\n <div class=\"clearfix\"></div>\n <div class=\"col-12 mb-3\">\n @if (!passwordVerified) {\n <input type=\"password\"\n class=\"form-control\"\n id=\"account-email-current-password\"\n name=\"currentPassword\"\n #password\n [placeholder]=\"'User.Account.CurrentPassword' | transloco\"\n autocomplete=\"current-password\"\n (keyup)=\"checkValidity()\"\n [attr.aria-label]=\"'User.Account.CurrentPassword' | transloco\" />\n }\n @if (passwordVerified) {\n <input type=\"text\"\n class=\"form-control\"\n id=\"account-new-email\"\n name=\"newEmail\"\n [placeholder]=\"'User.Account.Details.NewEmail' | transloco\"\n autocomplete=\"email\"\n formControlName=\"email\"\n [attr.aria-label]=\"'User.Account.Details.NewEmail' | transloco\" />\n }\n </div>\n <div class=\"col-12\">\n @if (toggleEmail) {\n <a\n class=\"btn btn-raised btn-outline-default my-2 me-2\"\n [attr.aria-label]=\"'Button.Cancel' | transloco\"\n (click)=\"onToggleEmail()\">{{ 'Button.Cancel' | transloco }}</a>\n }\n @if (!passwordVerified) {\n <button class=\"btn btn-raised btn-primary\"\n type=\"submit\"\n [buttonBusy]=\"validatePasswordBusyButton\"\n (click)=\"validatePassword()\"\n [disabled]=\"isCurrentPasswordValid\">\n {{ 'User.Account.Validate' | transloco }}\n </button>\n }\n @if (passwordVerified) {\n <button type=\"submit\"\n class=\"btn btn-raised btn-primary\"\n [buttonBusy]=\"emailBusyButton\"\n >\n {{\n 'User.Account.SendVerification' | transloco\n }}\n </button>\n }\n </div>\n </div>\n }\n </div>\n </div>\n <section id=\"slug\"\n class=\"mb-2 mt-3\">\n <div>\n <span class=\"me-3 pw-label-style\" id=\"account-nickname-label\">{{ 'User.Account.NickName' | transloco }}:</span>\n <span class=\"tooltip-wrap me-3\" [pTooltip]=\"'User.Account.HandleTooltip' | transloco\" [appendTo]=\"'body'\" tooltipPosition=\"top\"><i class=\"far fa-info-circle text-muted\"></i></span>\n <strong>{{ slug }}</strong>\n <div class=\"mt-1\">\n @if (!toggleNickName) {\n <a class=\"btn btn-raised btn-outline-primary me-2\"\n [attr.aria-label]=\"'User.Account.ChangeNickname' | transloco\"\n (click)=\"toggleNickName = true\">\n {{ 'User.Account.ChangeNickname' | transloco }}</a>\n }\n @if (toggleNickName) {\n <div class=\"mb-3\">\n <input type=\"text\"\n id=\"account-nickname\"\n name=\"nickname\"\n class=\"form-control slug-input\"\n aria-labelledby=\"account-nickname-label\"\n [(ngModel)]=\"slug\"\n [ngModelOptions]=\"{ standalone: true }\"\n [attr.aria-label]=\"'User.Account.NickName' | transloco\" />\n </div>\n <div>\n <button type=\"button\"\n class=\"btn btn-raised btn-outline-default\"\n (click)=\"toggleNickName = false\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"button\"\n class=\"btn btn-raised btn-primary ms-2\"\n [buttonBusy]=\"slugBusyButton\"\n [disabled]=\"slug?.length < 2\"\n (click)=\"onUpdateSlug()\">\n {{ 'User.Account.UpdateNickname' | transloco }}\n </button>\n </div>\n }\n </div>\n </div>\n </section>\n </form>\n </section>\n </div>\n </div>\n </section>\n </div>\n <div class=\"col-md-6\">\n <section id=\"password-change\"\n class=\"card p-4 h-100\">\n <form [formGroup]=\"passwordForm\"\n (ngSubmit)=\"onPasswordFormSubmit()\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Account.ChangePassword' | transloco }}</h2>\n </div>\n @if (!user?.has_password) {\n <div class=\"text-danger mx-3 my-2\">\n <div>\n {{ 'User.Account.Details.NoPassword' | transloco }}\n <em>{{ 'User.Account.ChangePassword' | transloco }}</em>.\n </div>\n <div>{{ 'User.Profile.PictureMessage' | transloco }}</div>\n </div>\n }\n @if (user?.has_password) {\n <div class=\"col-12\"\n >\n @if (togglePassword) {\n <div class=\"mb-3\">\n <label for=\"account-current-password\">{{ 'User.Account.CurrentPassword' | transloco }}</label>\n <input type=\"password\"\n id=\"account-current-password\"\n class=\"form-control\"\n formControlName=\"currentPassword\"\n autocomplete=\"current-password\" name=\"input_currentPassword_4\"\n [attr.aria-label]=\"'User.Account.CurrentPassword' | transloco\"/>\n @if (\n !passwordForm.get('currentPassword').valid &&\n (passwordForm.get('currentPassword').dirty ||\n passwordForm.get('currentPassword').touched)\n ) {\n <small class=\"form-text text-muted danger\"\n >\n {{ 'User.Account.Required' | transloco }}\n </small>\n }\n </div>\n <div class=\"mb-3\">\n <label for=\"account-new-password\">{{ 'User.Account.NewPassword' | transloco }}</label>\n <input type=\"password\"\n id=\"account-new-password\"\n class=\"form-control\"\n formControlName=\"newPassword\"\n autocomplete=\"new-password\" name=\"input_newPassword_5\"\n [attr.aria-label]=\"'User.Account.NewPassword' | transloco\"/>\n @if (\n !passwordForm.get('newPassword').valid &&\n (passwordForm.get('newPassword').dirty ||\n passwordForm.get('newPassword').touched)\n ) {\n <small class=\"form-text text-muted danger\"\n >{{ 'User.Account.Validation.StrongPassword' | transloco }}\n </small>\n }\n </div>\n <div class=\"mb-3\">\n <label for=\"account-confirm-password\">{{\n 'User.Account.ConfirmPassword' | transloco\n }}</label>\n <input type=\"password\"\n id=\"account-confirm-password\"\n class=\"form-control\"\n formControlName=\"confirmPassword\"\n autocomplete=\"new-password\" name=\"input_confirmPassword_6\"\n [attr.aria-label]=\"'User.Account.ConfirmPassword' | transloco\"/>\n @if (\n passwordForm.get('confirmPassword').touched &&\n passwordForm.get('confirmPassword').errors\n ?.MatchPassword\n ) {\n <div class=\"text-danger\"\n >\n {{ 'User.Account.Validation.PasswordsMatch' | transloco }}\n </div>\n }\n </div>\n <div class=\"mb-3\">\n @if (togglePassword) {\n <a class=\"btn btn-raised btn-outline-default\"\n [attr.aria-label]=\"'Button.Cancel' | transloco\"\n data-bs-target=\"\"\n (click)=\"onTogglePassword()\">\n {{ 'Button.Cancel' | transloco }}</a>\n }\n <button class=\"btn btn-raised btn-primary ms-2\"\n [buttonBusy]=\"passwordBusyButton\"\n [disabled]=\"!passwordForm.valid\">\n {{ 'User.Account.UpdatePassword' | transloco }}\n </button>\n </div>\n }\n <div>\n @if (!togglePassword) {\n <a class=\"btn btn-raised btn-outline-primary\"\n [attr.aria-label]=\"'User.Account.ChangePassword' | transloco\"\n data-bs-target=\"\"\n (click)=\"togglePassword = !togglePassword\">\n {{ 'User.Account.ChangePassword' | transloco }}</a>\n }\n </div>\n </div>\n }\n @if (!user?.has_password) {\n <div class=\"col-12\"\n >\n <a class=\"btn btn-raised btn-primary me-2\"\n [attr.aria-label]=\"'User.Account.ChangePassword' | transloco\"\n data-bs-target=\"\"\n (click)=\"sendMailToResetPassword()\">\n {{ 'User.Account.ChangePassword' | transloco }}</a>\n </div>\n }\n </div>\n </form>\n </section>\n </div>\n @if (apiMcpEnabled && user?.api_keys?.api_hits_max > 0) {\n <div class=\"col-12 mt-3\">\n <section id=\"api-credentials\"\n class=\"card p-4 h-auto\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Subscriptions.APICredentials.Title' | transloco }}</h2>\n <p>\n {{ 'User.Subscriptions.APICredentials.Description' | transloco: { company: mcpCompanyName } }}\n </p>\n <p class=\"text-muted small mb-2\">\n <i class=\"fas fa-link me-1\"></i>\n {{ 'User.Subscriptions.APICredentials.McpEndpointNote' | transloco: { url: mcpEndpointUrl, company: mcpCompanyName } }}\n </p>\n <!-- pb (not mb): .card .mb-3:last-child is margin-reset in this component's scss -->\n <p class=\"text-muted small mb-0 pb-3\">\n <i class=\"fas fa-info-circle me-1\"></i>\n {{ 'User.Subscriptions.APICredentials.SubscriptionClientIdNote' | transloco }}\n </p>\n </div>\n <div class=\"col-12 col-md-6\">\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"account-api-token\">{{ 'User.Account.APIUserToken' | transloco }}</label>\n <div class=\"input-group\">\n <input type=\"text\"\n id=\"account-api-token\"\n name=\"api_token\"\n class=\"form-control\"\n [value]=\"showApiToken ? user?.api_keys?.api_user_token || ('User.Subscriptions.APICredentials.NoTokenAvailable' | transloco) : '*************************'\"\n readonly\n [attr.aria-label]=\"'User.Account.APIUserToken' | transloco\" />\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"toggleApiTokenVisibility()\">\n {{ showApiToken ? ('User.Subscriptions.APICredentials.Hide' | transloco) : ('User.Subscriptions.APICredentials.View' | transloco) }}\n </button>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-md-6\">\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"account-api-client-id\">{{ 'User.Account.APIUserId' | transloco }}</label>\n <div class=\"input-group\">\n <input type=\"text\"\n id=\"account-api-client-id\"\n name=\"api_client_id\"\n class=\"form-control\"\n [value]=\"showApiClientId ? user?.api_keys?.api_user_id || ('User.Subscriptions.APICredentials.NoClientIdAvailable' | transloco) : '*************************'\"\n readonly\n [attr.aria-label]=\"'User.Account.APIUserId' | transloco\" />\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"toggleApiClientIdVisibility()\">\n {{ showApiClientId ? ('User.Subscriptions.APICredentials.Hide' | transloco) : ('User.Subscriptions.APICredentials.View' | transloco) }}\n </button>\n </div>\n </div>\n </div>\n <div class=\"col-12 mt-3\">\n <div class=\"d-flex align-items-center gap-3\">\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"refreshApiTokens()\"\n [disabled]=\"refreshingTokens\">\n <i class=\"fas fa-sync-alt me-2\" [class.fa-spin]=\"refreshingTokens\"></i>\n {{ refreshingTokens ? ('User.Subscriptions.APICredentials.Refreshing' | transloco) : ('User.Subscriptions.APICredentials.RefreshTokens' | transloco) }}\n </button>\n <div class=\"d-flex align-items-center gap-2\">\n @if (user?.api_keys?.api_hits !== null) {\n <span class=\"text-muted\">{{ 'User.Subscriptions.APICredentials.ApiHits' | transloco }}:</span>\n <span class=\"fw-bold\">{{ user.api_keys.api_hits | number }}</span>\n }\n @if (user?.api_keys?.api_hits_max !== null) {\n <span class=\"text-muted\">{{ 'User.Subscriptions.APICredentials.ApiHitsMax' | transloco }}:</span>\n <span class=\"fw-bold\">{{ user.api_keys.api_hits_max | number }}</span>\n }\n <!-- Show utilization percentage when both values exist -->\n @if (user?.api_keys?.api_hits !== null && user?.api_keys?.api_hits_max !== null && user?.api_keys?.api_hits_max > 0) {\n <span class=\"text-muted ms-2\">(</span>\n <span class=\"fw-bold\" [ngClass]=\"{\n 'text-success-muted': (user.api_keys.api_hits / user.api_keys.api_hits_max) <= 0.8,\n 'text-warning': (user.api_keys.api_hits / user.api_keys.api_hits_max) > 0.8 && (user.api_keys.api_hits / user.api_keys.api_hits_max) <= 0.9,\n 'text-danger': (user.api_keys.api_hits / user.api_keys.api_hits_max) > 0.9\n }\">\n {{ 'User.Subscriptions.Details.ApiConsumed' | transloco: { percent: ((user.api_keys.api_hits / user.api_keys.api_hits_max * 100) | number:'1.0-0') } }}\n </span>\n <span class=\"text-muted\">)</span>\n }\n </div>\n </div>\n </div>\n <div class=\"col-12 mt-3\">\n <label class=\"form-label\">{{ 'User.Subscriptions.APICredentials.ScopeLabel' | transloco }}</label>\n <div class=\"d-flex align-items-center flex-wrap gap-2\">\n <div class=\"btn-group\" role=\"group\"\n [attr.aria-label]=\"'User.Subscriptions.APICredentials.ScopeLabel' | transloco\">\n <button type=\"button\" class=\"btn\"\n [ngClass]=\"currentApiTokenScope === 'read_only' ? 'btn-primary' : 'btn-outline-secondary'\"\n [disabled]=\"updatingScope\"\n (click)=\"changeApiTokenScope('read_only')\">\n {{ 'User.Subscriptions.APICredentials.ScopeReadOnly' | transloco }}\n </button>\n <button type=\"button\" class=\"btn\"\n [ngClass]=\"currentApiTokenScope === 'read_write' ? 'btn-primary' : 'btn-outline-secondary'\"\n [disabled]=\"updatingScope\"\n (click)=\"changeApiTokenScope('read_write')\">\n {{ 'User.Subscriptions.APICredentials.ScopeReadWrite' | transloco }}\n </button>\n </div>\n <span class=\"text-muted small\">{{ 'User.Subscriptions.APICredentials.ScopeHint' | transloco }}</span>\n </div>\n </div>\n </div>\n </section>\n </div>\n }\n @if (apiMcpEnabled && user?.api_keys?.api_hits_max > 0) {\n <div class=\"col-12 mt-3\">\n <section id=\"registered-apps\"\n class=\"card p-4 h-auto\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Subscriptions.RegisteredApps.Title' | transloco }}</h2>\n <p>\n {{ 'User.Subscriptions.RegisteredApps.Description' | transloco }}\n </p>\n </div>\n <div class=\"col-12\">\n <pw-loader [isVisible]=\"loadingConnections\"></pw-loader>\n @if (!loadingConnections) {\n @if (connections.length === 0) {\n <p class=\"text-muted\">{{ 'User.Subscriptions.RegisteredApps.NoApps' | transloco }}</p>\n }\n @for (conn of connections; track conn.id) {\n <div class=\"d-flex align-items-center justify-content-between py-2 border-bottom\">\n <div>\n <span class=\"fw-bold me-3\">{{ conn.client_name }}</span>\n <span class=\"text-muted small\">\n {{ 'User.Subscriptions.RegisteredApps.ConnectedOn' | transloco }}\n {{ conn.created_at | date:'mediumDate' }}\n </span>\n <span class=\"text-muted small d-block\">\n {{ 'User.Subscriptions.RegisteredApps.LastUsed' | transloco }}\n @if (conn.last_used_at) {\n {{ conn.last_used_at | date:'medium' }}\n } @else {\n {{ 'User.Subscriptions.RegisteredApps.NeverUsed' | transloco }}\n }\n </span>\n </div>\n <button type=\"button\"\n class=\"btn btn-outline-danger btn-sm\"\n (click)=\"deregisterConnection(conn.id)\">\n {{ 'User.Subscriptions.RegisteredApps.Deregister' | transloco }}\n </button>\n </div>\n }\n }\n </div>\n </div>\n </section>\n </div>\n }\n</div>\n<ng-template #content\n let-modal>\n <div class=\"card m-0\">\n <div class=\"card-content\">\n <div class=\"card-title\">\n <h3 class=\"modal-title\">{{ 'User.Profile.ProfilePicture' | transloco }}</h3>\n <button type=\"button\"\n class=\"btn-close float-end\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss()\">\n </button>\n </div>\n <div class=\"card-header\">\n <small> {{ 'User.Profile.PictureMessage' | transloco }}</small>\n <pw-image-cropper #profile\n aspectRatio=\"auto\"\n (imageSelectionEvent)=\"onImageSelection($event)\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n </div>\n </div>\n</ng-template>\n",
|
|
1144
|
+
template: "<div class=\"w-100 text-center\">\n @if (!isLoaded) {\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n }\n</div>\n<div class=\"row gx-3 mb-3\">\n <div class=\"col-md-4\">\n <section class=\"card p-4 h-100 d-flex flex-column\">\n <h2>{{ 'User.Profile.Avatar' | transloco }}</h2>\n <div class=\"text-center d-flex flex-column justify-content-center flex-grow-1 mt-1\">\n <div class=\"image-container\">\n <img [src]=\"image\"\n width=\"150\"\n height=\"150\"\n class=\"image rounded-circle\"\n [alt]=\"'User.Profile.ProfilePicture' | transloco\"\n (error)=\"handleImageError($event, 'assets/img/icons/male.png')\" />\n <div class=\"overlay\"\n (keydown.enter)=\"openModal(content)\"\n (click)=\"openModal(content)\">\n <div class=\"overlay-text\">{{ 'User.Profile.Change' | transloco }}</div>\n </div>\n </div>\n <h4 class=\"mt-2\">{{ user?.first_name }} {{ user?.last_name }}</h4>\n <a [attr.aria-label]=\"'User.Profile.EditAvatar' | transloco\"\n class=\"d-inline-block mb-2\"\n (click)=\"openModal(content)\">\n {{ 'User.Profile.EditAvatar' | transloco }}</a>\n </div>\n </section>\n </div>\n <div class=\"col-md-8\">\n <section id=\"user-profile\"\n class=\"card p-4 overflow-visible h-100\">\n <form [formGroup]=\"profileForm\"\n (ngSubmit)=\"onProfileFormSubmit()\">\n <h2>{{ 'User.Profile.UserProfile' | transloco }}</h2>\n <div class=\"row mt-3\">\n <div class=\"col-sm-12 col-md-6 col-lg-6\">\n <pw-input-container [label]=\"'Label.FirstName' | transloco\"\n name=\"first_name\"\n controlId=\"account-first_name\"\n errorMsg=\"User.Account.Details.Validation.FirstName\">\n <input type=\"text\"\n id=\"account-first_name\"\n class=\"form-control\"\n formControlName=\"first_name\"\n autocomplete=\"given-name\" name=\"input_first_name_9\"\n [attr.aria-label]=\"'Label.FirstName' | transloco\"/>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.PreferredName' | transloco\"\n name=\"preferred_name\"\n controlId=\"account-preferred_name\"\n errorMsg=\"User.Account.Details.Validation.PreferredName\">\n <input type=\"text\"\n id=\"account-preferred_name\"\n class=\"form-control\"\n formControlName=\"preferred_name\"\n autocomplete=\"username\" name=\"input_preferred_name_10\"\n [attr.aria-label]=\"'User.Account.Details.PreferredName' | transloco\"/>\n </pw-input-container>\n @if (countries$ | async; as countries) {\n <pw-input-container [label]=\"'User.Subscriptions.Details.Country' | transloco\"\n name=\"country\"\n controlId=\"account-country\"\n [useAriaLabelledbyOnly]=\"true\"\n errorMsg=\"User.Subscriptions.Details.Validation.Country\">\n <p-select\n [attr.aria-labelledby]=\"'account-country-label'\"\n [options]=\"countries\"\n optionLabel=\"name\"\n optionValue=\"code\"\n formControlName=\"country\"\n (onChange)=\"getRegion($event.value)\"\n placeholder=\"{{ 'User.Profile.SelectCountry' | transloco }}\">\n </p-select>\n </pw-input-container>\n }\n <pw-input-container [label]=\"'User.Account.Details.Province' | transloco\"\n name=\"province\"\n controlId=\"account-province\"\n errorMsg=\"User.Account.Details.Validation.Province\">\n <input type=\"text\"\n id=\"account-province\"\n class=\"form-control\"\n formControlName=\"province\"\n autocomplete=\"postal-code\" name=\"input_province_11\"\n [attr.aria-label]=\"'User.Account.Details.Province' | transloco\"/>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.WebsiteUrl' | transloco\"\n name=\"website_url\"\n controlId=\"account-website_url\"\n errorMsg=\"User.Account.Details.Validation.Website\">\n <input type=\"text\"\n id=\"account-website_url\"\n class=\"form-control\"\n formControlName=\"website_url\"\n autocomplete=\"url\" name=\"input_website_url_12\"\n [attr.aria-label]=\"'User.Account.Details.WebsiteUrl' | transloco\"/>\n </pw-input-container>\n </div>\n <div class=\"col-sm-12 col-md-6 col-lg-6\">\n <pw-input-container [label]=\"'Label.LastName' | transloco\"\n name=\"last_name\"\n controlId=\"account-last_name\"\n errorMsg=\"User.Account.Details.Validation.LastName\">\n <input type=\"text\"\n id=\"account-last_name\"\n class=\"form-control\"\n formControlName=\"last_name\"\n autocomplete=\"family-name\" name=\"input_last_name_13\"\n [attr.aria-label]=\"'Label.LastName' | transloco\"/>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.DateOfBirth' | transloco\"\n name=\"dob\"\n controlId=\"account-dob\"\n errorMsg=\"User.Account.Details.Validation.DateOfBirth\">\n <div class=\"input-group\">\n <input class=\"form-control\"\n id=\"account-dob\"\n name=\"dob\"\n [placeholder]=\"'User.Account.Details.DateOfBirthPlaceholder' | transloco\"\n formControlName=\"dob\"\n ngbDatepicker\n #d=\"ngbDatepicker\"\n [minDate]=\"{ day: 1, month: 1, year: 1950 }\"\n [maxDate]=\"{ day: 31, month: 12, year: 2018 }\"\n [attr.aria-label]=\"'User.Account.Details.DateOfBirth' | transloco\" />\n <button class=\"btn btn-primary\"\n type=\"button\"\n id=\"account-dob-trigger\"\n [attr.aria-label]=\"'User.Account.Details.OpenDatePicker' | transloco\"\n (click)=\"d.toggle()\">\n <i class=\"fa fa-calendar\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.State' | transloco\"\n name=\"state\"\n controlId=\"account-state\"\n [useAriaLabelledbyOnly]=\"true\"\n errorMsg=\"User.Account.Details.Validation.State\">\n <p-select\n [attr.aria-labelledby]=\"'account-state-label'\"\n [options]=\"states\"\n [(ngModel)]=\"selectedState\"\n optionLabel=\"name\"\n optionValue=\"code\"\n formControlName=\"state\"\n [placeholder]=\"'User.Profile.SelectState' | transloco\">\n </p-select>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.Location' | transloco\"\n name=\"location\"\n controlId=\"account-location\"\n [useAriaLabelledbyOnly]=\"true\">\n <input ngx-gp-autocomplete\n id=\"account-location\"\n name=\"location\"\n class=\"form-control\"\n [attr.aria-labelledby]=\"'account-location-label'\"\n #places=\"ngx-places\"\n formControlName=\"location\"\n (onAddressChange)=\"handleAddressChange($event)\"\n [attr.aria-label]=\"'User.Account.Details.Location' | transloco\" />\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.PhoneNumber' | transloco\"\n name=\"phone_number\"\n controlId=\"account-phone_number\"\n errorMsg=\"User.Account.Details.Validation.PhoneNumber\">\n <input type=\"text\"\n id=\"account-phone_number\"\n class=\"form-control\"\n formControlName=\"phone_number\"\n autocomplete=\"tel\" name=\"input_phone_number_16\"\n [attr.aria-label]=\"'User.Account.Details.PhoneNumber' | transloco\"/>\n </pw-input-container>\n </div>\n <pw-sticky-actions>\n <button class=\"btn btn-raised btn-primary\" [buttonBusy]=\"profileBusyButton\">\n {{ 'Button.Save' | transloco }}\n </button>\n </pw-sticky-actions>\n </div>\n </form>\n </section>\n </div>\n</div>\n<div class=\"row gx-3 mb-3\">\n <div class=\"col-md-6\">\n <section id=\"email-section\"\n class=\"card p-4 h-100\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Account.RegisteredEmail' | transloco }}</h2>\n <section id=\"email-form\">\n <form [formGroup]=\"emailForm\"\n (ngSubmit)=\"onEmailFormSubmit()\">\n <!-- Email Address -->\n <div class=\"mt-0\">\n <span id=\"account-primary-email-label\" class=\"me-3 pw-label-style\">{{ 'User.Account.PrimaryEmail' | transloco }}:\n </span>\n <strong>{{ validatedEmail }}</strong>\n <div class=\"mt-1\">\n @if (!toggleEmail) {\n <a class=\"btn btn-raised btn-outline-primary\"\n [attr.aria-label]=\"'User.Account.ChangeEmail' | transloco\"\n (click)=\"shouldUserChangeEmail()\">\n {{ 'User.Account.ChangeEmail' | transloco }}</a>\n }\n @if (toggleEmail) {\n <div class=\"row\">\n <div class=\"clearfix\"></div>\n <div class=\"col-12 mb-3\">\n @if (!passwordVerified) {\n <input type=\"password\"\n class=\"form-control\"\n id=\"account-email-current-password\"\n name=\"currentPassword\"\n #password\n [placeholder]=\"'User.Account.CurrentPassword' | transloco\"\n autocomplete=\"current-password\"\n (keyup)=\"checkValidity()\"\n [attr.aria-label]=\"'User.Account.CurrentPassword' | transloco\" />\n }\n @if (passwordVerified) {\n <input type=\"text\"\n class=\"form-control\"\n id=\"account-new-email\"\n name=\"newEmail\"\n [placeholder]=\"'User.Account.Details.NewEmail' | transloco\"\n autocomplete=\"email\"\n formControlName=\"email\"\n [attr.aria-label]=\"'User.Account.Details.NewEmail' | transloco\" />\n }\n </div>\n <div class=\"col-12\">\n @if (toggleEmail) {\n <a\n class=\"btn btn-raised btn-outline-default my-2 me-2\"\n [attr.aria-label]=\"'Button.Cancel' | transloco\"\n (click)=\"onToggleEmail()\">{{ 'Button.Cancel' | transloco }}</a>\n }\n @if (!passwordVerified) {\n <button class=\"btn btn-raised btn-primary\"\n type=\"submit\"\n [buttonBusy]=\"validatePasswordBusyButton\"\n (click)=\"validatePassword()\"\n [disabled]=\"isCurrentPasswordValid\">\n {{ 'User.Account.Validate' | transloco }}\n </button>\n }\n @if (passwordVerified) {\n <button type=\"submit\"\n class=\"btn btn-raised btn-primary\"\n [buttonBusy]=\"emailBusyButton\"\n >\n {{\n 'User.Account.SendVerification' | transloco\n }}\n </button>\n }\n </div>\n </div>\n }\n </div>\n </div>\n <section id=\"slug\"\n class=\"mb-2 mt-3\">\n <div>\n <span class=\"me-3 pw-label-style\" id=\"account-nickname-label\">{{ 'User.Account.NickName' | transloco }}:</span>\n <span class=\"tooltip-wrap me-3\" [pTooltip]=\"'User.Account.HandleTooltip' | transloco\" [appendTo]=\"'body'\" tooltipPosition=\"top\"><i class=\"far fa-info-circle text-muted\"></i></span>\n <strong>{{ slug }}</strong>\n <div class=\"mt-1\">\n @if (!toggleNickName) {\n <a class=\"btn btn-raised btn-outline-primary me-2\"\n [attr.aria-label]=\"'User.Account.ChangeNickname' | transloco\"\n (click)=\"toggleNickName = true\">\n {{ 'User.Account.ChangeNickname' | transloco }}</a>\n }\n @if (toggleNickName) {\n <div class=\"mb-3\">\n <input type=\"text\"\n id=\"account-nickname\"\n name=\"nickname\"\n class=\"form-control slug-input\"\n aria-labelledby=\"account-nickname-label\"\n [(ngModel)]=\"slug\"\n [ngModelOptions]=\"{ standalone: true }\"\n [attr.aria-label]=\"'User.Account.NickName' | transloco\" />\n </div>\n <div>\n <button type=\"button\"\n class=\"btn btn-raised btn-outline-default\"\n (click)=\"toggleNickName = false\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"button\"\n class=\"btn btn-raised btn-primary ms-2\"\n [buttonBusy]=\"slugBusyButton\"\n [disabled]=\"slug?.length < 2\"\n (click)=\"onUpdateSlug()\">\n {{ 'User.Account.UpdateNickname' | transloco }}\n </button>\n </div>\n }\n </div>\n </div>\n </section>\n </form>\n </section>\n </div>\n </div>\n </section>\n </div>\n <div class=\"col-md-6\">\n <section id=\"password-change\"\n class=\"card p-4 h-100\">\n <form [formGroup]=\"passwordForm\"\n (ngSubmit)=\"onPasswordFormSubmit()\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Account.ChangePassword' | transloco }}</h2>\n </div>\n @if (!user?.has_password) {\n <div class=\"text-danger mx-3 my-2\">\n <div>\n {{ 'User.Account.Details.NoPassword' | transloco }}\n <em>{{ 'User.Account.ChangePassword' | transloco }}</em>.\n </div>\n <div>{{ 'User.Profile.PictureMessage' | transloco }}</div>\n </div>\n }\n @if (user?.has_password) {\n <div class=\"col-12\"\n >\n @if (togglePassword) {\n <div class=\"mb-3\">\n <label for=\"account-current-password\">{{ 'User.Account.CurrentPassword' | transloco }}</label>\n <input type=\"password\"\n id=\"account-current-password\"\n class=\"form-control\"\n formControlName=\"currentPassword\"\n autocomplete=\"current-password\" name=\"input_currentPassword_4\"\n [attr.aria-label]=\"'User.Account.CurrentPassword' | transloco\"/>\n @if (\n !passwordForm.get('currentPassword').valid &&\n (passwordForm.get('currentPassword').dirty ||\n passwordForm.get('currentPassword').touched)\n ) {\n <small class=\"form-text text-muted danger\"\n >\n {{ 'User.Account.Required' | transloco }}\n </small>\n }\n </div>\n <div class=\"mb-3\">\n <label for=\"account-new-password\">{{ 'User.Account.NewPassword' | transloco }}</label>\n <input type=\"password\"\n id=\"account-new-password\"\n class=\"form-control\"\n formControlName=\"newPassword\"\n autocomplete=\"new-password\" name=\"input_newPassword_5\"\n [attr.aria-label]=\"'User.Account.NewPassword' | transloco\"/>\n @if (\n !passwordForm.get('newPassword').valid &&\n (passwordForm.get('newPassword').dirty ||\n passwordForm.get('newPassword').touched)\n ) {\n <small class=\"form-text text-muted danger\"\n >{{ 'User.Account.Validation.StrongPassword' | transloco }}\n </small>\n }\n </div>\n <div class=\"mb-3\">\n <label for=\"account-confirm-password\">{{\n 'User.Account.ConfirmPassword' | transloco\n }}</label>\n <input type=\"password\"\n id=\"account-confirm-password\"\n class=\"form-control\"\n formControlName=\"confirmPassword\"\n autocomplete=\"new-password\" name=\"input_confirmPassword_6\"\n [attr.aria-label]=\"'User.Account.ConfirmPassword' | transloco\"/>\n @if (\n passwordForm.get('confirmPassword').touched &&\n passwordForm.get('confirmPassword').errors\n ?.MatchPassword\n ) {\n <div class=\"text-danger\"\n >\n {{ 'User.Account.Validation.PasswordsMatch' | transloco }}\n </div>\n }\n </div>\n <div class=\"mb-3\">\n @if (togglePassword) {\n <a class=\"btn btn-raised btn-outline-default\"\n [attr.aria-label]=\"'Button.Cancel' | transloco\"\n data-bs-target=\"\"\n (click)=\"onTogglePassword()\">\n {{ 'Button.Cancel' | transloco }}</a>\n }\n <button class=\"btn btn-raised btn-primary ms-2\"\n [buttonBusy]=\"passwordBusyButton\"\n [disabled]=\"!passwordForm.valid\">\n {{ 'User.Account.UpdatePassword' | transloco }}\n </button>\n </div>\n }\n <div>\n @if (!togglePassword) {\n <a class=\"btn btn-raised btn-outline-primary\"\n [attr.aria-label]=\"'User.Account.ChangePassword' | transloco\"\n data-bs-target=\"\"\n (click)=\"togglePassword = !togglePassword\">\n {{ 'User.Account.ChangePassword' | transloco }}</a>\n }\n </div>\n </div>\n }\n @if (!user?.has_password) {\n <div class=\"col-12\"\n >\n <a class=\"btn btn-raised btn-primary me-2\"\n [attr.aria-label]=\"'User.Account.ChangePassword' | transloco\"\n data-bs-target=\"\"\n (click)=\"sendMailToResetPassword()\">\n {{ 'User.Account.ChangePassword' | transloco }}</a>\n </div>\n }\n </div>\n </form>\n </section>\n </div>\n @if (apiMcpEnabled && user?.api_keys?.api_hits_max > 0) {\n <div class=\"col-12 mt-3\">\n <section id=\"api-credentials\"\n class=\"card p-4 h-auto\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Subscriptions.APICredentials.Title' | transloco }}</h2>\n <p>\n {{ 'User.Subscriptions.APICredentials.Description' | transloco: { company: mcpCompanyName } }}\n </p>\n <p class=\"text-muted small mb-2\">\n <i class=\"fas fa-link me-1\"></i>\n {{ 'User.Subscriptions.APICredentials.McpEndpointNote' | transloco: { url: mcpEndpointUrl, company: mcpCompanyName } }}\n </p>\n <!-- pb (not mb): .card .mb-3:last-child is margin-reset in this component's scss -->\n <p class=\"text-muted small mb-0 pb-3\">\n <i class=\"fas fa-info-circle me-1\"></i>\n {{ 'User.Subscriptions.APICredentials.SubscriptionClientIdNote' | transloco }}\n </p>\n </div>\n <div class=\"col-12 col-md-6\">\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"account-api-token\">{{ 'User.Account.APIUserToken' | transloco }}</label>\n <div class=\"input-group\">\n <input type=\"text\"\n id=\"account-api-token\"\n name=\"api_token\"\n class=\"form-control\"\n [value]=\"showApiToken ? user?.api_keys?.api_user_token || ('User.Subscriptions.APICredentials.NoTokenAvailable' | transloco) : '*************************'\"\n readonly\n [attr.aria-label]=\"'User.Account.APIUserToken' | transloco\" />\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"toggleApiTokenVisibility()\">\n {{ showApiToken ? ('User.Subscriptions.APICredentials.Hide' | transloco) : ('User.Subscriptions.APICredentials.View' | transloco) }}\n </button>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-md-6\">\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"account-api-client-id\">{{ 'User.Account.APIUserId' | transloco }}</label>\n <div class=\"input-group\">\n <input type=\"text\"\n id=\"account-api-client-id\"\n name=\"api_client_id\"\n class=\"form-control\"\n [value]=\"showApiClientId ? user?.api_keys?.api_user_id || ('User.Subscriptions.APICredentials.NoClientIdAvailable' | transloco) : '*************************'\"\n readonly\n [attr.aria-label]=\"'User.Account.APIUserId' | transloco\" />\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"toggleApiClientIdVisibility()\">\n {{ showApiClientId ? ('User.Subscriptions.APICredentials.Hide' | transloco) : ('User.Subscriptions.APICredentials.View' | transloco) }}\n </button>\n </div>\n </div>\n </div>\n <div class=\"col-12 mt-3\">\n <div class=\"d-flex align-items-center gap-3\">\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"refreshApiTokens()\"\n [disabled]=\"refreshingTokens\">\n <i class=\"fas fa-sync-alt me-2\" [class.fa-spin]=\"refreshingTokens\"></i>\n {{ refreshingTokens ? ('User.Subscriptions.APICredentials.Refreshing' | transloco) : ('User.Subscriptions.APICredentials.RefreshTokens' | transloco) }}\n </button>\n <div class=\"d-flex align-items-center gap-2\">\n @if (user?.api_keys?.api_hits !== null) {\n <span class=\"text-muted\">{{ 'User.Subscriptions.APICredentials.ApiHits' | transloco }}:</span>\n <span class=\"fw-bold\">{{ user.api_keys.api_hits | number }}</span>\n }\n @if (user?.api_keys?.api_hits_max !== null) {\n <span class=\"text-muted\">{{ 'User.Subscriptions.APICredentials.ApiHitsMax' | transloco }}:</span>\n <span class=\"fw-bold\">{{ user.api_keys.api_hits_max | number }}</span>\n }\n <!-- Show utilization percentage when both values exist -->\n @if (user?.api_keys?.api_hits !== null && user?.api_keys?.api_hits_max !== null && user?.api_keys?.api_hits_max > 0) {\n <span class=\"text-muted ms-2\">(</span>\n <span class=\"fw-bold\" [ngClass]=\"{\n 'text-success-muted': (user.api_keys.api_hits / user.api_keys.api_hits_max) <= 0.8,\n 'text-warning': (user.api_keys.api_hits / user.api_keys.api_hits_max) > 0.8 && (user.api_keys.api_hits / user.api_keys.api_hits_max) <= 0.9,\n 'text-danger': (user.api_keys.api_hits / user.api_keys.api_hits_max) > 0.9\n }\">\n {{ 'User.Subscriptions.Details.ApiConsumed' | transloco: { percent: ((user.api_keys.api_hits / user.api_keys.api_hits_max * 100) | number:'1.0-0') } }}\n </span>\n <span class=\"text-muted\">)</span>\n }\n </div>\n </div>\n </div>\n <div class=\"col-12 mt-3\">\n <label class=\"form-label\">{{ 'User.Subscriptions.APICredentials.ScopeLabel' | transloco }}</label>\n <div class=\"d-flex align-items-center flex-wrap gap-2\">\n <div class=\"btn-group\" role=\"group\"\n [attr.aria-label]=\"'User.Subscriptions.APICredentials.ScopeLabel' | transloco\">\n <button type=\"button\" class=\"btn\"\n [ngClass]=\"currentApiTokenScope === 'read_only' ? 'btn-primary' : 'btn-outline-secondary'\"\n [disabled]=\"updatingScope\"\n (click)=\"changeApiTokenScope('read_only')\">\n {{ 'User.Subscriptions.APICredentials.ScopeReadOnly' | transloco }}\n </button>\n <button type=\"button\" class=\"btn\"\n [ngClass]=\"currentApiTokenScope === 'read_write' ? 'btn-primary' : 'btn-outline-secondary'\"\n [disabled]=\"updatingScope\"\n (click)=\"changeApiTokenScope('read_write')\">\n {{ 'User.Subscriptions.APICredentials.ScopeReadWrite' | transloco }}\n </button>\n </div>\n <span class=\"text-muted small\">{{ 'User.Subscriptions.APICredentials.ScopeHint' | transloco }}</span>\n </div>\n </div>\n </div>\n </section>\n </div>\n }\n @if (apiMcpEnabled && user?.api_keys?.api_hits_max > 0) {\n <div class=\"col-12 mt-3\">\n <section id=\"registered-apps\"\n class=\"card p-4 h-auto\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Subscriptions.RegisteredApps.Title' | transloco }}</h2>\n <p>\n {{ 'User.Subscriptions.RegisteredApps.Description' | transloco }}\n </p>\n </div>\n <div class=\"col-12\">\n <pw-loader [isVisible]=\"loadingConnections\"></pw-loader>\n @if (!loadingConnections) {\n @if (connections.length === 0) {\n <p class=\"text-muted\">{{ 'User.Subscriptions.RegisteredApps.NoApps' | transloco }}</p>\n }\n @for (conn of connections; track conn.id) {\n <div class=\"d-flex align-items-center justify-content-between py-2 border-bottom\">\n <div>\n <span class=\"fw-bold me-3\">{{ conn.client_name }}</span>\n <span class=\"text-muted small\">\n {{ 'User.Subscriptions.RegisteredApps.ConnectedOn' | transloco }}\n {{ conn.created_at | date:'mediumDate' }}\n </span>\n <span class=\"text-muted small d-block\">\n {{ 'User.Subscriptions.RegisteredApps.LastUsed' | transloco }}\n @if (conn.last_used_at) {\n {{ conn.last_used_at | date:'medium' }}\n } @else {\n {{ 'User.Subscriptions.RegisteredApps.NeverUsed' | transloco }}\n }\n </span>\n </div>\n <button type=\"button\"\n class=\"btn btn-outline-danger btn-sm\"\n (click)=\"deregisterConnection(conn.id)\">\n {{ 'User.Subscriptions.RegisteredApps.Deregister' | transloco }}\n </button>\n </div>\n }\n }\n </div>\n </div>\n </section>\n </div>\n }\n @if (user?.id) {\n <div class=\"col-12 mt-3\">\n <pw-account-user-credentials [userId]=\"user.id\"></pw-account-user-credentials>\n </div>\n }\n</div>\n<ng-template #content\n let-modal>\n <div class=\"card m-0\">\n <div class=\"card-content\">\n <div class=\"card-title\">\n <h3 class=\"modal-title\">{{ 'User.Profile.ProfilePicture' | transloco }}</h3>\n <button type=\"button\"\n class=\"btn-close float-end\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss()\">\n </button>\n </div>\n <div class=\"card-header\">\n <small> {{ 'User.Profile.PictureMessage' | transloco }}</small>\n <pw-image-cropper #profile\n aspectRatio=\"auto\"\n (imageSelectionEvent)=\"onImageSelection($event)\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n </div>\n </div>\n</ng-template>\n",
|
|
567
1145
|
styles: [".card .mb-2:last-child,.card .mb-3:last-child{margin-bottom:0!important}.overlay{left:50%;opacity:0;position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%);transition:.5s ease}.image-container{position:relative}.image-container:hover .image{opacity:.3}.image-container:hover .overlay{opacity:0}.overlay-text{background:#f0efef80;border-radius:50%;color:#000;font-size:16px;height:150px;line-height:150px;text-align:center;vertical-align:middle;width:150px}@media screen and (max-width:767px){.card-body{padding:20px!important}}\n"],
|
|
568
1146
|
dependencies: [
|
|
569
1147
|
{
|
|
@@ -856,6 +1434,12 @@ var AccountDetailsComponent = class AccountDetailsComponent extends AccountAvata
|
|
|
856
1434
|
"fileChangeEvent"
|
|
857
1435
|
]
|
|
858
1436
|
},
|
|
1437
|
+
{
|
|
1438
|
+
kind: "component",
|
|
1439
|
+
type: AccountUserCredentialsComponent,
|
|
1440
|
+
selector: "pw-account-user-credentials",
|
|
1441
|
+
inputs: ["userId"]
|
|
1442
|
+
},
|
|
859
1443
|
{
|
|
860
1444
|
kind: "pipe",
|
|
861
1445
|
type: AsyncPipe,
|
|
@@ -907,12 +1491,13 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
907
1491
|
NgClass,
|
|
908
1492
|
AppLoaderComponent,
|
|
909
1493
|
ProfileImageCropperComponent,
|
|
1494
|
+
AccountUserCredentialsComponent,
|
|
910
1495
|
AsyncPipe,
|
|
911
1496
|
DecimalPipe,
|
|
912
1497
|
DatePipe,
|
|
913
1498
|
TranslocoPipe
|
|
914
1499
|
],
|
|
915
|
-
template: "<div class=\"w-100 text-center\">\n @if (!isLoaded) {\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n }\n</div>\n<div class=\"row gx-3 mb-3\">\n <div class=\"col-md-4\">\n <section class=\"card p-4 h-100 d-flex flex-column\">\n <h2>{{ 'User.Profile.Avatar' | transloco }}</h2>\n <div class=\"text-center d-flex flex-column justify-content-center flex-grow-1 mt-1\">\n <div class=\"image-container\">\n <img [src]=\"image\"\n width=\"150\"\n height=\"150\"\n class=\"image rounded-circle\"\n [alt]=\"'User.Profile.ProfilePicture' | transloco\"\n (error)=\"handleImageError($event, 'assets/img/icons/male.png')\" />\n <div class=\"overlay\"\n (keydown.enter)=\"openModal(content)\"\n (click)=\"openModal(content)\">\n <div class=\"overlay-text\">{{ 'User.Profile.Change' | transloco }}</div>\n </div>\n </div>\n <h4 class=\"mt-2\">{{ user?.first_name }} {{ user?.last_name }}</h4>\n <a [attr.aria-label]=\"'User.Profile.EditAvatar' | transloco\"\n class=\"d-inline-block mb-2\"\n (click)=\"openModal(content)\">\n {{ 'User.Profile.EditAvatar' | transloco }}</a>\n </div>\n </section>\n </div>\n <div class=\"col-md-8\">\n <section id=\"user-profile\"\n class=\"card p-4 overflow-visible h-100\">\n <form [formGroup]=\"profileForm\"\n (ngSubmit)=\"onProfileFormSubmit()\">\n <h2>{{ 'User.Profile.UserProfile' | transloco }}</h2>\n <div class=\"row mt-3\">\n <div class=\"col-sm-12 col-md-6 col-lg-6\">\n <pw-input-container [label]=\"'Label.FirstName' | transloco\"\n name=\"first_name\"\n controlId=\"account-first_name\"\n errorMsg=\"User.Account.Details.Validation.FirstName\">\n <input type=\"text\"\n id=\"account-first_name\"\n class=\"form-control\"\n formControlName=\"first_name\"\n autocomplete=\"given-name\" name=\"input_first_name_9\"\n [attr.aria-label]=\"'Label.FirstName' | transloco\"/>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.PreferredName' | transloco\"\n name=\"preferred_name\"\n controlId=\"account-preferred_name\"\n errorMsg=\"User.Account.Details.Validation.PreferredName\">\n <input type=\"text\"\n id=\"account-preferred_name\"\n class=\"form-control\"\n formControlName=\"preferred_name\"\n autocomplete=\"username\" name=\"input_preferred_name_10\"\n [attr.aria-label]=\"'User.Account.Details.PreferredName' | transloco\"/>\n </pw-input-container>\n @if (countries$ | async; as countries) {\n <pw-input-container [label]=\"'User.Subscriptions.Details.Country' | transloco\"\n name=\"country\"\n controlId=\"account-country\"\n [useAriaLabelledbyOnly]=\"true\"\n errorMsg=\"User.Subscriptions.Details.Validation.Country\">\n <p-select\n [attr.aria-labelledby]=\"'account-country-label'\"\n [options]=\"countries\"\n optionLabel=\"name\"\n optionValue=\"code\"\n formControlName=\"country\"\n (onChange)=\"getRegion($event.value)\"\n placeholder=\"{{ 'User.Profile.SelectCountry' | transloco }}\">\n </p-select>\n </pw-input-container>\n }\n <pw-input-container [label]=\"'User.Account.Details.Province' | transloco\"\n name=\"province\"\n controlId=\"account-province\"\n errorMsg=\"User.Account.Details.Validation.Province\">\n <input type=\"text\"\n id=\"account-province\"\n class=\"form-control\"\n formControlName=\"province\"\n autocomplete=\"postal-code\" name=\"input_province_11\"\n [attr.aria-label]=\"'User.Account.Details.Province' | transloco\"/>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.WebsiteUrl' | transloco\"\n name=\"website_url\"\n controlId=\"account-website_url\"\n errorMsg=\"User.Account.Details.Validation.Website\">\n <input type=\"text\"\n id=\"account-website_url\"\n class=\"form-control\"\n formControlName=\"website_url\"\n autocomplete=\"url\" name=\"input_website_url_12\"\n [attr.aria-label]=\"'User.Account.Details.WebsiteUrl' | transloco\"/>\n </pw-input-container>\n </div>\n <div class=\"col-sm-12 col-md-6 col-lg-6\">\n <pw-input-container [label]=\"'Label.LastName' | transloco\"\n name=\"last_name\"\n controlId=\"account-last_name\"\n errorMsg=\"User.Account.Details.Validation.LastName\">\n <input type=\"text\"\n id=\"account-last_name\"\n class=\"form-control\"\n formControlName=\"last_name\"\n autocomplete=\"family-name\" name=\"input_last_name_13\"\n [attr.aria-label]=\"'Label.LastName' | transloco\"/>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.DateOfBirth' | transloco\"\n name=\"dob\"\n controlId=\"account-dob\"\n errorMsg=\"User.Account.Details.Validation.DateOfBirth\">\n <div class=\"input-group\">\n <input class=\"form-control\"\n id=\"account-dob\"\n name=\"dob\"\n [placeholder]=\"'User.Account.Details.DateOfBirthPlaceholder' | transloco\"\n formControlName=\"dob\"\n ngbDatepicker\n #d=\"ngbDatepicker\"\n [minDate]=\"{ day: 1, month: 1, year: 1950 }\"\n [maxDate]=\"{ day: 31, month: 12, year: 2018 }\"\n [attr.aria-label]=\"'User.Account.Details.DateOfBirth' | transloco\" />\n <button class=\"btn btn-primary\"\n type=\"button\"\n id=\"account-dob-trigger\"\n [attr.aria-label]=\"'User.Account.Details.OpenDatePicker' | transloco\"\n (click)=\"d.toggle()\">\n <i class=\"fa fa-calendar\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.State' | transloco\"\n name=\"state\"\n controlId=\"account-state\"\n [useAriaLabelledbyOnly]=\"true\"\n errorMsg=\"User.Account.Details.Validation.State\">\n <p-select\n [attr.aria-labelledby]=\"'account-state-label'\"\n [options]=\"states\"\n [(ngModel)]=\"selectedState\"\n optionLabel=\"name\"\n optionValue=\"code\"\n formControlName=\"state\"\n [placeholder]=\"'User.Profile.SelectState' | transloco\">\n </p-select>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.Location' | transloco\"\n name=\"location\"\n controlId=\"account-location\"\n [useAriaLabelledbyOnly]=\"true\">\n <input ngx-gp-autocomplete\n id=\"account-location\"\n name=\"location\"\n class=\"form-control\"\n [attr.aria-labelledby]=\"'account-location-label'\"\n #places=\"ngx-places\"\n formControlName=\"location\"\n (onAddressChange)=\"handleAddressChange($event)\"\n [attr.aria-label]=\"'User.Account.Details.Location' | transloco\" />\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.PhoneNumber' | transloco\"\n name=\"phone_number\"\n controlId=\"account-phone_number\"\n errorMsg=\"User.Account.Details.Validation.PhoneNumber\">\n <input type=\"text\"\n id=\"account-phone_number\"\n class=\"form-control\"\n formControlName=\"phone_number\"\n autocomplete=\"tel\" name=\"input_phone_number_16\"\n [attr.aria-label]=\"'User.Account.Details.PhoneNumber' | transloco\"/>\n </pw-input-container>\n </div>\n <pw-sticky-actions>\n <button class=\"btn btn-raised btn-primary\" [buttonBusy]=\"profileBusyButton\">\n {{ 'Button.Save' | transloco }}\n </button>\n </pw-sticky-actions>\n </div>\n </form>\n </section>\n </div>\n</div>\n<div class=\"row gx-3 mb-3\">\n <div class=\"col-md-6\">\n <section id=\"email-section\"\n class=\"card p-4 h-100\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Account.RegisteredEmail' | transloco }}</h2>\n <section id=\"email-form\">\n <form [formGroup]=\"emailForm\"\n (ngSubmit)=\"onEmailFormSubmit()\">\n <!-- Email Address -->\n <div class=\"mt-0\">\n <span id=\"account-primary-email-label\" class=\"me-3 pw-label-style\">{{ 'User.Account.PrimaryEmail' | transloco }}:\n </span>\n <strong>{{ validatedEmail }}</strong>\n <div class=\"mt-1\">\n @if (!toggleEmail) {\n <a class=\"btn btn-raised btn-outline-primary\"\n [attr.aria-label]=\"'User.Account.ChangeEmail' | transloco\"\n (click)=\"shouldUserChangeEmail()\">\n {{ 'User.Account.ChangeEmail' | transloco }}</a>\n }\n @if (toggleEmail) {\n <div class=\"row\">\n <div class=\"clearfix\"></div>\n <div class=\"col-12 mb-3\">\n @if (!passwordVerified) {\n <input type=\"password\"\n class=\"form-control\"\n id=\"account-email-current-password\"\n name=\"currentPassword\"\n #password\n [placeholder]=\"'User.Account.CurrentPassword' | transloco\"\n autocomplete=\"current-password\"\n (keyup)=\"checkValidity()\"\n [attr.aria-label]=\"'User.Account.CurrentPassword' | transloco\" />\n }\n @if (passwordVerified) {\n <input type=\"text\"\n class=\"form-control\"\n id=\"account-new-email\"\n name=\"newEmail\"\n [placeholder]=\"'User.Account.Details.NewEmail' | transloco\"\n autocomplete=\"email\"\n formControlName=\"email\"\n [attr.aria-label]=\"'User.Account.Details.NewEmail' | transloco\" />\n }\n </div>\n <div class=\"col-12\">\n @if (toggleEmail) {\n <a\n class=\"btn btn-raised btn-outline-default my-2 me-2\"\n [attr.aria-label]=\"'Button.Cancel' | transloco\"\n (click)=\"onToggleEmail()\">{{ 'Button.Cancel' | transloco }}</a>\n }\n @if (!passwordVerified) {\n <button class=\"btn btn-raised btn-primary\"\n type=\"submit\"\n [buttonBusy]=\"validatePasswordBusyButton\"\n (click)=\"validatePassword()\"\n [disabled]=\"isCurrentPasswordValid\">\n {{ 'User.Account.Validate' | transloco }}\n </button>\n }\n @if (passwordVerified) {\n <button type=\"submit\"\n class=\"btn btn-raised btn-primary\"\n [buttonBusy]=\"emailBusyButton\"\n >\n {{\n 'User.Account.SendVerification' | transloco\n }}\n </button>\n }\n </div>\n </div>\n }\n </div>\n </div>\n <section id=\"slug\"\n class=\"mb-2 mt-3\">\n <div>\n <span class=\"me-3 pw-label-style\" id=\"account-nickname-label\">{{ 'User.Account.NickName' | transloco }}:</span>\n <span class=\"tooltip-wrap me-3\" [pTooltip]=\"'User.Account.HandleTooltip' | transloco\" [appendTo]=\"'body'\" tooltipPosition=\"top\"><i class=\"far fa-info-circle text-muted\"></i></span>\n <strong>{{ slug }}</strong>\n <div class=\"mt-1\">\n @if (!toggleNickName) {\n <a class=\"btn btn-raised btn-outline-primary me-2\"\n [attr.aria-label]=\"'User.Account.ChangeNickname' | transloco\"\n (click)=\"toggleNickName = true\">\n {{ 'User.Account.ChangeNickname' | transloco }}</a>\n }\n @if (toggleNickName) {\n <div class=\"mb-3\">\n <input type=\"text\"\n id=\"account-nickname\"\n name=\"nickname\"\n class=\"form-control slug-input\"\n aria-labelledby=\"account-nickname-label\"\n [(ngModel)]=\"slug\"\n [ngModelOptions]=\"{ standalone: true }\"\n [attr.aria-label]=\"'User.Account.NickName' | transloco\" />\n </div>\n <div>\n <button type=\"button\"\n class=\"btn btn-raised btn-outline-default\"\n (click)=\"toggleNickName = false\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"button\"\n class=\"btn btn-raised btn-primary ms-2\"\n [buttonBusy]=\"slugBusyButton\"\n [disabled]=\"slug?.length < 2\"\n (click)=\"onUpdateSlug()\">\n {{ 'User.Account.UpdateNickname' | transloco }}\n </button>\n </div>\n }\n </div>\n </div>\n </section>\n </form>\n </section>\n </div>\n </div>\n </section>\n </div>\n <div class=\"col-md-6\">\n <section id=\"password-change\"\n class=\"card p-4 h-100\">\n <form [formGroup]=\"passwordForm\"\n (ngSubmit)=\"onPasswordFormSubmit()\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Account.ChangePassword' | transloco }}</h2>\n </div>\n @if (!user?.has_password) {\n <div class=\"text-danger mx-3 my-2\">\n <div>\n {{ 'User.Account.Details.NoPassword' | transloco }}\n <em>{{ 'User.Account.ChangePassword' | transloco }}</em>.\n </div>\n <div>{{ 'User.Profile.PictureMessage' | transloco }}</div>\n </div>\n }\n @if (user?.has_password) {\n <div class=\"col-12\"\n >\n @if (togglePassword) {\n <div class=\"mb-3\">\n <label for=\"account-current-password\">{{ 'User.Account.CurrentPassword' | transloco }}</label>\n <input type=\"password\"\n id=\"account-current-password\"\n class=\"form-control\"\n formControlName=\"currentPassword\"\n autocomplete=\"current-password\" name=\"input_currentPassword_4\"\n [attr.aria-label]=\"'User.Account.CurrentPassword' | transloco\"/>\n @if (\n !passwordForm.get('currentPassword').valid &&\n (passwordForm.get('currentPassword').dirty ||\n passwordForm.get('currentPassword').touched)\n ) {\n <small class=\"form-text text-muted danger\"\n >\n {{ 'User.Account.Required' | transloco }}\n </small>\n }\n </div>\n <div class=\"mb-3\">\n <label for=\"account-new-password\">{{ 'User.Account.NewPassword' | transloco }}</label>\n <input type=\"password\"\n id=\"account-new-password\"\n class=\"form-control\"\n formControlName=\"newPassword\"\n autocomplete=\"new-password\" name=\"input_newPassword_5\"\n [attr.aria-label]=\"'User.Account.NewPassword' | transloco\"/>\n @if (\n !passwordForm.get('newPassword').valid &&\n (passwordForm.get('newPassword').dirty ||\n passwordForm.get('newPassword').touched)\n ) {\n <small class=\"form-text text-muted danger\"\n >{{ 'User.Account.Validation.StrongPassword' | transloco }}\n </small>\n }\n </div>\n <div class=\"mb-3\">\n <label for=\"account-confirm-password\">{{\n 'User.Account.ConfirmPassword' | transloco\n }}</label>\n <input type=\"password\"\n id=\"account-confirm-password\"\n class=\"form-control\"\n formControlName=\"confirmPassword\"\n autocomplete=\"new-password\" name=\"input_confirmPassword_6\"\n [attr.aria-label]=\"'User.Account.ConfirmPassword' | transloco\"/>\n @if (\n passwordForm.get('confirmPassword').touched &&\n passwordForm.get('confirmPassword').errors\n ?.MatchPassword\n ) {\n <div class=\"text-danger\"\n >\n {{ 'User.Account.Validation.PasswordsMatch' | transloco }}\n </div>\n }\n </div>\n <div class=\"mb-3\">\n @if (togglePassword) {\n <a class=\"btn btn-raised btn-outline-default\"\n [attr.aria-label]=\"'Button.Cancel' | transloco\"\n data-bs-target=\"\"\n (click)=\"onTogglePassword()\">\n {{ 'Button.Cancel' | transloco }}</a>\n }\n <button class=\"btn btn-raised btn-primary ms-2\"\n [buttonBusy]=\"passwordBusyButton\"\n [disabled]=\"!passwordForm.valid\">\n {{ 'User.Account.UpdatePassword' | transloco }}\n </button>\n </div>\n }\n <div>\n @if (!togglePassword) {\n <a class=\"btn btn-raised btn-outline-primary\"\n [attr.aria-label]=\"'User.Account.ChangePassword' | transloco\"\n data-bs-target=\"\"\n (click)=\"togglePassword = !togglePassword\">\n {{ 'User.Account.ChangePassword' | transloco }}</a>\n }\n </div>\n </div>\n }\n @if (!user?.has_password) {\n <div class=\"col-12\"\n >\n <a class=\"btn btn-raised btn-primary me-2\"\n [attr.aria-label]=\"'User.Account.ChangePassword' | transloco\"\n data-bs-target=\"\"\n (click)=\"sendMailToResetPassword()\">\n {{ 'User.Account.ChangePassword' | transloco }}</a>\n </div>\n }\n </div>\n </form>\n </section>\n </div>\n @if (apiMcpEnabled && user?.api_keys?.api_hits_max > 0) {\n <div class=\"col-12 mt-3\">\n <section id=\"api-credentials\"\n class=\"card p-4 h-auto\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Subscriptions.APICredentials.Title' | transloco }}</h2>\n <p>\n {{ 'User.Subscriptions.APICredentials.Description' | transloco: { company: mcpCompanyName } }}\n </p>\n <p class=\"text-muted small mb-2\">\n <i class=\"fas fa-link me-1\"></i>\n {{ 'User.Subscriptions.APICredentials.McpEndpointNote' | transloco: { url: mcpEndpointUrl, company: mcpCompanyName } }}\n </p>\n <!-- pb (not mb): .card .mb-3:last-child is margin-reset in this component's scss -->\n <p class=\"text-muted small mb-0 pb-3\">\n <i class=\"fas fa-info-circle me-1\"></i>\n {{ 'User.Subscriptions.APICredentials.SubscriptionClientIdNote' | transloco }}\n </p>\n </div>\n <div class=\"col-12 col-md-6\">\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"account-api-token\">{{ 'User.Account.APIUserToken' | transloco }}</label>\n <div class=\"input-group\">\n <input type=\"text\"\n id=\"account-api-token\"\n name=\"api_token\"\n class=\"form-control\"\n [value]=\"showApiToken ? user?.api_keys?.api_user_token || ('User.Subscriptions.APICredentials.NoTokenAvailable' | transloco) : '*************************'\"\n readonly\n [attr.aria-label]=\"'User.Account.APIUserToken' | transloco\" />\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"toggleApiTokenVisibility()\">\n {{ showApiToken ? ('User.Subscriptions.APICredentials.Hide' | transloco) : ('User.Subscriptions.APICredentials.View' | transloco) }}\n </button>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-md-6\">\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"account-api-client-id\">{{ 'User.Account.APIUserId' | transloco }}</label>\n <div class=\"input-group\">\n <input type=\"text\"\n id=\"account-api-client-id\"\n name=\"api_client_id\"\n class=\"form-control\"\n [value]=\"showApiClientId ? user?.api_keys?.api_user_id || ('User.Subscriptions.APICredentials.NoClientIdAvailable' | transloco) : '*************************'\"\n readonly\n [attr.aria-label]=\"'User.Account.APIUserId' | transloco\" />\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"toggleApiClientIdVisibility()\">\n {{ showApiClientId ? ('User.Subscriptions.APICredentials.Hide' | transloco) : ('User.Subscriptions.APICredentials.View' | transloco) }}\n </button>\n </div>\n </div>\n </div>\n <div class=\"col-12 mt-3\">\n <div class=\"d-flex align-items-center gap-3\">\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"refreshApiTokens()\"\n [disabled]=\"refreshingTokens\">\n <i class=\"fas fa-sync-alt me-2\" [class.fa-spin]=\"refreshingTokens\"></i>\n {{ refreshingTokens ? ('User.Subscriptions.APICredentials.Refreshing' | transloco) : ('User.Subscriptions.APICredentials.RefreshTokens' | transloco) }}\n </button>\n <div class=\"d-flex align-items-center gap-2\">\n @if (user?.api_keys?.api_hits !== null) {\n <span class=\"text-muted\">{{ 'User.Subscriptions.APICredentials.ApiHits' | transloco }}:</span>\n <span class=\"fw-bold\">{{ user.api_keys.api_hits | number }}</span>\n }\n @if (user?.api_keys?.api_hits_max !== null) {\n <span class=\"text-muted\">{{ 'User.Subscriptions.APICredentials.ApiHitsMax' | transloco }}:</span>\n <span class=\"fw-bold\">{{ user.api_keys.api_hits_max | number }}</span>\n }\n <!-- Show utilization percentage when both values exist -->\n @if (user?.api_keys?.api_hits !== null && user?.api_keys?.api_hits_max !== null && user?.api_keys?.api_hits_max > 0) {\n <span class=\"text-muted ms-2\">(</span>\n <span class=\"fw-bold\" [ngClass]=\"{\n 'text-success-muted': (user.api_keys.api_hits / user.api_keys.api_hits_max) <= 0.8,\n 'text-warning': (user.api_keys.api_hits / user.api_keys.api_hits_max) > 0.8 && (user.api_keys.api_hits / user.api_keys.api_hits_max) <= 0.9,\n 'text-danger': (user.api_keys.api_hits / user.api_keys.api_hits_max) > 0.9\n }\">\n {{ 'User.Subscriptions.Details.ApiConsumed' | transloco: { percent: ((user.api_keys.api_hits / user.api_keys.api_hits_max * 100) | number:'1.0-0') } }}\n </span>\n <span class=\"text-muted\">)</span>\n }\n </div>\n </div>\n </div>\n <div class=\"col-12 mt-3\">\n <label class=\"form-label\">{{ 'User.Subscriptions.APICredentials.ScopeLabel' | transloco }}</label>\n <div class=\"d-flex align-items-center flex-wrap gap-2\">\n <div class=\"btn-group\" role=\"group\"\n [attr.aria-label]=\"'User.Subscriptions.APICredentials.ScopeLabel' | transloco\">\n <button type=\"button\" class=\"btn\"\n [ngClass]=\"currentApiTokenScope === 'read_only' ? 'btn-primary' : 'btn-outline-secondary'\"\n [disabled]=\"updatingScope\"\n (click)=\"changeApiTokenScope('read_only')\">\n {{ 'User.Subscriptions.APICredentials.ScopeReadOnly' | transloco }}\n </button>\n <button type=\"button\" class=\"btn\"\n [ngClass]=\"currentApiTokenScope === 'read_write' ? 'btn-primary' : 'btn-outline-secondary'\"\n [disabled]=\"updatingScope\"\n (click)=\"changeApiTokenScope('read_write')\">\n {{ 'User.Subscriptions.APICredentials.ScopeReadWrite' | transloco }}\n </button>\n </div>\n <span class=\"text-muted small\">{{ 'User.Subscriptions.APICredentials.ScopeHint' | transloco }}</span>\n </div>\n </div>\n </div>\n </section>\n </div>\n }\n @if (apiMcpEnabled && user?.api_keys?.api_hits_max > 0) {\n <div class=\"col-12 mt-3\">\n <section id=\"registered-apps\"\n class=\"card p-4 h-auto\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Subscriptions.RegisteredApps.Title' | transloco }}</h2>\n <p>\n {{ 'User.Subscriptions.RegisteredApps.Description' | transloco }}\n </p>\n </div>\n <div class=\"col-12\">\n <pw-loader [isVisible]=\"loadingConnections\"></pw-loader>\n @if (!loadingConnections) {\n @if (connections.length === 0) {\n <p class=\"text-muted\">{{ 'User.Subscriptions.RegisteredApps.NoApps' | transloco }}</p>\n }\n @for (conn of connections; track conn.id) {\n <div class=\"d-flex align-items-center justify-content-between py-2 border-bottom\">\n <div>\n <span class=\"fw-bold me-3\">{{ conn.client_name }}</span>\n <span class=\"text-muted small\">\n {{ 'User.Subscriptions.RegisteredApps.ConnectedOn' | transloco }}\n {{ conn.created_at | date:'mediumDate' }}\n </span>\n <span class=\"text-muted small d-block\">\n {{ 'User.Subscriptions.RegisteredApps.LastUsed' | transloco }}\n @if (conn.last_used_at) {\n {{ conn.last_used_at | date:'medium' }}\n } @else {\n {{ 'User.Subscriptions.RegisteredApps.NeverUsed' | transloco }}\n }\n </span>\n </div>\n <button type=\"button\"\n class=\"btn btn-outline-danger btn-sm\"\n (click)=\"deregisterConnection(conn.id)\">\n {{ 'User.Subscriptions.RegisteredApps.Deregister' | transloco }}\n </button>\n </div>\n }\n }\n </div>\n </div>\n </section>\n </div>\n }\n</div>\n<ng-template #content\n let-modal>\n <div class=\"card m-0\">\n <div class=\"card-content\">\n <div class=\"card-title\">\n <h3 class=\"modal-title\">{{ 'User.Profile.ProfilePicture' | transloco }}</h3>\n <button type=\"button\"\n class=\"btn-close float-end\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss()\">\n </button>\n </div>\n <div class=\"card-header\">\n <small> {{ 'User.Profile.PictureMessage' | transloco }}</small>\n <pw-image-cropper #profile\n aspectRatio=\"auto\"\n (imageSelectionEvent)=\"onImageSelection($event)\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n </div>\n </div>\n</ng-template>\n",
|
|
1500
|
+
template: "<div class=\"w-100 text-center\">\n @if (!isLoaded) {\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n }\n</div>\n<div class=\"row gx-3 mb-3\">\n <div class=\"col-md-4\">\n <section class=\"card p-4 h-100 d-flex flex-column\">\n <h2>{{ 'User.Profile.Avatar' | transloco }}</h2>\n <div class=\"text-center d-flex flex-column justify-content-center flex-grow-1 mt-1\">\n <div class=\"image-container\">\n <img [src]=\"image\"\n width=\"150\"\n height=\"150\"\n class=\"image rounded-circle\"\n [alt]=\"'User.Profile.ProfilePicture' | transloco\"\n (error)=\"handleImageError($event, 'assets/img/icons/male.png')\" />\n <div class=\"overlay\"\n (keydown.enter)=\"openModal(content)\"\n (click)=\"openModal(content)\">\n <div class=\"overlay-text\">{{ 'User.Profile.Change' | transloco }}</div>\n </div>\n </div>\n <h4 class=\"mt-2\">{{ user?.first_name }} {{ user?.last_name }}</h4>\n <a [attr.aria-label]=\"'User.Profile.EditAvatar' | transloco\"\n class=\"d-inline-block mb-2\"\n (click)=\"openModal(content)\">\n {{ 'User.Profile.EditAvatar' | transloco }}</a>\n </div>\n </section>\n </div>\n <div class=\"col-md-8\">\n <section id=\"user-profile\"\n class=\"card p-4 overflow-visible h-100\">\n <form [formGroup]=\"profileForm\"\n (ngSubmit)=\"onProfileFormSubmit()\">\n <h2>{{ 'User.Profile.UserProfile' | transloco }}</h2>\n <div class=\"row mt-3\">\n <div class=\"col-sm-12 col-md-6 col-lg-6\">\n <pw-input-container [label]=\"'Label.FirstName' | transloco\"\n name=\"first_name\"\n controlId=\"account-first_name\"\n errorMsg=\"User.Account.Details.Validation.FirstName\">\n <input type=\"text\"\n id=\"account-first_name\"\n class=\"form-control\"\n formControlName=\"first_name\"\n autocomplete=\"given-name\" name=\"input_first_name_9\"\n [attr.aria-label]=\"'Label.FirstName' | transloco\"/>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.PreferredName' | transloco\"\n name=\"preferred_name\"\n controlId=\"account-preferred_name\"\n errorMsg=\"User.Account.Details.Validation.PreferredName\">\n <input type=\"text\"\n id=\"account-preferred_name\"\n class=\"form-control\"\n formControlName=\"preferred_name\"\n autocomplete=\"username\" name=\"input_preferred_name_10\"\n [attr.aria-label]=\"'User.Account.Details.PreferredName' | transloco\"/>\n </pw-input-container>\n @if (countries$ | async; as countries) {\n <pw-input-container [label]=\"'User.Subscriptions.Details.Country' | transloco\"\n name=\"country\"\n controlId=\"account-country\"\n [useAriaLabelledbyOnly]=\"true\"\n errorMsg=\"User.Subscriptions.Details.Validation.Country\">\n <p-select\n [attr.aria-labelledby]=\"'account-country-label'\"\n [options]=\"countries\"\n optionLabel=\"name\"\n optionValue=\"code\"\n formControlName=\"country\"\n (onChange)=\"getRegion($event.value)\"\n placeholder=\"{{ 'User.Profile.SelectCountry' | transloco }}\">\n </p-select>\n </pw-input-container>\n }\n <pw-input-container [label]=\"'User.Account.Details.Province' | transloco\"\n name=\"province\"\n controlId=\"account-province\"\n errorMsg=\"User.Account.Details.Validation.Province\">\n <input type=\"text\"\n id=\"account-province\"\n class=\"form-control\"\n formControlName=\"province\"\n autocomplete=\"postal-code\" name=\"input_province_11\"\n [attr.aria-label]=\"'User.Account.Details.Province' | transloco\"/>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.WebsiteUrl' | transloco\"\n name=\"website_url\"\n controlId=\"account-website_url\"\n errorMsg=\"User.Account.Details.Validation.Website\">\n <input type=\"text\"\n id=\"account-website_url\"\n class=\"form-control\"\n formControlName=\"website_url\"\n autocomplete=\"url\" name=\"input_website_url_12\"\n [attr.aria-label]=\"'User.Account.Details.WebsiteUrl' | transloco\"/>\n </pw-input-container>\n </div>\n <div class=\"col-sm-12 col-md-6 col-lg-6\">\n <pw-input-container [label]=\"'Label.LastName' | transloco\"\n name=\"last_name\"\n controlId=\"account-last_name\"\n errorMsg=\"User.Account.Details.Validation.LastName\">\n <input type=\"text\"\n id=\"account-last_name\"\n class=\"form-control\"\n formControlName=\"last_name\"\n autocomplete=\"family-name\" name=\"input_last_name_13\"\n [attr.aria-label]=\"'Label.LastName' | transloco\"/>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.DateOfBirth' | transloco\"\n name=\"dob\"\n controlId=\"account-dob\"\n errorMsg=\"User.Account.Details.Validation.DateOfBirth\">\n <div class=\"input-group\">\n <input class=\"form-control\"\n id=\"account-dob\"\n name=\"dob\"\n [placeholder]=\"'User.Account.Details.DateOfBirthPlaceholder' | transloco\"\n formControlName=\"dob\"\n ngbDatepicker\n #d=\"ngbDatepicker\"\n [minDate]=\"{ day: 1, month: 1, year: 1950 }\"\n [maxDate]=\"{ day: 31, month: 12, year: 2018 }\"\n [attr.aria-label]=\"'User.Account.Details.DateOfBirth' | transloco\" />\n <button class=\"btn btn-primary\"\n type=\"button\"\n id=\"account-dob-trigger\"\n [attr.aria-label]=\"'User.Account.Details.OpenDatePicker' | transloco\"\n (click)=\"d.toggle()\">\n <i class=\"fa fa-calendar\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.State' | transloco\"\n name=\"state\"\n controlId=\"account-state\"\n [useAriaLabelledbyOnly]=\"true\"\n errorMsg=\"User.Account.Details.Validation.State\">\n <p-select\n [attr.aria-labelledby]=\"'account-state-label'\"\n [options]=\"states\"\n [(ngModel)]=\"selectedState\"\n optionLabel=\"name\"\n optionValue=\"code\"\n formControlName=\"state\"\n [placeholder]=\"'User.Profile.SelectState' | transloco\">\n </p-select>\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.Location' | transloco\"\n name=\"location\"\n controlId=\"account-location\"\n [useAriaLabelledbyOnly]=\"true\">\n <input ngx-gp-autocomplete\n id=\"account-location\"\n name=\"location\"\n class=\"form-control\"\n [attr.aria-labelledby]=\"'account-location-label'\"\n #places=\"ngx-places\"\n formControlName=\"location\"\n (onAddressChange)=\"handleAddressChange($event)\"\n [attr.aria-label]=\"'User.Account.Details.Location' | transloco\" />\n </pw-input-container>\n <pw-input-container [label]=\"'User.Account.Details.PhoneNumber' | transloco\"\n name=\"phone_number\"\n controlId=\"account-phone_number\"\n errorMsg=\"User.Account.Details.Validation.PhoneNumber\">\n <input type=\"text\"\n id=\"account-phone_number\"\n class=\"form-control\"\n formControlName=\"phone_number\"\n autocomplete=\"tel\" name=\"input_phone_number_16\"\n [attr.aria-label]=\"'User.Account.Details.PhoneNumber' | transloco\"/>\n </pw-input-container>\n </div>\n <pw-sticky-actions>\n <button class=\"btn btn-raised btn-primary\" [buttonBusy]=\"profileBusyButton\">\n {{ 'Button.Save' | transloco }}\n </button>\n </pw-sticky-actions>\n </div>\n </form>\n </section>\n </div>\n</div>\n<div class=\"row gx-3 mb-3\">\n <div class=\"col-md-6\">\n <section id=\"email-section\"\n class=\"card p-4 h-100\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Account.RegisteredEmail' | transloco }}</h2>\n <section id=\"email-form\">\n <form [formGroup]=\"emailForm\"\n (ngSubmit)=\"onEmailFormSubmit()\">\n <!-- Email Address -->\n <div class=\"mt-0\">\n <span id=\"account-primary-email-label\" class=\"me-3 pw-label-style\">{{ 'User.Account.PrimaryEmail' | transloco }}:\n </span>\n <strong>{{ validatedEmail }}</strong>\n <div class=\"mt-1\">\n @if (!toggleEmail) {\n <a class=\"btn btn-raised btn-outline-primary\"\n [attr.aria-label]=\"'User.Account.ChangeEmail' | transloco\"\n (click)=\"shouldUserChangeEmail()\">\n {{ 'User.Account.ChangeEmail' | transloco }}</a>\n }\n @if (toggleEmail) {\n <div class=\"row\">\n <div class=\"clearfix\"></div>\n <div class=\"col-12 mb-3\">\n @if (!passwordVerified) {\n <input type=\"password\"\n class=\"form-control\"\n id=\"account-email-current-password\"\n name=\"currentPassword\"\n #password\n [placeholder]=\"'User.Account.CurrentPassword' | transloco\"\n autocomplete=\"current-password\"\n (keyup)=\"checkValidity()\"\n [attr.aria-label]=\"'User.Account.CurrentPassword' | transloco\" />\n }\n @if (passwordVerified) {\n <input type=\"text\"\n class=\"form-control\"\n id=\"account-new-email\"\n name=\"newEmail\"\n [placeholder]=\"'User.Account.Details.NewEmail' | transloco\"\n autocomplete=\"email\"\n formControlName=\"email\"\n [attr.aria-label]=\"'User.Account.Details.NewEmail' | transloco\" />\n }\n </div>\n <div class=\"col-12\">\n @if (toggleEmail) {\n <a\n class=\"btn btn-raised btn-outline-default my-2 me-2\"\n [attr.aria-label]=\"'Button.Cancel' | transloco\"\n (click)=\"onToggleEmail()\">{{ 'Button.Cancel' | transloco }}</a>\n }\n @if (!passwordVerified) {\n <button class=\"btn btn-raised btn-primary\"\n type=\"submit\"\n [buttonBusy]=\"validatePasswordBusyButton\"\n (click)=\"validatePassword()\"\n [disabled]=\"isCurrentPasswordValid\">\n {{ 'User.Account.Validate' | transloco }}\n </button>\n }\n @if (passwordVerified) {\n <button type=\"submit\"\n class=\"btn btn-raised btn-primary\"\n [buttonBusy]=\"emailBusyButton\"\n >\n {{\n 'User.Account.SendVerification' | transloco\n }}\n </button>\n }\n </div>\n </div>\n }\n </div>\n </div>\n <section id=\"slug\"\n class=\"mb-2 mt-3\">\n <div>\n <span class=\"me-3 pw-label-style\" id=\"account-nickname-label\">{{ 'User.Account.NickName' | transloco }}:</span>\n <span class=\"tooltip-wrap me-3\" [pTooltip]=\"'User.Account.HandleTooltip' | transloco\" [appendTo]=\"'body'\" tooltipPosition=\"top\"><i class=\"far fa-info-circle text-muted\"></i></span>\n <strong>{{ slug }}</strong>\n <div class=\"mt-1\">\n @if (!toggleNickName) {\n <a class=\"btn btn-raised btn-outline-primary me-2\"\n [attr.aria-label]=\"'User.Account.ChangeNickname' | transloco\"\n (click)=\"toggleNickName = true\">\n {{ 'User.Account.ChangeNickname' | transloco }}</a>\n }\n @if (toggleNickName) {\n <div class=\"mb-3\">\n <input type=\"text\"\n id=\"account-nickname\"\n name=\"nickname\"\n class=\"form-control slug-input\"\n aria-labelledby=\"account-nickname-label\"\n [(ngModel)]=\"slug\"\n [ngModelOptions]=\"{ standalone: true }\"\n [attr.aria-label]=\"'User.Account.NickName' | transloco\" />\n </div>\n <div>\n <button type=\"button\"\n class=\"btn btn-raised btn-outline-default\"\n (click)=\"toggleNickName = false\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"button\"\n class=\"btn btn-raised btn-primary ms-2\"\n [buttonBusy]=\"slugBusyButton\"\n [disabled]=\"slug?.length < 2\"\n (click)=\"onUpdateSlug()\">\n {{ 'User.Account.UpdateNickname' | transloco }}\n </button>\n </div>\n }\n </div>\n </div>\n </section>\n </form>\n </section>\n </div>\n </div>\n </section>\n </div>\n <div class=\"col-md-6\">\n <section id=\"password-change\"\n class=\"card p-4 h-100\">\n <form [formGroup]=\"passwordForm\"\n (ngSubmit)=\"onPasswordFormSubmit()\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Account.ChangePassword' | transloco }}</h2>\n </div>\n @if (!user?.has_password) {\n <div class=\"text-danger mx-3 my-2\">\n <div>\n {{ 'User.Account.Details.NoPassword' | transloco }}\n <em>{{ 'User.Account.ChangePassword' | transloco }}</em>.\n </div>\n <div>{{ 'User.Profile.PictureMessage' | transloco }}</div>\n </div>\n }\n @if (user?.has_password) {\n <div class=\"col-12\"\n >\n @if (togglePassword) {\n <div class=\"mb-3\">\n <label for=\"account-current-password\">{{ 'User.Account.CurrentPassword' | transloco }}</label>\n <input type=\"password\"\n id=\"account-current-password\"\n class=\"form-control\"\n formControlName=\"currentPassword\"\n autocomplete=\"current-password\" name=\"input_currentPassword_4\"\n [attr.aria-label]=\"'User.Account.CurrentPassword' | transloco\"/>\n @if (\n !passwordForm.get('currentPassword').valid &&\n (passwordForm.get('currentPassword').dirty ||\n passwordForm.get('currentPassword').touched)\n ) {\n <small class=\"form-text text-muted danger\"\n >\n {{ 'User.Account.Required' | transloco }}\n </small>\n }\n </div>\n <div class=\"mb-3\">\n <label for=\"account-new-password\">{{ 'User.Account.NewPassword' | transloco }}</label>\n <input type=\"password\"\n id=\"account-new-password\"\n class=\"form-control\"\n formControlName=\"newPassword\"\n autocomplete=\"new-password\" name=\"input_newPassword_5\"\n [attr.aria-label]=\"'User.Account.NewPassword' | transloco\"/>\n @if (\n !passwordForm.get('newPassword').valid &&\n (passwordForm.get('newPassword').dirty ||\n passwordForm.get('newPassword').touched)\n ) {\n <small class=\"form-text text-muted danger\"\n >{{ 'User.Account.Validation.StrongPassword' | transloco }}\n </small>\n }\n </div>\n <div class=\"mb-3\">\n <label for=\"account-confirm-password\">{{\n 'User.Account.ConfirmPassword' | transloco\n }}</label>\n <input type=\"password\"\n id=\"account-confirm-password\"\n class=\"form-control\"\n formControlName=\"confirmPassword\"\n autocomplete=\"new-password\" name=\"input_confirmPassword_6\"\n [attr.aria-label]=\"'User.Account.ConfirmPassword' | transloco\"/>\n @if (\n passwordForm.get('confirmPassword').touched &&\n passwordForm.get('confirmPassword').errors\n ?.MatchPassword\n ) {\n <div class=\"text-danger\"\n >\n {{ 'User.Account.Validation.PasswordsMatch' | transloco }}\n </div>\n }\n </div>\n <div class=\"mb-3\">\n @if (togglePassword) {\n <a class=\"btn btn-raised btn-outline-default\"\n [attr.aria-label]=\"'Button.Cancel' | transloco\"\n data-bs-target=\"\"\n (click)=\"onTogglePassword()\">\n {{ 'Button.Cancel' | transloco }}</a>\n }\n <button class=\"btn btn-raised btn-primary ms-2\"\n [buttonBusy]=\"passwordBusyButton\"\n [disabled]=\"!passwordForm.valid\">\n {{ 'User.Account.UpdatePassword' | transloco }}\n </button>\n </div>\n }\n <div>\n @if (!togglePassword) {\n <a class=\"btn btn-raised btn-outline-primary\"\n [attr.aria-label]=\"'User.Account.ChangePassword' | transloco\"\n data-bs-target=\"\"\n (click)=\"togglePassword = !togglePassword\">\n {{ 'User.Account.ChangePassword' | transloco }}</a>\n }\n </div>\n </div>\n }\n @if (!user?.has_password) {\n <div class=\"col-12\"\n >\n <a class=\"btn btn-raised btn-primary me-2\"\n [attr.aria-label]=\"'User.Account.ChangePassword' | transloco\"\n data-bs-target=\"\"\n (click)=\"sendMailToResetPassword()\">\n {{ 'User.Account.ChangePassword' | transloco }}</a>\n </div>\n }\n </div>\n </form>\n </section>\n </div>\n @if (apiMcpEnabled && user?.api_keys?.api_hits_max > 0) {\n <div class=\"col-12 mt-3\">\n <section id=\"api-credentials\"\n class=\"card p-4 h-auto\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Subscriptions.APICredentials.Title' | transloco }}</h2>\n <p>\n {{ 'User.Subscriptions.APICredentials.Description' | transloco: { company: mcpCompanyName } }}\n </p>\n <p class=\"text-muted small mb-2\">\n <i class=\"fas fa-link me-1\"></i>\n {{ 'User.Subscriptions.APICredentials.McpEndpointNote' | transloco: { url: mcpEndpointUrl, company: mcpCompanyName } }}\n </p>\n <!-- pb (not mb): .card .mb-3:last-child is margin-reset in this component's scss -->\n <p class=\"text-muted small mb-0 pb-3\">\n <i class=\"fas fa-info-circle me-1\"></i>\n {{ 'User.Subscriptions.APICredentials.SubscriptionClientIdNote' | transloco }}\n </p>\n </div>\n <div class=\"col-12 col-md-6\">\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"account-api-token\">{{ 'User.Account.APIUserToken' | transloco }}</label>\n <div class=\"input-group\">\n <input type=\"text\"\n id=\"account-api-token\"\n name=\"api_token\"\n class=\"form-control\"\n [value]=\"showApiToken ? user?.api_keys?.api_user_token || ('User.Subscriptions.APICredentials.NoTokenAvailable' | transloco) : '*************************'\"\n readonly\n [attr.aria-label]=\"'User.Account.APIUserToken' | transloco\" />\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"toggleApiTokenVisibility()\">\n {{ showApiToken ? ('User.Subscriptions.APICredentials.Hide' | transloco) : ('User.Subscriptions.APICredentials.View' | transloco) }}\n </button>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-md-6\">\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"account-api-client-id\">{{ 'User.Account.APIUserId' | transloco }}</label>\n <div class=\"input-group\">\n <input type=\"text\"\n id=\"account-api-client-id\"\n name=\"api_client_id\"\n class=\"form-control\"\n [value]=\"showApiClientId ? user?.api_keys?.api_user_id || ('User.Subscriptions.APICredentials.NoClientIdAvailable' | transloco) : '*************************'\"\n readonly\n [attr.aria-label]=\"'User.Account.APIUserId' | transloco\" />\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"toggleApiClientIdVisibility()\">\n {{ showApiClientId ? ('User.Subscriptions.APICredentials.Hide' | transloco) : ('User.Subscriptions.APICredentials.View' | transloco) }}\n </button>\n </div>\n </div>\n </div>\n <div class=\"col-12 mt-3\">\n <div class=\"d-flex align-items-center gap-3\">\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"refreshApiTokens()\"\n [disabled]=\"refreshingTokens\">\n <i class=\"fas fa-sync-alt me-2\" [class.fa-spin]=\"refreshingTokens\"></i>\n {{ refreshingTokens ? ('User.Subscriptions.APICredentials.Refreshing' | transloco) : ('User.Subscriptions.APICredentials.RefreshTokens' | transloco) }}\n </button>\n <div class=\"d-flex align-items-center gap-2\">\n @if (user?.api_keys?.api_hits !== null) {\n <span class=\"text-muted\">{{ 'User.Subscriptions.APICredentials.ApiHits' | transloco }}:</span>\n <span class=\"fw-bold\">{{ user.api_keys.api_hits | number }}</span>\n }\n @if (user?.api_keys?.api_hits_max !== null) {\n <span class=\"text-muted\">{{ 'User.Subscriptions.APICredentials.ApiHitsMax' | transloco }}:</span>\n <span class=\"fw-bold\">{{ user.api_keys.api_hits_max | number }}</span>\n }\n <!-- Show utilization percentage when both values exist -->\n @if (user?.api_keys?.api_hits !== null && user?.api_keys?.api_hits_max !== null && user?.api_keys?.api_hits_max > 0) {\n <span class=\"text-muted ms-2\">(</span>\n <span class=\"fw-bold\" [ngClass]=\"{\n 'text-success-muted': (user.api_keys.api_hits / user.api_keys.api_hits_max) <= 0.8,\n 'text-warning': (user.api_keys.api_hits / user.api_keys.api_hits_max) > 0.8 && (user.api_keys.api_hits / user.api_keys.api_hits_max) <= 0.9,\n 'text-danger': (user.api_keys.api_hits / user.api_keys.api_hits_max) > 0.9\n }\">\n {{ 'User.Subscriptions.Details.ApiConsumed' | transloco: { percent: ((user.api_keys.api_hits / user.api_keys.api_hits_max * 100) | number:'1.0-0') } }}\n </span>\n <span class=\"text-muted\">)</span>\n }\n </div>\n </div>\n </div>\n <div class=\"col-12 mt-3\">\n <label class=\"form-label\">{{ 'User.Subscriptions.APICredentials.ScopeLabel' | transloco }}</label>\n <div class=\"d-flex align-items-center flex-wrap gap-2\">\n <div class=\"btn-group\" role=\"group\"\n [attr.aria-label]=\"'User.Subscriptions.APICredentials.ScopeLabel' | transloco\">\n <button type=\"button\" class=\"btn\"\n [ngClass]=\"currentApiTokenScope === 'read_only' ? 'btn-primary' : 'btn-outline-secondary'\"\n [disabled]=\"updatingScope\"\n (click)=\"changeApiTokenScope('read_only')\">\n {{ 'User.Subscriptions.APICredentials.ScopeReadOnly' | transloco }}\n </button>\n <button type=\"button\" class=\"btn\"\n [ngClass]=\"currentApiTokenScope === 'read_write' ? 'btn-primary' : 'btn-outline-secondary'\"\n [disabled]=\"updatingScope\"\n (click)=\"changeApiTokenScope('read_write')\">\n {{ 'User.Subscriptions.APICredentials.ScopeReadWrite' | transloco }}\n </button>\n </div>\n <span class=\"text-muted small\">{{ 'User.Subscriptions.APICredentials.ScopeHint' | transloco }}</span>\n </div>\n </div>\n </div>\n </section>\n </div>\n }\n @if (apiMcpEnabled && user?.api_keys?.api_hits_max > 0) {\n <div class=\"col-12 mt-3\">\n <section id=\"registered-apps\"\n class=\"card p-4 h-auto\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h2>{{ 'User.Subscriptions.RegisteredApps.Title' | transloco }}</h2>\n <p>\n {{ 'User.Subscriptions.RegisteredApps.Description' | transloco }}\n </p>\n </div>\n <div class=\"col-12\">\n <pw-loader [isVisible]=\"loadingConnections\"></pw-loader>\n @if (!loadingConnections) {\n @if (connections.length === 0) {\n <p class=\"text-muted\">{{ 'User.Subscriptions.RegisteredApps.NoApps' | transloco }}</p>\n }\n @for (conn of connections; track conn.id) {\n <div class=\"d-flex align-items-center justify-content-between py-2 border-bottom\">\n <div>\n <span class=\"fw-bold me-3\">{{ conn.client_name }}</span>\n <span class=\"text-muted small\">\n {{ 'User.Subscriptions.RegisteredApps.ConnectedOn' | transloco }}\n {{ conn.created_at | date:'mediumDate' }}\n </span>\n <span class=\"text-muted small d-block\">\n {{ 'User.Subscriptions.RegisteredApps.LastUsed' | transloco }}\n @if (conn.last_used_at) {\n {{ conn.last_used_at | date:'medium' }}\n } @else {\n {{ 'User.Subscriptions.RegisteredApps.NeverUsed' | transloco }}\n }\n </span>\n </div>\n <button type=\"button\"\n class=\"btn btn-outline-danger btn-sm\"\n (click)=\"deregisterConnection(conn.id)\">\n {{ 'User.Subscriptions.RegisteredApps.Deregister' | transloco }}\n </button>\n </div>\n }\n }\n </div>\n </div>\n </section>\n </div>\n }\n @if (user?.id) {\n <div class=\"col-12 mt-3\">\n <pw-account-user-credentials [userId]=\"user.id\"></pw-account-user-credentials>\n </div>\n }\n</div>\n<ng-template #content\n let-modal>\n <div class=\"card m-0\">\n <div class=\"card-content\">\n <div class=\"card-title\">\n <h3 class=\"modal-title\">{{ 'User.Profile.ProfilePicture' | transloco }}</h3>\n <button type=\"button\"\n class=\"btn-close float-end\"\n [attr.aria-label]=\"'Common.Confirm.Close.Title' | transloco\"\n (click)=\"modal.dismiss()\">\n </button>\n </div>\n <div class=\"card-header\">\n <small> {{ 'User.Profile.PictureMessage' | transloco }}</small>\n <pw-image-cropper #profile\n aspectRatio=\"auto\"\n (imageSelectionEvent)=\"onImageSelection($event)\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n </div>\n </div>\n</ng-template>\n",
|
|
916
1501
|
styles: [".card .mb-2:last-child,.card .mb-3:last-child{margin-bottom:0!important}.overlay{left:50%;opacity:0;position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%);transition:.5s ease}.image-container{position:relative}.image-container:hover .image{opacity:.3}.image-container:hover .overlay{opacity:0}.overlay-text{background:#f0efef80;border-radius:50%;color:#000;font-size:16px;height:150px;line-height:150px;text-align:center;vertical-align:middle;width:150px}@media screen and (max-width:767px){.card-body{padding:20px!important}}\n"]
|
|
917
1502
|
}]
|
|
918
1503
|
}],
|
|
@@ -1149,189 +1734,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1149
1734
|
changeEvent: [{ type: Output }]
|
|
1150
1735
|
}
|
|
1151
1736
|
});
|
|
1152
|
-
var ClearMaskedOnFocusDirective = class ClearMaskedOnFocusDirective {
|
|
1153
|
-
constructor() {
|
|
1154
|
-
this.control = inject(NgControl, {
|
|
1155
|
-
optional: true,
|
|
1156
|
-
self: true
|
|
1157
|
-
});
|
|
1158
|
-
}
|
|
1159
|
-
onFocus(event) {
|
|
1160
|
-
const input = event.target;
|
|
1161
|
-
const value = input?.value ?? "";
|
|
1162
|
-
if (/\*{3,}/.test(value)) {
|
|
1163
|
-
this.control?.control?.setValue("");
|
|
1164
|
-
input.value = "";
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
static {
|
|
1168
|
-
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1169
|
-
minVersion: "12.0.0",
|
|
1170
|
-
version: "22.2.3",
|
|
1171
|
-
ngImport: i0,
|
|
1172
|
-
type: ClearMaskedOnFocusDirective,
|
|
1173
|
-
deps: [],
|
|
1174
|
-
target: i0.ɵɵFactoryTarget.Directive
|
|
1175
|
-
});
|
|
1176
|
-
}
|
|
1177
|
-
static {
|
|
1178
|
-
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
1179
|
-
minVersion: "14.0.0",
|
|
1180
|
-
version: "22.2.3",
|
|
1181
|
-
type: ClearMaskedOnFocusDirective,
|
|
1182
|
-
isStandalone: true,
|
|
1183
|
-
selector: "input[pwClearMaskedOnFocus]",
|
|
1184
|
-
host: { listeners: { "focus": "onFocus($event)" } },
|
|
1185
|
-
ngImport: i0
|
|
1186
|
-
});
|
|
1187
|
-
}
|
|
1188
|
-
};
|
|
1189
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
1190
|
-
minVersion: "12.0.0",
|
|
1191
|
-
version: "22.2.3",
|
|
1192
|
-
ngImport: i0,
|
|
1193
|
-
type: ClearMaskedOnFocusDirective,
|
|
1194
|
-
decorators: [{
|
|
1195
|
-
type: Directive,
|
|
1196
|
-
args: [{ selector: "input[pwClearMaskedOnFocus]" }]
|
|
1197
|
-
}],
|
|
1198
|
-
propDecorators: { onFocus: [{
|
|
1199
|
-
type: HostListener,
|
|
1200
|
-
args: ["focus", ["$event"]]
|
|
1201
|
-
}] }
|
|
1202
|
-
});
|
|
1203
|
-
const ACRONYMS = /* @__PURE__ */ new Set([
|
|
1204
|
-
"id",
|
|
1205
|
-
"url",
|
|
1206
|
-
"api",
|
|
1207
|
-
"aws",
|
|
1208
|
-
"smtp",
|
|
1209
|
-
"ssl",
|
|
1210
|
-
"tls",
|
|
1211
|
-
"iam",
|
|
1212
|
-
"sso",
|
|
1213
|
-
"sdk",
|
|
1214
|
-
"jwt",
|
|
1215
|
-
"oauth"
|
|
1216
|
-
]);
|
|
1217
|
-
var SubscriptionNameByIdPipe = class SubscriptionNameByIdPipe {
|
|
1218
|
-
transform(subs, id) {
|
|
1219
|
-
if (!subs || id == null) return "";
|
|
1220
|
-
const found = subs.find((s) => String(s.id) === String(id));
|
|
1221
|
-
return found?.organisation || found?.organization || found?.name || "";
|
|
1222
|
-
}
|
|
1223
|
-
static {
|
|
1224
|
-
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1225
|
-
minVersion: "12.0.0",
|
|
1226
|
-
version: "22.2.3",
|
|
1227
|
-
ngImport: i0,
|
|
1228
|
-
type: SubscriptionNameByIdPipe,
|
|
1229
|
-
deps: [],
|
|
1230
|
-
target: i0.ɵɵFactoryTarget.Pipe
|
|
1231
|
-
});
|
|
1232
|
-
}
|
|
1233
|
-
static {
|
|
1234
|
-
this.ɵpipe = i0.ɵɵngDeclarePipe({
|
|
1235
|
-
minVersion: "14.0.0",
|
|
1236
|
-
version: "22.2.3",
|
|
1237
|
-
ngImport: i0,
|
|
1238
|
-
type: SubscriptionNameByIdPipe,
|
|
1239
|
-
isStandalone: true,
|
|
1240
|
-
name: "subscriptionNameById"
|
|
1241
|
-
});
|
|
1242
|
-
}
|
|
1243
|
-
};
|
|
1244
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
1245
|
-
minVersion: "12.0.0",
|
|
1246
|
-
version: "22.2.3",
|
|
1247
|
-
ngImport: i0,
|
|
1248
|
-
type: SubscriptionNameByIdPipe,
|
|
1249
|
-
decorators: [{
|
|
1250
|
-
type: Pipe,
|
|
1251
|
-
args: [{ name: "subscriptionNameById" }]
|
|
1252
|
-
}]
|
|
1253
|
-
});
|
|
1254
|
-
var CredentialAvatarHuePipe = class CredentialAvatarHuePipe {
|
|
1255
|
-
transform(value) {
|
|
1256
|
-
if (!value) return 215;
|
|
1257
|
-
let hash = 0;
|
|
1258
|
-
for (let i = 0; i < value.length; i++) hash = hash * 31 + value.charCodeAt(i) | 0;
|
|
1259
|
-
return Math.abs(hash) % 360;
|
|
1260
|
-
}
|
|
1261
|
-
static {
|
|
1262
|
-
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1263
|
-
minVersion: "12.0.0",
|
|
1264
|
-
version: "22.2.3",
|
|
1265
|
-
ngImport: i0,
|
|
1266
|
-
type: CredentialAvatarHuePipe,
|
|
1267
|
-
deps: [],
|
|
1268
|
-
target: i0.ɵɵFactoryTarget.Pipe
|
|
1269
|
-
});
|
|
1270
|
-
}
|
|
1271
|
-
static {
|
|
1272
|
-
this.ɵpipe = i0.ɵɵngDeclarePipe({
|
|
1273
|
-
minVersion: "14.0.0",
|
|
1274
|
-
version: "22.2.3",
|
|
1275
|
-
ngImport: i0,
|
|
1276
|
-
type: CredentialAvatarHuePipe,
|
|
1277
|
-
isStandalone: true,
|
|
1278
|
-
name: "credentialAvatarHue"
|
|
1279
|
-
});
|
|
1280
|
-
}
|
|
1281
|
-
};
|
|
1282
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
1283
|
-
minVersion: "12.0.0",
|
|
1284
|
-
version: "22.2.3",
|
|
1285
|
-
ngImport: i0,
|
|
1286
|
-
type: CredentialAvatarHuePipe,
|
|
1287
|
-
decorators: [{
|
|
1288
|
-
type: Pipe,
|
|
1289
|
-
args: [{ name: "credentialAvatarHue" }]
|
|
1290
|
-
}]
|
|
1291
|
-
});
|
|
1292
|
-
var HumanizeCredentialNamePipe = class HumanizeCredentialNamePipe {
|
|
1293
|
-
transform(value) {
|
|
1294
|
-
if (!value) return "";
|
|
1295
|
-
return value.replace(/[_-]+/g, " ").split(" ").filter(Boolean).map((word) => ACRONYMS.has(word.toLowerCase()) ? word.toUpperCase() : word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
|
|
1296
|
-
}
|
|
1297
|
-
static {
|
|
1298
|
-
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1299
|
-
minVersion: "12.0.0",
|
|
1300
|
-
version: "22.2.3",
|
|
1301
|
-
ngImport: i0,
|
|
1302
|
-
type: HumanizeCredentialNamePipe,
|
|
1303
|
-
deps: [],
|
|
1304
|
-
target: i0.ɵɵFactoryTarget.Pipe
|
|
1305
|
-
});
|
|
1306
|
-
}
|
|
1307
|
-
static {
|
|
1308
|
-
this.ɵpipe = i0.ɵɵngDeclarePipe({
|
|
1309
|
-
minVersion: "14.0.0",
|
|
1310
|
-
version: "22.2.3",
|
|
1311
|
-
ngImport: i0,
|
|
1312
|
-
type: HumanizeCredentialNamePipe,
|
|
1313
|
-
isStandalone: true,
|
|
1314
|
-
name: "humanizeCredentialName"
|
|
1315
|
-
});
|
|
1316
|
-
}
|
|
1317
|
-
};
|
|
1318
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
1319
|
-
minVersion: "12.0.0",
|
|
1320
|
-
version: "22.2.3",
|
|
1321
|
-
ngImport: i0,
|
|
1322
|
-
type: HumanizeCredentialNamePipe,
|
|
1323
|
-
decorators: [{
|
|
1324
|
-
type: Pipe,
|
|
1325
|
-
args: [{ name: "humanizeCredentialName" }]
|
|
1326
|
-
}]
|
|
1327
|
-
});
|
|
1328
|
-
function sortByLabel(items, label) {
|
|
1329
|
-
const text = (item) => (label(item) ?? "").replace(/[_-]+/g, " ").trim();
|
|
1330
|
-
return [...items].sort((a, b) => text(a).localeCompare(text(b), void 0, {
|
|
1331
|
-
sensitivity: "base",
|
|
1332
|
-
numeric: true
|
|
1333
|
-
}));
|
|
1334
|
-
}
|
|
1335
1737
|
function uniqueByName(credentials) {
|
|
1336
1738
|
const seen = /* @__PURE__ */ new Set();
|
|
1337
1739
|
return sortByLabel(credentials.filter((credential) => {
|
|
@@ -1341,9 +1743,10 @@ function uniqueByName(credentials) {
|
|
|
1341
1743
|
}), (credential) => credential.name);
|
|
1342
1744
|
}
|
|
1343
1745
|
function groupByCredentialName(credentialTypes, stored) {
|
|
1746
|
+
const byName = credentialsByName(stored);
|
|
1344
1747
|
return credentialTypes.map(({ name }) => ({
|
|
1345
1748
|
credential_name: name,
|
|
1346
|
-
credentials: sortByLabel(
|
|
1749
|
+
credentials: sortByLabel(byName.get(name) ?? [], (credential) => credential.field)
|
|
1347
1750
|
})).filter((group) => group.credentials.length > 0);
|
|
1348
1751
|
}
|
|
1349
1752
|
function credentialFormRow(credentialType, stored) {
|
|
@@ -1356,20 +1759,12 @@ function credentialFormRow(credentialType, stored) {
|
|
|
1356
1759
|
id: [stored?.id]
|
|
1357
1760
|
};
|
|
1358
1761
|
}
|
|
1359
|
-
function changedCredentials(rows) {
|
|
1360
|
-
return rows.filter((row) => row?.value && !String(row.value).startsWith("***"));
|
|
1361
|
-
}
|
|
1362
1762
|
function applyStoredIds(rows, stored) {
|
|
1363
1763
|
rows.controls.forEach((row) => {
|
|
1364
1764
|
const saved = stored.find((s) => s.credential_id === row.value.credential_id);
|
|
1365
1765
|
if (saved && !row.value.id) row.patchValue({ id: saved.id });
|
|
1366
1766
|
});
|
|
1367
1767
|
}
|
|
1368
|
-
var SaveFailure = class {
|
|
1369
|
-
constructor(error) {
|
|
1370
|
-
this.error = error;
|
|
1371
|
-
}
|
|
1372
|
-
};
|
|
1373
1768
|
var SubscriptionCredentialActionsService = class SubscriptionCredentialActionsService {
|
|
1374
1769
|
constructor() {
|
|
1375
1770
|
this.confirmDialog = inject(ConfirmDialogService);
|
|
@@ -1386,18 +1781,13 @@ var SubscriptionCredentialActionsService = class SubscriptionCredentialActionsSe
|
|
|
1386
1781
|
return this.subscriptionService.getAllSubscriptionCredentials(subscriptionId).pipe(map$1(({ result }) => result));
|
|
1387
1782
|
}
|
|
1388
1783
|
saveChanged(rows, subscriptionId) {
|
|
1389
|
-
|
|
1784
|
+
return runAllThenReport(changedCredentials(rows).map((row) => {
|
|
1390
1785
|
const data = {
|
|
1391
1786
|
subscription_id: subscriptionId,
|
|
1392
1787
|
credential_id: row.credential_id,
|
|
1393
1788
|
value: row.value
|
|
1394
1789
|
};
|
|
1395
|
-
return
|
|
1396
|
-
});
|
|
1397
|
-
if (!requests.length) return of([]);
|
|
1398
|
-
return forkJoin(requests).pipe(switchMap((results) => {
|
|
1399
|
-
const failure = results.find((r) => r instanceof SaveFailure);
|
|
1400
|
-
return failure ? throwError(() => failure.error) : of(results);
|
|
1790
|
+
return row.id ? this.subscriptionService.editSubscriptionCredential(row.id, data) : this.subscriptionService.postSubscriptionCredential(data);
|
|
1401
1791
|
}));
|
|
1402
1792
|
}
|
|
1403
1793
|
confirmAndDelete(group, subscriptionId) {
|
|
@@ -1580,7 +1970,11 @@ var SubscriptionCredentialComponent = class SubscriptionCredentialComponent exte
|
|
|
1580
1970
|
usesInheritance: true,
|
|
1581
1971
|
ngImport: i0,
|
|
1582
1972
|
template: "@let subName = ((userService.getUserState() | async)?.currentUser?.subscriptions | subscriptionNameById: subscriptionId);\n\n@if (showForm) {\n <div class=\"row\">\n <div class=\"col-12 d-flex\">\n <a [attr.aria-label]=\"'Button.Back' | transloco\"\n (click)=\"onCancel()\"\n (keydown.enter)=\"onCancel()\"\n class=\"previous\">\n <i class=\"fa fa-arrow-alt-circle-left\" aria-hidden=\"true\"></i>\n </a>\n <h3 class=\"m-subheader__title m-subheader__title--separator\">\n <span>\n @if (subName) {\n {{ (isEdit ? 'User.Subscriptions.SubscriptionCredentials.EditTitle' : 'User.Subscriptions.SubscriptionCredentials.CreateTitle') | transloco: { name: subName } }}\n } @else {\n {{ (isEdit ? 'User.Subscriptions.SubscriptionCredentials.EditTitleFallback' : 'User.Subscriptions.SubscriptionCredentials.CreateTitleFallback') | transloco }}\n }\n </span>\n </h3>\n </div>\n </div>\n <p class=\"credential-page-subtitle text-muted mb-4\">\n @if (subName) {\n {{ 'User.Subscriptions.SubscriptionCredentials.FormSubtitle' | transloco: { name: subName } }}\n } @else {\n {{ 'User.Subscriptions.SubscriptionCredentials.FormSubtitleFallback' | transloco }}\n }\n </p>\n\n <section class=\"credential-form-shell\">\n @if (credentialsSelect?.length) {\n <div class=\"credential-form-band\"\n [style.--avatar-hue]=\"credentialsSelect[0].name | credentialAvatarHue\">\n <span class=\"credential-avatar\" aria-hidden=\"true\"\n [style.--avatar-hue]=\"credentialsSelect[0].name | credentialAvatarHue\">\n {{ (credentialsSelect[0].name | humanizeCredentialName).charAt(0) }}\n </span>\n <span class=\"credential-form-band-name\">\n {{ credentialsSelect[0].name | humanizeCredentialName }}\n </span>\n </div>\n }\n\n <form [formGroup]=\"form\" novalidate (ngSubmit)=\"saveCredentials()\" class=\"credential-form\">\n @if (!isEdit) {\n <div class=\"credential-form-row\">\n <pw-input-container\n [label]=\"'User.Subscriptions.SubscriptionCredentials.CredentialLabel' | transloco\"\n name=\"credentialType\">\n <p-select\n [options]=\"uniqueCredential\"\n [placeholder]=\"'User.Subscriptions.SubscriptionCredentials.CredentialPlaceholder' | transloco\"\n optionLabel=\"name\" optionValue=\"name\" appendTo=\"body\"\n (onChange)=\"selectedOption($event)\">\n </p-select>\n </pw-input-container>\n </div>\n }\n\n @if (credentialsSelect?.length) {\n <div formArrayName=\"credentials\" class=\"credential-form-fields\">\n @for (credential of credentialsGroup.controls; track credential; let i = $index) {\n <div [formGroupName]=\"i\" class=\"credential-form-row\">\n <pw-input-container\n [label]=\"credential.get('field').value | humanizeCredentialName\"\n [showTooltip]=\"!!credential.get('description').value\"\n [tooltipText]=\"credential.get('description').value\"\n tooltipPosition=\"top\"\n name=\"value\"\n errorMsg=\"User.Subscriptions.SubscriptionCredentials.ValueError\">\n <input type=\"text\" class=\"form-control\" formControlName=\"value\" pwClearMaskedOnFocus\n [ngClass]=\"{ 'is-invalid': submitted && credential.get('value').invalid }\"\n [id]=\"'credential-value-' + i\" [name]=\"'credential-value-' + i\"\n [attr.aria-label]=\"credential.get('field').value | humanizeCredentialName\" />\n </pw-input-container>\n </div>\n }\n </div>\n }\n\n <div class=\"credential-form-actions\">\n <button type=\"button\" class=\"btn btn-outline-default\" (click)=\"onCancel()\" (keydown.enter)=\"onCancel()\">\n {{ 'Button.Back' | transloco }}\n </button>\n @if (credentialsSelect?.length) {\n <button type=\"submit\" [buttonBusy]=\"buttonBusy\" class=\"btn btn-primary\">\n {{ 'Button.Submit' | transloco }}\n </button>\n }\n </div>\n </form>\n </section>\n}\n\n@if (!showForm) {\n <div class=\"row\">\n <div class=\"col-12 d-flex\">\n <a [attr.aria-label]=\"'Button.Back' | transloco\"\n (click)=\"back()\"\n (keydown.enter)=\"back()\"\n class=\"previous\">\n <i class=\"fa fa-arrow-alt-circle-left\" aria-hidden=\"true\"></i>\n </a>\n <h2 class=\"mt-3\">\n @if (subName) {\n {{ 'User.Subscriptions.SubscriptionCredentials.PageTitle' | transloco: { name: subName } }}\n } @else {\n {{ 'User.Subscriptions.SubscriptionCredentials.PageTitleFallback' | transloco }}\n }\n </h2>\n </div>\n <div class=\"col-12 col-md-12 text-end\">\n <button class=\"btn btn-sm btn-outline-primary\" (click)=\"openCredentialsForAdd()\">\n <i class=\"fa fa-plus-circle\" aria-hidden=\"true\"></i>\n {{ 'User.Subscriptions.SubscriptionCredentials.AddButton' | transloco }}\n </button>\n </div>\n </div>\n <p class=\"credential-page-subtitle text-muted mb-4\">\n @if (subName) {\n {{ 'User.Subscriptions.SubscriptionCredentials.ListSubtitle' | transloco: { name: subName } }}\n } @else {\n {{ 'User.Subscriptions.SubscriptionCredentials.ListSubtitleFallback' | transloco }}\n }\n </p>\n\n <pw-loader [isVisible]=\"!isLoaded\"></pw-loader>\n\n @if (isLoaded) {\n @if (allSubscriptionCredentials?.length === 0) {\n <div class=\"credential-empty\">\n <pw-no-data [withImage]=\"true\"\n [message]=\"'User.Subscriptions.SubscriptionCredentials.NoDataMessage' | transloco\"></pw-no-data>\n </div>\n } @else {\n <ul class=\"credential-grid\">\n @for (credential of credentials; track credential.credential_name) {\n <li class=\"credential-card\">\n <header class=\"credential-card-header\"\n [style.--avatar-hue]=\"credential.credential_name | credentialAvatarHue\">\n <span class=\"credential-avatar\" aria-hidden=\"true\">\n {{ (credential.credential_name | humanizeCredentialName).charAt(0) }}\n </span>\n <h3 class=\"credential-card-title\">\n {{ credential.credential_name | humanizeCredentialName }}\n </h3>\n <div class=\"credential-card-actions\">\n <button type=\"button\" class=\"credential-icon-btn\"\n [attr.aria-label]=\"'User.Subscriptions.SubscriptionCredentials.EditAriaLabel' | transloco\"\n (click)=\"openCredentialsForEdit(credential.credential_name)\">\n <i class=\"fa fa-pen\" aria-hidden=\"true\"></i>\n </button>\n <button type=\"button\" class=\"credential-icon-btn credential-icon-btn--danger\"\n [attr.aria-label]=\"'User.Subscriptions.SubscriptionCredentials.DeleteAriaLabel' | transloco\"\n (click)=\"openCredentialsForDelete(credential)\">\n <i class=\"fa fa-trash\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </header>\n <dl class=\"credential-card-fields\">\n @for (entry of credential.credentials; track entry.id) {\n <div class=\"credential-card-row\">\n <dt>{{ entry.field | humanizeCredentialName }}</dt>\n <dd><code class=\"credential-card-value\">{{ entry?.value }}</code></dd>\n </div>\n }\n </dl>\n </li>\n }\n </ul>\n }\n }\n}\n\n<pw-password-validation #passwordValidationModalForEditCredential (successEvent)=\"editCredentials()\"></pw-password-validation>\n<pw-password-validation #passwordValidationModalForAddCredential (successEvent)=\"showEditForm()\"></pw-password-validation>\n<pw-password-validation #passwordValidationModalForDeleteCredential (successEvent)=\"deleteCredentials()\"></pw-password-validation>\n",
|
|
1583
|
-
styles: [
|
|
1973
|
+
styles: [
|
|
1974
|
+
".credential-grid{list-style:none;padding:0;margin:16px 0 0;width:100%;display:grid;gap:16px;grid-template-columns:repeat(auto-fill,minmax(min(360px,100%),1fr))}.credential-card{background:#fff;border:1px solid #e2e5ea;border-radius:10px;display:flex;flex-direction:column;overflow:hidden;transition:border-color .15s ease-out}.credential-card:hover{border-color:#cfd4dc}.credential-card-header{display:flex;align-items:center;gap:12px;padding:14px 16px;background:hsl(var(--avatar-hue, 215),60%,97%);border-bottom:1px solid hsl(var(--avatar-hue, 215),40%,90%)}.credential-avatar{width:36px;height:36px;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;font-size:15px;font-weight:700;line-height:1;color:hsl(var(--avatar-hue, 215),60%,28%);background:hsl(var(--avatar-hue, 215),70%,92%);border:1px solid hsl(var(--avatar-hue, 215),50%,82%);flex-shrink:0;text-transform:uppercase}.credential-card-header h3.credential-card-title{font-size:15px;font-weight:600;line-height:1;height:36px;color:#1a1d21;margin:0!important;padding:0!important;flex:1 1 auto;min-width:0;display:flex;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.credential-icon-btn{appearance:none;background:transparent;border:1px solid transparent;border-radius:6px;width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;color:#5a6473;cursor:pointer;transition:background-color .12s ease-out,color .12s ease-out,border-color .12s ease-out}.credential-icon-btn .fa{font-size:13px}.credential-icon-btn:hover,.credential-icon-btn:focus-visible{background-color:#fff;color:#1a1d21;border-color:#e2e5ea;outline:none}.credential-icon-btn--danger:hover,.credential-icon-btn--danger:focus-visible{color:var(--bs-danger, #dc3545)}.credential-card-actions{display:inline-flex;gap:4px}.credential-card-fields{margin:0;padding:4px 16px 12px;display:flex;flex-direction:column}.credential-card-row{display:grid;grid-template-columns:minmax(120px,1fr) minmax(0,2fr);align-items:center;gap:12px;padding:10px 0;border-bottom:1px dashed #eef0f3}.credential-card-row:last-child{border-bottom:0}.credential-card-row dt{font-size:11px;font-weight:500;color:#5a6473;letter-spacing:.05em;text-transform:uppercase;margin:0}.credential-card-row dd{margin:0;min-width:0;text-align:right}.credential-card-value{font-size:12.5px;font-weight:500;color:#5a6473;background:#f7f8fa;border:1px solid #e2e5ea;border-radius:4px;padding:3px 8px;display:inline-block;max-width:100%;word-break:break-all;line-height:1.5;-webkit-user-select:all;user-select:all}@media(max-width:575px){.credential-card-row{grid-template-columns:1fr;gap:4px}.credential-card-row dd{text-align:left}}\n",
|
|
1975
|
+
".credential-page-subtitle{margin-bottom:24px}.credential-empty{padding:48px 0;text-align:center}\n",
|
|
1976
|
+
".credential-form-shell{background:#fff;border:1px solid #e2e5ea;border-radius:10px;max-width:640px;overflow:hidden;margin-top:16px}.credential-form-band{display:flex;align-items:center;gap:12px;padding:14px 20px;background:hsl(var(--avatar-hue, 215),60%,97%);border-bottom:1px solid hsl(var(--avatar-hue, 215),40%,90%)}.credential-form-band .credential-form-band-name{font-size:15px;font-weight:600;line-height:1;color:hsl(var(--avatar-hue, 215),60%,22%);display:inline-flex;align-items:center;height:36px}.credential-form{padding:20px 24px 24px}.credential-form-fields{display:flex;flex-direction:column;gap:16px}.credential-form-row+.credential-form-fields{margin-top:16px;padding-top:16px;border-top:1px solid #e2e5ea}.credential-form-actions{margin-top:24px;padding-top:16px;border-top:1px solid #e2e5ea;display:flex;justify-content:flex-end;gap:8px}@media(max-width:575px){.credential-form{padding:16px}}\n"
|
|
1977
|
+
],
|
|
1584
1978
|
dependencies: [
|
|
1585
1979
|
{
|
|
1586
1980
|
kind: "ngmodule",
|
|
@@ -1842,7 +2236,11 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1842
2236
|
SubscriptionNameByIdPipe
|
|
1843
2237
|
],
|
|
1844
2238
|
template: "@let subName = ((userService.getUserState() | async)?.currentUser?.subscriptions | subscriptionNameById: subscriptionId);\n\n@if (showForm) {\n <div class=\"row\">\n <div class=\"col-12 d-flex\">\n <a [attr.aria-label]=\"'Button.Back' | transloco\"\n (click)=\"onCancel()\"\n (keydown.enter)=\"onCancel()\"\n class=\"previous\">\n <i class=\"fa fa-arrow-alt-circle-left\" aria-hidden=\"true\"></i>\n </a>\n <h3 class=\"m-subheader__title m-subheader__title--separator\">\n <span>\n @if (subName) {\n {{ (isEdit ? 'User.Subscriptions.SubscriptionCredentials.EditTitle' : 'User.Subscriptions.SubscriptionCredentials.CreateTitle') | transloco: { name: subName } }}\n } @else {\n {{ (isEdit ? 'User.Subscriptions.SubscriptionCredentials.EditTitleFallback' : 'User.Subscriptions.SubscriptionCredentials.CreateTitleFallback') | transloco }}\n }\n </span>\n </h3>\n </div>\n </div>\n <p class=\"credential-page-subtitle text-muted mb-4\">\n @if (subName) {\n {{ 'User.Subscriptions.SubscriptionCredentials.FormSubtitle' | transloco: { name: subName } }}\n } @else {\n {{ 'User.Subscriptions.SubscriptionCredentials.FormSubtitleFallback' | transloco }}\n }\n </p>\n\n <section class=\"credential-form-shell\">\n @if (credentialsSelect?.length) {\n <div class=\"credential-form-band\"\n [style.--avatar-hue]=\"credentialsSelect[0].name | credentialAvatarHue\">\n <span class=\"credential-avatar\" aria-hidden=\"true\"\n [style.--avatar-hue]=\"credentialsSelect[0].name | credentialAvatarHue\">\n {{ (credentialsSelect[0].name | humanizeCredentialName).charAt(0) }}\n </span>\n <span class=\"credential-form-band-name\">\n {{ credentialsSelect[0].name | humanizeCredentialName }}\n </span>\n </div>\n }\n\n <form [formGroup]=\"form\" novalidate (ngSubmit)=\"saveCredentials()\" class=\"credential-form\">\n @if (!isEdit) {\n <div class=\"credential-form-row\">\n <pw-input-container\n [label]=\"'User.Subscriptions.SubscriptionCredentials.CredentialLabel' | transloco\"\n name=\"credentialType\">\n <p-select\n [options]=\"uniqueCredential\"\n [placeholder]=\"'User.Subscriptions.SubscriptionCredentials.CredentialPlaceholder' | transloco\"\n optionLabel=\"name\" optionValue=\"name\" appendTo=\"body\"\n (onChange)=\"selectedOption($event)\">\n </p-select>\n </pw-input-container>\n </div>\n }\n\n @if (credentialsSelect?.length) {\n <div formArrayName=\"credentials\" class=\"credential-form-fields\">\n @for (credential of credentialsGroup.controls; track credential; let i = $index) {\n <div [formGroupName]=\"i\" class=\"credential-form-row\">\n <pw-input-container\n [label]=\"credential.get('field').value | humanizeCredentialName\"\n [showTooltip]=\"!!credential.get('description').value\"\n [tooltipText]=\"credential.get('description').value\"\n tooltipPosition=\"top\"\n name=\"value\"\n errorMsg=\"User.Subscriptions.SubscriptionCredentials.ValueError\">\n <input type=\"text\" class=\"form-control\" formControlName=\"value\" pwClearMaskedOnFocus\n [ngClass]=\"{ 'is-invalid': submitted && credential.get('value').invalid }\"\n [id]=\"'credential-value-' + i\" [name]=\"'credential-value-' + i\"\n [attr.aria-label]=\"credential.get('field').value | humanizeCredentialName\" />\n </pw-input-container>\n </div>\n }\n </div>\n }\n\n <div class=\"credential-form-actions\">\n <button type=\"button\" class=\"btn btn-outline-default\" (click)=\"onCancel()\" (keydown.enter)=\"onCancel()\">\n {{ 'Button.Back' | transloco }}\n </button>\n @if (credentialsSelect?.length) {\n <button type=\"submit\" [buttonBusy]=\"buttonBusy\" class=\"btn btn-primary\">\n {{ 'Button.Submit' | transloco }}\n </button>\n }\n </div>\n </form>\n </section>\n}\n\n@if (!showForm) {\n <div class=\"row\">\n <div class=\"col-12 d-flex\">\n <a [attr.aria-label]=\"'Button.Back' | transloco\"\n (click)=\"back()\"\n (keydown.enter)=\"back()\"\n class=\"previous\">\n <i class=\"fa fa-arrow-alt-circle-left\" aria-hidden=\"true\"></i>\n </a>\n <h2 class=\"mt-3\">\n @if (subName) {\n {{ 'User.Subscriptions.SubscriptionCredentials.PageTitle' | transloco: { name: subName } }}\n } @else {\n {{ 'User.Subscriptions.SubscriptionCredentials.PageTitleFallback' | transloco }}\n }\n </h2>\n </div>\n <div class=\"col-12 col-md-12 text-end\">\n <button class=\"btn btn-sm btn-outline-primary\" (click)=\"openCredentialsForAdd()\">\n <i class=\"fa fa-plus-circle\" aria-hidden=\"true\"></i>\n {{ 'User.Subscriptions.SubscriptionCredentials.AddButton' | transloco }}\n </button>\n </div>\n </div>\n <p class=\"credential-page-subtitle text-muted mb-4\">\n @if (subName) {\n {{ 'User.Subscriptions.SubscriptionCredentials.ListSubtitle' | transloco: { name: subName } }}\n } @else {\n {{ 'User.Subscriptions.SubscriptionCredentials.ListSubtitleFallback' | transloco }}\n }\n </p>\n\n <pw-loader [isVisible]=\"!isLoaded\"></pw-loader>\n\n @if (isLoaded) {\n @if (allSubscriptionCredentials?.length === 0) {\n <div class=\"credential-empty\">\n <pw-no-data [withImage]=\"true\"\n [message]=\"'User.Subscriptions.SubscriptionCredentials.NoDataMessage' | transloco\"></pw-no-data>\n </div>\n } @else {\n <ul class=\"credential-grid\">\n @for (credential of credentials; track credential.credential_name) {\n <li class=\"credential-card\">\n <header class=\"credential-card-header\"\n [style.--avatar-hue]=\"credential.credential_name | credentialAvatarHue\">\n <span class=\"credential-avatar\" aria-hidden=\"true\">\n {{ (credential.credential_name | humanizeCredentialName).charAt(0) }}\n </span>\n <h3 class=\"credential-card-title\">\n {{ credential.credential_name | humanizeCredentialName }}\n </h3>\n <div class=\"credential-card-actions\">\n <button type=\"button\" class=\"credential-icon-btn\"\n [attr.aria-label]=\"'User.Subscriptions.SubscriptionCredentials.EditAriaLabel' | transloco\"\n (click)=\"openCredentialsForEdit(credential.credential_name)\">\n <i class=\"fa fa-pen\" aria-hidden=\"true\"></i>\n </button>\n <button type=\"button\" class=\"credential-icon-btn credential-icon-btn--danger\"\n [attr.aria-label]=\"'User.Subscriptions.SubscriptionCredentials.DeleteAriaLabel' | transloco\"\n (click)=\"openCredentialsForDelete(credential)\">\n <i class=\"fa fa-trash\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </header>\n <dl class=\"credential-card-fields\">\n @for (entry of credential.credentials; track entry.id) {\n <div class=\"credential-card-row\">\n <dt>{{ entry.field | humanizeCredentialName }}</dt>\n <dd><code class=\"credential-card-value\">{{ entry?.value }}</code></dd>\n </div>\n }\n </dl>\n </li>\n }\n </ul>\n }\n }\n}\n\n<pw-password-validation #passwordValidationModalForEditCredential (successEvent)=\"editCredentials()\"></pw-password-validation>\n<pw-password-validation #passwordValidationModalForAddCredential (successEvent)=\"showEditForm()\"></pw-password-validation>\n<pw-password-validation #passwordValidationModalForDeleteCredential (successEvent)=\"deleteCredentials()\"></pw-password-validation>\n",
|
|
1845
|
-
styles: [
|
|
2239
|
+
styles: [
|
|
2240
|
+
".credential-grid{list-style:none;padding:0;margin:16px 0 0;width:100%;display:grid;gap:16px;grid-template-columns:repeat(auto-fill,minmax(min(360px,100%),1fr))}.credential-card{background:#fff;border:1px solid #e2e5ea;border-radius:10px;display:flex;flex-direction:column;overflow:hidden;transition:border-color .15s ease-out}.credential-card:hover{border-color:#cfd4dc}.credential-card-header{display:flex;align-items:center;gap:12px;padding:14px 16px;background:hsl(var(--avatar-hue, 215),60%,97%);border-bottom:1px solid hsl(var(--avatar-hue, 215),40%,90%)}.credential-avatar{width:36px;height:36px;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;font-size:15px;font-weight:700;line-height:1;color:hsl(var(--avatar-hue, 215),60%,28%);background:hsl(var(--avatar-hue, 215),70%,92%);border:1px solid hsl(var(--avatar-hue, 215),50%,82%);flex-shrink:0;text-transform:uppercase}.credential-card-header h3.credential-card-title{font-size:15px;font-weight:600;line-height:1;height:36px;color:#1a1d21;margin:0!important;padding:0!important;flex:1 1 auto;min-width:0;display:flex;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.credential-icon-btn{appearance:none;background:transparent;border:1px solid transparent;border-radius:6px;width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;color:#5a6473;cursor:pointer;transition:background-color .12s ease-out,color .12s ease-out,border-color .12s ease-out}.credential-icon-btn .fa{font-size:13px}.credential-icon-btn:hover,.credential-icon-btn:focus-visible{background-color:#fff;color:#1a1d21;border-color:#e2e5ea;outline:none}.credential-icon-btn--danger:hover,.credential-icon-btn--danger:focus-visible{color:var(--bs-danger, #dc3545)}.credential-card-actions{display:inline-flex;gap:4px}.credential-card-fields{margin:0;padding:4px 16px 12px;display:flex;flex-direction:column}.credential-card-row{display:grid;grid-template-columns:minmax(120px,1fr) minmax(0,2fr);align-items:center;gap:12px;padding:10px 0;border-bottom:1px dashed #eef0f3}.credential-card-row:last-child{border-bottom:0}.credential-card-row dt{font-size:11px;font-weight:500;color:#5a6473;letter-spacing:.05em;text-transform:uppercase;margin:0}.credential-card-row dd{margin:0;min-width:0;text-align:right}.credential-card-value{font-size:12.5px;font-weight:500;color:#5a6473;background:#f7f8fa;border:1px solid #e2e5ea;border-radius:4px;padding:3px 8px;display:inline-block;max-width:100%;word-break:break-all;line-height:1.5;-webkit-user-select:all;user-select:all}@media(max-width:575px){.credential-card-row{grid-template-columns:1fr;gap:4px}.credential-card-row dd{text-align:left}}\n",
|
|
2241
|
+
".credential-page-subtitle{margin-bottom:24px}.credential-empty{padding:48px 0;text-align:center}\n",
|
|
2242
|
+
".credential-form-shell{background:#fff;border:1px solid #e2e5ea;border-radius:10px;max-width:640px;overflow:hidden;margin-top:16px}.credential-form-band{display:flex;align-items:center;gap:12px;padding:14px 20px;background:hsl(var(--avatar-hue, 215),60%,97%);border-bottom:1px solid hsl(var(--avatar-hue, 215),40%,90%)}.credential-form-band .credential-form-band-name{font-size:15px;font-weight:600;line-height:1;color:hsl(var(--avatar-hue, 215),60%,22%);display:inline-flex;align-items:center;height:36px}.credential-form{padding:20px 24px 24px}.credential-form-fields{display:flex;flex-direction:column;gap:16px}.credential-form-row+.credential-form-fields{margin-top:16px;padding-top:16px;border-top:1px solid #e2e5ea}.credential-form-actions{margin-top:24px;padding-top:16px;border-top:1px solid #e2e5ea;display:flex;justify-content:flex-end;gap:8px}@media(max-width:575px){.credential-form{padding:16px}}\n"
|
|
2243
|
+
]
|
|
1846
2244
|
}]
|
|
1847
2245
|
}],
|
|
1848
2246
|
ctorParameters: () => [],
|