data-primals-engine 1.7.2 → 1.7.3
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/README.md +160 -160
- package/client/package-lock.json +8430 -8430
- package/client/src/APIInfo.jsx +1 -1
- package/client/src/App.jsx +2 -1
- package/client/src/App.scss +1635 -1626
- package/client/src/AssistantChat.jsx +1 -0
- package/client/src/CalendarView.jsx +1 -0
- package/client/src/ContentView.jsx +3 -3
- package/client/src/Dashboard.jsx +5 -2
- package/client/src/DashboardChart.jsx +1 -0
- package/client/src/DashboardFlexViewItem.jsx +1 -0
- package/client/src/DashboardHtmlViewItem.jsx +1 -0
- package/client/src/DashboardView.jsx +2 -0
- package/client/src/DataEditor.jsx +0 -1
- package/client/src/DataImporter.jsx +489 -468
- package/client/src/DataLayout.jsx +6 -3
- package/client/src/DataTable.jsx +4 -3
- package/client/src/Dialog.jsx +92 -90
- package/client/src/Dialog.scss +122 -116
- package/client/src/DisplayFlexNodeRenderer.jsx +1 -0
- package/client/src/FlexBuilderControls.jsx +1 -0
- package/client/src/FlexBuilderPreview.jsx +1 -1
- package/client/src/FlexNode.jsx +1 -1
- package/client/src/HistoryDialog.jsx +3 -2
- package/client/src/KPIWidget.jsx +1 -1
- package/client/src/KanbanView.jsx +1 -0
- package/client/src/ModelCreator.jsx +4 -0
- package/client/src/ModelList.jsx +1 -0
- package/client/src/PackGallery.jsx +5 -4
- package/client/src/RTETrans.jsx +1 -1
- package/client/src/RelationField.jsx +2 -0
- package/client/src/RelationSelectorWidget.jsx +2 -0
- package/client/src/RelationValue.jsx +1 -0
- package/client/src/RestoreDialog.jsx +1 -0
- package/client/src/WorkflowEditor.jsx +3 -0
- package/client/src/contexts/CommandContext.jsx +2 -1
- package/client/src/contexts/ModelContext.jsx +3 -3
- package/client/src/hooks/data.js +1 -0
- package/client/src/hooks/useValidation.js +1 -0
- package/client/src/translations.js +24 -24
- package/doc/AI-assistance.md +87 -63
- package/doc/Concepts.md +122 -0
- package/doc/Custom-Endpoints.md +31 -0
- package/doc/Event-system.md +13 -14
- package/doc/Home.md +33 -0
- package/doc/Modules.md +83 -0
- package/doc/Packs-gallery.md +8 -23
- package/doc/Workflows.md +32 -0
- package/doc/automation-workflows.md +141 -102
- package/doc/dashboards-kpis-charts.md +47 -49
- package/doc/data-management.md +126 -120
- package/doc/data-models.md +68 -75
- package/doc/roles-permissions.md +144 -43
- package/doc/sharding-replication.md +158 -0
- package/doc/users.md +54 -30
- package/package.json +1 -1
- package/server.js +37 -37
- package/src/constants.js +7 -8
- package/src/data.js +521 -520
- package/src/email.js +157 -154
- package/src/engine.js +117 -7
- package/src/gameObject.js +6 -0
- package/src/i18n.js +0 -1
- package/src/modules/auth-google/index.js +53 -50
- package/src/modules/bucket.js +346 -339
- package/src/modules/data/data.backup.js +400 -376
- package/src/modules/data/data.cluster.js +410 -42
- package/src/modules/data/data.operations.js +3666 -3635
- package/src/modules/data/data.replication.js +106 -64
- package/src/modules/data/data.routes.js +87 -64
- package/src/modules/data/data.scheduling.js +2 -1
- package/src/modules/file.js +248 -247
- package/src/modules/user.js +11 -1
- package/src/sso.js +91 -25
- package/test/cluster.test.js +221 -0
- package/test/core.test.js +0 -2
- package/test/replication.test.js +163 -0
- package/doc/core-concepts.md +0 -33
|
@@ -64,6 +64,7 @@ const CalendarView = ({ settings, model, onEditData }) => {
|
|
|
64
64
|
['calendarData', model.name],
|
|
65
65
|
() => fetch(`/api/data/search?_user=${me.username}&depth=1`, {
|
|
66
66
|
method: 'POST',
|
|
67
|
+
credentials: "include",
|
|
67
68
|
headers: { 'Content-Type': 'application/json' },
|
|
68
69
|
// Note : Pour de très grands ensembles de données, vous pourriez vouloir implémenter une récupération par plage de dates.
|
|
69
70
|
body: JSON.stringify({ model: model.name, page: 1 })
|
|
@@ -49,14 +49,14 @@ const ContentView = () => { // Le prop 'menu' a été retiré car non passé par
|
|
|
49
49
|
// 2. Récupérer le contenu principal basé sur le slug et la langue
|
|
50
50
|
const {data: contentData, isLoading: isLoadingContent, error: errorContent} = useQuery(
|
|
51
51
|
['contentPage', slug, langCode, cat], // Ajout de cat pour la spécificité de la clé
|
|
52
|
-
() => fetch('/api/website/content?lang='+langCode+'&slug='+slug+'&limit=1&sort=_id:DESC', { headers: { 'Content-Type': 'application/json'}}).then(e => e.json())
|
|
52
|
+
() => fetch('/api/website/content?lang='+langCode+'&slug='+slug+'&limit=1&sort=_id:DESC', { credentials: "include", headers: { 'Content-Type': 'application/json'}}).then(e => e.json())
|
|
53
53
|
);
|
|
54
54
|
const pageContent = contentData?.data?.[0];
|
|
55
55
|
|
|
56
56
|
// 4. Récupérer les sous-catégories de la catégorie parente 'cat'
|
|
57
57
|
const {data: childCategoriesData, isLoading: isLoadingChildCategories} = useQuery(
|
|
58
58
|
['childDocCategories', cat, langCode], // Clé de query mise à jour
|
|
59
|
-
() => fetch('/api/website/taxonomies?lang='+langCode+'&identifier='+cat, { headers: { 'Content-Type': 'application/json' }}).then(e => e.json()), // Tri par order, puis par nom
|
|
59
|
+
() => fetch('/api/website/taxonomies?lang='+langCode+'&identifier='+cat, { credentials: "include",headers: { 'Content-Type': 'application/json' }}).then(e => e.json()), // Tri par order, puis par nom
|
|
60
60
|
{ enabled: !!cat && !!langCode } // Activer si cat et langCode sont présents
|
|
61
61
|
);
|
|
62
62
|
const childCategories = childCategoriesData?.data || [];
|
|
@@ -66,7 +66,7 @@ const ContentView = () => { // Le prop 'menu' a été retiré car non passé par
|
|
|
66
66
|
|
|
67
67
|
const {data: tocContentQuery, isLoading: isLoadingTocContent} = useQuery(
|
|
68
68
|
['tocContent', childCategoryIds, langCode], // Clé de query mise à jour
|
|
69
|
-
() => fetch( '/api/website/content?cats='+childCategoryIds.join(',')+'&lang='+langCode+'&sort=order:ASC,title:ASC', { headers: { 'Content-Type': 'application/json' }}).then(e => e.json()), // Tri par order, puis par titre
|
|
69
|
+
() => fetch( '/api/website/content?cats='+childCategoryIds.join(',')+'&lang='+langCode+'&sort=order:ASC,title:ASC', { credentials: "include",headers: { 'Content-Type': 'application/json' }}).then(e => e.json()), // Tri par order, puis par titre
|
|
70
70
|
{enabled: !!langCode && childCategoryIds.length > 0} // Activer si langCode et des IDs de catégories enfants sont présents
|
|
71
71
|
);
|
|
72
72
|
|
package/client/src/Dashboard.jsx
CHANGED
|
@@ -46,6 +46,7 @@ export function DashboardsPage() {
|
|
|
46
46
|
const response = await fetch(
|
|
47
47
|
`/api/data/search?model=dashboard&_user=${me.username}`, {
|
|
48
48
|
method: 'POST',
|
|
49
|
+
credentials: "include",
|
|
49
50
|
headers: { 'Content-Type': 'application/json' },
|
|
50
51
|
// body: JSON.stringify({ sort: { name: 1 } }) // Optionnel: trier
|
|
51
52
|
});
|
|
@@ -69,6 +70,7 @@ export function DashboardsPage() {
|
|
|
69
70
|
const isFirstDashboard = !dashboardsData?.data || dashboardsData.data.length === 0;
|
|
70
71
|
const response = await fetch('/api/data', {
|
|
71
72
|
method: 'POST',
|
|
73
|
+
credentials: "include",
|
|
72
74
|
headers: { 'Content-Type': 'application/json' },
|
|
73
75
|
body: JSON.stringify({
|
|
74
76
|
model: 'dashboard',
|
|
@@ -100,6 +102,7 @@ export function DashboardsPage() {
|
|
|
100
102
|
const { _id, _hash, _user, _createdAt, _updatedAt, ...data } = dashboardData;
|
|
101
103
|
const response = await fetch(`/api/data`, {
|
|
102
104
|
method: 'PUT',
|
|
105
|
+
credentials: "include",
|
|
103
106
|
headers: { 'Content-Type': 'application/json' },
|
|
104
107
|
body: JSON.stringify({
|
|
105
108
|
model: 'dashboard',
|
|
@@ -384,7 +387,8 @@ export function DashboardsPage() {
|
|
|
384
387
|
onChange={(selectedOption) => {
|
|
385
388
|
setSelectedDashboardId(selectedOption.value);
|
|
386
389
|
const d = dashboardsData.data.find(f => f._id === selectedOption.value);
|
|
387
|
-
|
|
390
|
+
if( me )
|
|
391
|
+
history.pushState({}, null, '/user/'+getUserHash(me)+'/dashboards/'+d._hash);
|
|
388
392
|
}}
|
|
389
393
|
items={dashboardOptions}
|
|
390
394
|
/>
|
|
@@ -425,7 +429,6 @@ export function DashboardsPage() {
|
|
|
425
429
|
label={t('dashboards.refreshPresets.label', 'Préréglages')}
|
|
426
430
|
value={dashboardToEdit.refreshInterval}
|
|
427
431
|
onChange={(option) => {
|
|
428
|
-
console.log({option});
|
|
429
432
|
if (option?.value)
|
|
430
433
|
handleEditFieldChange({ name: 'refreshInterval', value: option?.value })
|
|
431
434
|
}}
|
|
@@ -28,6 +28,7 @@ const fetchChartData = async (chartConfig) => {
|
|
|
28
28
|
try {
|
|
29
29
|
const response = await fetch(`/api/charts/aggregate`, {
|
|
30
30
|
method: 'POST',
|
|
31
|
+
credentials: "include",
|
|
31
32
|
headers: { 'Content-Type': 'application/json' },
|
|
32
33
|
body: JSON.stringify(chartConfig) // Le filtre sera envoyil est dans chartConfig
|
|
33
34
|
});
|
|
@@ -96,6 +96,7 @@ const DashboardHtmlViewItem = ({ config }) => {
|
|
|
96
96
|
async () => {
|
|
97
97
|
const response = await fetch(`/api/data/search?model=${modelName}&depth=2&limit=${limit || 10}&sort=${JSON.stringify(sort || {})}`, {
|
|
98
98
|
method: 'POST',
|
|
99
|
+
credentials: "include",
|
|
99
100
|
headers: { 'Content-Type': 'application/json' },
|
|
100
101
|
body: JSON.stringify({ filter: filter || {}}),
|
|
101
102
|
});
|
|
@@ -27,6 +27,7 @@ async function updateDashboardLayout(dashboard, newLayoutData, username, t) {
|
|
|
27
27
|
try {
|
|
28
28
|
const response = await fetch(`/api/data/${dashboard._id}?_user=${username}`, {
|
|
29
29
|
method: 'PUT',
|
|
30
|
+
credentials: "include",
|
|
30
31
|
headers: { 'Content-Type': 'application/json' },
|
|
31
32
|
body: JSON.stringify({
|
|
32
33
|
model: 'dashboard',
|
|
@@ -178,6 +179,7 @@ export function DashboardView({ dashboard }) {
|
|
|
178
179
|
const response = await fetch(
|
|
179
180
|
`/api/data/search?model=kpi&lang=${lang}&_user=${me.username}`, {
|
|
180
181
|
method: 'POST',
|
|
182
|
+
credentials: "include",
|
|
181
183
|
headers: { 'Content-Type': 'application/json' }
|
|
182
184
|
});
|
|
183
185
|
if (!response.ok) {
|
|
@@ -185,7 +185,6 @@ export const DataEditor = forwardRef(function MyDataEditor({
|
|
|
185
185
|
)}</div>
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
{console.log(formData[field.name])}
|
|
189
188
|
return <CodeField key={field.name} language={field.language} name={inputProps.name}
|
|
190
189
|
value={typeof (value) === 'string' ? value : JSON.stringify(value)}
|
|
191
190
|
onChange={handleChange}/>
|