valtech-components 2.0.994 → 2.0.995
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/member-import-modal/member-import-modal.component.mjs +313 -0
- package/esm2022/lib/components/organisms/member-import-modal/member-import-modal.i18n.mjs +63 -0
- package/esm2022/lib/components/organisms/organization-view/organization-view.component.mjs +53 -1
- package/esm2022/lib/components/organisms/organization-view/organization-view.i18n.mjs +3 -1
- package/esm2022/lib/services/org/org.service.mjs +8 -1
- package/esm2022/lib/services/org/types.mjs +1 -1
- package/esm2022/lib/version.mjs +2 -2
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/valtech-components.mjs +467 -42
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/organisms/member-import-modal/member-import-modal.component.d.ts +47 -0
- package/lib/components/organisms/member-import-modal/member-import-modal.i18n.d.ts +6 -0
- package/lib/components/organisms/organization-view/organization-view.component.d.ts +3 -0
- package/lib/services/org/org.service.d.ts +6 -1
- package/lib/services/org/types.d.ts +30 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { ImportMembersResponse, ImportOnConflict, ImportRowResult } from '../../../services/org/types';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* `val-member-import-modal` — panel de carga masiva de miembros (ADR-023 fase 6).
|
|
6
|
+
*
|
|
7
|
+
* El admin pega un CSV (`email,nombre,rol`); el modal lo parsea a filas y llama
|
|
8
|
+
* `OrgService.importMembers`. Muestra el resultado por-fila (partial success):
|
|
9
|
+
* `created` / `assigned` / `skipped` / `error`. Header canónico (Regla #5).
|
|
10
|
+
*
|
|
11
|
+
* Auto-registra defaults i18n (es/en) en `Settings.ImportModal`.
|
|
12
|
+
*/
|
|
13
|
+
export declare class MemberImportModalComponent implements OnInit {
|
|
14
|
+
private i18n;
|
|
15
|
+
private orgService;
|
|
16
|
+
/** Org destino del import. */
|
|
17
|
+
orgId: string;
|
|
18
|
+
/** Nombres de roles disponibles (para el hint). Opcional. */
|
|
19
|
+
availableRoles: string[];
|
|
20
|
+
/** Callback tras una importación exitosa (≥1 fila procesada) — refresca la lista. */
|
|
21
|
+
onSuccess?: () => void;
|
|
22
|
+
/** Inyectado por `ModalService.open`. */
|
|
23
|
+
_modalRef?: {
|
|
24
|
+
dismiss: (data?: unknown, role?: string) => void;
|
|
25
|
+
};
|
|
26
|
+
/** Namespace i18n. */
|
|
27
|
+
i18nNamespace: string;
|
|
28
|
+
csv: string;
|
|
29
|
+
onConflict: ImportOnConflict;
|
|
30
|
+
sendActivation: boolean;
|
|
31
|
+
readonly submitting: import("@angular/core").WritableSignal<boolean>;
|
|
32
|
+
readonly errorMsg: import("@angular/core").WritableSignal<string>;
|
|
33
|
+
readonly results: import("@angular/core").WritableSignal<ImportMembersResponse>;
|
|
34
|
+
readonly rolesHint: import("@angular/core").Signal<string>;
|
|
35
|
+
readonly summaryLabel: import("@angular/core").Signal<string>;
|
|
36
|
+
constructor();
|
|
37
|
+
ngOnInit(): void;
|
|
38
|
+
/** Parsea el CSV pegado a filas {email,name,roleName}. Tolera header. */
|
|
39
|
+
private parseCsv;
|
|
40
|
+
submit(): void;
|
|
41
|
+
statusLabel(r: ImportRowResult): string;
|
|
42
|
+
reset(): void;
|
|
43
|
+
dismiss(): void;
|
|
44
|
+
t(key: string): string;
|
|
45
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MemberImportModalComponent, never>;
|
|
46
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MemberImportModalComponent, "val-member-import-modal", never, { "orgId": { "alias": "orgId"; "required": false; }; "availableRoles": { "alias": "availableRoles"; "required": false; }; "onSuccess": { "alias": "onSuccess"; "required": false; }; "_modalRef": { "alias": "_modalRef"; "required": false; }; "i18nNamespace": { "alias": "i18nNamespace"; "required": false; }; }, {}, never, never, true, never>;
|
|
47
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LanguagesContent } from '../../../services/i18n/types';
|
|
2
|
+
/**
|
|
3
|
+
* Defaults i18n (es/en) embebidos en `val-member-import-modal` (ADR-023).
|
|
4
|
+
* Auto-registrados si el consumer no proveyó el namespace `Settings.ImportModal`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const MEMBER_IMPORT_MODAL_I18N: LanguagesContent;
|
|
@@ -61,6 +61,7 @@ export declare class OrganizationViewComponent {
|
|
|
61
61
|
readonly members: import("@angular/core").WritableSignal<MemberDetail[]>;
|
|
62
62
|
readonly membersLoading: import("@angular/core").WritableSignal<boolean>;
|
|
63
63
|
private readonly membersLoadError;
|
|
64
|
+
readonly membersErrorState: import("@angular/core").Signal<EmptyStateMetadata>;
|
|
64
65
|
readonly membersNextToken: import("@angular/core").WritableSignal<string>;
|
|
65
66
|
readonly loadingMoreMembers: import("@angular/core").WritableSignal<boolean>;
|
|
66
67
|
readonly showAllMembers: import("@angular/core").WritableSignal<boolean>;
|
|
@@ -81,12 +82,14 @@ export declare class OrganizationViewComponent {
|
|
|
81
82
|
readonly viewPermissionsButtonProps: import("@angular/core").Signal<Partial<ButtonMetadata>>;
|
|
82
83
|
readonly transferButtonProps: import("@angular/core").Signal<Partial<ButtonMetadata>>;
|
|
83
84
|
readonly openInviteButtonProps: import("@angular/core").Signal<Partial<ButtonMetadata>>;
|
|
85
|
+
readonly openImportButtonProps: import("@angular/core").Signal<Partial<ButtonMetadata>>;
|
|
84
86
|
/** Guarda para detectar el primer disparo del effect (evita doble carga). */
|
|
85
87
|
private lastLoadedOrgId;
|
|
86
88
|
constructor();
|
|
87
89
|
onEdit(): void;
|
|
88
90
|
onLeave(): Promise<void>;
|
|
89
91
|
onOpenInvite(): void;
|
|
92
|
+
onOpenImport(): void;
|
|
90
93
|
onViewPermissions(): void;
|
|
91
94
|
onOpenTransfer(): void;
|
|
92
95
|
onTransfer(newOwnerId: string): Promise<void>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HttpClient } from '@angular/common/http';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { ValtechAuthConfig } from '../auth/types';
|
|
4
|
-
import { Organization, ListMyOrgsResponse, CreateOrgRequest, UpdateOrgRequest, InviteUserRequest, InviteUserResponse, LeaveOrgResponse, ListOrgMembersResponse, OrgRole, ChangeMemberRoleResponse, PendingInvitation, AcceptInvitationResponse } from './types';
|
|
4
|
+
import { Organization, ListMyOrgsResponse, CreateOrgRequest, UpdateOrgRequest, InviteUserRequest, InviteUserResponse, LeaveOrgResponse, ListOrgMembersResponse, OrgRole, ChangeMemberRoleResponse, PendingInvitation, AcceptInvitationResponse, ImportMembersRequest, ImportMembersResponse } from './types';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export declare class OrgService {
|
|
7
7
|
private config;
|
|
@@ -21,6 +21,11 @@ export declare class OrgService {
|
|
|
21
21
|
message: string;
|
|
22
22
|
}>;
|
|
23
23
|
inviteUser(orgId: string, req: InviteUserRequest): Observable<InviteUserResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* Crea/asigna miembros en masa (ADR-023). Resultado por-fila (partial success):
|
|
26
|
+
* `created` (pre-aprovisionado), `assigned` (ya existía), `skipped`, `error`.
|
|
27
|
+
*/
|
|
28
|
+
importMembers(orgId: string, req: ImportMembersRequest): Observable<ImportMembersResponse>;
|
|
24
29
|
leaveOrg(orgId: string): Observable<LeaveOrgResponse>;
|
|
25
30
|
getOrgMembers(orgId: string, params?: {
|
|
26
31
|
limit?: number;
|
|
@@ -97,3 +97,33 @@ export interface ChangeMemberRoleResponse {
|
|
|
97
97
|
orgId: string;
|
|
98
98
|
roleId: string;
|
|
99
99
|
}
|
|
100
|
+
export type ImportOnConflict = 'assignRole' | 'skip' | 'error';
|
|
101
|
+
export interface ImportUserRow {
|
|
102
|
+
email: string;
|
|
103
|
+
name?: string;
|
|
104
|
+
roleName: string;
|
|
105
|
+
}
|
|
106
|
+
export interface ImportMembersRequest {
|
|
107
|
+
users: ImportUserRow[];
|
|
108
|
+
onConflict?: ImportOnConflict;
|
|
109
|
+
sendActivation?: boolean;
|
|
110
|
+
}
|
|
111
|
+
export type ImportRowStatus = 'created' | 'assigned' | 'skipped' | 'error';
|
|
112
|
+
export interface ImportRowResult {
|
|
113
|
+
email: string;
|
|
114
|
+
status: ImportRowStatus;
|
|
115
|
+
userId?: string;
|
|
116
|
+
activation?: 'sent' | 'pending';
|
|
117
|
+
reason?: string;
|
|
118
|
+
}
|
|
119
|
+
export interface ImportSummary {
|
|
120
|
+
created: number;
|
|
121
|
+
assigned: number;
|
|
122
|
+
skipped: number;
|
|
123
|
+
failed: number;
|
|
124
|
+
}
|
|
125
|
+
export interface ImportMembersResponse {
|
|
126
|
+
operationId: string;
|
|
127
|
+
summary: ImportSummary;
|
|
128
|
+
results: ImportRowResult[];
|
|
129
|
+
}
|
package/lib/version.d.ts
CHANGED
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -294,6 +294,7 @@ export * from './lib/components/organisms/org-info-sheet/org-info-sheet.componen
|
|
|
294
294
|
export * from './lib/components/organisms/invite-member-modal/invite-member-modal.component';
|
|
295
295
|
export * from './lib/components/organisms/member-detail-modal/member-detail-modal.component';
|
|
296
296
|
export * from './lib/components/organisms/member-detail-modal/types';
|
|
297
|
+
export * from './lib/components/organisms/member-import-modal/member-import-modal.component';
|
|
297
298
|
export * from './lib/components/organisms/edit-org-modal/edit-org-modal.component';
|
|
298
299
|
export * from './lib/components/organisms/transfer-ownership-modal/transfer-ownership-modal.component';
|
|
299
300
|
export * from './lib/components/organisms/transfer-ownership-modal/types';
|