valtech-components 2.0.988 → 2.0.990
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/atoms/button/button.component.mjs +6 -3
- 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/organization-view/organization-view.component.mjs +1065 -0
- package/esm2022/lib/components/organisms/organization-view/organization-view.i18n.mjs +148 -0
- package/esm2022/lib/components/organisms/organization-view/organization.routes.mjs +30 -0
- package/esm2022/lib/components/organisms/organization-view/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/components/types.mjs +1 -1
- package/esm2022/lib/version.mjs +2 -2
- package/esm2022/public-api.mjs +10 -1
- package/fesm2022/valtech-components.mjs +2755 -30
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/organisms/article/article.component.d.ts +1 -0
- 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/organization-view/organization-view.component.d.ts +104 -0
- package/lib/components/organisms/organization-view/organization-view.i18n.d.ts +9 -0
- package/lib/components/organisms/organization-view/organization.routes.d.ts +25 -0
- package/lib/components/organisms/organization-view/types.d.ts +61 -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/components/types.d.ts +2 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +9 -0
|
@@ -79,6 +79,7 @@ export declare class ArticleComponent implements OnInit {
|
|
|
79
79
|
expand?: "full" | "block";
|
|
80
80
|
link?: string;
|
|
81
81
|
href?: string;
|
|
82
|
+
routerLink?: string | any[];
|
|
82
83
|
target?: "_blank" | "_self" | "_parent" | "_top";
|
|
83
84
|
download?: string;
|
|
84
85
|
color: import("@ionic/core").Color;
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { EmptyStateMetadata } from '../../molecules/empty-state/types';
|
|
2
|
+
import { ButtonMetadata } from '../../types';
|
|
3
|
+
import { AuthService } from '../../../services/auth/auth.service';
|
|
4
|
+
import { OrgRole, Organization } from '../../../services/org/types';
|
|
5
|
+
import { MemberDetail } from '../member-detail-modal/types';
|
|
6
|
+
import { OrganizationViewConfig } from './types';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
/**
|
|
9
|
+
* `val-organization-view` — vista Gestión de organización full-feature
|
|
10
|
+
* autocontenida (organism). Promovida desde `showcase` bajo el proceso de
|
|
11
|
+
* ADR-021. Reúne:
|
|
12
|
+
* - **Información** — nombre, descripción, plan y tipo de la org activa; editar
|
|
13
|
+
* vía modal `val-edit-org-modal` (solo si `canEditOrg()`).
|
|
14
|
+
* - **Miembros** — lista paginada (`val-member-card`) enriquecida con perfiles
|
|
15
|
+
* públicos (Firestore); ver detalle vía `val-member-detail-modal`.
|
|
16
|
+
* - **Roles y permisos** — sección explicativa con CTA a la ruta de permisos.
|
|
17
|
+
* - **Invitar** — CTA que abre `val-invite-member-modal` (gateada por `users:*`).
|
|
18
|
+
* - **Transferir propiedad** — `val-transfer-ownership-modal` (solo owner).
|
|
19
|
+
* - **Salir de la organización** — `OrgService.leaveOrg` con confirmación
|
|
20
|
+
* destructiva.
|
|
21
|
+
*
|
|
22
|
+
* **RBAC interno** (decisión CTO, ADR-021): el gating fino se resuelve dentro de
|
|
23
|
+
* la vista vía `AuthService.hasPermission()` + `*valHasPermission` + computeds
|
|
24
|
+
* `isOwner()`/`canManageMembers()`/`canEditOrg()`. NO se expone como config.
|
|
25
|
+
*
|
|
26
|
+
* **Auto-reload en org-switch**: un `effect` reactiona a `activeOrgId()` y recarga
|
|
27
|
+
* org + miembros cuando el usuario cambia de organización activa mientras la vista
|
|
28
|
+
* está montada. El effect cubre también la carga inicial (sin doble carga).
|
|
29
|
+
*
|
|
30
|
+
* NO renderiza ion-content — vive dentro de val-page-wrapper. `ActivatedRoute` se
|
|
31
|
+
* inyecta `{ optional: true }` solo para leer el route data de config (no-op
|
|
32
|
+
* embebido). Auto-registra sus defaults i18n (es/en) si el consumer no proveyó el
|
|
33
|
+
* namespace (default `Settings.Organization`).
|
|
34
|
+
*/
|
|
35
|
+
export declare class OrganizationViewComponent {
|
|
36
|
+
private nav;
|
|
37
|
+
private i18n;
|
|
38
|
+
readonly auth: AuthService;
|
|
39
|
+
private orgService;
|
|
40
|
+
private toast;
|
|
41
|
+
private errors;
|
|
42
|
+
private modalService;
|
|
43
|
+
private firestore;
|
|
44
|
+
private confirmDialog;
|
|
45
|
+
private route;
|
|
46
|
+
readonly isDebug: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Config vía @Input (object-first). Si no se pasa, se cae al route data
|
|
49
|
+
* `organizationConfig` (poblado por `provideValtechOrganizationRoutes`).
|
|
50
|
+
* `resolvedConfig` mergea con los defaults — `@Input` gana sobre route data.
|
|
51
|
+
*/
|
|
52
|
+
config?: OrganizationViewConfig;
|
|
53
|
+
readonly resolvedConfig: import("@angular/core").Signal<Required<Omit<OrganizationViewConfig, "onOrgEdited" | "onMemberInvited" | "onOwnershipTransferred" | "onLeftOrg">> & Pick<OrganizationViewConfig, "onOrgEdited" | "onMemberInvited" | "onOwnershipTransferred" | "onLeftOrg">>;
|
|
54
|
+
/** Namespace i18n resuelto (capturado para llamadas no-reactivas). */
|
|
55
|
+
private get ns();
|
|
56
|
+
readonly org: import("@angular/core").WritableSignal<Organization>;
|
|
57
|
+
readonly loading: import("@angular/core").WritableSignal<boolean>;
|
|
58
|
+
readonly leaving: import("@angular/core").WritableSignal<boolean>;
|
|
59
|
+
private readonly orgLoadError;
|
|
60
|
+
readonly orgErrorState: import("@angular/core").Signal<EmptyStateMetadata>;
|
|
61
|
+
readonly members: import("@angular/core").WritableSignal<MemberDetail[]>;
|
|
62
|
+
readonly membersLoading: import("@angular/core").WritableSignal<boolean>;
|
|
63
|
+
private readonly membersLoadError;
|
|
64
|
+
readonly membersNextToken: import("@angular/core").WritableSignal<string>;
|
|
65
|
+
readonly loadingMoreMembers: import("@angular/core").WritableSignal<boolean>;
|
|
66
|
+
readonly showAllMembers: import("@angular/core").WritableSignal<boolean>;
|
|
67
|
+
readonly visibleMembers: import("@angular/core").Signal<MemberDetail[]>;
|
|
68
|
+
readonly transferring: import("@angular/core").WritableSignal<boolean>;
|
|
69
|
+
readonly availableRoles: import("@angular/core").WritableSignal<OrgRole[]>;
|
|
70
|
+
readonly activeOrgId: import("@angular/core").Signal<string>;
|
|
71
|
+
readonly userId: import("@angular/core").Signal<string>;
|
|
72
|
+
readonly isOwner: import("@angular/core").Signal<boolean>;
|
|
73
|
+
readonly canEditOrg: import("@angular/core").Signal<boolean>;
|
|
74
|
+
readonly canManageMembers: import("@angular/core").Signal<boolean>;
|
|
75
|
+
readonly pageTitle: import("@angular/core").Signal<string>;
|
|
76
|
+
readonly pageDescription: import("@angular/core").Signal<string>;
|
|
77
|
+
readonly planLabel: import("@angular/core").Signal<string>;
|
|
78
|
+
readonly editButtonProps: import("@angular/core").Signal<Partial<ButtonMetadata>>;
|
|
79
|
+
readonly leaveButtonProps: import("@angular/core").Signal<Partial<ButtonMetadata>>;
|
|
80
|
+
readonly transferableMembers: import("@angular/core").Signal<MemberDetail[]>;
|
|
81
|
+
readonly viewPermissionsButtonProps: import("@angular/core").Signal<Partial<ButtonMetadata>>;
|
|
82
|
+
readonly transferButtonProps: import("@angular/core").Signal<Partial<ButtonMetadata>>;
|
|
83
|
+
readonly openInviteButtonProps: import("@angular/core").Signal<Partial<ButtonMetadata>>;
|
|
84
|
+
/** Guarda para detectar el primer disparo del effect (evita doble carga). */
|
|
85
|
+
private lastLoadedOrgId;
|
|
86
|
+
constructor();
|
|
87
|
+
onEdit(): void;
|
|
88
|
+
onLeave(): Promise<void>;
|
|
89
|
+
onOpenInvite(): void;
|
|
90
|
+
onViewPermissions(): void;
|
|
91
|
+
onOpenTransfer(): void;
|
|
92
|
+
onTransfer(newOwnerId: string): Promise<void>;
|
|
93
|
+
private loadOrg;
|
|
94
|
+
loadMembers(): Promise<void>;
|
|
95
|
+
loadMoreMembers(): void;
|
|
96
|
+
private enrichWithProfiles;
|
|
97
|
+
loadRoles(): void;
|
|
98
|
+
roleLabel(roleIdOrName: string): string;
|
|
99
|
+
permissionLabel(perm: string): string;
|
|
100
|
+
onViewMember(member: MemberDetail): void;
|
|
101
|
+
protected tt(key: string): string;
|
|
102
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<OrganizationViewComponent, never>;
|
|
103
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<OrganizationViewComponent, "val-organization-view", never, { "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>;
|
|
104
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LanguagesContent } from '../../../services/i18n/types';
|
|
2
|
+
/**
|
|
3
|
+
* Defaults i18n (es/en) embebidos en `val-organization-view`. Auto-registrados en
|
|
4
|
+
* el constructor del componente si el consumer no proveyó el namespace
|
|
5
|
+
* (`Settings.Organization` por default). SOLO incluye las keys que la vista usa.
|
|
6
|
+
*
|
|
7
|
+
* Portado de `ORG_I18N_CONTENT` (showcase) bajo el proceso de ADR-021.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ORGANIZATION_VIEW_I18N: LanguagesContent;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Routes } from '@angular/router';
|
|
2
|
+
import { OrganizationViewConfig } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Helper para montar la vista Gestión de organización (`val-organization-view`)
|
|
5
|
+
* como ruta en una app del factory. El `config` se pasa por route `data`
|
|
6
|
+
* (`organizationConfig`) y el componente lo lee como fallback de su
|
|
7
|
+
* `@Input() config`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* // settings.routes.ts
|
|
12
|
+
* export const settingsRoutes: Routes = [
|
|
13
|
+
* ...provideValtechOrganizationRoutes(), // → /app/settings/organization
|
|
14
|
+
* { path: 'preferences', loadComponent: () => ... },
|
|
15
|
+
* ];
|
|
16
|
+
*
|
|
17
|
+
* // con config acotada:
|
|
18
|
+
* ...provideValtechOrganizationRoutes({ config: { showLeave: false } }),
|
|
19
|
+
* ...provideValtechOrganizationRoutes({ config: { viewPermissionsRoute: '/app/roles' } }),
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function provideValtechOrganizationRoutes(opts?: {
|
|
23
|
+
path?: string;
|
|
24
|
+
config?: OrganizationViewConfig;
|
|
25
|
+
}): Routes;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuración acotada de `val-organization-view` (object-first). Tres ejes de
|
|
3
|
+
* variación permitidos — **NADA de slots arbitrarios** (ADR-021: una vista
|
|
4
|
+
* full-feature no abre slots; si falta algo, se promueve un nuevo punto de
|
|
5
|
+
* extensión):
|
|
6
|
+
*
|
|
7
|
+
* - **secciones visibles** — gatean el render de cada bloque (información de la
|
|
8
|
+
* org, miembros, roles y permisos, invitar, transferir propiedad, salir de la
|
|
9
|
+
* org). El gating RBAC adicional (invitar = `users:*`, transferir = owner) es
|
|
10
|
+
* **interno** a la vista (vía `AuthService.hasPermission()` + `*valHasPermission`
|
|
11
|
+
* + computeds `isOwner`/`canManageMembers`) y NO se expone como config — decisión
|
|
12
|
+
* CTO confirmada. Estos flags solo permiten ocultar la sección por completo.
|
|
13
|
+
* - **branding** — `i18nNamespace` para resolver los textos (default
|
|
14
|
+
* `'Settings.Organization'`).
|
|
15
|
+
* - **comportamiento / callbacks** — rutas de navegación (`viewPermissionsRoute`,
|
|
16
|
+
* `leaveRedirectRoute`) y hooks opcionales tras editar / invitar / transferir /
|
|
17
|
+
* salir.
|
|
18
|
+
*/
|
|
19
|
+
export interface OrganizationViewConfig {
|
|
20
|
+
/** Muestra la sección "Información" de la organización. Default `true`. */
|
|
21
|
+
showInfo?: boolean;
|
|
22
|
+
/** Muestra la sección "Miembros". Default `true`. */
|
|
23
|
+
showMembers?: boolean;
|
|
24
|
+
/** Muestra la sección "Roles y permisos" (explicativa). Default `true`. */
|
|
25
|
+
showRoles?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Muestra la sección de invitar miembros. Default `true`. El render real exige
|
|
28
|
+
* además permiso `users:*` (gating RBAC interno vía `*valHasPermission`).
|
|
29
|
+
*/
|
|
30
|
+
showInvite?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Muestra la sección "Transferir propiedad". Default `true`. El render real exige
|
|
33
|
+
* además ser owner (gating RBAC interno vía `isOwner()`).
|
|
34
|
+
*/
|
|
35
|
+
showTransferOwnership?: boolean;
|
|
36
|
+
/** Muestra la sección "Salir de la organización". Default `true`. */
|
|
37
|
+
showLeave?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Namespace i18n con el que la vista resuelve sus textos.
|
|
40
|
+
* Default `'Settings.Organization'`.
|
|
41
|
+
*/
|
|
42
|
+
i18nNamespace?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Ruta a la que navegar al ver el detalle de roles y permisos (botón
|
|
45
|
+
* "Ver roles y permisos"). Default `'/app/settings/permissions'`.
|
|
46
|
+
*/
|
|
47
|
+
viewPermissionsRoute?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Ruta a la que redirigir tras salir de la organización.
|
|
50
|
+
* Default `'/app/settings/account'`.
|
|
51
|
+
*/
|
|
52
|
+
leaveRedirectRoute?: string;
|
|
53
|
+
/** Hook tras editar la organización vía el modal de edición. */
|
|
54
|
+
onOrgEdited?: () => void;
|
|
55
|
+
/** Hook tras invitar a un miembro vía el modal de invitación. */
|
|
56
|
+
onMemberInvited?: () => void;
|
|
57
|
+
/** Hook tras transferir la propiedad de la organización. */
|
|
58
|
+
onOwnershipTransferred?: () => void;
|
|
59
|
+
/** Hook tras salir de la organización. */
|
|
60
|
+
onLeftOrg?: () => void;
|
|
61
|
+
}
|
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
|
+
}
|
|
@@ -284,6 +284,8 @@ export interface ButtonMetadata {
|
|
|
284
284
|
link?: string;
|
|
285
285
|
/** Associated href link */
|
|
286
286
|
href?: string;
|
|
287
|
+
/** Angular router link (SPA navigation, no reload) */
|
|
288
|
+
routerLink?: string | any[];
|
|
287
289
|
/** Link target */
|
|
288
290
|
target?: '_blank' | '_self' | '_parent' | '_top';
|
|
289
291
|
/** Download file name */
|
package/lib/version.d.ts
CHANGED
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -281,10 +281,19 @@ export * from './lib/components/organisms/session-list-modal/types';
|
|
|
281
281
|
export * from './lib/components/organisms/account-view/account-view.component';
|
|
282
282
|
export * from './lib/components/organisms/account-view/types';
|
|
283
283
|
export * from './lib/components/organisms/account-view/account.routes';
|
|
284
|
+
export * from './lib/components/organisms/organization-view/organization-view.component';
|
|
285
|
+
export * from './lib/components/organisms/organization-view/types';
|
|
286
|
+
export * from './lib/components/organisms/organization-view/organization.routes';
|
|
284
287
|
export * from './lib/components/organisms/delete-account-modal/delete-account-modal.component';
|
|
285
288
|
export * from './lib/components/organisms/switch-org-modal/switch-org-modal.component';
|
|
286
289
|
export * from './lib/components/organisms/create-org-modal/create-org-modal.component';
|
|
287
290
|
export * from './lib/components/organisms/org-info-sheet/org-info-sheet.component';
|
|
291
|
+
export * from './lib/components/organisms/invite-member-modal/invite-member-modal.component';
|
|
292
|
+
export * from './lib/components/organisms/member-detail-modal/member-detail-modal.component';
|
|
293
|
+
export * from './lib/components/organisms/member-detail-modal/types';
|
|
294
|
+
export * from './lib/components/organisms/edit-org-modal/edit-org-modal.component';
|
|
295
|
+
export * from './lib/components/organisms/transfer-ownership-modal/transfer-ownership-modal.component';
|
|
296
|
+
export * from './lib/components/organisms/transfer-ownership-modal/types';
|
|
288
297
|
export * from './lib/components/organisms/skeleton-layout/skeleton-layout.component';
|
|
289
298
|
export * from './lib/components/organisms/skeleton-layout/types';
|
|
290
299
|
export * from './lib/components/organisms/faq/faq.component';
|