@posiwise/user-module 0.0.192 → 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";
|
|
@@ -30,7 +30,7 @@ import { Tooltip, TooltipModule } from "primeng/tooltip";
|
|
|
30
30
|
import { Loader } from "@googlemaps/js-api-loader";
|
|
31
31
|
import { NgbDatepickerModule, NgbInputDatepicker, NgbModal, NgbModalModule, NgbNav, NgbNavContent, NgbNavItem, NgbNavLink, NgbNavOutlet } from "@ng-bootstrap/ng-bootstrap";
|
|
32
32
|
import { __decorate } from "tslib";
|
|
33
|
-
import { AuthService, CommonService, CustomToastService, FormHelperService, GeoService, PermissionService, ProductService, ProfileService, QualificationService, ScriptLoaderService, SubscriptionService, TagService, UserService, ValidationService,
|
|
33
|
+
import { AI_ASSISTANT_FLAG, AI_ASSISTANT_PERMISSION, API_MCP_ACCESS_FLAG, AuthService, CommonService, CustomToastService, FormHelperService, GeoService, PermissionService, ProductService, ProfileService, QualificationService, ScriptLoaderService, SubscriptionService, TagService, UserService, ValidationService, isInMobileWebView } from "@posiwise/common-services";
|
|
34
34
|
import { AppUser, POLL_TIMEOUT, PRODUCT_CATEGORY, Project, TAG_ENTITY, TAG_TYPE } from "@posiwise/common-utilities";
|
|
35
35
|
import { HelperService } from "@posiwise/helper-service";
|
|
36
36
|
import { ProfileImageCropperComponent, ValidateForm, appendQueryParam, clearQueryParams } from "@posiwise/utils";
|
|
@@ -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 {
|
|
@@ -269,6 +269,9 @@ var AccountMcpConnections = class extends AccountApiCredentials {
|
|
|
269
269
|
this.connections = [];
|
|
270
270
|
this.loadingConnections = false;
|
|
271
271
|
}
|
|
272
|
+
get apiMcpEnabled() {
|
|
273
|
+
return !!this.user?.feature_flags?.[API_MCP_ACCESS_FLAG];
|
|
274
|
+
}
|
|
272
275
|
get mcpEndpointUrl() {
|
|
273
276
|
const url = `https://brain-api-mcp.${mcpHostBase(window.location.hostname)}/mcp`;
|
|
274
277
|
const shard = this.user?.user_shard;
|
|
@@ -438,13 +441,591 @@ var AccountAvatarSlug = class extends AccountSecurityForms {
|
|
|
438
441
|
this.cdr.markForCheck();
|
|
439
442
|
});
|
|
440
443
|
}
|
|
441
|
-
dataURLtoBlob(dataUrl) {
|
|
442
|
-
return dataUrlToBlob(dataUrl);
|
|
443
|
-
}
|
|
444
|
-
onClose() {
|
|
445
|
-
this.modalService.dismissAll();
|
|
446
|
-
}
|
|
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
|
+
}
|
|
447
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
|
+
});
|
|
448
1029
|
var AccountDetailsComponent = class AccountDetailsComponent extends AccountAvatarSlug {
|
|
449
1030
|
constructor() {
|
|
450
1031
|
super(...arguments);
|
|
@@ -560,7 +1141,7 @@ var AccountDetailsComponent = class AccountDetailsComponent extends AccountAvata
|
|
|
560
1141
|
}],
|
|
561
1142
|
usesInheritance: true,
|
|
562
1143
|
ngImport: i0,
|
|
563
|
-
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 (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 <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</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",
|
|
564
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"],
|
|
565
1146
|
dependencies: [
|
|
566
1147
|
{
|
|
@@ -853,6 +1434,12 @@ var AccountDetailsComponent = class AccountDetailsComponent extends AccountAvata
|
|
|
853
1434
|
"fileChangeEvent"
|
|
854
1435
|
]
|
|
855
1436
|
},
|
|
1437
|
+
{
|
|
1438
|
+
kind: "component",
|
|
1439
|
+
type: AccountUserCredentialsComponent,
|
|
1440
|
+
selector: "pw-account-user-credentials",
|
|
1441
|
+
inputs: ["userId"]
|
|
1442
|
+
},
|
|
856
1443
|
{
|
|
857
1444
|
kind: "pipe",
|
|
858
1445
|
type: AsyncPipe,
|
|
@@ -904,12 +1491,13 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
904
1491
|
NgClass,
|
|
905
1492
|
AppLoaderComponent,
|
|
906
1493
|
ProfileImageCropperComponent,
|
|
1494
|
+
AccountUserCredentialsComponent,
|
|
907
1495
|
AsyncPipe,
|
|
908
1496
|
DecimalPipe,
|
|
909
1497
|
DatePipe,
|
|
910
1498
|
TranslocoPipe
|
|
911
1499
|
],
|
|
912
|
-
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 (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 <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</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",
|
|
913
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"]
|
|
914
1502
|
}]
|
|
915
1503
|
}],
|
|
@@ -1146,189 +1734,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1146
1734
|
changeEvent: [{ type: Output }]
|
|
1147
1735
|
}
|
|
1148
1736
|
});
|
|
1149
|
-
var ClearMaskedOnFocusDirective = class ClearMaskedOnFocusDirective {
|
|
1150
|
-
constructor() {
|
|
1151
|
-
this.control = inject(NgControl, {
|
|
1152
|
-
optional: true,
|
|
1153
|
-
self: true
|
|
1154
|
-
});
|
|
1155
|
-
}
|
|
1156
|
-
onFocus(event) {
|
|
1157
|
-
const input = event.target;
|
|
1158
|
-
const value = input?.value ?? "";
|
|
1159
|
-
if (/\*{3,}/.test(value)) {
|
|
1160
|
-
this.control?.control?.setValue("");
|
|
1161
|
-
input.value = "";
|
|
1162
|
-
}
|
|
1163
|
-
}
|
|
1164
|
-
static {
|
|
1165
|
-
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1166
|
-
minVersion: "12.0.0",
|
|
1167
|
-
version: "22.2.3",
|
|
1168
|
-
ngImport: i0,
|
|
1169
|
-
type: ClearMaskedOnFocusDirective,
|
|
1170
|
-
deps: [],
|
|
1171
|
-
target: i0.ɵɵFactoryTarget.Directive
|
|
1172
|
-
});
|
|
1173
|
-
}
|
|
1174
|
-
static {
|
|
1175
|
-
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
1176
|
-
minVersion: "14.0.0",
|
|
1177
|
-
version: "22.2.3",
|
|
1178
|
-
type: ClearMaskedOnFocusDirective,
|
|
1179
|
-
isStandalone: true,
|
|
1180
|
-
selector: "input[pwClearMaskedOnFocus]",
|
|
1181
|
-
host: { listeners: { "focus": "onFocus($event)" } },
|
|
1182
|
-
ngImport: i0
|
|
1183
|
-
});
|
|
1184
|
-
}
|
|
1185
|
-
};
|
|
1186
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
1187
|
-
minVersion: "12.0.0",
|
|
1188
|
-
version: "22.2.3",
|
|
1189
|
-
ngImport: i0,
|
|
1190
|
-
type: ClearMaskedOnFocusDirective,
|
|
1191
|
-
decorators: [{
|
|
1192
|
-
type: Directive,
|
|
1193
|
-
args: [{ selector: "input[pwClearMaskedOnFocus]" }]
|
|
1194
|
-
}],
|
|
1195
|
-
propDecorators: { onFocus: [{
|
|
1196
|
-
type: HostListener,
|
|
1197
|
-
args: ["focus", ["$event"]]
|
|
1198
|
-
}] }
|
|
1199
|
-
});
|
|
1200
|
-
const ACRONYMS = /* @__PURE__ */ new Set([
|
|
1201
|
-
"id",
|
|
1202
|
-
"url",
|
|
1203
|
-
"api",
|
|
1204
|
-
"aws",
|
|
1205
|
-
"smtp",
|
|
1206
|
-
"ssl",
|
|
1207
|
-
"tls",
|
|
1208
|
-
"iam",
|
|
1209
|
-
"sso",
|
|
1210
|
-
"sdk",
|
|
1211
|
-
"jwt",
|
|
1212
|
-
"oauth"
|
|
1213
|
-
]);
|
|
1214
|
-
var SubscriptionNameByIdPipe = class SubscriptionNameByIdPipe {
|
|
1215
|
-
transform(subs, id) {
|
|
1216
|
-
if (!subs || id == null) return "";
|
|
1217
|
-
const found = subs.find((s) => String(s.id) === String(id));
|
|
1218
|
-
return found?.organisation || found?.organization || found?.name || "";
|
|
1219
|
-
}
|
|
1220
|
-
static {
|
|
1221
|
-
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1222
|
-
minVersion: "12.0.0",
|
|
1223
|
-
version: "22.2.3",
|
|
1224
|
-
ngImport: i0,
|
|
1225
|
-
type: SubscriptionNameByIdPipe,
|
|
1226
|
-
deps: [],
|
|
1227
|
-
target: i0.ɵɵFactoryTarget.Pipe
|
|
1228
|
-
});
|
|
1229
|
-
}
|
|
1230
|
-
static {
|
|
1231
|
-
this.ɵpipe = i0.ɵɵngDeclarePipe({
|
|
1232
|
-
minVersion: "14.0.0",
|
|
1233
|
-
version: "22.2.3",
|
|
1234
|
-
ngImport: i0,
|
|
1235
|
-
type: SubscriptionNameByIdPipe,
|
|
1236
|
-
isStandalone: true,
|
|
1237
|
-
name: "subscriptionNameById"
|
|
1238
|
-
});
|
|
1239
|
-
}
|
|
1240
|
-
};
|
|
1241
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
1242
|
-
minVersion: "12.0.0",
|
|
1243
|
-
version: "22.2.3",
|
|
1244
|
-
ngImport: i0,
|
|
1245
|
-
type: SubscriptionNameByIdPipe,
|
|
1246
|
-
decorators: [{
|
|
1247
|
-
type: Pipe,
|
|
1248
|
-
args: [{ name: "subscriptionNameById" }]
|
|
1249
|
-
}]
|
|
1250
|
-
});
|
|
1251
|
-
var CredentialAvatarHuePipe = class CredentialAvatarHuePipe {
|
|
1252
|
-
transform(value) {
|
|
1253
|
-
if (!value) return 215;
|
|
1254
|
-
let hash = 0;
|
|
1255
|
-
for (let i = 0; i < value.length; i++) hash = hash * 31 + value.charCodeAt(i) | 0;
|
|
1256
|
-
return Math.abs(hash) % 360;
|
|
1257
|
-
}
|
|
1258
|
-
static {
|
|
1259
|
-
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1260
|
-
minVersion: "12.0.0",
|
|
1261
|
-
version: "22.2.3",
|
|
1262
|
-
ngImport: i0,
|
|
1263
|
-
type: CredentialAvatarHuePipe,
|
|
1264
|
-
deps: [],
|
|
1265
|
-
target: i0.ɵɵFactoryTarget.Pipe
|
|
1266
|
-
});
|
|
1267
|
-
}
|
|
1268
|
-
static {
|
|
1269
|
-
this.ɵpipe = i0.ɵɵngDeclarePipe({
|
|
1270
|
-
minVersion: "14.0.0",
|
|
1271
|
-
version: "22.2.3",
|
|
1272
|
-
ngImport: i0,
|
|
1273
|
-
type: CredentialAvatarHuePipe,
|
|
1274
|
-
isStandalone: true,
|
|
1275
|
-
name: "credentialAvatarHue"
|
|
1276
|
-
});
|
|
1277
|
-
}
|
|
1278
|
-
};
|
|
1279
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
1280
|
-
minVersion: "12.0.0",
|
|
1281
|
-
version: "22.2.3",
|
|
1282
|
-
ngImport: i0,
|
|
1283
|
-
type: CredentialAvatarHuePipe,
|
|
1284
|
-
decorators: [{
|
|
1285
|
-
type: Pipe,
|
|
1286
|
-
args: [{ name: "credentialAvatarHue" }]
|
|
1287
|
-
}]
|
|
1288
|
-
});
|
|
1289
|
-
var HumanizeCredentialNamePipe = class HumanizeCredentialNamePipe {
|
|
1290
|
-
transform(value) {
|
|
1291
|
-
if (!value) return "";
|
|
1292
|
-
return value.replace(/[_-]+/g, " ").split(" ").filter(Boolean).map((word) => ACRONYMS.has(word.toLowerCase()) ? word.toUpperCase() : word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
|
|
1293
|
-
}
|
|
1294
|
-
static {
|
|
1295
|
-
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1296
|
-
minVersion: "12.0.0",
|
|
1297
|
-
version: "22.2.3",
|
|
1298
|
-
ngImport: i0,
|
|
1299
|
-
type: HumanizeCredentialNamePipe,
|
|
1300
|
-
deps: [],
|
|
1301
|
-
target: i0.ɵɵFactoryTarget.Pipe
|
|
1302
|
-
});
|
|
1303
|
-
}
|
|
1304
|
-
static {
|
|
1305
|
-
this.ɵpipe = i0.ɵɵngDeclarePipe({
|
|
1306
|
-
minVersion: "14.0.0",
|
|
1307
|
-
version: "22.2.3",
|
|
1308
|
-
ngImport: i0,
|
|
1309
|
-
type: HumanizeCredentialNamePipe,
|
|
1310
|
-
isStandalone: true,
|
|
1311
|
-
name: "humanizeCredentialName"
|
|
1312
|
-
});
|
|
1313
|
-
}
|
|
1314
|
-
};
|
|
1315
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
1316
|
-
minVersion: "12.0.0",
|
|
1317
|
-
version: "22.2.3",
|
|
1318
|
-
ngImport: i0,
|
|
1319
|
-
type: HumanizeCredentialNamePipe,
|
|
1320
|
-
decorators: [{
|
|
1321
|
-
type: Pipe,
|
|
1322
|
-
args: [{ name: "humanizeCredentialName" }]
|
|
1323
|
-
}]
|
|
1324
|
-
});
|
|
1325
|
-
function sortByLabel(items, label) {
|
|
1326
|
-
const text = (item) => (label(item) ?? "").replace(/[_-]+/g, " ").trim();
|
|
1327
|
-
return [...items].sort((a, b) => text(a).localeCompare(text(b), void 0, {
|
|
1328
|
-
sensitivity: "base",
|
|
1329
|
-
numeric: true
|
|
1330
|
-
}));
|
|
1331
|
-
}
|
|
1332
1737
|
function uniqueByName(credentials) {
|
|
1333
1738
|
const seen = /* @__PURE__ */ new Set();
|
|
1334
1739
|
return sortByLabel(credentials.filter((credential) => {
|
|
@@ -1338,9 +1743,10 @@ function uniqueByName(credentials) {
|
|
|
1338
1743
|
}), (credential) => credential.name);
|
|
1339
1744
|
}
|
|
1340
1745
|
function groupByCredentialName(credentialTypes, stored) {
|
|
1746
|
+
const byName = credentialsByName(stored);
|
|
1341
1747
|
return credentialTypes.map(({ name }) => ({
|
|
1342
1748
|
credential_name: name,
|
|
1343
|
-
credentials: sortByLabel(
|
|
1749
|
+
credentials: sortByLabel(byName.get(name) ?? [], (credential) => credential.field)
|
|
1344
1750
|
})).filter((group) => group.credentials.length > 0);
|
|
1345
1751
|
}
|
|
1346
1752
|
function credentialFormRow(credentialType, stored) {
|
|
@@ -1353,20 +1759,12 @@ function credentialFormRow(credentialType, stored) {
|
|
|
1353
1759
|
id: [stored?.id]
|
|
1354
1760
|
};
|
|
1355
1761
|
}
|
|
1356
|
-
function changedCredentials(rows) {
|
|
1357
|
-
return rows.filter((row) => row?.value && !String(row.value).startsWith("***"));
|
|
1358
|
-
}
|
|
1359
1762
|
function applyStoredIds(rows, stored) {
|
|
1360
1763
|
rows.controls.forEach((row) => {
|
|
1361
1764
|
const saved = stored.find((s) => s.credential_id === row.value.credential_id);
|
|
1362
1765
|
if (saved && !row.value.id) row.patchValue({ id: saved.id });
|
|
1363
1766
|
});
|
|
1364
1767
|
}
|
|
1365
|
-
var SaveFailure = class {
|
|
1366
|
-
constructor(error) {
|
|
1367
|
-
this.error = error;
|
|
1368
|
-
}
|
|
1369
|
-
};
|
|
1370
1768
|
var SubscriptionCredentialActionsService = class SubscriptionCredentialActionsService {
|
|
1371
1769
|
constructor() {
|
|
1372
1770
|
this.confirmDialog = inject(ConfirmDialogService);
|
|
@@ -1383,18 +1781,13 @@ var SubscriptionCredentialActionsService = class SubscriptionCredentialActionsSe
|
|
|
1383
1781
|
return this.subscriptionService.getAllSubscriptionCredentials(subscriptionId).pipe(map$1(({ result }) => result));
|
|
1384
1782
|
}
|
|
1385
1783
|
saveChanged(rows, subscriptionId) {
|
|
1386
|
-
|
|
1784
|
+
return runAllThenReport(changedCredentials(rows).map((row) => {
|
|
1387
1785
|
const data = {
|
|
1388
1786
|
subscription_id: subscriptionId,
|
|
1389
1787
|
credential_id: row.credential_id,
|
|
1390
1788
|
value: row.value
|
|
1391
1789
|
};
|
|
1392
|
-
return
|
|
1393
|
-
});
|
|
1394
|
-
if (!requests.length) return of([]);
|
|
1395
|
-
return forkJoin(requests).pipe(switchMap((results) => {
|
|
1396
|
-
const failure = results.find((r) => r instanceof SaveFailure);
|
|
1397
|
-
return failure ? throwError(() => failure.error) : of(results);
|
|
1790
|
+
return row.id ? this.subscriptionService.editSubscriptionCredential(row.id, data) : this.subscriptionService.postSubscriptionCredential(data);
|
|
1398
1791
|
}));
|
|
1399
1792
|
}
|
|
1400
1793
|
confirmAndDelete(group, subscriptionId) {
|
|
@@ -1577,7 +1970,11 @@ var SubscriptionCredentialComponent = class SubscriptionCredentialComponent exte
|
|
|
1577
1970
|
usesInheritance: true,
|
|
1578
1971
|
ngImport: i0,
|
|
1579
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",
|
|
1580
|
-
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
|
+
],
|
|
1581
1978
|
dependencies: [
|
|
1582
1979
|
{
|
|
1583
1980
|
kind: "ngmodule",
|
|
@@ -1839,7 +2236,11 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1839
2236
|
SubscriptionNameByIdPipe
|
|
1840
2237
|
],
|
|
1841
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",
|
|
1842
|
-
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
|
+
]
|
|
1843
2244
|
}]
|
|
1844
2245
|
}],
|
|
1845
2246
|
ctorParameters: () => [],
|
|
@@ -3393,6 +3794,12 @@ var UserSubscriptionDetailsComponent = class UserSubscriptionDetailsComponent ex
|
|
|
3393
3794
|
get brandName() {
|
|
3394
3795
|
return this.appConfig?.company?.name?.trim() || "PosiWise";
|
|
3395
3796
|
}
|
|
3797
|
+
get apiMcpEnabled() {
|
|
3798
|
+
return !!this.user?.feature_flags?.[API_MCP_ACCESS_FLAG];
|
|
3799
|
+
}
|
|
3800
|
+
get aiAssistantEnabled() {
|
|
3801
|
+
return !!this.user?.feature_flags?.[AI_ASSISTANT_FLAG];
|
|
3802
|
+
}
|
|
3396
3803
|
onSaveDetails() {
|
|
3397
3804
|
this.busyButton = true;
|
|
3398
3805
|
const formValue = { ...this.form.value };
|
|
@@ -3444,7 +3851,7 @@ var UserSubscriptionDetailsComponent = class UserSubscriptionDetailsComponent ex
|
|
|
3444
3851
|
}],
|
|
3445
3852
|
usesInheritance: true,
|
|
3446
3853
|
ngImport: i0,
|
|
3447
|
-
template: "<!-- edit Subscription details page -->\n<div class=\"row\">\n <div class=\"col-12\">\n <h3 class=\"my-3\">{{ subscription?.organisation || subscription?.contact_name }}</h3>\n </div>\n</div>\n\n@if (subscription) {\n <form [formGroup]=\"form\"\n (ngSubmit)=\"onSaveDetails()\"\n class=\"row mt-4\"\n >\n <!-- 1. Contact details -->\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.Contact' | transloco }}</h3>\n </div>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.ContactName' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.ContactName' | transloco\"\n name=\"contact_name\"\n controlId=\"user-subscription-contact_name\"\n errorMsg=\"User.Account.Validation.ContactName\">\n <input type=\"text\"\n id=\"user-subscription-contact_name\"\n class=\"form-control\"\n formControlName=\"contact_name\"\n [attr.aria-label]=\"'User.Subscriptions.Details.ContactName' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.ContactEmail' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.ContactEmail' | transloco\"\n name=\"contact_email\"\n controlId=\"user-subscription-contact_email\"\n errorMsg=\"User.Subscriptions.Details.Validation.ContactEmail\">\n <input type=\"text\"\n id=\"user-subscription-contact_email\"\n class=\"form-control\"\n formControlName=\"contact_email\"\n [attr.aria-label]=\"'User.Subscriptions.Details.ContactEmail' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Organization' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.Organisation' | transloco\"\n name=\"organisation\"\n controlId=\"user-subscription-organisation\"\n errorMsg=\"User.Subscriptions.Details.Validation.Organisation\">\n <input type=\"text\"\n id=\"user-subscription-organisation\"\n class=\"form-control\"\n formControlName=\"organisation\"\n [attr.aria-label]=\"'User.Subscriptions.Details.Organisation' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Phone' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.ContactTel' | transloco\"\n name=\"contact_tel\"\n controlId=\"user-subscription-contact_tel\"\n errorMsg=\"User.Subscriptions.Details.Validation.ContactTel\">\n <input type=\"text\"\n id=\"user-subscription-contact_tel\"\n class=\"form-control\"\n formControlName=\"contact_tel\"\n [attr.aria-label]=\"'User.Subscriptions.Details.ContactTel' | transloco\" />\n </pw-input-container>\n @if (countries$ | async; as countries) {\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Country' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.Country' | transloco\"\n name=\"country_code\"\n controlId=\"user-subscription-country_code\"\n [useAriaLabelledbyOnly]=\"true\"\n [isLeftTooltip]=\"true\"\n errorMsg=\"User.Subscriptions.Details.Validation.Country\">\n <p-select\n [attr.aria-labelledby]=\"'user-subscription-country_code-label'\"\n [options]=\"countries\"\n optionLabel=\"name\"\n optionValue=\"code\"\n formControlName=\"country_code\"\n [placeholder]=\"'User.Profile.SelectCountry' | transloco\">\n </p-select>\n </pw-input-container>\n }\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Address' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.Address' | transloco\"\n name=\"address\"\n controlId=\"user-subscription-address\"\n [useAriaLabelledbyOnly]=\"true\"\n errorMsg=\"User.Subscriptions.Details.Validation.Address\">\n <input ngx-gp-autocomplete\n id=\"user-subscription-address\"\n name=\"address\"\n class=\"form-control\"\n [attr.aria-labelledby]=\"'user-subscription-address-label'\"\n #places=\"ngx-places\"\n formControlName=\"address\"\n (onAddressChange)=\"handleAddressChange($event)\"\n [attr.aria-label]=\"'User.Subscriptions.Details.Address' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.VatNumber' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.TaxId' | transloco\"\n name=\"tax_id\"\n controlId=\"user-subscription-tax_id\"\n errorMsg=\"User.Subscriptions.Details.Validation.TaxId\">\n <input type=\"text\"\n id=\"user-subscription-tax_id\"\n class=\"form-control\"\n formControlName=\"tax_id\"\n [attr.aria-label]=\"'User.Subscriptions.Details.TaxId' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.CompanyUrl' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.CompanyUrl' | transloco\"\n name=\"company_url\"\n controlId=\"user-subscription-company_url\"\n errorMsg=\"User.Subscriptions.Details.Validation.CompanyUrl\">\n <input type=\"text\"\n id=\"user-subscription-company_url\"\n class=\"form-control\"\n formControlName=\"company_url\"\n [attr.aria-label]=\"'User.Subscriptions.Details.CompanyUrl' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.InvoiceRecipientEmails' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.InvoiceRecipientEmails' | transloco\"\n name=\"invoice_recipient_emails\"\n controlId=\"user-subscription-invoice_recipient_emails\"\n errorMsg=\"User.Subscriptions.Details.Validation.InvoiceRecipientEmails\">\n <input type=\"text\"\n id=\"user-subscription-invoice_recipient_emails\"\n class=\"form-control\"\n formControlName=\"invoice_recipient_emails\"\n [placeholder]=\"'User.Subscriptions.Details.Placeholder.InvoiceRecipientEmails' | transloco\"\n [attr.aria-label]=\"'User.Subscriptions.Details.InvoiceRecipientEmails' | transloco\" />\n </pw-input-container>\n\n <!-- 2. Branding / Logos -->\n <div class=\"col-12\">\n <div class=\"row branding-section\">\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.Branding' | transloco }}</h3>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-md-6\">\n <div class=\"text-center mt-5\">\n <div class=\"image-container\">\n <h4 class=\"mb-2\">{{ 'User.Subscriptions.FullLogo' | transloco }}\n <span class=\"tooltip-wrap ms-1\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.FullLogo'|transloco\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"'top'\">\n <i class=\"far fa-info-circle text-muted\"></i>\n </span>\n </h4>\n @if (fullLogo && !fullLogo.includes('no_image_uploaded') && !fullLogoBroken) {\n <img [src]=\"fullLogo\"\n [alt]=\"'User.Subscriptions.Details.Logo.FullAlt' | transloco\"\n class=\"image full-logo\"\n role=\"presentation\"\n (error)=\"fullLogoBroken = true\" />\n <div class=\"overlay mt-2\"\n (keydown.enter)=\"openModal(content)\"\n (click)=\"openModal(content)\">\n <div class=\"overlay-text\">\n <a [attr.aria-label]=\"'User.Profile.Change' | transloco\">{{ 'User.Profile.Change' | transloco }}</a>\n </div>\n </div>\n } @else {\n <div class=\"logo-dropzone full-dropzone\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'User.Subscriptions.Details.Logo.UploadFull' | transloco\"\n (keydown.enter)=\"openModal(content)\"\n (click)=\"openModal(content)\">\n <i class=\"fas fa-upload\"></i>\n <span class=\"dropzone-title\">{{ 'User.Subscriptions.Details.Logo.Upload' | transloco }}</span>\n <span class=\"dropzone-hint\">{{ 'User.Subscriptions.Details.Logo.FileTypes' | transloco }}</span>\n </div>\n }\n </div>\n </div>\n </div>\n <div class=\"col-md-6\">\n <div class=\"text-center mt-5\">\n <div class=\"image-container\">\n <h4 class=\"mb-2\">{{ 'User.Subscriptions.SquaredLogo' | transloco }}\n <span class=\"tooltip-wrap ms-1\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.SquaredLogo'|transloco\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"'top'\">\n <i class=\"far fa-info-circle text-muted\"></i>\n </span>\n </h4>\n @if (squaredLogo && !squaredLogo.includes('no_image_uploaded') && !squaredLogoBroken) {\n <img [src]=\"squaredLogo\"\n [alt]=\"'User.Subscriptions.Details.Logo.SquaredAlt' | transloco\"\n class=\"squared_logo\"\n role=\"presentation\"\n (error)=\"squaredLogoBroken = true\" />\n <div class=\"overlay mt-2\"\n (keydown.enter)=\"openModal(squaredLogoContent)\"\n (click)=\"openModal(squaredLogoContent)\">\n <div class=\"overlay-text\">\n <a [attr.aria-label]=\"'User.Profile.Change' | transloco\">{{ 'User.Profile.Change' | transloco }}</a>\n </div>\n </div>\n } @else {\n <div class=\"logo-dropzone squared-dropzone\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'User.Subscriptions.Details.Logo.UploadSquared' | transloco\"\n (keydown.enter)=\"openModal(squaredLogoContent)\"\n (click)=\"openModal(squaredLogoContent)\">\n <i class=\"fas fa-upload\"></i>\n <span class=\"dropzone-title\">{{ 'User.Subscriptions.Details.Logo.Upload' | transloco }}</span>\n <span class=\"dropzone-hint\">{{ 'User.Subscriptions.Details.Logo.FileTypes' | transloco }}</span>\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <!-- 3. Social Media -->\n <ng-container *rbacAllow=\"'SubscriptionSuperAdmin'\">\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.SocialMedia' | transloco }}</h3>\n <p>\n {{ 'User.Subscriptions.Details.SocialMedia.Description' | transloco }}\n </p>\n </div>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.FacebookHandle' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.FacebookHandle' | transloco\"\n name=\"facebook_handle\"\n controlId=\"user-subscription-facebook_handle\"\n errorMsg=\"User.Subscriptions.Details.Validation.FacebookHandle\">\n <input type=\"text\"\n id=\"user-subscription-facebook_handle\"\n class=\"form-control\"\n formControlName=\"facebook_handle\"\n [attr.aria-label]=\"'User.Subscriptions.Details.FacebookHandle' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.TwitterHandle' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.TwitterHandle' | transloco\"\n name=\"twitter_handle\"\n controlId=\"user-subscription-twitter_handle\"\n errorMsg=\"User.Subscriptions.Details.Validation.TwitterHandle\">\n <input type=\"text\"\n id=\"user-subscription-twitter_handle\"\n class=\"form-control\"\n formControlName=\"twitter_handle\"\n [attr.aria-label]=\"'User.Subscriptions.Details.TwitterHandle' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.LinkedinHandle' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.LinkedinHandle' | transloco\"\n name=\"linkedin_handle\"\n controlId=\"user-subscription-linkedin_handle\"\n errorMsg=\"User.Subscriptions.Details.Validation.LinkedinHandle\">\n <input type=\"text\"\n id=\"user-subscription-linkedin_handle\"\n class=\"form-control\"\n formControlName=\"linkedin_handle\"\n [attr.aria-label]=\"'User.Subscriptions.Details.LinkedinHandle' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.RedditHandle' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.RedditHandle' | transloco\"\n name=\"reddit_handle\"\n controlId=\"user-subscription-reddit_handle\"\n errorMsg=\"User.Subscriptions.Details.Validation.RedditHandle\">\n <input type=\"text\"\n id=\"user-subscription-reddit_handle\"\n class=\"form-control\"\n formControlName=\"reddit_handle\"\n [attr.aria-label]=\"'User.Subscriptions.Details.RedditHandle' | transloco\" />\n </pw-input-container>\n </ng-container>\n\n <!-- 4. Seats -->\n <div class=\"col-12\">\n <div class=\"row seats-section\">\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.Seats' | transloco }}</h3>\n <p>{{ 'User.Subscriptions.Details.Seats.Description' | transloco }}</p>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n @if (subscription?.trial_subscription && subscription?.calculated_price) {\n <small\n class=\"text-danger\">{{ 'User.Subscriptions.Details.Seats.UpgradeRequired' | transloco }}</small>\n }\n </div>\n </div>\n <div class=\"row btns-row align-items-center\">\n @if (subscription) {\n <div class=\"col-md-3 col-8\"\n >\n <label for=\"user-subscription-seats\" class=\"visually-hidden\">{{ 'User.Subscriptions.Tooltip.Seats' | transloco }}</label>\n <pw-number-picker [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Seats'|transloco\"\n inputId=\"user-subscription-seats\"\n name=\"number-picker\"\n [(value)]=\"units\"\n [min]=\"subscription?.min_units||subscription?.products[0].min_units\"\n [max]=\"subscription?.products[0].max_units\"\n step=\"1\"\n [postfix]=\"'User.Subscriptions.Details.Seats.Postfix' | transloco\"\n [placeholder]=\"'User.Subscriptions.Details.Seats.Placeholder' | transloco\"\n [inputReadOnly]=\"subscription?.products[0].trial_subscription\"\n [showUpButton]=\"!subscription?.products[0].trial_subscription\"\n [showDownButton]=\"!subscription?.products[0].trial_subscription\"\n size=\"small\"\n pickStartAfter=\"500\"\n pickTimer=\"100\"\n [arrowKeys]=\"true\"\n (minReached)=\"onMinReached($event)\"\n (maxReached)=\"onMaxReached($event)\"\n (valueChange)=\"onUnitChange($event)\">\n </pw-number-picker>\n </div>\n }\n\n @if (subscription) {\n <div class=\"col-md-3 col-4 p-1\"\n >\n @if (!subscription?.products[0].trial_subscription && allowUpdate) {\n <button type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"updateUnits()\">\n {{ 'User.Subscriptions.UpdateUnits' | transloco }}\n </button>\n } @else {\n <div>\n @if (subscription?.products[0].trial_subscription) {\n <small class=\"text-muted\"\n >{{ 'User.Subscriptions.Details.Seats.PaidOnly' | transloco }}</small>\n }\n </div>\n }\n </div>\n }\n\n @if (hasUnitChanged) {\n <div class=\"col-12 col-md-6\"\n >\n <table class=\"table table-borderless table-sm\"\n aria-describedby=\"Product details\">\n <thead>\n <tr>\n <th scope=\"true\">{{ 'Label.Product' | transloco }}</th>\n <th scope=\"true\">{{ 'User.Subscriptions.Details.Seats.PricePerSeat' | transloco }} <span>({{subscription?.products[0]?.currency|currencySymbol}})</span></th>\n <th scope=\"true\">{{ 'User.Subscriptions.Details.Section.Seats' | transloco }}</th>\n </tr>\n </thead>\n <tbody>\n @for (product of subscription.products; track trackByProduct($index, product)) {\n <tr>\n <td>{{ product.name }}</td>\n <td>{{ product.price_per_unit / 100 }}</td>\n <td>{{ units }}</td>\n </tr>\n }\n </tbody>\n </table>\n <p>\n {{ 'User.Subscriptions.Details.Seats.NewCost' | transloco }}\n <strong>{{ totalAmount()| currency: subscription?.products[0]?.currency:'symbol-narrow'}}</strong>\n </p>\n </div>\n }\n </div>\n </div>\n\n <!-- 5. API & MCP Credentials -->\n @if (subscription?.api_hits_max > 0) {\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.APICredentials.Title' | transloco }}</h3>\n <p>\n {{ 'User.Subscriptions.Details.ApiIntro' | transloco }}\n </p>\n </div>\n <div class=\"col-md-6\">\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"user-subscription-api-token\">\n {{ 'User.Subscriptions.APICredentials.AccessToken' | transloco }}\n <span class=\"tooltip-wrap ms-1\"\n [pTooltip]=\"'User.Subscriptions.Details.Tooltip.TokenDiscontinued' | transloco\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"'top'\">\n <i class=\"far fa-info-circle text-muted\"></i>\n </span>\n </label>\n <div class=\"input-group\">\n <input type=\"text\"\n id=\"user-subscription-api-token\"\n name=\"api_token\"\n class=\"form-control\"\n [value]=\"showApiToken ? subscription?.api_access_token || ('User.Subscriptions.APICredentials.NoTokenAvailable' | transloco) : '*************************'\"\n readonly\n [attr.aria-label]=\"'User.Subscriptions.APICredentials.AccessToken' | 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-md-6\">\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"user-subscription-api-client-id\">{{ 'User.Subscriptions.APICredentials.ClientId' | transloco }}</label>\n <div class=\"input-group\">\n <input type=\"text\"\n id=\"user-subscription-api-client-id\"\n name=\"api_client_id\"\n class=\"form-control\"\n [value]=\"showApiClientId ? subscription?.api_client_id || ('User.Subscriptions.APICredentials.NoClientIdAvailable' | transloco) : '*************************'\"\n readonly\n [attr.aria-label]=\"'User.Subscriptions.APICredentials.ClientId' | 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 (subscription?.api_hits !== null) {\n <span class=\"text-muted\">{{ 'User.Subscriptions.APICredentials.ApiHits' | transloco }}:</span>\n <span class=\"fw-bold\">{{ subscription.api_hits | number }}</span>\n }\n @if (subscription?.api_hits_max !== null) {\n <span class=\"text-muted\">{{ 'User.Subscriptions.APICredentials.ApiHitsMax' | transloco }}:</span>\n <span class=\"fw-bold\">{{ subscription.api_hits_max | number }}</span>\n }\n <!-- Show utilization percentage when both values exist -->\n @if (subscription?.api_hits !== null || subscription?.api_hits_max !== null) {\n <span class=\"text-muted ms-2\">(</span>\n <span class=\"fw-bold\" [ngClass]=\"{\n 'text-success-muted': (subscription.api_hits / subscription.api_hits_max) <= 0.8,\n 'text-warning': (subscription.api_hits / subscription.api_hits_max) > 0.8 && (subscription.api_hits / subscription.api_hits_max) <= 0.9,\n 'text-danger': (subscription.api_hits / subscription.api_hits_max) > 0.9\n }\">\n {{ 'User.Subscriptions.Details.ApiConsumed' | transloco: { percent: ((subscription.api_hits / subscription.api_hits_max * 100) | number:'1.0-0') } }}\n </span>\n <span class=\"text-muted\">)</span>\n }\n </div>\n </div>\n </div>\n }\n\n <!-- 6. Security -->\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.Security' | transloco }}</h3>\n <p>\n {{ 'User.Subscriptions.Details.Security.Description' | transloco }}\n </p>\n </div>\n <div class=\"col-12 col-sm-3\">\n <pw-input-container [label]=\"'User.Subscriptions.Details.Enforce2fa' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Enforce2fa' | transloco\"\n name=\"enforce_2fa\"\n controlId=\"user-subscription-enforce_2fa\"\n [useAriaLabelledbyOnly]=\"true\">\n <ui-switch formControlName=\"enforce_2fa\"\n name=\"enforce_2fa\"\n [attr.aria-labelledby]=\"'user-subscription-enforce_2fa-label'\"> </ui-switch>\n </pw-input-container>\n </div>\n\n <!-- 7. Brain AI data -->\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.BrainData.Title' | transloco: { brand: brandName } }}</h3>\n <p>{{ 'User.Subscriptions.BrainData.Description' | transloco: { brand: brandName } }}</p>\n </div>\n <div class=\"col-12 col-sm-3\">\n <pw-input-container [label]=\"'User.Subscriptions.BrainData.UseOwnDataLabel' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.RagUseOwnData' | transloco: { brand: brandName }\"\n name=\"rag_use_own_data\"\n controlId=\"user-subscription-rag_use_own_data\"\n [useAriaLabelledbyOnly]=\"true\">\n <ui-switch formControlName=\"rag_use_own_data\"\n name=\"rag_use_own_data\"\n [attr.aria-labelledby]=\"'user-subscription-rag_use_own_data-label'\"> </ui-switch>\n </pw-input-container>\n </div>\n <!-- Keeping personal data is a question about WHAT is kept, so it only\n arises while there is something to keep. Hidden rather than disabled:\n a greyed-out switch still reads as an affordance, and the stored value\n survives in the form either way. -->\n @if (form.value.rag_use_own_data) {\n <div class=\"col-12 col-sm-3\">\n <pw-input-container [label]=\"'User.Subscriptions.BrainData.KeepPiiLabel' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.RagKeepPii' | transloco: { brand: brandName }\"\n name=\"rag_keep_pii\"\n controlId=\"user-subscription-rag_keep_pii\"\n [useAriaLabelledbyOnly]=\"true\">\n <ui-switch formControlName=\"rag_keep_pii\"\n name=\"rag_keep_pii\"\n [attr.aria-labelledby]=\"'user-subscription-rag_keep_pii-label'\"> </ui-switch>\n </pw-input-container>\n </div>\n <!-- Slack history is also the subscription's own data, so it needs \"Use subscription data\" too. -->\n <div class=\"col-12 col-sm-3\">\n <pw-input-container [label]=\"'User.Subscriptions.BrainData.SlackHistoryLabel' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.RagSlackHistory' | transloco: { brand: brandName }\"\n name=\"rag_slack_history\"\n controlId=\"user-subscription-rag_slack_history\"\n [useAriaLabelledbyOnly]=\"true\">\n <ui-switch formControlName=\"rag_slack_history\"\n name=\"rag_slack_history\"\n [attr.aria-labelledby]=\"'user-subscription-rag_slack_history-label'\"> </ui-switch>\n </pw-input-container>\n </div>\n } @else {\n <div class=\"col-12 col-sm-6\">\n <p>{{ 'User.Subscriptions.BrainData.KeepPiiNotApplicable' | transloco: { brand: brandName } }}</p>\n </div>\n }\n <pw-sticky-actions>\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n routerLink=\"/account/subscriptions\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button name=\"submit\"\n type=\"submit\"\n [buttonBusy]=\"busyButton\"\n class=\"btn btn-primary\">\n {{ 'Button.Submit' | transloco }}\n </button>\n </pw-sticky-actions>\n </form>\n}\n\n<ng-template #content\n let-modal>\n <div class=\"modal-header\">\n <h3 class=\"modal-title mb-0 p-0\">{{ 'User.Subscriptions.FullLogo' | 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\n </button>\n </div>\n <div class=\"modal-body\">\n <small> {{ 'User.Profile.PictureMessage' | transloco }}</small>\n <pw-image-cropper #profile\n (imageSelectionEvent)=\"onImageSelection($event)\"\n aspectRatio=\"fullLogo\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n</ng-template>\n<ng-template #squaredLogoContent\n let-modal>\n <div class=\"modal-header\">\n <h3 class=\"modal-title mb-0 p-0\">{{ 'User.Subscriptions.SquaredLogo' | 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\n </button>\n </div>\n <div class=\"modal-body\">\n <small> {{ 'User.Profile.PictureMessage' | transloco }}</small>\n <pw-image-cropper #profile\n (imageSelectionEvent)=\"uploadSquaredLogo($event)\"\n aspectRatio=\"auto\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n</ng-template>\n<pw-password-validation #modal\n(successEvent)=\"onPasswordValidation($event)\"> </pw-password-validation>\n",
|
|
3854
|
+
template: "<!-- edit Subscription details page -->\n<div class=\"row\">\n <div class=\"col-12\">\n <h3 class=\"my-3\">{{ subscription?.organisation || subscription?.contact_name }}</h3>\n </div>\n</div>\n\n@if (subscription) {\n <form [formGroup]=\"form\"\n (ngSubmit)=\"onSaveDetails()\"\n class=\"row mt-4\"\n >\n <!-- 1. Contact details -->\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.Contact' | transloco }}</h3>\n </div>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.ContactName' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.ContactName' | transloco\"\n name=\"contact_name\"\n controlId=\"user-subscription-contact_name\"\n errorMsg=\"User.Account.Validation.ContactName\">\n <input type=\"text\"\n id=\"user-subscription-contact_name\"\n class=\"form-control\"\n formControlName=\"contact_name\"\n [attr.aria-label]=\"'User.Subscriptions.Details.ContactName' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.ContactEmail' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.ContactEmail' | transloco\"\n name=\"contact_email\"\n controlId=\"user-subscription-contact_email\"\n errorMsg=\"User.Subscriptions.Details.Validation.ContactEmail\">\n <input type=\"text\"\n id=\"user-subscription-contact_email\"\n class=\"form-control\"\n formControlName=\"contact_email\"\n [attr.aria-label]=\"'User.Subscriptions.Details.ContactEmail' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Organization' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.Organisation' | transloco\"\n name=\"organisation\"\n controlId=\"user-subscription-organisation\"\n errorMsg=\"User.Subscriptions.Details.Validation.Organisation\">\n <input type=\"text\"\n id=\"user-subscription-organisation\"\n class=\"form-control\"\n formControlName=\"organisation\"\n [attr.aria-label]=\"'User.Subscriptions.Details.Organisation' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Phone' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.ContactTel' | transloco\"\n name=\"contact_tel\"\n controlId=\"user-subscription-contact_tel\"\n errorMsg=\"User.Subscriptions.Details.Validation.ContactTel\">\n <input type=\"text\"\n id=\"user-subscription-contact_tel\"\n class=\"form-control\"\n formControlName=\"contact_tel\"\n [attr.aria-label]=\"'User.Subscriptions.Details.ContactTel' | transloco\" />\n </pw-input-container>\n @if (countries$ | async; as countries) {\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Country' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.Country' | transloco\"\n name=\"country_code\"\n controlId=\"user-subscription-country_code\"\n [useAriaLabelledbyOnly]=\"true\"\n [isLeftTooltip]=\"true\"\n errorMsg=\"User.Subscriptions.Details.Validation.Country\">\n <p-select\n [attr.aria-labelledby]=\"'user-subscription-country_code-label'\"\n [options]=\"countries\"\n optionLabel=\"name\"\n optionValue=\"code\"\n formControlName=\"country_code\"\n [placeholder]=\"'User.Profile.SelectCountry' | transloco\">\n </p-select>\n </pw-input-container>\n }\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Address' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.Address' | transloco\"\n name=\"address\"\n controlId=\"user-subscription-address\"\n [useAriaLabelledbyOnly]=\"true\"\n errorMsg=\"User.Subscriptions.Details.Validation.Address\">\n <input ngx-gp-autocomplete\n id=\"user-subscription-address\"\n name=\"address\"\n class=\"form-control\"\n [attr.aria-labelledby]=\"'user-subscription-address-label'\"\n #places=\"ngx-places\"\n formControlName=\"address\"\n (onAddressChange)=\"handleAddressChange($event)\"\n [attr.aria-label]=\"'User.Subscriptions.Details.Address' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.VatNumber' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.TaxId' | transloco\"\n name=\"tax_id\"\n controlId=\"user-subscription-tax_id\"\n errorMsg=\"User.Subscriptions.Details.Validation.TaxId\">\n <input type=\"text\"\n id=\"user-subscription-tax_id\"\n class=\"form-control\"\n formControlName=\"tax_id\"\n [attr.aria-label]=\"'User.Subscriptions.Details.TaxId' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.CompanyUrl' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.CompanyUrl' | transloco\"\n name=\"company_url\"\n controlId=\"user-subscription-company_url\"\n errorMsg=\"User.Subscriptions.Details.Validation.CompanyUrl\">\n <input type=\"text\"\n id=\"user-subscription-company_url\"\n class=\"form-control\"\n formControlName=\"company_url\"\n [attr.aria-label]=\"'User.Subscriptions.Details.CompanyUrl' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.InvoiceRecipientEmails' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.InvoiceRecipientEmails' | transloco\"\n name=\"invoice_recipient_emails\"\n controlId=\"user-subscription-invoice_recipient_emails\"\n errorMsg=\"User.Subscriptions.Details.Validation.InvoiceRecipientEmails\">\n <input type=\"text\"\n id=\"user-subscription-invoice_recipient_emails\"\n class=\"form-control\"\n formControlName=\"invoice_recipient_emails\"\n [placeholder]=\"'User.Subscriptions.Details.Placeholder.InvoiceRecipientEmails' | transloco\"\n [attr.aria-label]=\"'User.Subscriptions.Details.InvoiceRecipientEmails' | transloco\" />\n </pw-input-container>\n\n <!-- 2. Branding / Logos -->\n <div class=\"col-12\">\n <div class=\"row branding-section\">\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.Branding' | transloco }}</h3>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-md-6\">\n <div class=\"text-center mt-5\">\n <div class=\"image-container\">\n <h4 class=\"mb-2\">{{ 'User.Subscriptions.FullLogo' | transloco }}\n <span class=\"tooltip-wrap ms-1\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.FullLogo'|transloco\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"'top'\">\n <i class=\"far fa-info-circle text-muted\"></i>\n </span>\n </h4>\n @if (fullLogo && !fullLogo.includes('no_image_uploaded') && !fullLogoBroken) {\n <img [src]=\"fullLogo\"\n [alt]=\"'User.Subscriptions.Details.Logo.FullAlt' | transloco\"\n class=\"image full-logo\"\n role=\"presentation\"\n (error)=\"fullLogoBroken = true\" />\n <div class=\"overlay mt-2\"\n (keydown.enter)=\"openModal(content)\"\n (click)=\"openModal(content)\">\n <div class=\"overlay-text\">\n <a [attr.aria-label]=\"'User.Profile.Change' | transloco\">{{ 'User.Profile.Change' | transloco }}</a>\n </div>\n </div>\n } @else {\n <div class=\"logo-dropzone full-dropzone\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'User.Subscriptions.Details.Logo.UploadFull' | transloco\"\n (keydown.enter)=\"openModal(content)\"\n (click)=\"openModal(content)\">\n <i class=\"fas fa-upload\"></i>\n <span class=\"dropzone-title\">{{ 'User.Subscriptions.Details.Logo.Upload' | transloco }}</span>\n <span class=\"dropzone-hint\">{{ 'User.Subscriptions.Details.Logo.FileTypes' | transloco }}</span>\n </div>\n }\n </div>\n </div>\n </div>\n <div class=\"col-md-6\">\n <div class=\"text-center mt-5\">\n <div class=\"image-container\">\n <h4 class=\"mb-2\">{{ 'User.Subscriptions.SquaredLogo' | transloco }}\n <span class=\"tooltip-wrap ms-1\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.SquaredLogo'|transloco\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"'top'\">\n <i class=\"far fa-info-circle text-muted\"></i>\n </span>\n </h4>\n @if (squaredLogo && !squaredLogo.includes('no_image_uploaded') && !squaredLogoBroken) {\n <img [src]=\"squaredLogo\"\n [alt]=\"'User.Subscriptions.Details.Logo.SquaredAlt' | transloco\"\n class=\"squared_logo\"\n role=\"presentation\"\n (error)=\"squaredLogoBroken = true\" />\n <div class=\"overlay mt-2\"\n (keydown.enter)=\"openModal(squaredLogoContent)\"\n (click)=\"openModal(squaredLogoContent)\">\n <div class=\"overlay-text\">\n <a [attr.aria-label]=\"'User.Profile.Change' | transloco\">{{ 'User.Profile.Change' | transloco }}</a>\n </div>\n </div>\n } @else {\n <div class=\"logo-dropzone squared-dropzone\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'User.Subscriptions.Details.Logo.UploadSquared' | transloco\"\n (keydown.enter)=\"openModal(squaredLogoContent)\"\n (click)=\"openModal(squaredLogoContent)\">\n <i class=\"fas fa-upload\"></i>\n <span class=\"dropzone-title\">{{ 'User.Subscriptions.Details.Logo.Upload' | transloco }}</span>\n <span class=\"dropzone-hint\">{{ 'User.Subscriptions.Details.Logo.FileTypes' | transloco }}</span>\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <!-- 3. Social Media -->\n <ng-container *rbacAllow=\"'SubscriptionSuperAdmin'\">\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.SocialMedia' | transloco }}</h3>\n <p>\n {{ 'User.Subscriptions.Details.SocialMedia.Description' | transloco }}\n </p>\n </div>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.FacebookHandle' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.FacebookHandle' | transloco\"\n name=\"facebook_handle\"\n controlId=\"user-subscription-facebook_handle\"\n errorMsg=\"User.Subscriptions.Details.Validation.FacebookHandle\">\n <input type=\"text\"\n id=\"user-subscription-facebook_handle\"\n class=\"form-control\"\n formControlName=\"facebook_handle\"\n [attr.aria-label]=\"'User.Subscriptions.Details.FacebookHandle' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.TwitterHandle' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.TwitterHandle' | transloco\"\n name=\"twitter_handle\"\n controlId=\"user-subscription-twitter_handle\"\n errorMsg=\"User.Subscriptions.Details.Validation.TwitterHandle\">\n <input type=\"text\"\n id=\"user-subscription-twitter_handle\"\n class=\"form-control\"\n formControlName=\"twitter_handle\"\n [attr.aria-label]=\"'User.Subscriptions.Details.TwitterHandle' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.LinkedinHandle' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.LinkedinHandle' | transloco\"\n name=\"linkedin_handle\"\n controlId=\"user-subscription-linkedin_handle\"\n errorMsg=\"User.Subscriptions.Details.Validation.LinkedinHandle\">\n <input type=\"text\"\n id=\"user-subscription-linkedin_handle\"\n class=\"form-control\"\n formControlName=\"linkedin_handle\"\n [attr.aria-label]=\"'User.Subscriptions.Details.LinkedinHandle' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.RedditHandle' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.RedditHandle' | transloco\"\n name=\"reddit_handle\"\n controlId=\"user-subscription-reddit_handle\"\n errorMsg=\"User.Subscriptions.Details.Validation.RedditHandle\">\n <input type=\"text\"\n id=\"user-subscription-reddit_handle\"\n class=\"form-control\"\n formControlName=\"reddit_handle\"\n [attr.aria-label]=\"'User.Subscriptions.Details.RedditHandle' | transloco\" />\n </pw-input-container>\n </ng-container>\n\n <!-- 4. Seats -->\n <div class=\"col-12\">\n <div class=\"row seats-section\">\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.Seats' | transloco }}</h3>\n <p>{{ 'User.Subscriptions.Details.Seats.Description' | transloco }}</p>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n @if (subscription?.trial_subscription && subscription?.calculated_price) {\n <small\n class=\"text-danger\">{{ 'User.Subscriptions.Details.Seats.UpgradeRequired' | transloco }}</small>\n }\n </div>\n </div>\n <div class=\"row btns-row align-items-center\">\n @if (subscription) {\n <div class=\"col-md-3 col-8\"\n >\n <label for=\"user-subscription-seats\" class=\"visually-hidden\">{{ 'User.Subscriptions.Tooltip.Seats' | transloco }}</label>\n <pw-number-picker [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Seats'|transloco\"\n inputId=\"user-subscription-seats\"\n name=\"number-picker\"\n [(value)]=\"units\"\n [min]=\"subscription?.min_units||subscription?.products[0].min_units\"\n [max]=\"subscription?.products[0].max_units\"\n step=\"1\"\n [postfix]=\"'User.Subscriptions.Details.Seats.Postfix' | transloco\"\n [placeholder]=\"'User.Subscriptions.Details.Seats.Placeholder' | transloco\"\n [inputReadOnly]=\"subscription?.products[0].trial_subscription\"\n [showUpButton]=\"!subscription?.products[0].trial_subscription\"\n [showDownButton]=\"!subscription?.products[0].trial_subscription\"\n size=\"small\"\n pickStartAfter=\"500\"\n pickTimer=\"100\"\n [arrowKeys]=\"true\"\n (minReached)=\"onMinReached($event)\"\n (maxReached)=\"onMaxReached($event)\"\n (valueChange)=\"onUnitChange($event)\">\n </pw-number-picker>\n </div>\n }\n\n @if (subscription) {\n <div class=\"col-md-3 col-4 p-1\"\n >\n @if (!subscription?.products[0].trial_subscription && allowUpdate) {\n <button type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"updateUnits()\">\n {{ 'User.Subscriptions.UpdateUnits' | transloco }}\n </button>\n } @else {\n <div>\n @if (subscription?.products[0].trial_subscription) {\n <small class=\"text-muted\"\n >{{ 'User.Subscriptions.Details.Seats.PaidOnly' | transloco }}</small>\n }\n </div>\n }\n </div>\n }\n\n @if (hasUnitChanged) {\n <div class=\"col-12 col-md-6\"\n >\n <table class=\"table table-borderless table-sm\"\n aria-describedby=\"Product details\">\n <thead>\n <tr>\n <th scope=\"true\">{{ 'Label.Product' | transloco }}</th>\n <th scope=\"true\">{{ 'User.Subscriptions.Details.Seats.PricePerSeat' | transloco }} <span>({{subscription?.products[0]?.currency|currencySymbol}})</span></th>\n <th scope=\"true\">{{ 'User.Subscriptions.Details.Section.Seats' | transloco }}</th>\n </tr>\n </thead>\n <tbody>\n @for (product of subscription.products; track trackByProduct($index, product)) {\n <tr>\n <td>{{ product.name }}</td>\n <td>{{ product.price_per_unit / 100 }}</td>\n <td>{{ units }}</td>\n </tr>\n }\n </tbody>\n </table>\n <p>\n {{ 'User.Subscriptions.Details.Seats.NewCost' | transloco }}\n <strong>{{ totalAmount()| currency: subscription?.products[0]?.currency:'symbol-narrow'}}</strong>\n </p>\n </div>\n }\n </div>\n </div>\n\n <!-- 5. API & MCP Credentials -->\n @if (apiMcpEnabled && subscription?.api_hits_max > 0) {\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.APICredentials.Title' | transloco }}</h3>\n <p>\n {{ 'User.Subscriptions.Details.ApiIntro' | transloco }}\n </p>\n </div>\n <div class=\"col-md-6\">\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"user-subscription-api-token\">\n {{ 'User.Subscriptions.APICredentials.AccessToken' | transloco }}\n <span class=\"tooltip-wrap ms-1\"\n [pTooltip]=\"'User.Subscriptions.Details.Tooltip.TokenDiscontinued' | transloco\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"'top'\">\n <i class=\"far fa-info-circle text-muted\"></i>\n </span>\n </label>\n <div class=\"input-group\">\n <input type=\"text\"\n id=\"user-subscription-api-token\"\n name=\"api_token\"\n class=\"form-control\"\n [value]=\"showApiToken ? subscription?.api_access_token || ('User.Subscriptions.APICredentials.NoTokenAvailable' | transloco) : '*************************'\"\n readonly\n [attr.aria-label]=\"'User.Subscriptions.APICredentials.AccessToken' | 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-md-6\">\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"user-subscription-api-client-id\">{{ 'User.Subscriptions.APICredentials.ClientId' | transloco }}</label>\n <div class=\"input-group\">\n <input type=\"text\"\n id=\"user-subscription-api-client-id\"\n name=\"api_client_id\"\n class=\"form-control\"\n [value]=\"showApiClientId ? subscription?.api_client_id || ('User.Subscriptions.APICredentials.NoClientIdAvailable' | transloco) : '*************************'\"\n readonly\n [attr.aria-label]=\"'User.Subscriptions.APICredentials.ClientId' | 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 (subscription?.api_hits !== null) {\n <span class=\"text-muted\">{{ 'User.Subscriptions.APICredentials.ApiHits' | transloco }}:</span>\n <span class=\"fw-bold\">{{ subscription.api_hits | number }}</span>\n }\n @if (subscription?.api_hits_max !== null) {\n <span class=\"text-muted\">{{ 'User.Subscriptions.APICredentials.ApiHitsMax' | transloco }}:</span>\n <span class=\"fw-bold\">{{ subscription.api_hits_max | number }}</span>\n }\n <!-- Show utilization percentage when both values exist -->\n @if (subscription?.api_hits !== null || subscription?.api_hits_max !== null) {\n <span class=\"text-muted ms-2\">(</span>\n <span class=\"fw-bold\" [ngClass]=\"{\n 'text-success-muted': (subscription.api_hits / subscription.api_hits_max) <= 0.8,\n 'text-warning': (subscription.api_hits / subscription.api_hits_max) > 0.8 && (subscription.api_hits / subscription.api_hits_max) <= 0.9,\n 'text-danger': (subscription.api_hits / subscription.api_hits_max) > 0.9\n }\">\n {{ 'User.Subscriptions.Details.ApiConsumed' | transloco: { percent: ((subscription.api_hits / subscription.api_hits_max * 100) | number:'1.0-0') } }}\n </span>\n <span class=\"text-muted\">)</span>\n }\n </div>\n </div>\n </div>\n }\n\n <!-- 6. Security -->\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.Security' | transloco }}</h3>\n <p>\n {{ 'User.Subscriptions.Details.Security.Description' | transloco }}\n </p>\n </div>\n <div class=\"col-12 col-sm-3\">\n <pw-input-container [label]=\"'User.Subscriptions.Details.Enforce2fa' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Enforce2fa' | transloco\"\n name=\"enforce_2fa\"\n controlId=\"user-subscription-enforce_2fa\"\n [useAriaLabelledbyOnly]=\"true\">\n <ui-switch formControlName=\"enforce_2fa\"\n name=\"enforce_2fa\"\n [attr.aria-labelledby]=\"'user-subscription-enforce_2fa-label'\"> </ui-switch>\n </pw-input-container>\n </div>\n\n @if (aiAssistantEnabled) {\n <!-- 7. Brain AI data -->\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.BrainData.Title' | transloco: { brand: brandName } }}</h3>\n <p>{{ 'User.Subscriptions.BrainData.Description' | transloco: { brand: brandName } }}</p>\n </div>\n <div class=\"col-12 col-sm-3\">\n <pw-input-container [label]=\"'User.Subscriptions.BrainData.UseOwnDataLabel' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.RagUseOwnData' | transloco: { brand: brandName }\"\n name=\"rag_use_own_data\"\n controlId=\"user-subscription-rag_use_own_data\"\n [useAriaLabelledbyOnly]=\"true\">\n <ui-switch formControlName=\"rag_use_own_data\"\n name=\"rag_use_own_data\"\n [attr.aria-labelledby]=\"'user-subscription-rag_use_own_data-label'\"> </ui-switch>\n </pw-input-container>\n </div>\n <!-- Keeping personal data is a question about WHAT is kept, so it only\n arises while there is something to keep. Hidden rather than disabled:\n a greyed-out switch still reads as an affordance, and the stored value\n survives in the form either way. -->\n @if (form.value.rag_use_own_data) {\n <div class=\"col-12 col-sm-3\">\n <pw-input-container [label]=\"'User.Subscriptions.BrainData.KeepPiiLabel' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.RagKeepPii' | transloco: { brand: brandName }\"\n name=\"rag_keep_pii\"\n controlId=\"user-subscription-rag_keep_pii\"\n [useAriaLabelledbyOnly]=\"true\">\n <ui-switch formControlName=\"rag_keep_pii\"\n name=\"rag_keep_pii\"\n [attr.aria-labelledby]=\"'user-subscription-rag_keep_pii-label'\"> </ui-switch>\n </pw-input-container>\n </div>\n <!-- Slack history is also the subscription's own data, so it needs \"Use subscription data\" too. -->\n <div class=\"col-12 col-sm-3\">\n <pw-input-container [label]=\"'User.Subscriptions.BrainData.SlackHistoryLabel' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.RagSlackHistory' | transloco: { brand: brandName }\"\n name=\"rag_slack_history\"\n controlId=\"user-subscription-rag_slack_history\"\n [useAriaLabelledbyOnly]=\"true\">\n <ui-switch formControlName=\"rag_slack_history\"\n name=\"rag_slack_history\"\n [attr.aria-labelledby]=\"'user-subscription-rag_slack_history-label'\"> </ui-switch>\n </pw-input-container>\n </div>\n } @else {\n <div class=\"col-12 col-sm-6\">\n <p>{{ 'User.Subscriptions.BrainData.KeepPiiNotApplicable' | transloco: { brand: brandName } }}</p>\n </div>\n }\n }\n <pw-sticky-actions>\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n routerLink=\"/account/subscriptions\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button name=\"submit\"\n type=\"submit\"\n [buttonBusy]=\"busyButton\"\n class=\"btn btn-primary\">\n {{ 'Button.Submit' | transloco }}\n </button>\n </pw-sticky-actions>\n </form>\n}\n\n<ng-template #content\n let-modal>\n <div class=\"modal-header\">\n <h3 class=\"modal-title mb-0 p-0\">{{ 'User.Subscriptions.FullLogo' | 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\n </button>\n </div>\n <div class=\"modal-body\">\n <small> {{ 'User.Profile.PictureMessage' | transloco }}</small>\n <pw-image-cropper #profile\n (imageSelectionEvent)=\"onImageSelection($event)\"\n aspectRatio=\"fullLogo\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n</ng-template>\n<ng-template #squaredLogoContent\n let-modal>\n <div class=\"modal-header\">\n <h3 class=\"modal-title mb-0 p-0\">{{ 'User.Subscriptions.SquaredLogo' | 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\n </button>\n </div>\n <div class=\"modal-body\">\n <small> {{ 'User.Profile.PictureMessage' | transloco }}</small>\n <pw-image-cropper #profile\n (imageSelectionEvent)=\"uploadSquaredLogo($event)\"\n aspectRatio=\"auto\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n</ng-template>\n<pw-password-validation #modal\n(successEvent)=\"onPasswordValidation($event)\"> </pw-password-validation>\n",
|
|
3448
3855
|
styles: [":host{display:block}:host>.row:first-of-type h3{color:var(--titles, #222);font-size:24px;font-weight:700;letter-spacing:-.01em;line-height:1.18}:host form .col-12>h3,:host .seats-section>.col-12>h3,:host .branding-section>.col-12>h3{border-top:1px solid #e2e5ea;color:var(--titles, #222);display:block;font-size:18px;font-weight:600;margin-top:32px;padding-top:24px}:host form>.col-12:first-child>h3{border-top:0;margin-top:0;padding-top:0}:host form .col-12>p,:host .seats-section>.col-12>p{color:#5a6473;margin-bottom:16px}:host .row .text-center.mt-5{margin-top:16px!important;text-align:left!important}:host .image-container>h4{color:var(--titles, #222);font-size:14px;font-weight:600}:host .full-logo,:host .squared_logo{background:#f7f8fa;border:1px solid #e2e5ea;border-radius:8px;object-fit:contain;padding:12px}:host .full-logo{height:120px;width:280px}:host .squared_logo{height:150px;width:150px}:host .overlay{cursor:pointer;margin-top:8px}:host .overlay-text a{color:var(--first, #1769e1);cursor:pointer;font-weight:600}:host .overlay-text a:hover{text-decoration:underline}.sub-header{color:gray;font-size:20px;font-weight:600}@media only screen and (max-width:767px){.btns-row>[class*=col-]{flex:0 0 100%;max-width:100%}.btns-row .btn-primary{font-size:.8rem;margin-top:5px;padding:.375rem .5rem}}\n"],
|
|
3449
3856
|
dependencies: [
|
|
3450
3857
|
{
|
|
@@ -3830,7 +4237,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3830
4237
|
TranslocoPipe,
|
|
3831
4238
|
CurrencySymbolPipe
|
|
3832
4239
|
],
|
|
3833
|
-
template: "<!-- edit Subscription details page -->\n<div class=\"row\">\n <div class=\"col-12\">\n <h3 class=\"my-3\">{{ subscription?.organisation || subscription?.contact_name }}</h3>\n </div>\n</div>\n\n@if (subscription) {\n <form [formGroup]=\"form\"\n (ngSubmit)=\"onSaveDetails()\"\n class=\"row mt-4\"\n >\n <!-- 1. Contact details -->\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.Contact' | transloco }}</h3>\n </div>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.ContactName' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.ContactName' | transloco\"\n name=\"contact_name\"\n controlId=\"user-subscription-contact_name\"\n errorMsg=\"User.Account.Validation.ContactName\">\n <input type=\"text\"\n id=\"user-subscription-contact_name\"\n class=\"form-control\"\n formControlName=\"contact_name\"\n [attr.aria-label]=\"'User.Subscriptions.Details.ContactName' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.ContactEmail' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.ContactEmail' | transloco\"\n name=\"contact_email\"\n controlId=\"user-subscription-contact_email\"\n errorMsg=\"User.Subscriptions.Details.Validation.ContactEmail\">\n <input type=\"text\"\n id=\"user-subscription-contact_email\"\n class=\"form-control\"\n formControlName=\"contact_email\"\n [attr.aria-label]=\"'User.Subscriptions.Details.ContactEmail' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Organization' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.Organisation' | transloco\"\n name=\"organisation\"\n controlId=\"user-subscription-organisation\"\n errorMsg=\"User.Subscriptions.Details.Validation.Organisation\">\n <input type=\"text\"\n id=\"user-subscription-organisation\"\n class=\"form-control\"\n formControlName=\"organisation\"\n [attr.aria-label]=\"'User.Subscriptions.Details.Organisation' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Phone' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.ContactTel' | transloco\"\n name=\"contact_tel\"\n controlId=\"user-subscription-contact_tel\"\n errorMsg=\"User.Subscriptions.Details.Validation.ContactTel\">\n <input type=\"text\"\n id=\"user-subscription-contact_tel\"\n class=\"form-control\"\n formControlName=\"contact_tel\"\n [attr.aria-label]=\"'User.Subscriptions.Details.ContactTel' | transloco\" />\n </pw-input-container>\n @if (countries$ | async; as countries) {\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Country' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.Country' | transloco\"\n name=\"country_code\"\n controlId=\"user-subscription-country_code\"\n [useAriaLabelledbyOnly]=\"true\"\n [isLeftTooltip]=\"true\"\n errorMsg=\"User.Subscriptions.Details.Validation.Country\">\n <p-select\n [attr.aria-labelledby]=\"'user-subscription-country_code-label'\"\n [options]=\"countries\"\n optionLabel=\"name\"\n optionValue=\"code\"\n formControlName=\"country_code\"\n [placeholder]=\"'User.Profile.SelectCountry' | transloco\">\n </p-select>\n </pw-input-container>\n }\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Address' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.Address' | transloco\"\n name=\"address\"\n controlId=\"user-subscription-address\"\n [useAriaLabelledbyOnly]=\"true\"\n errorMsg=\"User.Subscriptions.Details.Validation.Address\">\n <input ngx-gp-autocomplete\n id=\"user-subscription-address\"\n name=\"address\"\n class=\"form-control\"\n [attr.aria-labelledby]=\"'user-subscription-address-label'\"\n #places=\"ngx-places\"\n formControlName=\"address\"\n (onAddressChange)=\"handleAddressChange($event)\"\n [attr.aria-label]=\"'User.Subscriptions.Details.Address' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.VatNumber' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.TaxId' | transloco\"\n name=\"tax_id\"\n controlId=\"user-subscription-tax_id\"\n errorMsg=\"User.Subscriptions.Details.Validation.TaxId\">\n <input type=\"text\"\n id=\"user-subscription-tax_id\"\n class=\"form-control\"\n formControlName=\"tax_id\"\n [attr.aria-label]=\"'User.Subscriptions.Details.TaxId' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.CompanyUrl' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.CompanyUrl' | transloco\"\n name=\"company_url\"\n controlId=\"user-subscription-company_url\"\n errorMsg=\"User.Subscriptions.Details.Validation.CompanyUrl\">\n <input type=\"text\"\n id=\"user-subscription-company_url\"\n class=\"form-control\"\n formControlName=\"company_url\"\n [attr.aria-label]=\"'User.Subscriptions.Details.CompanyUrl' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.InvoiceRecipientEmails' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.InvoiceRecipientEmails' | transloco\"\n name=\"invoice_recipient_emails\"\n controlId=\"user-subscription-invoice_recipient_emails\"\n errorMsg=\"User.Subscriptions.Details.Validation.InvoiceRecipientEmails\">\n <input type=\"text\"\n id=\"user-subscription-invoice_recipient_emails\"\n class=\"form-control\"\n formControlName=\"invoice_recipient_emails\"\n [placeholder]=\"'User.Subscriptions.Details.Placeholder.InvoiceRecipientEmails' | transloco\"\n [attr.aria-label]=\"'User.Subscriptions.Details.InvoiceRecipientEmails' | transloco\" />\n </pw-input-container>\n\n <!-- 2. Branding / Logos -->\n <div class=\"col-12\">\n <div class=\"row branding-section\">\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.Branding' | transloco }}</h3>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-md-6\">\n <div class=\"text-center mt-5\">\n <div class=\"image-container\">\n <h4 class=\"mb-2\">{{ 'User.Subscriptions.FullLogo' | transloco }}\n <span class=\"tooltip-wrap ms-1\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.FullLogo'|transloco\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"'top'\">\n <i class=\"far fa-info-circle text-muted\"></i>\n </span>\n </h4>\n @if (fullLogo && !fullLogo.includes('no_image_uploaded') && !fullLogoBroken) {\n <img [src]=\"fullLogo\"\n [alt]=\"'User.Subscriptions.Details.Logo.FullAlt' | transloco\"\n class=\"image full-logo\"\n role=\"presentation\"\n (error)=\"fullLogoBroken = true\" />\n <div class=\"overlay mt-2\"\n (keydown.enter)=\"openModal(content)\"\n (click)=\"openModal(content)\">\n <div class=\"overlay-text\">\n <a [attr.aria-label]=\"'User.Profile.Change' | transloco\">{{ 'User.Profile.Change' | transloco }}</a>\n </div>\n </div>\n } @else {\n <div class=\"logo-dropzone full-dropzone\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'User.Subscriptions.Details.Logo.UploadFull' | transloco\"\n (keydown.enter)=\"openModal(content)\"\n (click)=\"openModal(content)\">\n <i class=\"fas fa-upload\"></i>\n <span class=\"dropzone-title\">{{ 'User.Subscriptions.Details.Logo.Upload' | transloco }}</span>\n <span class=\"dropzone-hint\">{{ 'User.Subscriptions.Details.Logo.FileTypes' | transloco }}</span>\n </div>\n }\n </div>\n </div>\n </div>\n <div class=\"col-md-6\">\n <div class=\"text-center mt-5\">\n <div class=\"image-container\">\n <h4 class=\"mb-2\">{{ 'User.Subscriptions.SquaredLogo' | transloco }}\n <span class=\"tooltip-wrap ms-1\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.SquaredLogo'|transloco\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"'top'\">\n <i class=\"far fa-info-circle text-muted\"></i>\n </span>\n </h4>\n @if (squaredLogo && !squaredLogo.includes('no_image_uploaded') && !squaredLogoBroken) {\n <img [src]=\"squaredLogo\"\n [alt]=\"'User.Subscriptions.Details.Logo.SquaredAlt' | transloco\"\n class=\"squared_logo\"\n role=\"presentation\"\n (error)=\"squaredLogoBroken = true\" />\n <div class=\"overlay mt-2\"\n (keydown.enter)=\"openModal(squaredLogoContent)\"\n (click)=\"openModal(squaredLogoContent)\">\n <div class=\"overlay-text\">\n <a [attr.aria-label]=\"'User.Profile.Change' | transloco\">{{ 'User.Profile.Change' | transloco }}</a>\n </div>\n </div>\n } @else {\n <div class=\"logo-dropzone squared-dropzone\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'User.Subscriptions.Details.Logo.UploadSquared' | transloco\"\n (keydown.enter)=\"openModal(squaredLogoContent)\"\n (click)=\"openModal(squaredLogoContent)\">\n <i class=\"fas fa-upload\"></i>\n <span class=\"dropzone-title\">{{ 'User.Subscriptions.Details.Logo.Upload' | transloco }}</span>\n <span class=\"dropzone-hint\">{{ 'User.Subscriptions.Details.Logo.FileTypes' | transloco }}</span>\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <!-- 3. Social Media -->\n <ng-container *rbacAllow=\"'SubscriptionSuperAdmin'\">\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.SocialMedia' | transloco }}</h3>\n <p>\n {{ 'User.Subscriptions.Details.SocialMedia.Description' | transloco }}\n </p>\n </div>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.FacebookHandle' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.FacebookHandle' | transloco\"\n name=\"facebook_handle\"\n controlId=\"user-subscription-facebook_handle\"\n errorMsg=\"User.Subscriptions.Details.Validation.FacebookHandle\">\n <input type=\"text\"\n id=\"user-subscription-facebook_handle\"\n class=\"form-control\"\n formControlName=\"facebook_handle\"\n [attr.aria-label]=\"'User.Subscriptions.Details.FacebookHandle' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.TwitterHandle' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.TwitterHandle' | transloco\"\n name=\"twitter_handle\"\n controlId=\"user-subscription-twitter_handle\"\n errorMsg=\"User.Subscriptions.Details.Validation.TwitterHandle\">\n <input type=\"text\"\n id=\"user-subscription-twitter_handle\"\n class=\"form-control\"\n formControlName=\"twitter_handle\"\n [attr.aria-label]=\"'User.Subscriptions.Details.TwitterHandle' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.LinkedinHandle' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.LinkedinHandle' | transloco\"\n name=\"linkedin_handle\"\n controlId=\"user-subscription-linkedin_handle\"\n errorMsg=\"User.Subscriptions.Details.Validation.LinkedinHandle\">\n <input type=\"text\"\n id=\"user-subscription-linkedin_handle\"\n class=\"form-control\"\n formControlName=\"linkedin_handle\"\n [attr.aria-label]=\"'User.Subscriptions.Details.LinkedinHandle' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.RedditHandle' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.RedditHandle' | transloco\"\n name=\"reddit_handle\"\n controlId=\"user-subscription-reddit_handle\"\n errorMsg=\"User.Subscriptions.Details.Validation.RedditHandle\">\n <input type=\"text\"\n id=\"user-subscription-reddit_handle\"\n class=\"form-control\"\n formControlName=\"reddit_handle\"\n [attr.aria-label]=\"'User.Subscriptions.Details.RedditHandle' | transloco\" />\n </pw-input-container>\n </ng-container>\n\n <!-- 4. Seats -->\n <div class=\"col-12\">\n <div class=\"row seats-section\">\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.Seats' | transloco }}</h3>\n <p>{{ 'User.Subscriptions.Details.Seats.Description' | transloco }}</p>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n @if (subscription?.trial_subscription && subscription?.calculated_price) {\n <small\n class=\"text-danger\">{{ 'User.Subscriptions.Details.Seats.UpgradeRequired' | transloco }}</small>\n }\n </div>\n </div>\n <div class=\"row btns-row align-items-center\">\n @if (subscription) {\n <div class=\"col-md-3 col-8\"\n >\n <label for=\"user-subscription-seats\" class=\"visually-hidden\">{{ 'User.Subscriptions.Tooltip.Seats' | transloco }}</label>\n <pw-number-picker [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Seats'|transloco\"\n inputId=\"user-subscription-seats\"\n name=\"number-picker\"\n [(value)]=\"units\"\n [min]=\"subscription?.min_units||subscription?.products[0].min_units\"\n [max]=\"subscription?.products[0].max_units\"\n step=\"1\"\n [postfix]=\"'User.Subscriptions.Details.Seats.Postfix' | transloco\"\n [placeholder]=\"'User.Subscriptions.Details.Seats.Placeholder' | transloco\"\n [inputReadOnly]=\"subscription?.products[0].trial_subscription\"\n [showUpButton]=\"!subscription?.products[0].trial_subscription\"\n [showDownButton]=\"!subscription?.products[0].trial_subscription\"\n size=\"small\"\n pickStartAfter=\"500\"\n pickTimer=\"100\"\n [arrowKeys]=\"true\"\n (minReached)=\"onMinReached($event)\"\n (maxReached)=\"onMaxReached($event)\"\n (valueChange)=\"onUnitChange($event)\">\n </pw-number-picker>\n </div>\n }\n\n @if (subscription) {\n <div class=\"col-md-3 col-4 p-1\"\n >\n @if (!subscription?.products[0].trial_subscription && allowUpdate) {\n <button type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"updateUnits()\">\n {{ 'User.Subscriptions.UpdateUnits' | transloco }}\n </button>\n } @else {\n <div>\n @if (subscription?.products[0].trial_subscription) {\n <small class=\"text-muted\"\n >{{ 'User.Subscriptions.Details.Seats.PaidOnly' | transloco }}</small>\n }\n </div>\n }\n </div>\n }\n\n @if (hasUnitChanged) {\n <div class=\"col-12 col-md-6\"\n >\n <table class=\"table table-borderless table-sm\"\n aria-describedby=\"Product details\">\n <thead>\n <tr>\n <th scope=\"true\">{{ 'Label.Product' | transloco }}</th>\n <th scope=\"true\">{{ 'User.Subscriptions.Details.Seats.PricePerSeat' | transloco }} <span>({{subscription?.products[0]?.currency|currencySymbol}})</span></th>\n <th scope=\"true\">{{ 'User.Subscriptions.Details.Section.Seats' | transloco }}</th>\n </tr>\n </thead>\n <tbody>\n @for (product of subscription.products; track trackByProduct($index, product)) {\n <tr>\n <td>{{ product.name }}</td>\n <td>{{ product.price_per_unit / 100 }}</td>\n <td>{{ units }}</td>\n </tr>\n }\n </tbody>\n </table>\n <p>\n {{ 'User.Subscriptions.Details.Seats.NewCost' | transloco }}\n <strong>{{ totalAmount()| currency: subscription?.products[0]?.currency:'symbol-narrow'}}</strong>\n </p>\n </div>\n }\n </div>\n </div>\n\n <!-- 5. API & MCP Credentials -->\n @if (subscription?.api_hits_max > 0) {\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.APICredentials.Title' | transloco }}</h3>\n <p>\n {{ 'User.Subscriptions.Details.ApiIntro' | transloco }}\n </p>\n </div>\n <div class=\"col-md-6\">\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"user-subscription-api-token\">\n {{ 'User.Subscriptions.APICredentials.AccessToken' | transloco }}\n <span class=\"tooltip-wrap ms-1\"\n [pTooltip]=\"'User.Subscriptions.Details.Tooltip.TokenDiscontinued' | transloco\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"'top'\">\n <i class=\"far fa-info-circle text-muted\"></i>\n </span>\n </label>\n <div class=\"input-group\">\n <input type=\"text\"\n id=\"user-subscription-api-token\"\n name=\"api_token\"\n class=\"form-control\"\n [value]=\"showApiToken ? subscription?.api_access_token || ('User.Subscriptions.APICredentials.NoTokenAvailable' | transloco) : '*************************'\"\n readonly\n [attr.aria-label]=\"'User.Subscriptions.APICredentials.AccessToken' | 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-md-6\">\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"user-subscription-api-client-id\">{{ 'User.Subscriptions.APICredentials.ClientId' | transloco }}</label>\n <div class=\"input-group\">\n <input type=\"text\"\n id=\"user-subscription-api-client-id\"\n name=\"api_client_id\"\n class=\"form-control\"\n [value]=\"showApiClientId ? subscription?.api_client_id || ('User.Subscriptions.APICredentials.NoClientIdAvailable' | transloco) : '*************************'\"\n readonly\n [attr.aria-label]=\"'User.Subscriptions.APICredentials.ClientId' | 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 (subscription?.api_hits !== null) {\n <span class=\"text-muted\">{{ 'User.Subscriptions.APICredentials.ApiHits' | transloco }}:</span>\n <span class=\"fw-bold\">{{ subscription.api_hits | number }}</span>\n }\n @if (subscription?.api_hits_max !== null) {\n <span class=\"text-muted\">{{ 'User.Subscriptions.APICredentials.ApiHitsMax' | transloco }}:</span>\n <span class=\"fw-bold\">{{ subscription.api_hits_max | number }}</span>\n }\n <!-- Show utilization percentage when both values exist -->\n @if (subscription?.api_hits !== null || subscription?.api_hits_max !== null) {\n <span class=\"text-muted ms-2\">(</span>\n <span class=\"fw-bold\" [ngClass]=\"{\n 'text-success-muted': (subscription.api_hits / subscription.api_hits_max) <= 0.8,\n 'text-warning': (subscription.api_hits / subscription.api_hits_max) > 0.8 && (subscription.api_hits / subscription.api_hits_max) <= 0.9,\n 'text-danger': (subscription.api_hits / subscription.api_hits_max) > 0.9\n }\">\n {{ 'User.Subscriptions.Details.ApiConsumed' | transloco: { percent: ((subscription.api_hits / subscription.api_hits_max * 100) | number:'1.0-0') } }}\n </span>\n <span class=\"text-muted\">)</span>\n }\n </div>\n </div>\n </div>\n }\n\n <!-- 6. Security -->\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.Security' | transloco }}</h3>\n <p>\n {{ 'User.Subscriptions.Details.Security.Description' | transloco }}\n </p>\n </div>\n <div class=\"col-12 col-sm-3\">\n <pw-input-container [label]=\"'User.Subscriptions.Details.Enforce2fa' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Enforce2fa' | transloco\"\n name=\"enforce_2fa\"\n controlId=\"user-subscription-enforce_2fa\"\n [useAriaLabelledbyOnly]=\"true\">\n <ui-switch formControlName=\"enforce_2fa\"\n name=\"enforce_2fa\"\n [attr.aria-labelledby]=\"'user-subscription-enforce_2fa-label'\"> </ui-switch>\n </pw-input-container>\n </div>\n\n <!-- 7. Brain AI data -->\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.BrainData.Title' | transloco: { brand: brandName } }}</h3>\n <p>{{ 'User.Subscriptions.BrainData.Description' | transloco: { brand: brandName } }}</p>\n </div>\n <div class=\"col-12 col-sm-3\">\n <pw-input-container [label]=\"'User.Subscriptions.BrainData.UseOwnDataLabel' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.RagUseOwnData' | transloco: { brand: brandName }\"\n name=\"rag_use_own_data\"\n controlId=\"user-subscription-rag_use_own_data\"\n [useAriaLabelledbyOnly]=\"true\">\n <ui-switch formControlName=\"rag_use_own_data\"\n name=\"rag_use_own_data\"\n [attr.aria-labelledby]=\"'user-subscription-rag_use_own_data-label'\"> </ui-switch>\n </pw-input-container>\n </div>\n <!-- Keeping personal data is a question about WHAT is kept, so it only\n arises while there is something to keep. Hidden rather than disabled:\n a greyed-out switch still reads as an affordance, and the stored value\n survives in the form either way. -->\n @if (form.value.rag_use_own_data) {\n <div class=\"col-12 col-sm-3\">\n <pw-input-container [label]=\"'User.Subscriptions.BrainData.KeepPiiLabel' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.RagKeepPii' | transloco: { brand: brandName }\"\n name=\"rag_keep_pii\"\n controlId=\"user-subscription-rag_keep_pii\"\n [useAriaLabelledbyOnly]=\"true\">\n <ui-switch formControlName=\"rag_keep_pii\"\n name=\"rag_keep_pii\"\n [attr.aria-labelledby]=\"'user-subscription-rag_keep_pii-label'\"> </ui-switch>\n </pw-input-container>\n </div>\n <!-- Slack history is also the subscription's own data, so it needs \"Use subscription data\" too. -->\n <div class=\"col-12 col-sm-3\">\n <pw-input-container [label]=\"'User.Subscriptions.BrainData.SlackHistoryLabel' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.RagSlackHistory' | transloco: { brand: brandName }\"\n name=\"rag_slack_history\"\n controlId=\"user-subscription-rag_slack_history\"\n [useAriaLabelledbyOnly]=\"true\">\n <ui-switch formControlName=\"rag_slack_history\"\n name=\"rag_slack_history\"\n [attr.aria-labelledby]=\"'user-subscription-rag_slack_history-label'\"> </ui-switch>\n </pw-input-container>\n </div>\n } @else {\n <div class=\"col-12 col-sm-6\">\n <p>{{ 'User.Subscriptions.BrainData.KeepPiiNotApplicable' | transloco: { brand: brandName } }}</p>\n </div>\n }\n <pw-sticky-actions>\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n routerLink=\"/account/subscriptions\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button name=\"submit\"\n type=\"submit\"\n [buttonBusy]=\"busyButton\"\n class=\"btn btn-primary\">\n {{ 'Button.Submit' | transloco }}\n </button>\n </pw-sticky-actions>\n </form>\n}\n\n<ng-template #content\n let-modal>\n <div class=\"modal-header\">\n <h3 class=\"modal-title mb-0 p-0\">{{ 'User.Subscriptions.FullLogo' | 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\n </button>\n </div>\n <div class=\"modal-body\">\n <small> {{ 'User.Profile.PictureMessage' | transloco }}</small>\n <pw-image-cropper #profile\n (imageSelectionEvent)=\"onImageSelection($event)\"\n aspectRatio=\"fullLogo\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n</ng-template>\n<ng-template #squaredLogoContent\n let-modal>\n <div class=\"modal-header\">\n <h3 class=\"modal-title mb-0 p-0\">{{ 'User.Subscriptions.SquaredLogo' | 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\n </button>\n </div>\n <div class=\"modal-body\">\n <small> {{ 'User.Profile.PictureMessage' | transloco }}</small>\n <pw-image-cropper #profile\n (imageSelectionEvent)=\"uploadSquaredLogo($event)\"\n aspectRatio=\"auto\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n</ng-template>\n<pw-password-validation #modal\n(successEvent)=\"onPasswordValidation($event)\"> </pw-password-validation>\n",
|
|
4240
|
+
template: "<!-- edit Subscription details page -->\n<div class=\"row\">\n <div class=\"col-12\">\n <h3 class=\"my-3\">{{ subscription?.organisation || subscription?.contact_name }}</h3>\n </div>\n</div>\n\n@if (subscription) {\n <form [formGroup]=\"form\"\n (ngSubmit)=\"onSaveDetails()\"\n class=\"row mt-4\"\n >\n <!-- 1. Contact details -->\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.Contact' | transloco }}</h3>\n </div>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.ContactName' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.ContactName' | transloco\"\n name=\"contact_name\"\n controlId=\"user-subscription-contact_name\"\n errorMsg=\"User.Account.Validation.ContactName\">\n <input type=\"text\"\n id=\"user-subscription-contact_name\"\n class=\"form-control\"\n formControlName=\"contact_name\"\n [attr.aria-label]=\"'User.Subscriptions.Details.ContactName' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.ContactEmail' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.ContactEmail' | transloco\"\n name=\"contact_email\"\n controlId=\"user-subscription-contact_email\"\n errorMsg=\"User.Subscriptions.Details.Validation.ContactEmail\">\n <input type=\"text\"\n id=\"user-subscription-contact_email\"\n class=\"form-control\"\n formControlName=\"contact_email\"\n [attr.aria-label]=\"'User.Subscriptions.Details.ContactEmail' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Organization' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.Organisation' | transloco\"\n name=\"organisation\"\n controlId=\"user-subscription-organisation\"\n errorMsg=\"User.Subscriptions.Details.Validation.Organisation\">\n <input type=\"text\"\n id=\"user-subscription-organisation\"\n class=\"form-control\"\n formControlName=\"organisation\"\n [attr.aria-label]=\"'User.Subscriptions.Details.Organisation' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Phone' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.ContactTel' | transloco\"\n name=\"contact_tel\"\n controlId=\"user-subscription-contact_tel\"\n errorMsg=\"User.Subscriptions.Details.Validation.ContactTel\">\n <input type=\"text\"\n id=\"user-subscription-contact_tel\"\n class=\"form-control\"\n formControlName=\"contact_tel\"\n [attr.aria-label]=\"'User.Subscriptions.Details.ContactTel' | transloco\" />\n </pw-input-container>\n @if (countries$ | async; as countries) {\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Country' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.Country' | transloco\"\n name=\"country_code\"\n controlId=\"user-subscription-country_code\"\n [useAriaLabelledbyOnly]=\"true\"\n [isLeftTooltip]=\"true\"\n errorMsg=\"User.Subscriptions.Details.Validation.Country\">\n <p-select\n [attr.aria-labelledby]=\"'user-subscription-country_code-label'\"\n [options]=\"countries\"\n optionLabel=\"name\"\n optionValue=\"code\"\n formControlName=\"country_code\"\n [placeholder]=\"'User.Profile.SelectCountry' | transloco\">\n </p-select>\n </pw-input-container>\n }\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Address' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.Address' | transloco\"\n name=\"address\"\n controlId=\"user-subscription-address\"\n [useAriaLabelledbyOnly]=\"true\"\n errorMsg=\"User.Subscriptions.Details.Validation.Address\">\n <input ngx-gp-autocomplete\n id=\"user-subscription-address\"\n name=\"address\"\n class=\"form-control\"\n [attr.aria-labelledby]=\"'user-subscription-address-label'\"\n #places=\"ngx-places\"\n formControlName=\"address\"\n (onAddressChange)=\"handleAddressChange($event)\"\n [attr.aria-label]=\"'User.Subscriptions.Details.Address' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.VatNumber' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.TaxId' | transloco\"\n name=\"tax_id\"\n controlId=\"user-subscription-tax_id\"\n errorMsg=\"User.Subscriptions.Details.Validation.TaxId\">\n <input type=\"text\"\n id=\"user-subscription-tax_id\"\n class=\"form-control\"\n formControlName=\"tax_id\"\n [attr.aria-label]=\"'User.Subscriptions.Details.TaxId' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.CompanyUrl' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.CompanyUrl' | transloco\"\n name=\"company_url\"\n controlId=\"user-subscription-company_url\"\n errorMsg=\"User.Subscriptions.Details.Validation.CompanyUrl\">\n <input type=\"text\"\n id=\"user-subscription-company_url\"\n class=\"form-control\"\n formControlName=\"company_url\"\n [attr.aria-label]=\"'User.Subscriptions.Details.CompanyUrl' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.InvoiceRecipientEmails' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.InvoiceRecipientEmails' | transloco\"\n name=\"invoice_recipient_emails\"\n controlId=\"user-subscription-invoice_recipient_emails\"\n errorMsg=\"User.Subscriptions.Details.Validation.InvoiceRecipientEmails\">\n <input type=\"text\"\n id=\"user-subscription-invoice_recipient_emails\"\n class=\"form-control\"\n formControlName=\"invoice_recipient_emails\"\n [placeholder]=\"'User.Subscriptions.Details.Placeholder.InvoiceRecipientEmails' | transloco\"\n [attr.aria-label]=\"'User.Subscriptions.Details.InvoiceRecipientEmails' | transloco\" />\n </pw-input-container>\n\n <!-- 2. Branding / Logos -->\n <div class=\"col-12\">\n <div class=\"row branding-section\">\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.Branding' | transloco }}</h3>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-md-6\">\n <div class=\"text-center mt-5\">\n <div class=\"image-container\">\n <h4 class=\"mb-2\">{{ 'User.Subscriptions.FullLogo' | transloco }}\n <span class=\"tooltip-wrap ms-1\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.FullLogo'|transloco\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"'top'\">\n <i class=\"far fa-info-circle text-muted\"></i>\n </span>\n </h4>\n @if (fullLogo && !fullLogo.includes('no_image_uploaded') && !fullLogoBroken) {\n <img [src]=\"fullLogo\"\n [alt]=\"'User.Subscriptions.Details.Logo.FullAlt' | transloco\"\n class=\"image full-logo\"\n role=\"presentation\"\n (error)=\"fullLogoBroken = true\" />\n <div class=\"overlay mt-2\"\n (keydown.enter)=\"openModal(content)\"\n (click)=\"openModal(content)\">\n <div class=\"overlay-text\">\n <a [attr.aria-label]=\"'User.Profile.Change' | transloco\">{{ 'User.Profile.Change' | transloco }}</a>\n </div>\n </div>\n } @else {\n <div class=\"logo-dropzone full-dropzone\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'User.Subscriptions.Details.Logo.UploadFull' | transloco\"\n (keydown.enter)=\"openModal(content)\"\n (click)=\"openModal(content)\">\n <i class=\"fas fa-upload\"></i>\n <span class=\"dropzone-title\">{{ 'User.Subscriptions.Details.Logo.Upload' | transloco }}</span>\n <span class=\"dropzone-hint\">{{ 'User.Subscriptions.Details.Logo.FileTypes' | transloco }}</span>\n </div>\n }\n </div>\n </div>\n </div>\n <div class=\"col-md-6\">\n <div class=\"text-center mt-5\">\n <div class=\"image-container\">\n <h4 class=\"mb-2\">{{ 'User.Subscriptions.SquaredLogo' | transloco }}\n <span class=\"tooltip-wrap ms-1\"\n [pTooltip]=\"'User.Subscriptions.Tooltip.SquaredLogo'|transloco\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"'top'\">\n <i class=\"far fa-info-circle text-muted\"></i>\n </span>\n </h4>\n @if (squaredLogo && !squaredLogo.includes('no_image_uploaded') && !squaredLogoBroken) {\n <img [src]=\"squaredLogo\"\n [alt]=\"'User.Subscriptions.Details.Logo.SquaredAlt' | transloco\"\n class=\"squared_logo\"\n role=\"presentation\"\n (error)=\"squaredLogoBroken = true\" />\n <div class=\"overlay mt-2\"\n (keydown.enter)=\"openModal(squaredLogoContent)\"\n (click)=\"openModal(squaredLogoContent)\">\n <div class=\"overlay-text\">\n <a [attr.aria-label]=\"'User.Profile.Change' | transloco\">{{ 'User.Profile.Change' | transloco }}</a>\n </div>\n </div>\n } @else {\n <div class=\"logo-dropzone squared-dropzone\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'User.Subscriptions.Details.Logo.UploadSquared' | transloco\"\n (keydown.enter)=\"openModal(squaredLogoContent)\"\n (click)=\"openModal(squaredLogoContent)\">\n <i class=\"fas fa-upload\"></i>\n <span class=\"dropzone-title\">{{ 'User.Subscriptions.Details.Logo.Upload' | transloco }}</span>\n <span class=\"dropzone-hint\">{{ 'User.Subscriptions.Details.Logo.FileTypes' | transloco }}</span>\n </div>\n }\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <!-- 3. Social Media -->\n <ng-container *rbacAllow=\"'SubscriptionSuperAdmin'\">\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.SocialMedia' | transloco }}</h3>\n <p>\n {{ 'User.Subscriptions.Details.SocialMedia.Description' | transloco }}\n </p>\n </div>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.FacebookHandle' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.FacebookHandle' | transloco\"\n name=\"facebook_handle\"\n controlId=\"user-subscription-facebook_handle\"\n errorMsg=\"User.Subscriptions.Details.Validation.FacebookHandle\">\n <input type=\"text\"\n id=\"user-subscription-facebook_handle\"\n class=\"form-control\"\n formControlName=\"facebook_handle\"\n [attr.aria-label]=\"'User.Subscriptions.Details.FacebookHandle' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.TwitterHandle' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.TwitterHandle' | transloco\"\n name=\"twitter_handle\"\n controlId=\"user-subscription-twitter_handle\"\n errorMsg=\"User.Subscriptions.Details.Validation.TwitterHandle\">\n <input type=\"text\"\n id=\"user-subscription-twitter_handle\"\n class=\"form-control\"\n formControlName=\"twitter_handle\"\n [attr.aria-label]=\"'User.Subscriptions.Details.TwitterHandle' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.LinkedinHandle' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.LinkedinHandle' | transloco\"\n name=\"linkedin_handle\"\n controlId=\"user-subscription-linkedin_handle\"\n errorMsg=\"User.Subscriptions.Details.Validation.LinkedinHandle\">\n <input type=\"text\"\n id=\"user-subscription-linkedin_handle\"\n class=\"form-control\"\n formControlName=\"linkedin_handle\"\n [attr.aria-label]=\"'User.Subscriptions.Details.LinkedinHandle' | transloco\" />\n </pw-input-container>\n <pw-input-container [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.RedditHandle' | transloco\"\n class=\"col-md-6\"\n [label]=\"'User.Subscriptions.Details.RedditHandle' | transloco\"\n name=\"reddit_handle\"\n controlId=\"user-subscription-reddit_handle\"\n errorMsg=\"User.Subscriptions.Details.Validation.RedditHandle\">\n <input type=\"text\"\n id=\"user-subscription-reddit_handle\"\n class=\"form-control\"\n formControlName=\"reddit_handle\"\n [attr.aria-label]=\"'User.Subscriptions.Details.RedditHandle' | transloco\" />\n </pw-input-container>\n </ng-container>\n\n <!-- 4. Seats -->\n <div class=\"col-12\">\n <div class=\"row seats-section\">\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.Seats' | transloco }}</h3>\n <p>{{ 'User.Subscriptions.Details.Seats.Description' | transloco }}</p>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n @if (subscription?.trial_subscription && subscription?.calculated_price) {\n <small\n class=\"text-danger\">{{ 'User.Subscriptions.Details.Seats.UpgradeRequired' | transloco }}</small>\n }\n </div>\n </div>\n <div class=\"row btns-row align-items-center\">\n @if (subscription) {\n <div class=\"col-md-3 col-8\"\n >\n <label for=\"user-subscription-seats\" class=\"visually-hidden\">{{ 'User.Subscriptions.Tooltip.Seats' | transloco }}</label>\n <pw-number-picker [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Seats'|transloco\"\n inputId=\"user-subscription-seats\"\n name=\"number-picker\"\n [(value)]=\"units\"\n [min]=\"subscription?.min_units||subscription?.products[0].min_units\"\n [max]=\"subscription?.products[0].max_units\"\n step=\"1\"\n [postfix]=\"'User.Subscriptions.Details.Seats.Postfix' | transloco\"\n [placeholder]=\"'User.Subscriptions.Details.Seats.Placeholder' | transloco\"\n [inputReadOnly]=\"subscription?.products[0].trial_subscription\"\n [showUpButton]=\"!subscription?.products[0].trial_subscription\"\n [showDownButton]=\"!subscription?.products[0].trial_subscription\"\n size=\"small\"\n pickStartAfter=\"500\"\n pickTimer=\"100\"\n [arrowKeys]=\"true\"\n (minReached)=\"onMinReached($event)\"\n (maxReached)=\"onMaxReached($event)\"\n (valueChange)=\"onUnitChange($event)\">\n </pw-number-picker>\n </div>\n }\n\n @if (subscription) {\n <div class=\"col-md-3 col-4 p-1\"\n >\n @if (!subscription?.products[0].trial_subscription && allowUpdate) {\n <button type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"updateUnits()\">\n {{ 'User.Subscriptions.UpdateUnits' | transloco }}\n </button>\n } @else {\n <div>\n @if (subscription?.products[0].trial_subscription) {\n <small class=\"text-muted\"\n >{{ 'User.Subscriptions.Details.Seats.PaidOnly' | transloco }}</small>\n }\n </div>\n }\n </div>\n }\n\n @if (hasUnitChanged) {\n <div class=\"col-12 col-md-6\"\n >\n <table class=\"table table-borderless table-sm\"\n aria-describedby=\"Product details\">\n <thead>\n <tr>\n <th scope=\"true\">{{ 'Label.Product' | transloco }}</th>\n <th scope=\"true\">{{ 'User.Subscriptions.Details.Seats.PricePerSeat' | transloco }} <span>({{subscription?.products[0]?.currency|currencySymbol}})</span></th>\n <th scope=\"true\">{{ 'User.Subscriptions.Details.Section.Seats' | transloco }}</th>\n </tr>\n </thead>\n <tbody>\n @for (product of subscription.products; track trackByProduct($index, product)) {\n <tr>\n <td>{{ product.name }}</td>\n <td>{{ product.price_per_unit / 100 }}</td>\n <td>{{ units }}</td>\n </tr>\n }\n </tbody>\n </table>\n <p>\n {{ 'User.Subscriptions.Details.Seats.NewCost' | transloco }}\n <strong>{{ totalAmount()| currency: subscription?.products[0]?.currency:'symbol-narrow'}}</strong>\n </p>\n </div>\n }\n </div>\n </div>\n\n <!-- 5. API & MCP Credentials -->\n @if (apiMcpEnabled && subscription?.api_hits_max > 0) {\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.APICredentials.Title' | transloco }}</h3>\n <p>\n {{ 'User.Subscriptions.Details.ApiIntro' | transloco }}\n </p>\n </div>\n <div class=\"col-md-6\">\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"user-subscription-api-token\">\n {{ 'User.Subscriptions.APICredentials.AccessToken' | transloco }}\n <span class=\"tooltip-wrap ms-1\"\n [pTooltip]=\"'User.Subscriptions.Details.Tooltip.TokenDiscontinued' | transloco\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"'top'\">\n <i class=\"far fa-info-circle text-muted\"></i>\n </span>\n </label>\n <div class=\"input-group\">\n <input type=\"text\"\n id=\"user-subscription-api-token\"\n name=\"api_token\"\n class=\"form-control\"\n [value]=\"showApiToken ? subscription?.api_access_token || ('User.Subscriptions.APICredentials.NoTokenAvailable' | transloco) : '*************************'\"\n readonly\n [attr.aria-label]=\"'User.Subscriptions.APICredentials.AccessToken' | 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-md-6\">\n <div class=\"form-group\">\n <label class=\"form-label\" for=\"user-subscription-api-client-id\">{{ 'User.Subscriptions.APICredentials.ClientId' | transloco }}</label>\n <div class=\"input-group\">\n <input type=\"text\"\n id=\"user-subscription-api-client-id\"\n name=\"api_client_id\"\n class=\"form-control\"\n [value]=\"showApiClientId ? subscription?.api_client_id || ('User.Subscriptions.APICredentials.NoClientIdAvailable' | transloco) : '*************************'\"\n readonly\n [attr.aria-label]=\"'User.Subscriptions.APICredentials.ClientId' | 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 (subscription?.api_hits !== null) {\n <span class=\"text-muted\">{{ 'User.Subscriptions.APICredentials.ApiHits' | transloco }}:</span>\n <span class=\"fw-bold\">{{ subscription.api_hits | number }}</span>\n }\n @if (subscription?.api_hits_max !== null) {\n <span class=\"text-muted\">{{ 'User.Subscriptions.APICredentials.ApiHitsMax' | transloco }}:</span>\n <span class=\"fw-bold\">{{ subscription.api_hits_max | number }}</span>\n }\n <!-- Show utilization percentage when both values exist -->\n @if (subscription?.api_hits !== null || subscription?.api_hits_max !== null) {\n <span class=\"text-muted ms-2\">(</span>\n <span class=\"fw-bold\" [ngClass]=\"{\n 'text-success-muted': (subscription.api_hits / subscription.api_hits_max) <= 0.8,\n 'text-warning': (subscription.api_hits / subscription.api_hits_max) > 0.8 && (subscription.api_hits / subscription.api_hits_max) <= 0.9,\n 'text-danger': (subscription.api_hits / subscription.api_hits_max) > 0.9\n }\">\n {{ 'User.Subscriptions.Details.ApiConsumed' | transloco: { percent: ((subscription.api_hits / subscription.api_hits_max * 100) | number:'1.0-0') } }}\n </span>\n <span class=\"text-muted\">)</span>\n }\n </div>\n </div>\n </div>\n }\n\n <!-- 6. Security -->\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.Details.Section.Security' | transloco }}</h3>\n <p>\n {{ 'User.Subscriptions.Details.Security.Description' | transloco }}\n </p>\n </div>\n <div class=\"col-12 col-sm-3\">\n <pw-input-container [label]=\"'User.Subscriptions.Details.Enforce2fa' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.Enforce2fa' | transloco\"\n name=\"enforce_2fa\"\n controlId=\"user-subscription-enforce_2fa\"\n [useAriaLabelledbyOnly]=\"true\">\n <ui-switch formControlName=\"enforce_2fa\"\n name=\"enforce_2fa\"\n [attr.aria-labelledby]=\"'user-subscription-enforce_2fa-label'\"> </ui-switch>\n </pw-input-container>\n </div>\n\n @if (aiAssistantEnabled) {\n <!-- 7. Brain AI data -->\n <div class=\"col-12\">\n <h3>{{ 'User.Subscriptions.BrainData.Title' | transloco: { brand: brandName } }}</h3>\n <p>{{ 'User.Subscriptions.BrainData.Description' | transloco: { brand: brandName } }}</p>\n </div>\n <div class=\"col-12 col-sm-3\">\n <pw-input-container [label]=\"'User.Subscriptions.BrainData.UseOwnDataLabel' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.RagUseOwnData' | transloco: { brand: brandName }\"\n name=\"rag_use_own_data\"\n controlId=\"user-subscription-rag_use_own_data\"\n [useAriaLabelledbyOnly]=\"true\">\n <ui-switch formControlName=\"rag_use_own_data\"\n name=\"rag_use_own_data\"\n [attr.aria-labelledby]=\"'user-subscription-rag_use_own_data-label'\"> </ui-switch>\n </pw-input-container>\n </div>\n <!-- Keeping personal data is a question about WHAT is kept, so it only\n arises while there is something to keep. Hidden rather than disabled:\n a greyed-out switch still reads as an affordance, and the stored value\n survives in the form either way. -->\n @if (form.value.rag_use_own_data) {\n <div class=\"col-12 col-sm-3\">\n <pw-input-container [label]=\"'User.Subscriptions.BrainData.KeepPiiLabel' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.RagKeepPii' | transloco: { brand: brandName }\"\n name=\"rag_keep_pii\"\n controlId=\"user-subscription-rag_keep_pii\"\n [useAriaLabelledbyOnly]=\"true\">\n <ui-switch formControlName=\"rag_keep_pii\"\n name=\"rag_keep_pii\"\n [attr.aria-labelledby]=\"'user-subscription-rag_keep_pii-label'\"> </ui-switch>\n </pw-input-container>\n </div>\n <!-- Slack history is also the subscription's own data, so it needs \"Use subscription data\" too. -->\n <div class=\"col-12 col-sm-3\">\n <pw-input-container [label]=\"'User.Subscriptions.BrainData.SlackHistoryLabel' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'User.Subscriptions.Tooltip.RagSlackHistory' | transloco: { brand: brandName }\"\n name=\"rag_slack_history\"\n controlId=\"user-subscription-rag_slack_history\"\n [useAriaLabelledbyOnly]=\"true\">\n <ui-switch formControlName=\"rag_slack_history\"\n name=\"rag_slack_history\"\n [attr.aria-labelledby]=\"'user-subscription-rag_slack_history-label'\"> </ui-switch>\n </pw-input-container>\n </div>\n } @else {\n <div class=\"col-12 col-sm-6\">\n <p>{{ 'User.Subscriptions.BrainData.KeepPiiNotApplicable' | transloco: { brand: brandName } }}</p>\n </div>\n }\n }\n <pw-sticky-actions>\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n routerLink=\"/account/subscriptions\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button name=\"submit\"\n type=\"submit\"\n [buttonBusy]=\"busyButton\"\n class=\"btn btn-primary\">\n {{ 'Button.Submit' | transloco }}\n </button>\n </pw-sticky-actions>\n </form>\n}\n\n<ng-template #content\n let-modal>\n <div class=\"modal-header\">\n <h3 class=\"modal-title mb-0 p-0\">{{ 'User.Subscriptions.FullLogo' | 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\n </button>\n </div>\n <div class=\"modal-body\">\n <small> {{ 'User.Profile.PictureMessage' | transloco }}</small>\n <pw-image-cropper #profile\n (imageSelectionEvent)=\"onImageSelection($event)\"\n aspectRatio=\"fullLogo\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n</ng-template>\n<ng-template #squaredLogoContent\n let-modal>\n <div class=\"modal-header\">\n <h3 class=\"modal-title mb-0 p-0\">{{ 'User.Subscriptions.SquaredLogo' | 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\n </button>\n </div>\n <div class=\"modal-body\">\n <small> {{ 'User.Profile.PictureMessage' | transloco }}</small>\n <pw-image-cropper #profile\n (imageSelectionEvent)=\"uploadSquaredLogo($event)\"\n aspectRatio=\"auto\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n</ng-template>\n<pw-password-validation #modal\n(successEvent)=\"onPasswordValidation($event)\"> </pw-password-validation>\n",
|
|
3834
4241
|
styles: [":host{display:block}:host>.row:first-of-type h3{color:var(--titles, #222);font-size:24px;font-weight:700;letter-spacing:-.01em;line-height:1.18}:host form .col-12>h3,:host .seats-section>.col-12>h3,:host .branding-section>.col-12>h3{border-top:1px solid #e2e5ea;color:var(--titles, #222);display:block;font-size:18px;font-weight:600;margin-top:32px;padding-top:24px}:host form>.col-12:first-child>h3{border-top:0;margin-top:0;padding-top:0}:host form .col-12>p,:host .seats-section>.col-12>p{color:#5a6473;margin-bottom:16px}:host .row .text-center.mt-5{margin-top:16px!important;text-align:left!important}:host .image-container>h4{color:var(--titles, #222);font-size:14px;font-weight:600}:host .full-logo,:host .squared_logo{background:#f7f8fa;border:1px solid #e2e5ea;border-radius:8px;object-fit:contain;padding:12px}:host .full-logo{height:120px;width:280px}:host .squared_logo{height:150px;width:150px}:host .overlay{cursor:pointer;margin-top:8px}:host .overlay-text a{color:var(--first, #1769e1);cursor:pointer;font-weight:600}:host .overlay-text a:hover{text-decoration:underline}.sub-header{color:gray;font-size:20px;font-weight:600}@media only screen and (max-width:767px){.btns-row>[class*=col-]{flex:0 0 100%;max-width:100%}.btns-row .btn-primary{font-size:.8rem;margin-top:5px;padding:.375rem .5rem}}\n"]
|
|
3835
4242
|
}]
|
|
3836
4243
|
}],
|
|
@@ -4638,8 +5045,8 @@ var AiKnowledgeTabComponent = class AiKnowledgeTabComponent {
|
|
|
4638
5045
|
get ready() {
|
|
4639
5046
|
return !!this.permissionService.user;
|
|
4640
5047
|
}
|
|
4641
|
-
get
|
|
4642
|
-
return
|
|
5048
|
+
get isEnabled() {
|
|
5049
|
+
return this.permissionService.evaluatePermissions(AI_ASSISTANT_PERMISSION);
|
|
4643
5050
|
}
|
|
4644
5051
|
get subscription() {
|
|
4645
5052
|
return PermissionService.selectedSubscription ?? null;
|
|
@@ -4665,7 +5072,7 @@ var AiKnowledgeTabComponent = class AiKnowledgeTabComponent {
|
|
|
4665
5072
|
isStandalone: true,
|
|
4666
5073
|
selector: "pw-ai-knowledge-tab",
|
|
4667
5074
|
ngImport: i0,
|
|
4668
|
-
template: "@if (!ready) {\n <pw-loader [isVisible]=\"true\"></pw-loader>\n} @else if (!
|
|
5075
|
+
template: "@if (!ready) {\n <pw-loader [isVisible]=\"true\"></pw-loader>\n} @else if (!isEnabled) {\n <pw-no-data [withImage]=\"true\" [message]=\"'AiKnowledge.NotAvailable' | transloco\"></pw-no-data>\n} @else if (subscription) {\n <div class=\"title\">\n <h2>{{ 'AiKnowledge.PersonalTitle' | transloco: { name: subscription.organisation } }}</h2>\n </div>\n <ul ngbNav #nav=\"ngbNav\" [(activeId)]=\"activeTab\" [destroyOnHide]=\"false\" class=\"nav-tabs\">\n <li ngbNavItem=\"files\">\n <a ngbNavLink>{{ 'AiKnowledge.FilesTab' | transloco }}</a>\n <ng-template ngbNavContent>\n <pw-ai-knowledge scope=\"personal\"\n [subscriptionId]=\"subscription.id\"\n [subscriptionName]=\"subscription.organisation\"\n [useOwnData]=\"useOwnData\"></pw-ai-knowledge>\n </ng-template>\n </li>\n <li ngbNavItem=\"notes\">\n <a ngbNavLink>{{ 'AiMemory.Title' | transloco }}</a>\n <ng-template ngbNavContent>\n <pw-ai-memory [subscriptionId]=\"subscription.id\"></pw-ai-memory>\n </ng-template>\n </li>\n </ul>\n <div class=\"mt-3\" [ngbNavOutlet]=\"nav\"></div>\n} @else {\n <pw-no-data [withImage]=\"true\" [message]=\"'AiKnowledge.NoSubscription' | transloco\"></pw-no-data>\n}\n",
|
|
4669
5076
|
dependencies: [
|
|
4670
5077
|
{
|
|
4671
5078
|
kind: "component",
|
|
@@ -4782,7 +5189,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4782
5189
|
NgbNavOutlet,
|
|
4783
5190
|
TranslocoPipe
|
|
4784
5191
|
],
|
|
4785
|
-
template: "@if (!ready) {\n <pw-loader [isVisible]=\"true\"></pw-loader>\n} @else if (!
|
|
5192
|
+
template: "@if (!ready) {\n <pw-loader [isVisible]=\"true\"></pw-loader>\n} @else if (!isEnabled) {\n <pw-no-data [withImage]=\"true\" [message]=\"'AiKnowledge.NotAvailable' | transloco\"></pw-no-data>\n} @else if (subscription) {\n <div class=\"title\">\n <h2>{{ 'AiKnowledge.PersonalTitle' | transloco: { name: subscription.organisation } }}</h2>\n </div>\n <ul ngbNav #nav=\"ngbNav\" [(activeId)]=\"activeTab\" [destroyOnHide]=\"false\" class=\"nav-tabs\">\n <li ngbNavItem=\"files\">\n <a ngbNavLink>{{ 'AiKnowledge.FilesTab' | transloco }}</a>\n <ng-template ngbNavContent>\n <pw-ai-knowledge scope=\"personal\"\n [subscriptionId]=\"subscription.id\"\n [subscriptionName]=\"subscription.organisation\"\n [useOwnData]=\"useOwnData\"></pw-ai-knowledge>\n </ng-template>\n </li>\n <li ngbNavItem=\"notes\">\n <a ngbNavLink>{{ 'AiMemory.Title' | transloco }}</a>\n <ng-template ngbNavContent>\n <pw-ai-memory [subscriptionId]=\"subscription.id\"></pw-ai-memory>\n </ng-template>\n </li>\n </ul>\n <div class=\"mt-3\" [ngbNavOutlet]=\"nav\"></div>\n} @else {\n <pw-no-data [withImage]=\"true\" [message]=\"'AiKnowledge.NoSubscription' | transloco\"></pw-no-data>\n}\n"
|
|
4786
5193
|
}]
|
|
4787
5194
|
}]
|
|
4788
5195
|
});
|
|
@@ -5368,7 +5775,7 @@ var SettingsComponent = class SettingsComponent {
|
|
|
5368
5775
|
labelKey: "Menu.Enterprise.AiKnowledge",
|
|
5369
5776
|
icon: "fa fa-fw fa-brain",
|
|
5370
5777
|
routerLink: ["/settings/ai-knowledge"],
|
|
5371
|
-
visible:
|
|
5778
|
+
visible: this.permissionService.evaluatePermissions(AI_ASSISTANT_PERMISSION)
|
|
5372
5779
|
},
|
|
5373
5780
|
{
|
|
5374
5781
|
id: "other",
|