@sinequa/atomic-angular 2.1.0 → 2.3.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/features/settings/i18n/de.json +41 -0
- package/features/settings/i18n/en.json +41 -0
- package/features/settings/i18n/fr.json +41 -0
- package/features/user-profile/i18n/de.json +0 -1
- package/features/user-profile/i18n/en.json +0 -1
- package/features/user-profile/i18n/fr.json +0 -1
- package/fesm2022/sinequa-atomic-angular-document-workspaces.mjs +32 -32
- package/fesm2022/sinequa-atomic-angular-document-workspaces.mjs.map +1 -1
- package/fesm2022/sinequa-atomic-angular.mjs +913 -266
- package/fesm2022/sinequa-atomic-angular.mjs.map +1 -1
- package/package.json +6 -2
- package/types/sinequa-atomic-angular-document-workspaces.d.ts +16 -16
- package/types/sinequa-atomic-angular.d.ts +183 -121
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Einstellungen",
|
|
3
|
+
"close": "Schließen",
|
|
4
|
+
"account": {
|
|
5
|
+
"nav": "Konto",
|
|
6
|
+
"title": "Konto",
|
|
7
|
+
"description": "Verwalten Sie Ihr Profil und Ihr Konto",
|
|
8
|
+
"overrideUser": {
|
|
9
|
+
"title": "Als anderer Benutzer anmelden",
|
|
10
|
+
"description": "Auf die Plattform als anderer Benutzer oder Domäne zugreifen",
|
|
11
|
+
"action": "Wechseln"
|
|
12
|
+
},
|
|
13
|
+
"revertOverride": {
|
|
14
|
+
"title": "Als anderer Benutzer anmelden",
|
|
15
|
+
"description": "Sie handeln als anderer Benutzer: zurück zu Ihrem eigenen",
|
|
16
|
+
"action": "Zurück"
|
|
17
|
+
},
|
|
18
|
+
"clearData": {
|
|
19
|
+
"title": "Meine Daten löschen",
|
|
20
|
+
"description": "Aktivität, Arbeitsbereiche, Alerts und Einstellungen entfernen",
|
|
21
|
+
"action": "Alles löschen"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"appearance": {
|
|
25
|
+
"nav": "Darstellung",
|
|
26
|
+
"title": "Darstellung",
|
|
27
|
+
"description": "Steuern Sie Aussehen und Sprache der Anwendung",
|
|
28
|
+
"theme": "Design",
|
|
29
|
+
"themeDescription": "Wählen Sie das Design der Benutzeroberfläche",
|
|
30
|
+
"lightMode": "Hell",
|
|
31
|
+
"darkMode": "Dunkel",
|
|
32
|
+
"systemMode": "System",
|
|
33
|
+
"language": "Sprache",
|
|
34
|
+
"languageDescription": "Wählen Sie die Sprache der Benutzeroberfläche"
|
|
35
|
+
},
|
|
36
|
+
"shortcuts": {
|
|
37
|
+
"nav": "Tastenkürzel",
|
|
38
|
+
"title": "Tastenkürzel",
|
|
39
|
+
"description": "Die auf dieser Seite verfügbaren Tastenkürzel"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Settings",
|
|
3
|
+
"close": "Close",
|
|
4
|
+
"account": {
|
|
5
|
+
"nav": "Account",
|
|
6
|
+
"title": "Account",
|
|
7
|
+
"description": "Manage your profile and your account",
|
|
8
|
+
"overrideUser": {
|
|
9
|
+
"title": "Override user",
|
|
10
|
+
"description": "Access the platform as another user or domain",
|
|
11
|
+
"action": "Override"
|
|
12
|
+
},
|
|
13
|
+
"revertOverride": {
|
|
14
|
+
"title": "Override user",
|
|
15
|
+
"description": "You are acting as another user: go back to your own",
|
|
16
|
+
"action": "Revert"
|
|
17
|
+
},
|
|
18
|
+
"clearData": {
|
|
19
|
+
"title": "Clear my data",
|
|
20
|
+
"description": "Remove your activity, workspaces, alerts, and preferences",
|
|
21
|
+
"action": "Clear all"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"appearance": {
|
|
25
|
+
"nav": "Appearance",
|
|
26
|
+
"title": "Appearance",
|
|
27
|
+
"description": "Control how the application looks and speaks to you",
|
|
28
|
+
"theme": "Theme",
|
|
29
|
+
"themeDescription": "Select the theme for the user interface",
|
|
30
|
+
"lightMode": "Light",
|
|
31
|
+
"darkMode": "Dark",
|
|
32
|
+
"systemMode": "System",
|
|
33
|
+
"language": "Language",
|
|
34
|
+
"languageDescription": "Select the language for the user interface"
|
|
35
|
+
},
|
|
36
|
+
"shortcuts": {
|
|
37
|
+
"nav": "Keyboard shortcuts",
|
|
38
|
+
"title": "Keyboard shortcuts",
|
|
39
|
+
"description": "The shortcuts available on this page"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Paramètres",
|
|
3
|
+
"close": "Fermer",
|
|
4
|
+
"account": {
|
|
5
|
+
"nav": "Compte",
|
|
6
|
+
"title": "Compte",
|
|
7
|
+
"description": "Gérez votre profil et votre compte",
|
|
8
|
+
"overrideUser": {
|
|
9
|
+
"title": "Se faire passer pour un utilisateur",
|
|
10
|
+
"description": "Accéder à la plateforme en tant qu'autre utilisateur ou domaine",
|
|
11
|
+
"action": "Se substituer"
|
|
12
|
+
},
|
|
13
|
+
"revertOverride": {
|
|
14
|
+
"title": "Se faire passer pour un utilisateur",
|
|
15
|
+
"description": "Vous agissez en tant qu'un autre utilisateur : revenez au vôtre",
|
|
16
|
+
"action": "Revenir"
|
|
17
|
+
},
|
|
18
|
+
"clearData": {
|
|
19
|
+
"title": "Effacer mes données",
|
|
20
|
+
"description": "Supprimez votre activité, vos espaces de travail, vos alertes et vos préférences",
|
|
21
|
+
"action": "Tout effacer"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"appearance": {
|
|
25
|
+
"nav": "Apparence",
|
|
26
|
+
"title": "Apparence",
|
|
27
|
+
"description": "Contrôlez l'aspect et la langue de l'application",
|
|
28
|
+
"theme": "Thème",
|
|
29
|
+
"themeDescription": "Sélectionnez le thème de l'interface",
|
|
30
|
+
"lightMode": "Clair",
|
|
31
|
+
"darkMode": "Sombre",
|
|
32
|
+
"systemMode": "Système",
|
|
33
|
+
"language": "Langue",
|
|
34
|
+
"languageDescription": "Sélectionnez la langue de l'interface"
|
|
35
|
+
},
|
|
36
|
+
"shortcuts": {
|
|
37
|
+
"nav": "Raccourcis clavier",
|
|
38
|
+
"title": "Raccourcis clavier",
|
|
39
|
+
"description": "Les raccourcis disponibles sur cette page"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -2,7 +2,7 @@ import * as i0 from "@angular/core";
|
|
|
2
2
|
import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, Injectable, InjectionToken, Injector, Pipe, ViewEncapsulation, afterNextRender, assertInInjectionContext, booleanAttribute, computed, effect, forwardRef, inject, input, model, output, signal, untracked, viewChild } from "@angular/core";
|
|
3
3
|
import { withDevtools } from "@angular-architects/ngrx-toolkit";
|
|
4
4
|
import { patchState, signalStore, withComputed, withMethods, withState } from "@ngrx/signals";
|
|
5
|
-
import { ApiError,
|
|
5
|
+
import { ApiError, addWorkspaceDocuments, createHeaders, createWorkspace, deleteWorkspaceDocuments, deleteWorkspaces, fetchPreview, fetchPrincipal, fetchPrincipalsByIds, fetchUploadStatus, getWorkspace, globalConfig, listWorkspaceDocuments, listWorkspaces, onAuthEvent, searchPrincipals, tryAutoAuthentication, updateWorkspace } from "@sinequa/atomic";
|
|
6
6
|
import { Upload } from "tus-js-client";
|
|
7
7
|
import { toSignal } from "@angular/core/rxjs-interop";
|
|
8
8
|
import { TranslocoPipe, TranslocoService, provideTranslocoScope } from "@jsverse/transloco";
|
|
@@ -31,7 +31,7 @@ function workspaceColorFor(id) {
|
|
|
31
31
|
for (let i = 0; i < id.length; i++) hash = hash * 31 + id.charCodeAt(i) | 0;
|
|
32
32
|
return PALETTE[Math.abs(hash) % PALETTE.length];
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function mapWireWorkspaceToWorkspace(dto) {
|
|
35
35
|
return {
|
|
36
36
|
id: dto.id,
|
|
37
37
|
name: dto.name,
|
|
@@ -57,12 +57,12 @@ function mapDocumentStatus(status) {
|
|
|
57
57
|
default: return;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function mapWireDocumentToWorkspaceDocument(dto) {
|
|
61
61
|
const wire = dto;
|
|
62
62
|
return {
|
|
63
63
|
id: dto.id,
|
|
64
64
|
name: dto.name,
|
|
65
|
-
workspaceId: dto.
|
|
65
|
+
workspaceId: dto.workspaceId,
|
|
66
66
|
type: getDocumentType(dto.name),
|
|
67
67
|
createdAt: dto.createdAt ?? void 0,
|
|
68
68
|
status: mapDocumentStatus(wire.status),
|
|
@@ -119,11 +119,11 @@ const WorkspacesStore = signalStore({ providedIn: "root" }, withDevtools("Worksp
|
|
|
119
119
|
});
|
|
120
120
|
};
|
|
121
121
|
const loadDocuments = async (workspaceId, signal) => {
|
|
122
|
-
const res = await
|
|
122
|
+
const res = await listWorkspaceDocuments(workspaceId, {
|
|
123
123
|
page: 1,
|
|
124
124
|
pageSize: PAGE_SIZE
|
|
125
125
|
}, { signal });
|
|
126
|
-
const documents = res.documents.map(
|
|
126
|
+
const documents = res.documents.map(mapWireDocumentToWorkspaceDocument);
|
|
127
127
|
patchState(store, (state) => ({ documentPagination: {
|
|
128
128
|
...state.documentPagination,
|
|
129
129
|
[workspaceId]: {
|
|
@@ -143,12 +143,12 @@ const WorkspacesStore = signalStore({ providedIn: "root" }, withDevtools("Worksp
|
|
|
143
143
|
const load = async () => {
|
|
144
144
|
patchState(store, { loading: true });
|
|
145
145
|
try {
|
|
146
|
-
const res = await
|
|
146
|
+
const res = await listWorkspaces({
|
|
147
147
|
page: 1,
|
|
148
148
|
pageSize: PAGE_SIZE
|
|
149
149
|
});
|
|
150
150
|
patchState(store, {
|
|
151
|
-
workspaces: res.
|
|
151
|
+
workspaces: res.workspaces.map(mapWireWorkspaceToWorkspace),
|
|
152
152
|
pagination: {
|
|
153
153
|
page: res.page,
|
|
154
154
|
total: res.total
|
|
@@ -187,13 +187,13 @@ const WorkspacesStore = signalStore({ providedIn: "root" }, withDevtools("Worksp
|
|
|
187
187
|
try {
|
|
188
188
|
const current = store.workspaces();
|
|
189
189
|
const page = Math.min(store.pagination().page + 1, Math.floor(current.length / PAGE_SIZE) + 1);
|
|
190
|
-
const res = await
|
|
190
|
+
const res = await listWorkspaces({
|
|
191
191
|
page,
|
|
192
192
|
pageSize: PAGE_SIZE
|
|
193
193
|
});
|
|
194
194
|
patchState(store, (state) => {
|
|
195
195
|
const loaded = new Set(state.workspaces.map((w) => w.id));
|
|
196
|
-
const fresh = res.
|
|
196
|
+
const fresh = res.workspaces.map(mapWireWorkspaceToWorkspace).filter((w) => !loaded.has(w.id));
|
|
197
197
|
return {
|
|
198
198
|
workspaces: [...state.workspaces, ...fresh],
|
|
199
199
|
pagination: {
|
|
@@ -210,12 +210,12 @@ const WorkspacesStore = signalStore({ providedIn: "root" }, withDevtools("Worksp
|
|
|
210
210
|
return loadingMorePromise;
|
|
211
211
|
},
|
|
212
212
|
async fetch(id) {
|
|
213
|
-
const workspace =
|
|
213
|
+
const workspace = mapWireWorkspaceToWorkspace(await getWorkspace(id));
|
|
214
214
|
patchState(store, (state) => ({ workspaces: state.workspaces.some((w) => w.id === id) ? state.workspaces.map((w) => w.id === id ? workspace : w) : [...state.workspaces, workspace] }));
|
|
215
215
|
return workspace;
|
|
216
216
|
},
|
|
217
217
|
async create({ name, description = "", tags = [], owners = [], readers = [] }) {
|
|
218
|
-
const workspace =
|
|
218
|
+
const workspace = mapWireWorkspaceToWorkspace(await createWorkspace({
|
|
219
219
|
name,
|
|
220
220
|
description,
|
|
221
221
|
tags,
|
|
@@ -237,12 +237,12 @@ const WorkspacesStore = signalStore({ providedIn: "root" }, withDevtools("Worksp
|
|
|
237
237
|
},
|
|
238
238
|
async update(id, patch) {
|
|
239
239
|
if (!store.workspaces().some((w) => w.id === id)) return null;
|
|
240
|
-
const updated =
|
|
240
|
+
const updated = mapWireWorkspaceToWorkspace(await updateWorkspace(id, patch));
|
|
241
241
|
patchState(store, (state) => ({ workspaces: state.workspaces.map((w) => w.id === id ? updated : w) }));
|
|
242
242
|
return updated;
|
|
243
243
|
},
|
|
244
244
|
async remove(ids) {
|
|
245
|
-
const result = await
|
|
245
|
+
const result = await deleteWorkspaces(ids);
|
|
246
246
|
const succeeded = new Set(result.succeeded);
|
|
247
247
|
patchState(store, (state) => ({
|
|
248
248
|
workspaces: state.workspaces.filter((w) => !succeeded.has(w.id)),
|
|
@@ -256,7 +256,7 @@ const WorkspacesStore = signalStore({ providedIn: "root" }, withDevtools("Worksp
|
|
|
256
256
|
return {
|
|
257
257
|
succeeded: result.succeeded,
|
|
258
258
|
failed: result.failed.map((f) => ({
|
|
259
|
-
id: f.
|
|
259
|
+
id: f.workspaceId,
|
|
260
260
|
error: f.error
|
|
261
261
|
}))
|
|
262
262
|
};
|
|
@@ -279,12 +279,12 @@ const WorkspacesStore = signalStore({ providedIn: "root" }, withDevtools("Worksp
|
|
|
279
279
|
const pagination = store.documentPagination()[workspaceId];
|
|
280
280
|
if (!pagination || current.length >= pagination.total) return current;
|
|
281
281
|
const page = Math.min(pagination.page + 1, Math.floor(current.length / PAGE_SIZE) + 1);
|
|
282
|
-
const res = await
|
|
282
|
+
const res = await listWorkspaceDocuments(workspaceId, {
|
|
283
283
|
page,
|
|
284
284
|
pageSize: PAGE_SIZE
|
|
285
285
|
});
|
|
286
286
|
const loaded = new Set(current.map((d) => d.id));
|
|
287
|
-
const fresh = res.documents.map(
|
|
287
|
+
const fresh = res.documents.map(mapWireDocumentToWorkspaceDocument).filter((d) => !loaded.has(d.id));
|
|
288
288
|
const merged = [...current, ...fresh];
|
|
289
289
|
patchState(store, (state) => ({ documentPagination: {
|
|
290
290
|
...state.documentPagination,
|
|
@@ -316,13 +316,13 @@ const WorkspacesStore = signalStore({ providedIn: "root" }, withDevtools("Worksp
|
|
|
316
316
|
} }));
|
|
317
317
|
},
|
|
318
318
|
async saveDocuments(workspaceId, documents) {
|
|
319
|
-
const mapped = (await
|
|
319
|
+
const mapped = (await addWorkspaceDocuments(workspaceId, documents.map((d) => ({ name: d.name })))).map(mapWireDocumentToWorkspaceDocument);
|
|
320
320
|
setDocuments(workspaceId, [...store.documents()[workspaceId] ?? [], ...mapped]);
|
|
321
321
|
adjustDocumentCount(workspaceId, mapped.length);
|
|
322
322
|
return mapped;
|
|
323
323
|
},
|
|
324
324
|
async removeDocuments(workspaceId, documentIds) {
|
|
325
|
-
await
|
|
325
|
+
await deleteWorkspaceDocuments(workspaceId, documentIds);
|
|
326
326
|
const before = store.documents()[workspaceId] ?? [];
|
|
327
327
|
const after = before.filter((d) => !documentIds.includes(d.id));
|
|
328
328
|
setDocuments(workspaceId, after);
|
|
@@ -333,10 +333,10 @@ const WorkspacesStore = signalStore({ providedIn: "root" }, withDevtools("Worksp
|
|
|
333
333
|
const from = store.documents()[fromWorkspaceId] ?? [];
|
|
334
334
|
const moved = from.filter((d) => documentIds.includes(d.id));
|
|
335
335
|
if (!moved.length) return;
|
|
336
|
-
const created = await
|
|
337
|
-
setDocuments(toWorkspaceId, [...store.documents()[toWorkspaceId] ?? [], ...created.map(
|
|
336
|
+
const created = await addWorkspaceDocuments(toWorkspaceId, moved.map((d) => ({ name: d.name })));
|
|
337
|
+
setDocuments(toWorkspaceId, [...store.documents()[toWorkspaceId] ?? [], ...created.map(mapWireDocumentToWorkspaceDocument)]);
|
|
338
338
|
adjustDocumentCount(toWorkspaceId, created.length);
|
|
339
|
-
await
|
|
339
|
+
await deleteWorkspaceDocuments(fromWorkspaceId, documentIds);
|
|
340
340
|
const remaining = from.filter((d) => !documentIds.includes(d.id));
|
|
341
341
|
setDocuments(fromWorkspaceId, remaining);
|
|
342
342
|
adjustDocumentCount(fromWorkspaceId, remaining.length - from.length);
|
|
@@ -734,13 +734,13 @@ function isJobTerminal(job) {
|
|
|
734
734
|
return job.indexingStatus === "complete" || job.indexingStatus === "failed" || job.indexingStatus === "interrupted";
|
|
735
735
|
}
|
|
736
736
|
function allJobs(res) {
|
|
737
|
-
return (res.
|
|
737
|
+
return (res.workspaces ?? []).flatMap((c) => c.jobs ?? []);
|
|
738
738
|
}
|
|
739
|
-
function
|
|
740
|
-
return (res.
|
|
739
|
+
function workspaceJobs(res) {
|
|
740
|
+
return (res.workspaces ?? []).flatMap((c) => (c.jobs ?? []).map((job) => ({
|
|
741
741
|
job,
|
|
742
|
-
|
|
743
|
-
|
|
742
|
+
workspaceId: c.workspaceId,
|
|
743
|
+
workspaceName: c.workspaceName
|
|
744
744
|
})));
|
|
745
745
|
}
|
|
746
746
|
const FINISHED_UPLOAD_VISIBLE_MS = 12e4;
|
|
@@ -1059,7 +1059,7 @@ var UploadService = class UploadService {
|
|
|
1059
1059
|
}
|
|
1060
1060
|
async runPollTick(signal) {
|
|
1061
1061
|
const workspaceId = this.focusedWorkspaceId;
|
|
1062
|
-
const response = await fetchUploadStatus(workspaceId ? {
|
|
1062
|
+
const response = await fetchUploadStatus(workspaceId ? { workspaceId } : {}, { signal });
|
|
1063
1063
|
const jobs = allJobs(response);
|
|
1064
1064
|
const remote = await this.remoteJobs(response, signal);
|
|
1065
1065
|
let changed = this.tracker.applyRemoteJobs(remote);
|
|
@@ -1076,12 +1076,12 @@ var UploadService = class UploadService {
|
|
|
1076
1076
|
const me = (await this.currentUser.whenReady())?.id;
|
|
1077
1077
|
if (signal.aborted) return [];
|
|
1078
1078
|
const entries = [];
|
|
1079
|
-
for (const { job,
|
|
1080
|
-
if (this.focusedWorkspaceId && this.focusedWorkspaceId !==
|
|
1081
|
-
const workspaceName = this.workspaces.workspace(
|
|
1079
|
+
for (const { job, workspaceId, workspaceName: apiName } of workspaceJobs(response)) {
|
|
1080
|
+
if (this.focusedWorkspaceId && this.focusedWorkspaceId !== workspaceId) continue;
|
|
1081
|
+
const workspaceName = this.workspaces.workspace(workspaceId)?.name ?? apiName;
|
|
1082
1082
|
entries.push({
|
|
1083
1083
|
job,
|
|
1084
|
-
workspaceId
|
|
1084
|
+
workspaceId,
|
|
1085
1085
|
workspaceName,
|
|
1086
1086
|
mine: !!me && job.initiatedBy === me
|
|
1087
1087
|
});
|