valtech-components 2.0.987 → 2.0.989
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/esm2022/lib/components/organisms/edit-org-modal/edit-org-modal.component.mjs +229 -0
- package/esm2022/lib/components/organisms/edit-org-modal/edit-org-modal.i18n.mjs +38 -0
- package/esm2022/lib/components/organisms/invite-member-modal/invite-member-modal.component.mjs +519 -0
- package/esm2022/lib/components/organisms/invite-member-modal/invite-member-modal.i18n.mjs +54 -0
- package/esm2022/lib/components/organisms/member-detail-modal/member-detail-modal.component.mjs +406 -0
- package/esm2022/lib/components/organisms/member-detail-modal/member-detail-modal.i18n.mjs +72 -0
- package/esm2022/lib/components/organisms/member-detail-modal/types.mjs +2 -0
- package/esm2022/lib/components/organisms/transfer-ownership-modal/transfer-ownership-modal.component.mjs +231 -0
- package/esm2022/lib/components/organisms/transfer-ownership-modal/transfer-ownership-modal.i18n.mjs +27 -0
- package/esm2022/lib/components/organisms/transfer-ownership-modal/types.mjs +2 -0
- package/esm2022/lib/version.mjs +2 -2
- package/esm2022/public-api.mjs +7 -1
- package/fesm2022/valtech-components.mjs +1539 -28
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/organisms/edit-org-modal/edit-org-modal.component.d.ts +49 -0
- package/lib/components/organisms/edit-org-modal/edit-org-modal.i18n.d.ts +7 -0
- package/lib/components/organisms/invite-member-modal/invite-member-modal.component.d.ts +74 -0
- package/lib/components/organisms/invite-member-modal/invite-member-modal.i18n.d.ts +7 -0
- package/lib/components/organisms/member-detail-modal/member-detail-modal.component.d.ts +67 -0
- package/lib/components/organisms/member-detail-modal/member-detail-modal.i18n.d.ts +7 -0
- package/lib/components/organisms/member-detail-modal/types.d.ts +17 -0
- package/lib/components/organisms/transfer-ownership-modal/transfer-ownership-modal.component.d.ts +44 -0
- package/lib/components/organisms/transfer-ownership-modal/transfer-ownership-modal.i18n.d.ts +8 -0
- package/lib/components/organisms/transfer-ownership-modal/types.d.ts +11 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +6 -0
- package/src/lib/services/firebase/firebase-messaging-sw.js +0 -145
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { OnInit, WritableSignal } from '@angular/core';
|
|
2
|
+
import { FormMetadata, FormSubmit } from '../../types';
|
|
3
|
+
import { Organization } from '../../../services/org/types';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* `val-edit-org-modal` — modal de edición de organización (nombre + descripción).
|
|
7
|
+
* Promovido desde `showcase` bajo el proceso de ADR-021. Reusado por la vista de
|
|
8
|
+
* gestión de organización (y futuras vistas org-aware).
|
|
9
|
+
*
|
|
10
|
+
* Edita la org vía `OrgService.updateOrg`. El formulario se construye una vez y se
|
|
11
|
+
* mantiene reactivo a idioma + estado de trabajo vía effects `allowSignalWrites`.
|
|
12
|
+
* Si el consumer no pasa `org`, cae al `activeOrgId` del `AuthService`.
|
|
13
|
+
*
|
|
14
|
+
* Abierto vía `ModalService` — recibe `_modalRef` por `componentProps` + callback
|
|
15
|
+
* `onSuccess(updated)`. Header canónico (Regla #5): sin `ion-title`, botón Cerrar
|
|
16
|
+
* texto en `slot=end`, título/subtítulo en el body con `val-display`/`val-title`.
|
|
17
|
+
*
|
|
18
|
+
* Auto-registra sus defaults i18n (es/en) si el consumer no proveyó el namespace
|
|
19
|
+
* `EditOrgModal`.
|
|
20
|
+
*/
|
|
21
|
+
export declare class EditOrgModalComponent implements OnInit {
|
|
22
|
+
private i18n;
|
|
23
|
+
private orgService;
|
|
24
|
+
private toast;
|
|
25
|
+
private errors;
|
|
26
|
+
private auth;
|
|
27
|
+
/** Inyectado por `ModalService.open` — referencia para cerrar desde dentro. */
|
|
28
|
+
_modalRef?: {
|
|
29
|
+
dismiss: (data?: unknown, role?: string) => void;
|
|
30
|
+
};
|
|
31
|
+
/** Organización a editar (pasada por `componentProps`). */
|
|
32
|
+
org: Organization | null;
|
|
33
|
+
/** Callback tras actualizar la org (pasado por `componentProps`). */
|
|
34
|
+
onSuccess?: (updated: Organization) => void;
|
|
35
|
+
/** Namespace i18n con que la vista resuelve sus textos. */
|
|
36
|
+
i18nNamespace: string;
|
|
37
|
+
private readonly saving;
|
|
38
|
+
readonly formMeta: WritableSignal<FormMetadata>;
|
|
39
|
+
constructor();
|
|
40
|
+
ngOnInit(): void;
|
|
41
|
+
private get activeOrgId();
|
|
42
|
+
private buildFormMeta;
|
|
43
|
+
onFormSubmit(event: FormSubmit): void;
|
|
44
|
+
private save;
|
|
45
|
+
dismiss(): void;
|
|
46
|
+
t(key: string): string;
|
|
47
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EditOrgModalComponent, never>;
|
|
48
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<EditOrgModalComponent, "val-edit-org-modal", never, { "_modalRef": { "alias": "_modalRef"; "required": false; }; "org": { "alias": "org"; "required": false; }; "onSuccess": { "alias": "onSuccess"; "required": false; }; "i18nNamespace": { "alias": "i18nNamespace"; "required": false; }; }, {}, never, never, true, never>;
|
|
49
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LanguagesContent } from '../../../services/i18n/types';
|
|
2
|
+
/**
|
|
3
|
+
* Defaults i18n (es/en) embebidos en `val-edit-org-modal`. Auto-registrados en
|
|
4
|
+
* el constructor del componente si el consumer no proveyó el namespace
|
|
5
|
+
* (`EditOrgModal` por default). SOLO incluye las keys que el modal usa.
|
|
6
|
+
*/
|
|
7
|
+
export declare const EDIT_ORG_MODAL_I18N: LanguagesContent;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import { FormControl } from '@angular/forms';
|
|
3
|
+
import { ButtonMetadata, InputMetadata } from '../../types';
|
|
4
|
+
import { OrgRole } from '../../../services/org/types';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
interface PublicUserProfile {
|
|
7
|
+
userId: string;
|
|
8
|
+
handle?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* `val-invite-member-modal` — invitación de miembros a una organización.
|
|
13
|
+
* Promovido desde `showcase` bajo el proceso de ADR-021.
|
|
14
|
+
*
|
|
15
|
+
* Busca usuarios por handle en Firestore `/profiles` (multi-select) o invita por
|
|
16
|
+
* email cuando el query es un correo válido. Asigna el rol seleccionado y envía la
|
|
17
|
+
* invitación vía `OrgService.inviteUser`. Excluye al usuario actual y a los
|
|
18
|
+
* `existingMemberIds` de los resultados.
|
|
19
|
+
*
|
|
20
|
+
* Abierto vía `ModalService` — recibe `_modalRef` por `componentProps` + callback
|
|
21
|
+
* `onSuccess`. Header canónico (Regla #5): sin `ion-title`, botón Cerrar texto en
|
|
22
|
+
* `slot=end`, título/subtítulo en el body con `val-display`/`val-title`.
|
|
23
|
+
*
|
|
24
|
+
* Auto-registra sus defaults i18n (es/en) si el consumer no proveyó el namespace
|
|
25
|
+
* `InviteModal`.
|
|
26
|
+
*/
|
|
27
|
+
export declare class InviteMemberModalComponent implements OnDestroy {
|
|
28
|
+
private orgService;
|
|
29
|
+
private auth;
|
|
30
|
+
private toast;
|
|
31
|
+
private errors;
|
|
32
|
+
private firestore;
|
|
33
|
+
private i18n;
|
|
34
|
+
/** Inyectado por `ModalService.open` — referencia para cerrar desde dentro. */
|
|
35
|
+
_modalRef?: {
|
|
36
|
+
dismiss: (data?: unknown, role?: string) => void;
|
|
37
|
+
};
|
|
38
|
+
/** Organización a la que se invita. */
|
|
39
|
+
orgId: string;
|
|
40
|
+
/** Ids de miembros ya existentes (excluidos de los resultados). */
|
|
41
|
+
existingMemberIds: string[];
|
|
42
|
+
/** Callback tras enviar la(s) invitación(es) (pasado por `componentProps`). */
|
|
43
|
+
onSuccess?: () => void;
|
|
44
|
+
/** Namespace i18n con que la vista resuelve sus textos. */
|
|
45
|
+
i18nNamespace: string;
|
|
46
|
+
readonly query: import("@angular/core").WritableSignal<string>;
|
|
47
|
+
readonly searching: import("@angular/core").WritableSignal<boolean>;
|
|
48
|
+
readonly searchResults: import("@angular/core").WritableSignal<PublicUserProfile[]>;
|
|
49
|
+
readonly selectedUsers: import("@angular/core").WritableSignal<PublicUserProfile[]>;
|
|
50
|
+
readonly sending: import("@angular/core").WritableSignal<boolean>;
|
|
51
|
+
readonly selectedRole: import("@angular/core").WritableSignal<string>;
|
|
52
|
+
readonly availableRoles: import("@angular/core").WritableSignal<OrgRole[]>;
|
|
53
|
+
readonly roleControl: FormControl<string>;
|
|
54
|
+
readonly roleSelectProps: import("@angular/core").Signal<Partial<InputMetadata>>;
|
|
55
|
+
readonly isEmail: import("@angular/core").Signal<boolean>;
|
|
56
|
+
readonly sendButtonProps: import("@angular/core").Signal<Partial<ButtonMetadata>>;
|
|
57
|
+
readonly sendSelectedProps: import("@angular/core").Signal<Partial<ButtonMetadata>>;
|
|
58
|
+
private searchSubject;
|
|
59
|
+
private roleSub?;
|
|
60
|
+
constructor();
|
|
61
|
+
onQueryChange(value: string): void;
|
|
62
|
+
private loadRoles;
|
|
63
|
+
roleDisplayName(role: OrgRole): string;
|
|
64
|
+
onInviteByEmail(): Promise<void>;
|
|
65
|
+
isSelected(userId: string): boolean;
|
|
66
|
+
toggleUser(user: PublicUserProfile): void;
|
|
67
|
+
onSendSelected(): Promise<void>;
|
|
68
|
+
ngOnDestroy(): void;
|
|
69
|
+
dismiss(): void;
|
|
70
|
+
t(key: string): string;
|
|
71
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InviteMemberModalComponent, never>;
|
|
72
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<InviteMemberModalComponent, "val-invite-member-modal", never, { "_modalRef": { "alias": "_modalRef"; "required": false; }; "orgId": { "alias": "orgId"; "required": false; }; "existingMemberIds": { "alias": "existingMemberIds"; "required": false; }; "onSuccess": { "alias": "onSuccess"; "required": false; }; "i18nNamespace": { "alias": "i18nNamespace"; "required": false; }; }, {}, never, never, true, never>;
|
|
73
|
+
}
|
|
74
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LanguagesContent } from '../../../services/i18n/types';
|
|
2
|
+
/**
|
|
3
|
+
* Defaults i18n (es/en) embebidos en `val-invite-member-modal`. Auto-registrados
|
|
4
|
+
* en el constructor del componente si el consumer no proveyó el namespace
|
|
5
|
+
* (`InviteModal` por default). SOLO incluye las keys que el modal usa.
|
|
6
|
+
*/
|
|
7
|
+
export declare const INVITE_MEMBER_MODAL_I18N: LanguagesContent;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { FormControl } from '@angular/forms';
|
|
3
|
+
import { ButtonMetadata, InputMetadata } from '../../types';
|
|
4
|
+
import { MemberDetail, OrgRoleWithPermissions } from './types';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* `val-member-detail-modal` — detalle de miembro de organización: perfil, rol y
|
|
8
|
+
* permisos. Promovido desde `showcase` bajo el proceso de ADR-021.
|
|
9
|
+
*
|
|
10
|
+
* Si `canManage` es true, permite cambiar el rol (vía `OrgService.changeMemberRole`)
|
|
11
|
+
* y quitar al miembro (vía `OrgService.removeMember`, con confirmación destructiva).
|
|
12
|
+
* Los permisos del rol actual se muestran cuando el consumer los provee en
|
|
13
|
+
* `availableRoles`.
|
|
14
|
+
*
|
|
15
|
+
* Abierto vía `ModalService` — recibe `_modalRef` por `componentProps` + callback
|
|
16
|
+
* `onChanged`. Header canónico (Regla #5): sin `ion-title`, botón Cerrar texto en
|
|
17
|
+
* `slot=end`, identidad en el body con `val-user-avatar`/`val-display`/`val-title`.
|
|
18
|
+
*
|
|
19
|
+
* Auto-registra sus defaults i18n (es/en) si el consumer no proveyó el namespace
|
|
20
|
+
* `Settings.MemberDetail`.
|
|
21
|
+
*/
|
|
22
|
+
export declare class MemberDetailModalComponent implements OnInit, OnDestroy {
|
|
23
|
+
private orgService;
|
|
24
|
+
private toast;
|
|
25
|
+
private errors;
|
|
26
|
+
private i18n;
|
|
27
|
+
private confirmDialog;
|
|
28
|
+
/** Inyectado por `ModalService.open` — referencia para cerrar desde dentro. */
|
|
29
|
+
_modalRef?: {
|
|
30
|
+
dismiss: (data?: unknown, role?: string) => void;
|
|
31
|
+
};
|
|
32
|
+
/** Miembro a mostrar (pasado por `componentProps`). */
|
|
33
|
+
member: MemberDetail;
|
|
34
|
+
/** Organización a la que pertenece el miembro. */
|
|
35
|
+
orgId: string;
|
|
36
|
+
/** Si true, habilita cambio de rol y eliminación. */
|
|
37
|
+
canManage: boolean;
|
|
38
|
+
/** Si true, el miembro mostrado es el propio usuario. */
|
|
39
|
+
isSelf: boolean;
|
|
40
|
+
/** Roles disponibles (con permisos opcionales) para el selector de rol. */
|
|
41
|
+
availableRoles: OrgRoleWithPermissions[];
|
|
42
|
+
/** Callback tras cambiar rol o quitar al miembro (pasado por `componentProps`). */
|
|
43
|
+
onChanged?: () => void;
|
|
44
|
+
/** Namespace i18n con que la vista resuelve sus textos. */
|
|
45
|
+
i18nNamespace: string;
|
|
46
|
+
readonly working: import("@angular/core").WritableSignal<boolean>;
|
|
47
|
+
readonly currentRole: import("@angular/core").WritableSignal<string>;
|
|
48
|
+
readonly roleControl: FormControl<string>;
|
|
49
|
+
private roleSub?;
|
|
50
|
+
readonly displayName: import("@angular/core").Signal<string>;
|
|
51
|
+
readonly subtitle: import("@angular/core").Signal<string>;
|
|
52
|
+
readonly currentRoleLabel: import("@angular/core").Signal<string>;
|
|
53
|
+
readonly permissionsForCurrentRole: import("@angular/core").Signal<string[]>;
|
|
54
|
+
readonly roleSelectProps: import("@angular/core").Signal<Partial<InputMetadata>>;
|
|
55
|
+
readonly removeButtonProps: import("@angular/core").Signal<Partial<ButtonMetadata>>;
|
|
56
|
+
constructor();
|
|
57
|
+
ngOnInit(): void;
|
|
58
|
+
permissionLabel(perm: string): string;
|
|
59
|
+
private onChangeRole;
|
|
60
|
+
onRemove(): Promise<void>;
|
|
61
|
+
roleLabel(roleIdOrName: string): string;
|
|
62
|
+
ngOnDestroy(): void;
|
|
63
|
+
dismiss(): void;
|
|
64
|
+
t(key: string): string;
|
|
65
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MemberDetailModalComponent, never>;
|
|
66
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MemberDetailModalComponent, "val-member-detail-modal", never, { "_modalRef": { "alias": "_modalRef"; "required": false; }; "member": { "alias": "member"; "required": false; }; "orgId": { "alias": "orgId"; "required": false; }; "canManage": { "alias": "canManage"; "required": false; }; "isSelf": { "alias": "isSelf"; "required": false; }; "availableRoles": { "alias": "availableRoles"; "required": false; }; "onChanged": { "alias": "onChanged"; "required": false; }; "i18nNamespace": { "alias": "i18nNamespace"; "required": false; }; }, {}, never, never, true, never>;
|
|
67
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LanguagesContent } from '../../../services/i18n/types';
|
|
2
|
+
/**
|
|
3
|
+
* Defaults i18n (es/en) embebidos en `val-member-detail-modal`. Auto-registrados
|
|
4
|
+
* en el constructor del componente si el consumer no proveyó el namespace
|
|
5
|
+
* (`Settings.MemberDetail` por default). SOLO incluye las keys que el modal usa.
|
|
6
|
+
*/
|
|
7
|
+
export declare const MEMBER_DETAIL_MODAL_I18N: LanguagesContent;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { OrgMember, OrgRole } from '../../../services/org/types';
|
|
2
|
+
/**
|
|
3
|
+
* Miembro de organización enriquecido con datos de perfil público
|
|
4
|
+
* (`handle`/`avatar`), consumido por `val-member-detail-modal`. Promovido desde
|
|
5
|
+
* `showcase` bajo el proceso de ADR-021.
|
|
6
|
+
*/
|
|
7
|
+
export interface MemberDetail extends OrgMember {
|
|
8
|
+
handle?: string;
|
|
9
|
+
avatar?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Rol de organización con permisos opcionales. El modal muestra los permisos del
|
|
13
|
+
* rol actual cuando el consumer los provee en `availableRoles`.
|
|
14
|
+
*/
|
|
15
|
+
export interface OrgRoleWithPermissions extends OrgRole {
|
|
16
|
+
permissions?: string[];
|
|
17
|
+
}
|
package/lib/components/organisms/transfer-ownership-modal/transfer-ownership-modal.component.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { MemberCard } from './types';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* `val-transfer-ownership-modal` — selector de miembro para transferir la
|
|
6
|
+
* propiedad de la organización. Promovido desde `showcase` bajo el proceso de
|
|
7
|
+
* ADR-021.
|
|
8
|
+
*
|
|
9
|
+
* Recibe la lista de candidatos por `members` (todos excepto el owner actual),
|
|
10
|
+
* permite filtrarlos con `val-searchbar` y, al confirmar, ejecuta el callback
|
|
11
|
+
* `onConfirm(newOwnerId)`. La ejecución real de la transferencia (vía
|
|
12
|
+
* `OrgService.transferOwnership`) queda en el consumer.
|
|
13
|
+
*
|
|
14
|
+
* Abierto vía `ModalService` — recibe `_modalRef` por `componentProps`. Header
|
|
15
|
+
* canónico (Regla #5): sin `ion-title`, botón Cerrar texto en `slot=end`,
|
|
16
|
+
* título/subtítulo en el body con `val-display`/`val-title`.
|
|
17
|
+
*
|
|
18
|
+
* Auto-registra sus defaults i18n (es/en) si el consumer no proveyó el namespace
|
|
19
|
+
* `Settings.TransferModal`.
|
|
20
|
+
*/
|
|
21
|
+
export declare class TransferOwnershipModalComponent implements OnInit {
|
|
22
|
+
private i18n;
|
|
23
|
+
/** Lista de miembros transferibles (todos excepto el owner actual). */
|
|
24
|
+
members: MemberCard[];
|
|
25
|
+
/** Callback ejecutado con el userId seleccionado tras confirmar. */
|
|
26
|
+
onConfirm?: (newOwnerId: string) => void;
|
|
27
|
+
/** Inyectado por `ModalService.open` — referencia para cerrar desde dentro. */
|
|
28
|
+
_modalRef?: {
|
|
29
|
+
dismiss: (data?: unknown, role?: string) => void;
|
|
30
|
+
};
|
|
31
|
+
/** Namespace i18n con que la vista resuelve sus textos. */
|
|
32
|
+
i18nNamespace: string;
|
|
33
|
+
readonly query: import("@angular/core").WritableSignal<string>;
|
|
34
|
+
readonly selectedId: import("@angular/core").WritableSignal<string>;
|
|
35
|
+
readonly filtered: import("@angular/core").Signal<MemberCard[]>;
|
|
36
|
+
readonly noResultsLabel: import("@angular/core").Signal<string>;
|
|
37
|
+
constructor();
|
|
38
|
+
ngOnInit(): void;
|
|
39
|
+
confirm(): void;
|
|
40
|
+
dismiss(): void;
|
|
41
|
+
t(key: string): string;
|
|
42
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TransferOwnershipModalComponent, never>;
|
|
43
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TransferOwnershipModalComponent, "val-transfer-ownership-modal", never, { "members": { "alias": "members"; "required": false; }; "onConfirm": { "alias": "onConfirm"; "required": false; }; "_modalRef": { "alias": "_modalRef"; "required": false; }; "i18nNamespace": { "alias": "i18nNamespace"; "required": false; }; }, {}, never, never, true, never>;
|
|
44
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LanguagesContent } from '../../../services/i18n/types';
|
|
2
|
+
/**
|
|
3
|
+
* Defaults i18n (es/en) embebidos en `val-transfer-ownership-modal`.
|
|
4
|
+
* Auto-registrados en el constructor del componente si el consumer no proveyó el
|
|
5
|
+
* namespace (`Settings.TransferModal` por default). SOLO incluye las keys que el
|
|
6
|
+
* modal usa.
|
|
7
|
+
*/
|
|
8
|
+
export declare const TRANSFER_OWNERSHIP_MODAL_I18N: LanguagesContent;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OrgMember } from '../../../services/org/types';
|
|
2
|
+
/**
|
|
3
|
+
* Miembro de organización enriquecido con datos de perfil público
|
|
4
|
+
* (`handle`/`avatar`), consumido por `val-transfer-ownership-modal` como entrada
|
|
5
|
+
* de su lista de candidatos. Promovido desde `showcase` bajo el proceso de
|
|
6
|
+
* ADR-021.
|
|
7
|
+
*/
|
|
8
|
+
export interface MemberCard extends OrgMember {
|
|
9
|
+
handle?: string;
|
|
10
|
+
avatar?: string;
|
|
11
|
+
}
|
package/lib/version.d.ts
CHANGED
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -285,6 +285,12 @@ export * from './lib/components/organisms/delete-account-modal/delete-account-mo
|
|
|
285
285
|
export * from './lib/components/organisms/switch-org-modal/switch-org-modal.component';
|
|
286
286
|
export * from './lib/components/organisms/create-org-modal/create-org-modal.component';
|
|
287
287
|
export * from './lib/components/organisms/org-info-sheet/org-info-sheet.component';
|
|
288
|
+
export * from './lib/components/organisms/invite-member-modal/invite-member-modal.component';
|
|
289
|
+
export * from './lib/components/organisms/member-detail-modal/member-detail-modal.component';
|
|
290
|
+
export * from './lib/components/organisms/member-detail-modal/types';
|
|
291
|
+
export * from './lib/components/organisms/edit-org-modal/edit-org-modal.component';
|
|
292
|
+
export * from './lib/components/organisms/transfer-ownership-modal/transfer-ownership-modal.component';
|
|
293
|
+
export * from './lib/components/organisms/transfer-ownership-modal/types';
|
|
288
294
|
export * from './lib/components/organisms/skeleton-layout/skeleton-layout.component';
|
|
289
295
|
export * from './lib/components/organisms/skeleton-layout/types';
|
|
290
296
|
export * from './lib/components/organisms/faq/faq.component';
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Firebase Messaging Service Worker
|
|
3
|
-
*
|
|
4
|
-
* Service Worker estático para Firebase Cloud Messaging.
|
|
5
|
-
* Carga la configuración dinámicamente desde /firebase-config.js.
|
|
6
|
-
*
|
|
7
|
-
* CONFIGURACIÓN:
|
|
8
|
-
* 1. Crea firebase.config.json con tu configuración de Firebase
|
|
9
|
-
* 2. Ejecuta: npm run generate:firebase-config
|
|
10
|
-
* Esto genera /firebase-config.js con: self.FIREBASE_CONFIG = {...}
|
|
11
|
-
* 3. Agrega este SW y firebase-config.js a los assets de angular.json
|
|
12
|
-
*
|
|
13
|
-
* Ver README.md para documentación completa.
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
// Importar Firebase scripts
|
|
17
|
-
importScripts('https://www.gstatic.com/firebasejs/10.7.0/firebase-app-compat.js');
|
|
18
|
-
importScripts('https://www.gstatic.com/firebasejs/10.7.0/firebase-messaging-compat.js');
|
|
19
|
-
|
|
20
|
-
// Importar configuración desde archivo externo (generado en build)
|
|
21
|
-
// Este archivo define: self.FIREBASE_CONFIG = { ... }
|
|
22
|
-
try {
|
|
23
|
-
importScripts('/firebase-config.js');
|
|
24
|
-
} catch (e) {
|
|
25
|
-
console.error('[SW] No se pudo cargar firebase-config.js:', e);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// Verificar que la configuración existe
|
|
29
|
-
if (!self.FIREBASE_CONFIG) {
|
|
30
|
-
console.error('[SW] FIREBASE_CONFIG no está definido.');
|
|
31
|
-
console.error('[SW] Ejecuta: npm run generate:firebase-config');
|
|
32
|
-
} else {
|
|
33
|
-
// Inicializar Firebase
|
|
34
|
-
firebase.initializeApp(self.FIREBASE_CONFIG);
|
|
35
|
-
|
|
36
|
-
// Obtener instancia de messaging
|
|
37
|
-
const messaging = firebase.messaging();
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Handler para mensajes en background.
|
|
41
|
-
*/
|
|
42
|
-
messaging.onBackgroundMessage((payload) => {
|
|
43
|
-
console.log('[SW] Mensaje recibido en background:', payload);
|
|
44
|
-
|
|
45
|
-
// Web push usa mensajes data-only (sin bloque `notification`) para que el
|
|
46
|
-
// navegador NO auto-muestre una notificación duplicada — el SW es el único
|
|
47
|
-
// que la pinta. Title/body/icon llegan dentro de `data`. Se mantiene el
|
|
48
|
-
// fallback a `payload.notification` por compatibilidad con mensajes
|
|
49
|
-
// legacy o nativos que sí traen el bloque.
|
|
50
|
-
const data = payload.data || {};
|
|
51
|
-
const notificationTitle =
|
|
52
|
-
payload.notification?.title || data.title || 'Nueva notificación';
|
|
53
|
-
const notificationBody = payload.notification?.body || data.body || '';
|
|
54
|
-
const notificationIcon =
|
|
55
|
-
payload.notification?.icon || data.icon || '/assets/icon/favicon.ico';
|
|
56
|
-
|
|
57
|
-
const notificationOptions = {
|
|
58
|
-
body: notificationBody,
|
|
59
|
-
icon: notificationIcon,
|
|
60
|
-
image: payload.notification?.image,
|
|
61
|
-
badge: '/assets/icon/badge.png',
|
|
62
|
-
tag: payload.messageId || data.messageId || 'default',
|
|
63
|
-
data: {
|
|
64
|
-
...data,
|
|
65
|
-
messageId: payload.messageId || data.messageId,
|
|
66
|
-
title: notificationTitle,
|
|
67
|
-
body: notificationBody,
|
|
68
|
-
},
|
|
69
|
-
vibrate: [200, 100, 200],
|
|
70
|
-
requireInteraction: data.require_interaction === 'true',
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
return self.registration.showNotification(notificationTitle, notificationOptions);
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Handler para clicks en notificaciones.
|
|
78
|
-
*/
|
|
79
|
-
self.addEventListener('notificationclick', (event) => {
|
|
80
|
-
console.log('[SW] Click en notificación:', event);
|
|
81
|
-
event.notification.close();
|
|
82
|
-
|
|
83
|
-
const data = event.notification.data || {};
|
|
84
|
-
let targetUrl = '/';
|
|
85
|
-
|
|
86
|
-
if (data.route) {
|
|
87
|
-
targetUrl = data.route;
|
|
88
|
-
} else if (data.url) {
|
|
89
|
-
targetUrl = data.url;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
if (data.query_params) {
|
|
93
|
-
const separator = targetUrl.includes('?') ? '&' : '?';
|
|
94
|
-
targetUrl += separator + data.query_params;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const notificationPayload = {
|
|
98
|
-
type: 'NOTIFICATION_CLICK',
|
|
99
|
-
notification: {
|
|
100
|
-
title: data.title,
|
|
101
|
-
body: data.body,
|
|
102
|
-
data: data,
|
|
103
|
-
messageId: data.messageId,
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
event.waitUntil(
|
|
108
|
-
clients
|
|
109
|
-
.matchAll({ type: 'window', includeUncontrolled: true })
|
|
110
|
-
.then((clientList) => {
|
|
111
|
-
// Siempre enviar postMessage para que la app pueda reaccionar
|
|
112
|
-
for (const client of clientList) {
|
|
113
|
-
client.postMessage(notificationPayload);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// Navegar si hay route o url
|
|
117
|
-
if (targetUrl !== '/') {
|
|
118
|
-
for (const client of clientList) {
|
|
119
|
-
if ('navigate' in client) {
|
|
120
|
-
return client.navigate(targetUrl).then((c) => c?.focus());
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
// Si no hay cliente abierto, abrir nueva ventana
|
|
124
|
-
if (clients.openWindow) {
|
|
125
|
-
return clients.openWindow(targetUrl);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// Solo hacer focus si no hay navegación
|
|
130
|
-
for (const client of clientList) {
|
|
131
|
-
if ('focus' in client) {
|
|
132
|
-
return client.focus();
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
if (clients.openWindow) {
|
|
136
|
-
return clients.openWindow('/');
|
|
137
|
-
}
|
|
138
|
-
})
|
|
139
|
-
);
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
self.addEventListener('notificationclose', (event) => {
|
|
143
|
-
console.log('[SW] Notificación cerrada:', event.notification.tag);
|
|
144
|
-
});
|
|
145
|
-
}
|