@block-auth.io/angular 0.3.2 → 0.4.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/.turbo/turbo-build.log +7 -7
- package/.turbo/turbo-lint.log +1 -1
- package/.turbo/turbo-test.log +701 -1302
- package/.turbo/turbo-typecheck.log +4 -4
- package/CHANGELOG.md +28 -0
- package/package.json +3 -3
- package/src/lib/components/btns/btn-base-provider.component.test.ts +14 -0
- package/src/lib/components/btns/btn-base-provider.component.ts +7 -1
- package/src/lib/components/contents/content-signup.component.ts +5 -17
- package/src/lib/components/dds/dropdown-profile-btn.component.ts +5 -3
- package/src/lib/components/flow-block-auth.component.test.ts +2 -0
- package/src/lib/components/flow-block-auth.component.ts +10 -8
- package/src/lib/components/modals/modal-signin.component.ts +2 -2
- package/src/lib/components/modals/modal-signup.component.ts +1 -1
- package/src/lib/components/sections/internals/providers-buttons.component.ts +1 -11
- package/src/lib/components/sections/login-section.component.ts +4 -5
- package/src/lib/components/txns/internals/permissions-required-modal.component.ts +1 -1
- package/src/lib/components/txns/internals/solicited-data-modal.component.test.ts +39 -0
- package/src/lib/components/txns/internals/solicited-data-modal.component.ts +25 -10
- package/src/lib/components/txns/internals/txn.component.test.ts +13 -0
- package/src/lib/components/txns/internals/txn.component.ts +15 -23
- package/src/lib/components/txns/txns-overview.component.ts +49 -12
- package/src/lib/primitives/horizontal-loader.component.test.ts +3 -2
- package/src/lib/primitives/horizontal-loader.component.ts +15 -39
- package/src/lib/primitives/img-loader.component.test.ts +10 -0
- package/src/lib/primitives/img-loader.component.ts +5 -2
- package/src/lib/primitives/oval-spinner.component.test.ts +10 -2
- package/src/lib/primitives/oval-spinner.component.ts +35 -57
- package/src/lib/primitives/progressbar.component.test.ts +27 -11
- package/src/lib/primitives/progressbar.component.ts +24 -81
- package/src/lib/primitives/providersStyles.ts +0 -50
- package/src/lib/transitions.css +0 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @block-auth.io/angular@0.
|
|
2
|
+
> @block-auth.io/angular@0.4.0 pretypecheck /home/vlad/Escritorio/blockauth-code/blockauth-sdk/packages/angular
|
|
3
3
|
> pnpm build:css
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @block-auth.io/angular@0.
|
|
6
|
+
> @block-auth.io/angular@0.4.0 build:css /home/vlad/Escritorio/blockauth-code/blockauth-sdk/packages/angular
|
|
7
7
|
> tailwindcss -i ../ui-styles/src/input.css -c ./tailwind.config.cjs -o ./src/styles.generated.css --minify && node scripts/css-to-ts.mjs
|
|
8
8
|
|
|
9
9
|
Browserslist: caniuse-lite is outdated. Please run:
|
|
@@ -12,8 +12,8 @@ Browserslist: caniuse-lite is outdated. Please run:
|
|
|
12
12
|
|
|
13
13
|
Rebuilding...
|
|
14
14
|
|
|
15
|
-
Done in
|
|
15
|
+
Done in 1767ms.
|
|
16
16
|
|
|
17
|
-
> @block-auth.io/angular@0.
|
|
17
|
+
> @block-auth.io/angular@0.4.0 typecheck /home/vlad/Escritorio/blockauth-code/blockauth-sdk/packages/angular
|
|
18
18
|
> tsc -p tsconfig.lib.json --noEmit
|
|
19
19
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @block-auth.io/angular
|
|
2
2
|
|
|
3
|
+
## 0.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 409f7c3: Las tarjetas de inicio de sesión, registro y consentimiento pasan al diseño
|
|
8
|
+
glass, igual que en React, y `OvalSpinner` y `HorizontalLoader` usan el loader
|
|
9
|
+
glass. `ImgLoader` acepta `showLoaderRing` para ocultar el anillo, y el
|
|
10
|
+
proveedor elegido se expone con `aria-pressed`. Los datos solicitados no se
|
|
11
|
+
pueden aceptar mientras falte alguno obligatorio, y "Cancelar" descarta los
|
|
12
|
+
cambios. Requiere `@block-auth.io/core` 0.12, que ya no tiene `apiUrl` por
|
|
13
|
+
defecto: las apps first-party tienen que pasarlo.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- baf72f4: La barra de pasos de la tarjeta de registro pinta siempre el paso actual: ya no
|
|
18
|
+
deja círculos a medio dibujar, tramos sin rellenar ni dos subrayados a la vez al
|
|
19
|
+
saltar o volver de paso. Mismo diseño en React, Vue y Angular, con la línea
|
|
20
|
+
redondeada, un halo suave en el paso activo y transiciones CSS.
|
|
21
|
+
- Updated dependencies [409f7c3]
|
|
22
|
+
- Updated dependencies [acefee6]
|
|
23
|
+
- Updated dependencies [4f8e9ce]
|
|
24
|
+
- Updated dependencies [1b33e98]
|
|
25
|
+
- Updated dependencies [4413898]
|
|
26
|
+
- Updated dependencies [baf72f4]
|
|
27
|
+
- Updated dependencies [409f7c3]
|
|
28
|
+
- @block-auth.io/core@0.12.0
|
|
29
|
+
- @block-auth.io/ui-styles@0.6.0
|
|
30
|
+
|
|
3
31
|
## 0.3.2
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@block-auth.io/angular",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"nanostores": "^0.10.0",
|
|
6
6
|
"tslib": "^2.6.0",
|
|
7
|
-
"@block-auth.io/core": "0.
|
|
8
|
-
"@block-auth.io/ui-styles": "0.
|
|
7
|
+
"@block-auth.io/core": "0.12.0",
|
|
8
|
+
"@block-auth.io/ui-styles": "0.6.0"
|
|
9
9
|
},
|
|
10
10
|
"peerDependencies": {
|
|
11
11
|
"@angular/core": ">=20.0.0",
|
|
@@ -20,3 +20,17 @@ describe('BtnBaseProvider', () => {
|
|
|
20
20
|
expect(onProviderClicked).toHaveBeenCalled();
|
|
21
21
|
});
|
|
22
22
|
});
|
|
23
|
+
|
|
24
|
+
describe('BtnBaseProviderComponent estado seleccionado', () => {
|
|
25
|
+
it('expone la selección con aria-pressed', async () => {
|
|
26
|
+
await render(BtnBaseProviderComponent, {
|
|
27
|
+
componentInputs: { text: 'google', isSelected: true },
|
|
28
|
+
});
|
|
29
|
+
expect(screen.getByRole('button').getAttribute('aria-pressed')).toBe('true');
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('no está seleccionado por defecto', async () => {
|
|
33
|
+
await render(BtnBaseProviderComponent, { componentInputs: { text: 'google' } });
|
|
34
|
+
expect(screen.getByRole('button').getAttribute('aria-pressed')).toBe('false');
|
|
35
|
+
});
|
|
36
|
+
});
|
|
@@ -9,7 +9,12 @@ import { ChangeDetectionStrategy, Component, computed, input, output } from '@an
|
|
|
9
9
|
standalone: true,
|
|
10
10
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11
11
|
template: `
|
|
12
|
-
<button
|
|
12
|
+
<button
|
|
13
|
+
type="button"
|
|
14
|
+
[attr.aria-pressed]="isSelected()"
|
|
15
|
+
[class]="btnClass()"
|
|
16
|
+
(click)="onClick($event)"
|
|
17
|
+
>
|
|
13
18
|
<ng-content select="[slot=icon]" />
|
|
14
19
|
@if (text() && text() !== '') {
|
|
15
20
|
<p [class]="'bas-m-0 bas-text-gray-700 ' + textClass()">{{ capitalizedText() }}</p>
|
|
@@ -22,6 +27,7 @@ export class BtnBaseProviderComponent {
|
|
|
22
27
|
sizeClassNames = input('bas-h-16 bas-w-full');
|
|
23
28
|
text = input('');
|
|
24
29
|
isEditable = input(false);
|
|
30
|
+
isSelected = input(false);
|
|
25
31
|
device = input<'desktop' | 'phone'>('desktop');
|
|
26
32
|
|
|
27
33
|
providerClicked = output<void>();
|
|
@@ -56,7 +56,7 @@ function applyFilters(providers: string[], { webType, search }: { webType: strin
|
|
|
56
56
|
data-testid="content-signup"
|
|
57
57
|
[attr.data-device]="device()"
|
|
58
58
|
[class]="
|
|
59
|
-
'bas-grid bas-h-full ' +
|
|
59
|
+
'bal-ba-glass-signup bas-grid bas-h-full ' +
|
|
60
60
|
(!isEditable()
|
|
61
61
|
? 'bas-w-full bas-grid-cols-1 bas-grid-rows-[52px_140px_228px_48px] sm1:bas-w-fit sm1:bas-grid-cols-[240px_384px] sm1:bas-grid-rows-[52px_auto_auto] lg:bas-grid-cols-[240px_640px]'
|
|
62
62
|
: 'bas-w-fit')
|
|
@@ -80,13 +80,9 @@ function applyFilters(providers: string[], { webType, search }: { webType: strin
|
|
|
80
80
|
'bas-flex bas-items-center bas-justify-center ' + (!isEditable() ? 'bas-row-start-1 sm1:bas-row-start-auto' : '')
|
|
81
81
|
"
|
|
82
82
|
>
|
|
83
|
-
<ba-
|
|
84
|
-
[
|
|
85
|
-
|
|
86
|
-
[step2]="!hasBeenConnected() && showImgLoader()"
|
|
87
|
-
[step3]="!showImgLoader()"
|
|
88
|
-
[goBackToStep2]="(serviceName() !== selectedService() || !isServiceConnected()) && hasBeenConnected()"
|
|
89
|
-
/>
|
|
83
|
+
<span class="bal-ba-glass-stepper">
|
|
84
|
+
<ba-progressbar [step]="showImgLoader() ? 2 : 3" />
|
|
85
|
+
</span>
|
|
90
86
|
</section>
|
|
91
87
|
|
|
92
88
|
<ba-login-section
|
|
@@ -177,7 +173,6 @@ export class ContentSignupComponent {
|
|
|
177
173
|
|
|
178
174
|
protected selectedService = signal<string>(this.allProviders()[0] ?? 'blockauth');
|
|
179
175
|
protected showedProviders = signal<string[]>(this.allProviders());
|
|
180
|
-
protected hasBeenConnected = signal(false);
|
|
181
176
|
protected imgQR = signal<string | null>(null);
|
|
182
177
|
// Estado de filtros no reactivo: mutarlo no dispara reactividad.
|
|
183
178
|
private filterState: { webType: string; search: string } = { webType: 'all', search: '' };
|
|
@@ -195,14 +190,7 @@ export class ContentSignupComponent {
|
|
|
195
190
|
this.selectedService.set(providers.includes(cur) ? cur : providers[0] ?? 'blockauth');
|
|
196
191
|
});
|
|
197
192
|
|
|
198
|
-
// Efecto 2:
|
|
199
|
-
effect(() => {
|
|
200
|
-
if (this.serviceName() === this.selectedService() && this.isServiceConnected()) {
|
|
201
|
-
this.hasBeenConnected.set(true);
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
// Efecto 3: genera el QR para providers web3 (metamask/phantom), con guard
|
|
193
|
+
// Efecto 2: genera el QR para providers web3 (metamask/phantom), con guard
|
|
206
194
|
// de cancelación.
|
|
207
195
|
effect((onCleanup) => {
|
|
208
196
|
const svc = this.selectedService();
|
|
@@ -22,18 +22,20 @@ import { TbCopyComponent, TbCopyCheckFilledComponent } from '../../icons';
|
|
|
22
22
|
data-testid="dropdown-profile-btn"
|
|
23
23
|
[attr.data-service]="serviceNameResolved()"
|
|
24
24
|
[class]="
|
|
25
|
-
'bal-ba-transition-2 bas-group bas-relative bas-box-border bas-grid bas-h-full bas-w-full bas-cursor-pointer bas-flex-row bas-items-center bas-justify-between bas-gap-1 bas-overflow-hidden bas-rounded-lg bas-mx-auto ' +
|
|
25
|
+
'bal-ba-glass-profile bal-ba-transition-2 bas-group bas-relative bas-box-border bas-grid bas-h-full bas-w-full bas-cursor-pointer bas-flex-row bas-items-center bas-justify-between bas-gap-1 bas-overflow-hidden bas-rounded-lg bas-mx-auto ' +
|
|
26
26
|
dropdownBtnBgClassNames() + ' bas-border-2 bas-border-solid ' +
|
|
27
27
|
gridClassNames() + ' ' +
|
|
28
|
-
(dropdownBtnBorderClassNames() ||
|
|
28
|
+
(dropdownBtnBorderClassNames() || 'bal-ba-glass-profile-rim')
|
|
29
29
|
"
|
|
30
|
+
[style.--bal-ba-provider]="style().colorBase"
|
|
30
31
|
[style.minHeight]="height() != null ? height() + 'px' : null"
|
|
31
32
|
[style.width]="widthStyle()"
|
|
32
33
|
(click)="clicked.emit()"
|
|
33
34
|
>
|
|
34
35
|
<span
|
|
36
|
+
[attr.data-status]="!isSignedFirstCheck() ? 'pending' : !isSigned() ? 'unsigned' : 'signed'"
|
|
35
37
|
[class]="
|
|
36
|
-
'bas-absolute bas-right-2.5 bas-top-1.5 bas-h-2 bas-w-2 bas-rounded-full ' +
|
|
38
|
+
'bal-ba-glass-status-dot bas-absolute bas-right-2.5 bas-top-1.5 bas-h-2 bas-w-2 bas-rounded-full ' +
|
|
37
39
|
(!isSignedFirstCheck() ? 'bas-bg-gray-400' : !isSigned() ? 'bas-bg-red-400' : 'bas-bg-green-400')
|
|
38
40
|
"
|
|
39
41
|
></span>
|
|
@@ -85,6 +85,8 @@ describe('FlowBlockAuth', () => {
|
|
|
85
85
|
const btn = container.querySelector('#btn-flow-blockauth') as HTMLButtonElement;
|
|
86
86
|
expect(btn).toBeTruthy();
|
|
87
87
|
expect(btn.disabled).toBe(false);
|
|
88
|
+
expect(btn.className).toContain('bal-ba-glass-status-btn');
|
|
89
|
+
expect(btn.className).toContain('bal-ba-glass-tone-ready');
|
|
88
90
|
await fireEvent.click(btn);
|
|
89
91
|
|
|
90
92
|
await waitFor(() => expect(client.requestSignin).toHaveBeenCalled());
|
|
@@ -159,14 +159,16 @@ export class FlowBlockAuthComponent {
|
|
|
159
159
|
|
|
160
160
|
// Azul mientras arranca, transparente una vez firmado en el SDK, naranja en
|
|
161
161
|
// on-deletion, rojo si la api key es inválida.
|
|
162
|
-
protected readonly bgClassNames = computed(
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
?
|
|
167
|
-
: this.ui().
|
|
168
|
-
? '
|
|
169
|
-
:
|
|
162
|
+
protected readonly bgClassNames = computed(
|
|
163
|
+
() =>
|
|
164
|
+
'bal-ba-glass-status-btn ' +
|
|
165
|
+
(!(this.ws().ready && this.isUiConfig())
|
|
166
|
+
? 'bal-ba-glass-tone-boot'
|
|
167
|
+
: this.ui().isSdkSignedIn
|
|
168
|
+
? 'bal-ba-glass-tone-ready'
|
|
169
|
+
: this.ui().isOnDeletion
|
|
170
|
+
? 'bal-ba-glass-tone-deletion'
|
|
171
|
+
: 'bal-ba-glass-tone-error'),
|
|
170
172
|
);
|
|
171
173
|
|
|
172
174
|
protected readonly isLoading = computed(
|
|
@@ -22,11 +22,11 @@ import { BlockAuthService } from '../../block-auth.service';
|
|
|
22
22
|
<ba-modal-overlay
|
|
23
23
|
testId="modal-signin"
|
|
24
24
|
[open]="open()"
|
|
25
|
-
panelClassName="xmd:bas-top-24 bas-w-full xsm1:bas-w-[380px] bas-
|
|
25
|
+
panelClassName="bal-ba-glass-card xmd:bas-top-24 bas-w-full xsm1:bas-w-[380px] bas-text-left bas-h-[600px] bas-rounded-tl-[18px] bas-rounded-tr-[18px] xmd:bas-rounded-br-[18px] xmd:bas-rounded-bl-[18px]"
|
|
26
26
|
(closed)="handleClose()"
|
|
27
27
|
>
|
|
28
28
|
<div class="bas-flex bas-h-full bas-w-full bas-items-center bas-justify-center">
|
|
29
|
-
<div class="bas-relative bas-h-full bas-w-
|
|
29
|
+
<div class="bas-relative bas-h-full bas-w-full">
|
|
30
30
|
<ba-content-signin [closeTxns]="handleClose" />
|
|
31
31
|
</div>
|
|
32
32
|
</div>
|
|
@@ -21,7 +21,7 @@ import { BlockAuthService } from '../../block-auth.service';
|
|
|
21
21
|
<ba-modal-overlay
|
|
22
22
|
testId="modal-signup"
|
|
23
23
|
[open]="open()"
|
|
24
|
-
panelClassName="xmd:bas-top-24 xmd:bas-m-1 bas-min-w-fit bas-
|
|
24
|
+
panelClassName="bal-ba-glass-card xmd:bas-top-24 xmd:bas-m-1 bas-min-w-fit bas-text-left xmd:bas-my-8 sm1:bas-h-[364px] bas-w-full xmd:bas-w-fit lg:bas-h-[376px] bas-h-[508px] bas-rounded-tl-[18px] bas-rounded-tr-[18px] xmd:bas-rounded-br-[18px] xmd:bas-rounded-bl-[18px]"
|
|
25
25
|
(closed)="onClose()"
|
|
26
26
|
>
|
|
27
27
|
<div class="bas-box-border bas-h-full bas-w-full bas-px-4 bas-pb-4 bas-pt-6 sm1:bas-pt-5 xmd:bas-pb-3.5 lg:bas-px-6 lg:bas-pb-5 lg:bas-pt-[26px]">
|
|
@@ -71,7 +71,7 @@ import { BtnBaseProviderComponent } from '../../btns/btn-base-provider.component
|
|
|
71
71
|
<ba-btn-base-provider
|
|
72
72
|
[text]="getBtnProviderText(item, uiConfigProvidersInfo().providersColumns ?? 3, isMobile(), uiConfigProvidersInfo().showProviderNameOnMobile)"
|
|
73
73
|
[sizeClassNames]="getBtnProviderSize(isMobile(), uiConfigProvidersInfo().showProviderNameOnMobile, isEditable(), device())"
|
|
74
|
-
[
|
|
74
|
+
[isSelected]="selectedService() === item"
|
|
75
75
|
[isEditable]="isEditable()"
|
|
76
76
|
[device]="device()"
|
|
77
77
|
(providerClicked)="selectedServiceChange.emit(item)"
|
|
@@ -238,16 +238,6 @@ export class ProvidersButtonsComponent {
|
|
|
238
238
|
return classNames;
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
-
getBtnProviderBorderClassNames(item: string, selected: string): string {
|
|
242
|
-
const style = providersStyles[item];
|
|
243
|
-
let classNames = `${style ? style.hoverBorderStyles : 'hover:bas-border-slate-400'}`;
|
|
244
|
-
if (item === 'blockauth') classNames += ' bas-border-[3px] ';
|
|
245
|
-
else classNames += ' bas-border-2 ';
|
|
246
|
-
if (selected === item && style) classNames += ` ${style.borderStyles} `;
|
|
247
|
-
else classNames += ' bas-border-slate-300 ';
|
|
248
|
-
return classNames;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
241
|
getBtnBaseProviderContainerClassNames(editable: boolean, dev: string): string {
|
|
252
242
|
if (!editable) return 'bas-h-fit bas-w-fit sm1:bas-h-16 sm1:bas-w-full';
|
|
253
243
|
if (dev === 'phone') return 'bas-h-fit bas-w-fit';
|
|
@@ -47,8 +47,7 @@ import { DropdownProfileComponent } from '../dds/dropdown-profile.component';
|
|
|
47
47
|
loaderId="signup-provider-loader"
|
|
48
48
|
[imgSrc]="isWeb3ProviderSelected() && imgQR() ? imgQR() : style().imgSrc"
|
|
49
49
|
[imgAlt]="'Img of ' + selectedService() + ' provider'"
|
|
50
|
-
[
|
|
51
|
-
[loaderColor]="style().loaderColor"
|
|
50
|
+
[showLoaderRing]="false"
|
|
52
51
|
[scaleImgWhenHovered]="!isWeb3ProviderSelected()"
|
|
53
52
|
[size]="isWeb3ProviderSelected() ? 'medium' : 'small'"
|
|
54
53
|
/>
|
|
@@ -75,9 +74,9 @@ import { DropdownProfileComponent } from '../dds/dropdown-profile.component';
|
|
|
75
74
|
<!-- CONECTADO: "Completa el último paso" + fila de Log In -->
|
|
76
75
|
<div class="bas-flex bas-w-full bas-flex-col bas-items-center bas-gap-4 bas-pt-2">
|
|
77
76
|
<div class="bas-flex bas-w-full bas-items-center bas-justify-center bas-gap-3">
|
|
78
|
-
<span class="bas-h-px bas-flex-1
|
|
79
|
-
<p class="bas-m-0 bas-text-center bas-text-[var(--bal-primary-
|
|
80
|
-
<span class="bas-h-px bas-flex-1
|
|
77
|
+
<span class="bal-ba-glass-divider bas-h-px bas-flex-1"></span>
|
|
78
|
+
<p class="bas-m-0 bas-text-center bas-text-[var(--bal-primary-700)]">{{ lastStepTxt() }}</p>
|
|
79
|
+
<span class="bal-ba-glass-divider bal-ba-glass-divider-end bas-h-px bas-flex-1"></span>
|
|
81
80
|
</div>
|
|
82
81
|
<div class="bas-flex bas-h-fit bas-w-full bas-flex-row bas-items-center bas-justify-center bas-gap-4">
|
|
83
82
|
<ba-arrow-icon direction="right" />
|
|
@@ -12,7 +12,7 @@ const iconClassNames = 'bal-ba-glass-icon bas-text-[#009F6B]';
|
|
|
12
12
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
13
13
|
template: `
|
|
14
14
|
<div
|
|
15
|
-
class="bal-ba-glass-panel bal-ba-glass-pop bal-ba-glass-stagger bas-box-border bas-grid bas-w-
|
|
15
|
+
class="bal-ba-glass-panel bal-ba-glass-pop bal-ba-glass-stagger bas-box-border bas-grid bas-w-full bas-grid-rows-3 bas-gap-3 bas-py-4 bas-pl-3"
|
|
16
16
|
>
|
|
17
17
|
@for (permission of requiredPermissions(); track $index) {
|
|
18
18
|
<div class="bal-ba-glass-row">
|
|
@@ -544,6 +544,7 @@ describe('SolicitedDataModal botón de cerrar', () => {
|
|
|
544
544
|
imports: [SolicitedDataModalComponent],
|
|
545
545
|
template: `<ba-solicited-data-modal
|
|
546
546
|
[requiredParams]="['users-email']"
|
|
547
|
+
[userParamValues]="{ 'users-email': 'user@test.com' }"
|
|
547
548
|
[closable]="true"
|
|
548
549
|
[acceptable]="true"
|
|
549
550
|
(accepted)="onAccepted()"
|
|
@@ -561,6 +562,44 @@ describe('SolicitedDataModal botón de cerrar', () => {
|
|
|
561
562
|
expect(accepts).toBe(1);
|
|
562
563
|
});
|
|
563
564
|
|
|
565
|
+
it('deshabilita Aceptar mientras falte un obligatorio', async () => {
|
|
566
|
+
@Component({
|
|
567
|
+
standalone: true,
|
|
568
|
+
imports: [SolicitedDataModalComponent],
|
|
569
|
+
template: `<ba-solicited-data-modal
|
|
570
|
+
[requiredParams]="['users-email']"
|
|
571
|
+
[acceptable]="true"
|
|
572
|
+
/>`,
|
|
573
|
+
})
|
|
574
|
+
class Host {}
|
|
575
|
+
await render(Host);
|
|
576
|
+
const accept = screen.getByRole('button', { name: 'Accept' }) as HTMLButtonElement;
|
|
577
|
+
expect(accept.disabled).toBe(true);
|
|
578
|
+
});
|
|
579
|
+
|
|
580
|
+
it('coloca Cancelar a la izquierda de Aceptar y emite closed', async () => {
|
|
581
|
+
let closes = 0;
|
|
582
|
+
@Component({
|
|
583
|
+
standalone: true,
|
|
584
|
+
imports: [SolicitedDataModalComponent],
|
|
585
|
+
template: `<ba-solicited-data-modal
|
|
586
|
+
[requiredParams]="['users-email']"
|
|
587
|
+
[closable]="true"
|
|
588
|
+
[acceptable]="true"
|
|
589
|
+
(closed)="onClosed()"
|
|
590
|
+
/>`,
|
|
591
|
+
})
|
|
592
|
+
class Host {
|
|
593
|
+
onClosed = () => closes++;
|
|
594
|
+
}
|
|
595
|
+
await render(Host);
|
|
596
|
+
const cancel = screen.getByRole('button', { name: 'Cancel' });
|
|
597
|
+
const accept = screen.getByRole('button', { name: 'Accept' });
|
|
598
|
+
expect(cancel.nextElementSibling).toBe(accept);
|
|
599
|
+
await fireEvent.click(cancel);
|
|
600
|
+
expect(closes).toBe(1);
|
|
601
|
+
});
|
|
602
|
+
|
|
564
603
|
it('traduce el botón Aceptar', async () => {
|
|
565
604
|
setLocale('es');
|
|
566
605
|
@Component({
|
|
@@ -67,7 +67,7 @@ interface SolicitedFieldView extends SolicitedField {
|
|
|
67
67
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
68
68
|
template: `
|
|
69
69
|
<div
|
|
70
|
-
class="bal-ba-glass-panel bal-ba-glass-pop bal-ba-glass-modal bas-box-border bas-w-[334px] bas-gap-4 bas-p-4"
|
|
70
|
+
class="bal-ba-glass-panel bal-ba-glass-pop bal-ba-glass-modal bas-box-border bas-w-full bas-max-w-[334px] bas-gap-4 bas-p-4"
|
|
71
71
|
>
|
|
72
72
|
@if (closable()) {
|
|
73
73
|
<div class="bal-ba-glass-modal-head">
|
|
@@ -265,15 +265,29 @@ interface SolicitedFieldView extends SolicitedField {
|
|
|
265
265
|
<p role="alert" class="bal-ba-glass-notice bal-ba-glass-notice-error bal-ba-glass-rise">
|
|
266
266
|
{{ errorTxt() }}
|
|
267
267
|
</p>
|
|
268
|
-
} @if (acceptable()) {
|
|
269
|
-
<
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
268
|
+
} @if (closable() || acceptable()) {
|
|
269
|
+
<div class="bal-ba-glass-actions">
|
|
270
|
+
@if (closable()) {
|
|
271
|
+
<button
|
|
272
|
+
type="button"
|
|
273
|
+
id="solicited-data-cancel"
|
|
274
|
+
class="bal-ba-glass-action bal-ba-glass-action-primary bal-ba-glass-action-secondary"
|
|
275
|
+
(click)="closed.emit()"
|
|
276
|
+
>
|
|
277
|
+
{{ cancelTxt() ?? t('cancelData') }}
|
|
278
|
+
</button>
|
|
279
|
+
} @if (acceptable()) {
|
|
280
|
+
<button
|
|
281
|
+
type="button"
|
|
282
|
+
id="solicited-data-accept"
|
|
283
|
+
class="bal-ba-glass-action bal-ba-glass-action-primary"
|
|
284
|
+
[disabled]="!allRequiredFilled()"
|
|
285
|
+
(click)="accepted.emit()"
|
|
286
|
+
>
|
|
287
|
+
{{ acceptTxt() ?? t('acceptData') }}
|
|
288
|
+
</button>
|
|
289
|
+
}
|
|
290
|
+
</div>
|
|
277
291
|
}
|
|
278
292
|
</div>
|
|
279
293
|
`,
|
|
@@ -292,6 +306,7 @@ export class SolicitedDataModalComponent {
|
|
|
292
306
|
closable = input(false);
|
|
293
307
|
acceptable = input(false);
|
|
294
308
|
acceptTxt = input<string>();
|
|
309
|
+
cancelTxt = input<string>();
|
|
295
310
|
|
|
296
311
|
paramChange = output<ParamChange>();
|
|
297
312
|
shareChange = output<ShareChange>();
|
|
@@ -48,6 +48,19 @@ describe('Txn', () => {
|
|
|
48
48
|
expect(screen.getByText('REJECT')).toBeDefined();
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
+
it('lee el consentimiento como una sola frase que fluye', async () => {
|
|
52
|
+
setLocale('es');
|
|
53
|
+
await render(TxnComponent, {
|
|
54
|
+
inputs: { hasSolicitedData: true },
|
|
55
|
+
providers: [provideBlockAuthClientForTest(makeClient())],
|
|
56
|
+
});
|
|
57
|
+
const sentence = screen.getByTestId('btn-privacy-policy').parentElement;
|
|
58
|
+
expect(sentence?.tagName).toBe('P');
|
|
59
|
+
expect(sentence?.textContent?.replace(/\s+/g, ' ').trim()).toBe(
|
|
60
|
+
'Autorizo la Política de Privacidad y los Términos y Condiciones',
|
|
61
|
+
);
|
|
62
|
+
});
|
|
63
|
+
|
|
51
64
|
it('respeta el locale activo cuando no se pasan textos custom', async () => {
|
|
52
65
|
setLocale('es');
|
|
53
66
|
await render(TxnComponent, {
|
|
@@ -128,13 +128,13 @@ interface TxnPreParams {
|
|
|
128
128
|
(click)="closeLifetime()"
|
|
129
129
|
></div>
|
|
130
130
|
<div
|
|
131
|
-
class="bal-ba-glass-popup-slot bas-absolute bas-inset-x-0 bas-top-44 bas-z-40"
|
|
131
|
+
class="bal-ba-glass-popup-slot bas-absolute bas-inset-x-0 bas-top-44 bas-z-40 bas-box-border bas-px-4"
|
|
132
132
|
>
|
|
133
133
|
<div
|
|
134
134
|
role="dialog"
|
|
135
135
|
id="txn-lifetime-modal"
|
|
136
136
|
[attr.aria-label]="configureSessionTimeTxtResolved()"
|
|
137
|
-
class="bal-ba-glass-panel bal-ba-glass-pop bal-ba-glass-lifetime bas-box-border bas-w-[334px] bas-p-4"
|
|
137
|
+
class="bal-ba-glass-panel bal-ba-glass-pop bal-ba-glass-lifetime bas-box-border bas-w-full bas-max-w-[334px] bas-p-4"
|
|
138
138
|
>
|
|
139
139
|
<div class="bal-ba-glass-modal-head">
|
|
140
140
|
<button
|
|
@@ -217,34 +217,26 @@ interface TxnPreParams {
|
|
|
217
217
|
></span>
|
|
218
218
|
</label>
|
|
219
219
|
</div>
|
|
220
|
-
<
|
|
221
|
-
class="
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
(click)="openPrivacyPolicy()"
|
|
232
|
-
>
|
|
233
|
-
{{ privacyPolicyTxtResolved() }}
|
|
234
|
-
</button>
|
|
235
|
-
<p class="bal-ba-transition-2 bas-m-0 bas-cursor-default">
|
|
236
|
-
{{ andTheTxtResolved() }}
|
|
237
|
-
</p>
|
|
238
|
-
</div>
|
|
220
|
+
<p class="bas-m-0 bas-text-sm bas-text-[var(--bal-primary-500)] group-hover:bas-text-[var(--bal-primary-800)]">
|
|
221
|
+
<span class="bal-ba-transition-2 bas-cursor-default">{{ iAuthorizeTheTxtResolved() }} </span>
|
|
222
|
+
<button
|
|
223
|
+
type="button"
|
|
224
|
+
data-testid="btn-privacy-policy"
|
|
225
|
+
class="bal-ba-transition-2 bas-inline bas-cursor-pointer bas-border-none bas-bg-transparent bas-p-0 bas-text-left bas-text-sm bas-text-[var(--bal-primary-700)] bas-underline group-hover:bas-text-[var(--bal-primary-900)]"
|
|
226
|
+
(click)="openPrivacyPolicy()"
|
|
227
|
+
>
|
|
228
|
+
{{ privacyPolicyTxtResolved() }}
|
|
229
|
+
</button>
|
|
230
|
+
<span class="bal-ba-transition-2 bas-cursor-default"> {{ andTheTxtResolved() }} </span>
|
|
239
231
|
<button
|
|
240
232
|
type="button"
|
|
241
233
|
data-testid="btn-terms-and-conditions"
|
|
242
|
-
class="bal-ba-transition-2 bas-
|
|
234
|
+
class="bal-ba-transition-2 bas-inline bas-cursor-pointer bas-border-none bas-bg-transparent bas-p-0 bas-text-left bas-text-sm bas-text-[var(--bal-primary-700)] bas-underline group-hover:bas-text-[var(--bal-primary-900)]"
|
|
243
235
|
(click)="openTermsAndConditions()"
|
|
244
236
|
>
|
|
245
237
|
{{ termsAndConditionsTxtResolved() }}
|
|
246
238
|
</button>
|
|
247
|
-
</
|
|
239
|
+
</p>
|
|
248
240
|
</div>
|
|
249
241
|
<div
|
|
250
242
|
class="bas-flex bas-w-full bas-flex-row bas-items-center bas-justify-between bas-gap-2"
|