@dereekb/dbx-firebase 13.32.0 → 13.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/dereekb-dbx-firebase-oidc.mjs +123 -48
- package/fesm2022/dereekb-dbx-firebase-oidc.mjs.map +1 -1
- package/fesm2022/dereekb-dbx-firebase.mjs +1033 -8
- package/fesm2022/dereekb-dbx-firebase.mjs.map +1 -1
- package/lib/modules/externalconnection/_externalconnection.scss +19 -0
- package/lib/style/_all-core.scss +2 -0
- package/lib/style/_all-theme.scss +2 -0
- package/package.json +11 -11
- package/types/dereekb-dbx-firebase-oidc.d.ts +61 -13
- package/types/dereekb-dbx-firebase.d.ts +763 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, computed, output, ChangeDetectionStrategy, Component, inject, Injectable, signal, effect, Directive, viewChild, provideAppInitializer, makeEnvironmentProviders } from '@angular/core';
|
|
3
3
|
import * as i1 from '@dereekb/dbx-web';
|
|
4
|
-
import { DbxBasicLoadingComponent, DbxErrorComponent, DbxButtonComponent, DbxAvatarComponent, DbxButtonSpacerDirective, DbxActionSnackbarErrorDirective, AbstractDbxSelectionListWrapperDirective, DbxListWrapperComponentImportsModule, DEFAULT_LIST_WRAPPER_COMPONENT_CONFIGURATION_TEMPLATE, AbstractDbxSelectionListViewDirective, DbxSelectionValueListViewComponentImportsModule, provideDbxListView, DEFAULT_DBX_SELECTION_VALUE_LIST_COMPONENT_CONFIGURATION_TEMPLATE, AbstractDbxValueListViewItemComponent, provideDbxListViewWrapper, DbxSpacerDirective, DbxActionConfirmDirective,
|
|
4
|
+
import { DbxBasicLoadingComponent, DbxErrorComponent, DbxButtonComponent, DbxAvatarComponent, DbxButtonSpacerDirective, DbxActionSnackbarErrorDirective, AbstractDbxSelectionListWrapperDirective, DbxListWrapperComponentImportsModule, DEFAULT_LIST_WRAPPER_COMPONENT_CONFIGURATION_TEMPLATE, AbstractDbxSelectionListViewDirective, DbxSelectionValueListViewComponentImportsModule, provideDbxListView, DEFAULT_DBX_SELECTION_VALUE_LIST_COMPONENT_CONFIGURATION_TEMPLATE, AbstractDbxValueListViewItemComponent, DbxContentPitDirective, DbxLinkComponent, provideDbxListViewWrapper, DbxSpacerDirective, DbxActionConfirmDirective, DbxDetailBlockComponent, DbxClickToCopyTextComponent } from '@dereekb/dbx-web';
|
|
5
5
|
import { readableError, SPACE_STRING_SPLIT_JOIN, separateValues, generatePkceCodeVerifier, generatePkceCodeChallenge } from '@dereekb/util';
|
|
6
6
|
import { DbxInjectionComponent, DbxActionDirective, DbxActionHandlerDirective, DbxActionValueDirective, DbxActionButtonDirective, DBX_INJECTION_COMPONENT_DATA, DbxRouterService, clean, dbxRouteParamReaderInstance, completeOnDestroy, DbxActionEnforceModifiedDirective, DbxAppAuthRouterService } from '@dereekb/dbx-core';
|
|
7
7
|
import { of, map, first, switchMap, tap, BehaviorSubject } from 'rxjs';
|
|
@@ -185,7 +185,7 @@ class DbxFirebaseOAuthConsentViewComponent {
|
|
|
185
185
|
@if (clientNameSignal()) {
|
|
186
186
|
<p class="dbx-firebase-oauth-consent-prompt">
|
|
187
187
|
<strong>{{ clientNameSignal() }}</strong>
|
|
188
|
-
|
|
188
|
+
wants access to your account.
|
|
189
189
|
</p>
|
|
190
190
|
}
|
|
191
191
|
|
|
@@ -203,7 +203,7 @@ class DbxFirebaseOAuthConsentViewComponent {
|
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
</div>
|
|
206
|
-
`, isInline: true, styles: [".dbx-firebase-oauth-consent-view .dbx-firebase-oauth-consent-header-info{align-items:center;gap:12px}\n"], dependencies: [{ kind: "component", type: DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }, { kind: "component", type: DbxAvatarComponent, selector: "dbx-avatar", inputs: ["context", "avatarSelector", "avatarUid", "avatarUrl", "avatarName", "avatarKey", "avatarIcon", "avatarStyle", "avatarSize", "avatarHideOnError"] }, { kind: "component", type: DbxBasicLoadingComponent, selector: "dbx-basic-loading", inputs: ["diameter", "mode", "text", "linear", "show", "loading", "error"] }, { kind: "component", type: DbxButtonComponent, selector: "dbx-button", inputs: ["bar", "type", "buttonStyle", "color", "spinnerColor", "customButtonColor", "customTextColor", "customSpinnerColor", "basic", "tonal", "raised", "stroked", "flat", "iconOnly", "fab", "customContent", "allowClickPropagation", "mode"] }, { kind: "directive", type: DbxButtonSpacerDirective, selector: "dbx-button-spacer,[dbxButtonSpacer]" }, { kind: "directive", type: DbxActionDirective, selector: "dbx-action,[dbxAction]", exportAs: ["action", "dbxAction"] }, { kind: "directive", type: DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: ["dbxActionHandler"] }, { kind: "directive", type: DbxActionValueDirective, selector: "dbxActionValue,[dbxActionValue]", inputs: ["dbxActionValue"] }, { kind: "directive", type: DbxActionButtonDirective, selector: "[dbxActionButton]", inputs: ["dbxActionButtonEcho"] }, { kind: "directive", type: DbxActionSnackbarErrorDirective, selector: "[dbxActionSnackbarError]", inputs: ["dbxActionSnackbarError"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
206
|
+
`, isInline: true, styles: [".dbx-firebase-oauth-consent-view .dbx-firebase-oauth-consent-header-info{align-items:center;gap:12px}\n"], dependencies: [{ kind: "component", type: DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }, { kind: "component", type: DbxAvatarComponent, selector: "dbx-avatar", inputs: ["context", "avatarSelector", "avatarUid", "avatarUrl", "avatarName", "avatarKey", "avatarIcon", "avatarStyle", "avatarSize", "avatarHideOnError", "avatarTile", "avatarColor", "avatarColorTone", "avatarImageFit", "avatarImageFilter", "avatarIgnoreDefaultUrl"] }, { kind: "component", type: DbxBasicLoadingComponent, selector: "dbx-basic-loading", inputs: ["diameter", "mode", "text", "linear", "show", "loading", "error"] }, { kind: "component", type: DbxButtonComponent, selector: "dbx-button", inputs: ["bar", "type", "buttonStyle", "color", "spinnerColor", "customButtonColor", "customTextColor", "customSpinnerColor", "basic", "tonal", "raised", "stroked", "flat", "iconOnly", "fab", "customContent", "allowClickPropagation", "mode"] }, { kind: "directive", type: DbxButtonSpacerDirective, selector: "dbx-button-spacer,[dbxButtonSpacer]" }, { kind: "directive", type: DbxActionDirective, selector: "dbx-action,[dbxAction]", exportAs: ["action", "dbxAction"] }, { kind: "directive", type: DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: ["dbxActionHandler"] }, { kind: "directive", type: DbxActionValueDirective, selector: "dbxActionValue,[dbxActionValue]", inputs: ["dbxActionValue"] }, { kind: "directive", type: DbxActionButtonDirective, selector: "[dbxActionButton]", inputs: ["dbxActionButtonEcho"] }, { kind: "directive", type: DbxActionSnackbarErrorDirective, selector: "[dbxActionSnackbarError]", inputs: ["dbxActionSnackbarError"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
207
207
|
}
|
|
208
208
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFirebaseOAuthConsentViewComponent, decorators: [{
|
|
209
209
|
type: Component,
|
|
@@ -233,7 +233,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
233
233
|
@if (clientNameSignal()) {
|
|
234
234
|
<p class="dbx-firebase-oauth-consent-prompt">
|
|
235
235
|
<strong>{{ clientNameSignal() }}</strong>
|
|
236
|
-
|
|
236
|
+
wants access to your account.
|
|
237
237
|
</p>
|
|
238
238
|
}
|
|
239
239
|
|
|
@@ -330,11 +330,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
330
330
|
* Selection list view that pairs with `DbxFirebaseOAuthConsentScopeListComponent`.
|
|
331
331
|
* Maps each `OAuthConsentScope` to a `DbxValueListItem` keyed by the scope name
|
|
332
332
|
* and renders it through `DbxFirebaseOAuthConsentScopeListItemComponent`.
|
|
333
|
+
*
|
|
334
|
+
* Scopes flagged `required` map to disabled rows so they render selected but cannot be toggled
|
|
335
|
+
* off — the surrounding `dbxListItemIsSelectedModifier` owns the `selected` flag (driven by the
|
|
336
|
+
* form value), and only `disabled` is set here.
|
|
333
337
|
*/
|
|
334
338
|
class DbxFirebaseOAuthConsentScopeListViewComponent extends AbstractDbxSelectionListViewDirective {
|
|
335
339
|
config = {
|
|
336
340
|
componentClass: DbxFirebaseOAuthConsentScopeListItemComponent,
|
|
337
|
-
mapValuesToItemValues: (values) => of(values.map((scope) => ({ ...scope, key: scope.name, itemValue: scope })))
|
|
341
|
+
mapValuesToItemValues: (values) => of(values.map((scope) => ({ ...scope, key: scope.name, itemValue: scope, disabled: scope.required === true })))
|
|
338
342
|
};
|
|
339
343
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFirebaseOAuthConsentScopeListViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
340
344
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.11", type: DbxFirebaseOAuthConsentScopeListViewComponent, isStandalone: true, selector: "dbx-firebase-oauth-consent-scope-list-view", providers: provideDbxListView(DbxFirebaseOAuthConsentScopeListViewComponent), usesInheritance: true, ngImport: i0, template: "<dbx-selection-list-view [config]=\"config\"></dbx-selection-list-view>", isInline: true, dependencies: [{ kind: "ngmodule", type: DbxSelectionValueListViewComponentImportsModule }, { kind: "component", type: i1.DbxSelectionValueListViewComponent, selector: "dbx-selection-list-view" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
@@ -355,6 +359,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
355
359
|
* row for both selected and unselected scopes — the selection chrome (the
|
|
356
360
|
* leading checkbox/highlight) is provided by the wrapping
|
|
357
361
|
* `dbx-selection-list-view`.
|
|
362
|
+
*
|
|
363
|
+
* Required scopes get an extra "Always granted" note so the row explains why its checkbox is
|
|
364
|
+
* locked on.
|
|
358
365
|
*/
|
|
359
366
|
class DbxFirebaseOAuthConsentScopeListItemComponent extends AbstractDbxValueListViewItemComponent {
|
|
360
367
|
get name() {
|
|
@@ -363,6 +370,9 @@ class DbxFirebaseOAuthConsentScopeListItemComponent extends AbstractDbxValueList
|
|
|
363
370
|
get description() {
|
|
364
371
|
return this.itemValue.description;
|
|
365
372
|
}
|
|
373
|
+
get required() {
|
|
374
|
+
return this.itemValue.required === true;
|
|
375
|
+
}
|
|
366
376
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFirebaseOAuthConsentScopeListItemComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
367
377
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.11", type: DbxFirebaseOAuthConsentScopeListItemComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
368
378
|
<div class="dbx-list-item-padded dbx-list-item-padded-thick dbx-list-two-line-item">
|
|
@@ -371,6 +381,9 @@ class DbxFirebaseOAuthConsentScopeListItemComponent extends AbstractDbxValueList
|
|
|
371
381
|
@if (description) {
|
|
372
382
|
<div class="item-details">{{ description }}</div>
|
|
373
383
|
}
|
|
384
|
+
@if (required) {
|
|
385
|
+
<div class="item-details dbx-hint">Always granted</div>
|
|
386
|
+
}
|
|
374
387
|
</div>
|
|
375
388
|
</div>
|
|
376
389
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
@@ -385,6 +398,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
385
398
|
@if (description) {
|
|
386
399
|
<div class="item-details">{{ description }}</div>
|
|
387
400
|
}
|
|
401
|
+
@if (required) {
|
|
402
|
+
<div class="item-details dbx-hint">Always granted</div>
|
|
403
|
+
}
|
|
388
404
|
</div>
|
|
389
405
|
</div>
|
|
390
406
|
`,
|
|
@@ -411,20 +427,30 @@ const DEFAULT_OAUTH_CONSENT_SCOPES_REQUIRED_VALIDATOR_MESSAGE = 'Select at least
|
|
|
411
427
|
* The list renders bare (no Material form-field wrapper) and without the
|
|
412
428
|
* default 300px height cap so it grows to fit the scope list.
|
|
413
429
|
*
|
|
430
|
+
* Required scopes are seeded into the initial value and rendered as disabled rows, so they cannot
|
|
431
|
+
* be deselected. Because they are always present in the value, the "select at least one" validator
|
|
432
|
+
* compares against the required count rather than zero — and is skipped entirely when every
|
|
433
|
+
* requested scope is required (there would be nothing left to select).
|
|
434
|
+
*
|
|
414
435
|
* @param config - The consent scopes form fields configuration.
|
|
415
436
|
* @returns A `FormConfig` whose single field selects an `OidcScope[]` of granted scopes.
|
|
416
437
|
*/
|
|
417
438
|
function oauthConsentScopesFormConfig(config) {
|
|
418
|
-
const {
|
|
419
|
-
const
|
|
420
|
-
const
|
|
421
|
-
const
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
439
|
+
const { scopes, initiallySelected } = config;
|
|
440
|
+
const scopesArray = scopes.slice();
|
|
441
|
+
const requiredScopeNames = scopesArray.filter((scope) => scope.required).map((scope) => scope.name);
|
|
442
|
+
const selectedScopeNames = initiallySelected ?? scopesArray.map((scope) => scope.name);
|
|
443
|
+
const value = Array.from(new Set([...requiredScopeNames, ...selectedScopeNames]));
|
|
444
|
+
const hasOptionalScopes = requiredScopeNames.length < scopesArray.length;
|
|
445
|
+
const validators = hasOptionalScopes
|
|
446
|
+
? [
|
|
447
|
+
{
|
|
448
|
+
type: 'custom',
|
|
449
|
+
expression: `fieldValue && fieldValue.length > ${requiredScopeNames.length}`,
|
|
450
|
+
kind: OAUTH_CONSENT_SCOPES_REQUIRED_VALIDATOR_KIND
|
|
451
|
+
}
|
|
452
|
+
]
|
|
453
|
+
: [];
|
|
428
454
|
return {
|
|
429
455
|
fields: [
|
|
430
456
|
dbxForgeListSelectionField({
|
|
@@ -437,7 +463,7 @@ function oauthConsentScopesFormConfig(config) {
|
|
|
437
463
|
props: {
|
|
438
464
|
listComponentClass: of(DbxFirebaseOAuthConsentScopeListComponent),
|
|
439
465
|
readKey: (scope) => scope.name,
|
|
440
|
-
state$: of(successResult(
|
|
466
|
+
state$: of(successResult(scopesArray)),
|
|
441
467
|
wrapped: false,
|
|
442
468
|
maxHeight: 'none'
|
|
443
469
|
}
|
|
@@ -576,6 +602,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
576
602
|
type: Injectable
|
|
577
603
|
}] });
|
|
578
604
|
|
|
605
|
+
/**
|
|
606
|
+
* Height cap applied to the scope pit while the selection list is expanded. Bounds a long
|
|
607
|
+
* scope list so it scrolls inside the pit instead of pushing the consent screen's
|
|
608
|
+
* Approve/Deny buttons below the fold on small screens.
|
|
609
|
+
*/
|
|
610
|
+
const OAUTH_CONSENT_SCOPES_PIT_SCROLLABLE_HEIGHT = 'medium';
|
|
579
611
|
/**
|
|
580
612
|
* Default consent scope view component.
|
|
581
613
|
*
|
|
@@ -587,9 +619,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
587
619
|
* form's value participates in the surrounding `dbxAction` (the consent
|
|
588
620
|
* view's outer Approve action).
|
|
589
621
|
*
|
|
590
|
-
*
|
|
591
|
-
*
|
|
592
|
-
*
|
|
622
|
+
* The scopes live inside a `dbx-content-pit` that starts collapsed to a single
|
|
623
|
+
* underlined summary line ("N permissions are being requested. Click here to
|
|
624
|
+
* edit requested permissions."). Clicking it expands the pit to reveal the
|
|
625
|
+
* selection list so the user can customize which scopes they grant. Starting
|
|
626
|
+
* collapsed keeps the consent screen short enough that Approve/Deny are visible
|
|
627
|
+
* without scrolling even when a client requests many scopes, and the expanded
|
|
628
|
+
* pit is height-capped and scrollable for the same reason.
|
|
629
|
+
*
|
|
630
|
+
* The form itself is always mounted (hidden rather than removed while
|
|
631
|
+
* collapsed) so `dbxActionForm` keeps supplying the granted-scope value to the
|
|
632
|
+
* consent action even when the user never expands the pit.
|
|
633
|
+
*
|
|
634
|
+
* Required scopes are listed first and render as selected-and-disabled rows carrying an "Always
|
|
635
|
+
* granted" note, so their description is visible alongside every other scope while staying
|
|
636
|
+
* non-deselectable. The server force-grants them regardless of the submitted payload.
|
|
593
637
|
*
|
|
594
638
|
* Apps can override this default via
|
|
595
639
|
* `DbxFirebaseOidcConfig.consentScopeListViewClass` or
|
|
@@ -600,51 +644,82 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
600
644
|
class DbxFirebaseOAuthConsentScopeDefaultViewComponent {
|
|
601
645
|
_oidcConfigService = inject(DbxFirebaseOidcConfigService);
|
|
602
646
|
_data = inject(DBX_INJECTION_COMPONENT_DATA);
|
|
647
|
+
_customizing = signal(false, ...(ngDevMode ? [{ debugName: "_customizing" }] : /* istanbul ignore next */ []));
|
|
648
|
+
/**
|
|
649
|
+
* Every requested scope paired with its human-readable description, required ones first so the
|
|
650
|
+
* always-granted rows head the list.
|
|
651
|
+
*/
|
|
603
652
|
mappedScopesSignal = computed(() => {
|
|
604
653
|
const availableScopes = this._oidcConfigService.availableScopes;
|
|
605
654
|
const availableScopeValues = new Set(availableScopes.map((s) => s.value));
|
|
655
|
+
const requiredSet = new Set(this._data.requiredScopes ?? []);
|
|
606
656
|
const { included: knownScopes, excluded: unknownScopes } = separateValues(this._data.scopes, (name) => availableScopeValues.has(name));
|
|
607
|
-
|
|
657
|
+
const mappedScopes = [
|
|
608
658
|
...knownScopes.map((name) => {
|
|
609
659
|
const details = availableScopes.find((s) => s.value === name);
|
|
610
|
-
return { name, description: details?.description ?? '' };
|
|
660
|
+
return { name, description: details?.description ?? '', required: requiredSet.has(name) };
|
|
611
661
|
}),
|
|
612
|
-
...unknownScopes.map((name) => ({ name, description: 'unknown' }))
|
|
662
|
+
...unknownScopes.map((name) => ({ name, description: 'unknown', required: requiredSet.has(name) }))
|
|
613
663
|
];
|
|
664
|
+
const { included: requiredScopes, excluded: optionalScopes } = separateValues(mappedScopes, (scope) => scope.required === true);
|
|
665
|
+
return [...requiredScopes, ...optionalScopes];
|
|
614
666
|
}, ...(ngDevMode ? [{ debugName: "mappedScopesSignal" }] : /* istanbul ignore next */ []));
|
|
615
|
-
optionalScopesSignal = computed(() => {
|
|
616
|
-
const requiredSet = new Set(this._data.requiredScopes ?? []);
|
|
617
|
-
return this.mappedScopesSignal().filter((scope) => !requiredSet.has(scope.name));
|
|
618
|
-
}, ...(ngDevMode ? [{ debugName: "optionalScopesSignal" }] : /* istanbul ignore next */ []));
|
|
619
|
-
alwaysGrantedLabelSignal = computed(() => {
|
|
620
|
-
const required = this._data.requiredScopes ?? [];
|
|
621
|
-
return required.length > 0 ? required.join(', ') : null;
|
|
622
|
-
}, ...(ngDevMode ? [{ debugName: "alwaysGrantedLabelSignal" }] : /* istanbul ignore next */ []));
|
|
623
667
|
formFieldsConfigSignal = computed(() => ({
|
|
624
|
-
|
|
668
|
+
scopes: this.mappedScopesSignal()
|
|
625
669
|
}), ...(ngDevMode ? [{ debugName: "formFieldsConfigSignal" }] : /* istanbul ignore next */ []));
|
|
670
|
+
/**
|
|
671
|
+
* Leading sentence of the collapsed summary — the number of scopes the client is requesting,
|
|
672
|
+
* counting the always-granted ones since the expanded pit accounts for them too.
|
|
673
|
+
*/
|
|
674
|
+
requestedScopesSummarySignal = computed(() => {
|
|
675
|
+
const count = this.mappedScopesSignal().length;
|
|
676
|
+
return count === 1 ? '1 permission is being requested.' : `${count} permissions are being requested.`;
|
|
677
|
+
}, ...(ngDevMode ? [{ debugName: "requestedScopesSummarySignal" }] : /* istanbul ignore next */ []));
|
|
678
|
+
/**
|
|
679
|
+
* True once the user has expanded the pit to review/customize the requested scopes.
|
|
680
|
+
*/
|
|
681
|
+
customizingSignal = this._customizing.asReadonly();
|
|
682
|
+
pitScrollableSignal = computed(() => (this.customizingSignal() ? OAUTH_CONSENT_SCOPES_PIT_SCROLLABLE_HEIGHT : undefined), ...(ngDevMode ? [{ debugName: "pitScrollableSignal" }] : /* istanbul ignore next */ []));
|
|
683
|
+
customizeAnchor = {
|
|
684
|
+
onClick: () => this.showScopeCustomization()
|
|
685
|
+
};
|
|
686
|
+
showScopeCustomization() {
|
|
687
|
+
this._customizing.set(true);
|
|
688
|
+
}
|
|
626
689
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFirebaseOAuthConsentScopeDefaultViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
627
690
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.11", type: DbxFirebaseOAuthConsentScopeDefaultViewComponent, isStandalone: true, selector: "dbx-firebase-oauth-consent-scope-default-view", ngImport: i0, template: `
|
|
628
|
-
|
|
629
|
-
<
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
691
|
+
<dbx-content-pit class="dbx-firebase-oauth-consent-scopes-pit" [scrollable]="pitScrollableSignal()">
|
|
692
|
+
<div class="dbx-content-pit-scrollable-content">
|
|
693
|
+
@if (!customizingSignal()) {
|
|
694
|
+
<p class="dbx-firebase-oauth-consent-scopes-summary">
|
|
695
|
+
<dbx-link [anchor]="customizeAnchor">{{ requestedScopesSummarySignal() }} Click here to edit requested permissions.</dbx-link>
|
|
696
|
+
</p>
|
|
697
|
+
}
|
|
698
|
+
<!-- Hidden rather than removed while collapsed so dbxActionForm keeps supplying the granted scopes even when the pit is never expanded. -->
|
|
699
|
+
<div [hidden]="!customizingSignal()">
|
|
700
|
+
<dbx-firebase-oauth-consent-scope-form dbxActionForm [config]="formFieldsConfigSignal()"></dbx-firebase-oauth-consent-scope-form>
|
|
701
|
+
</div>
|
|
702
|
+
</div>
|
|
703
|
+
</dbx-content-pit>
|
|
704
|
+
`, isInline: true, styles: [".dbx-firebase-oauth-consent-scopes-pit{--mat-list-list-item-disabled-label-text-opacity: 1;--mat-checkbox-disabled-selected-icon-color: var(--mat-sys-on-surface-variant);--mat-checkbox-disabled-selected-checkmark-color: var(--mat-sys-surface)}\n"], dependencies: [{ kind: "component", type: DbxFirebaseOAuthConsentScopeFormComponent, selector: "dbx-firebase-oauth-consent-scope-form" }, { kind: "directive", type: DbxActionFormDirective, selector: "[dbxActionForm]", inputs: ["dbxActionFormDisabledOnWorking", "dbxActionFormIsValid", "dbxActionFormIsEqual", "dbxActionFormIsModified", "dbxActionFormMapValue"] }, { kind: "directive", type: DbxContentPitDirective, selector: "dbx-content-pit, [dbxContentPit]", inputs: ["scrollable", "square"] }, { kind: "component", type: DbxLinkComponent, selector: "dbx-link", inputs: ["ref", "href", "anchor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
633
705
|
}
|
|
634
706
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxFirebaseOAuthConsentScopeDefaultViewComponent, decorators: [{
|
|
635
707
|
type: Component,
|
|
636
|
-
args: [{
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
708
|
+
args: [{ selector: 'dbx-firebase-oauth-consent-scope-default-view', template: `
|
|
709
|
+
<dbx-content-pit class="dbx-firebase-oauth-consent-scopes-pit" [scrollable]="pitScrollableSignal()">
|
|
710
|
+
<div class="dbx-content-pit-scrollable-content">
|
|
711
|
+
@if (!customizingSignal()) {
|
|
712
|
+
<p class="dbx-firebase-oauth-consent-scopes-summary">
|
|
713
|
+
<dbx-link [anchor]="customizeAnchor">{{ requestedScopesSummarySignal() }} Click here to edit requested permissions.</dbx-link>
|
|
714
|
+
</p>
|
|
715
|
+
}
|
|
716
|
+
<!-- Hidden rather than removed while collapsed so dbxActionForm keeps supplying the granted scopes even when the pit is never expanded. -->
|
|
717
|
+
<div [hidden]="!customizingSignal()">
|
|
718
|
+
<dbx-firebase-oauth-consent-scope-form dbxActionForm [config]="formFieldsConfigSignal()"></dbx-firebase-oauth-consent-scope-form>
|
|
719
|
+
</div>
|
|
720
|
+
</div>
|
|
721
|
+
</dbx-content-pit>
|
|
722
|
+
`, imports: [DbxFirebaseOAuthConsentScopeFormComponent, DbxActionFormDirective, DbxContentPitDirective, DbxLinkComponent], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, styles: [".dbx-firebase-oauth-consent-scopes-pit{--mat-list-list-item-disabled-label-text-opacity: 1;--mat-checkbox-disabled-selected-icon-color: var(--mat-sys-on-surface-variant);--mat-checkbox-disabled-selected-checkmark-color: var(--mat-sys-surface)}\n"] }]
|
|
648
723
|
}] });
|
|
649
724
|
|
|
650
725
|
// MARK: Service
|