data-primals-engine 1.5.1 → 1.5.2
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 +2 -0
- package/client/src/App.scss +1 -1
- package/client/src/DataLayout.jsx +2 -0
- package/client/src/HistoryDialog.jsx +24 -2
- package/client/src/ModelList.jsx +280 -275
- package/client/src/filter.js +1 -0
- package/package.json +6 -6
- package/src/core.js +8 -1
- package/src/engine.js +85 -43
- package/src/events.js +137 -113
- package/src/index.js +3 -0
- package/src/modules/assistant/assistant.js +123 -134
- package/src/modules/assistant/constants.js +2 -1
- package/src/modules/data/data.history.js +32 -8
- package/src/modules/data/data.operations.js +3381 -3282
- package/src/modules/data/data.relations.js +1 -1
- package/src/modules/data/data.routes.js +3 -3
- package/src/modules/user.js +1 -0
- package/src/modules/workflow.js +2 -2
- package/src/openai.jobs.js +3 -2
- package/src/sso.js +2 -2
- package/src/workers/import-export-worker.js +1 -1
- package/test/data.history.integration.test.js +264 -192
- package/test/data.integration.test.js +1206 -1115
package/README.md
CHANGED
|
@@ -863,6 +863,8 @@ Event.Listen("OnDataAdded", (engine, data) => {
|
|
|
863
863
|
| OnDataValidate | Triggered to override validation check. | System | internal | (value, field, data) |
|
|
864
864
|
| OnDataFilter | Triggered to override data filtering operation. | System | internal | (filteredValue, field, data) |
|
|
865
865
|
| OnEmailTemplate | Triggered to override custom email templates | System | internal | (templateData, lang) |
|
|
866
|
+
| OnSystemPrompt | Triggered to override assistant system prompt | User | handleChatRequest | (user) |
|
|
867
|
+
| OnChatAction | Triggered when an action is created by the AI | User | handleChatRequest | (action, params, parsedResponse, user) |
|
|
866
868
|
|
|
867
869
|
### Triggering events
|
|
868
870
|
|
package/client/src/App.scss
CHANGED
|
@@ -270,6 +270,7 @@ function DataLayout({refreshUI}) {
|
|
|
270
270
|
setRelationFilters({});
|
|
271
271
|
setCheckedItems([])
|
|
272
272
|
setFilterValues({});
|
|
273
|
+
setEditionMode(false);
|
|
273
274
|
if (!model) {
|
|
274
275
|
setSelectedModel(null);
|
|
275
276
|
return;
|
|
@@ -659,6 +660,7 @@ function DataLayout({refreshUI}) {
|
|
|
659
660
|
|
|
660
661
|
<div className="datalayout flex flex-start">
|
|
661
662
|
<ModelList tourSteps={currentTourSteps}
|
|
663
|
+
editionMode={editionMode}
|
|
662
664
|
onAPIInfo={(model) => {
|
|
663
665
|
setAPIInfoVisible(true);
|
|
664
666
|
setDataEditorVisible(false);
|
|
@@ -140,6 +140,8 @@ export const HistoryDialog = ({ modelName, recordId, onClose }) => {
|
|
|
140
140
|
const [selectedVersion, setSelectedVersion] = useState(null);
|
|
141
141
|
const [page, setPage] = useState(1);
|
|
142
142
|
const [totalCount, setTotalCount] = useState(0);
|
|
143
|
+
const [startDate, setStartDate] = useState('');
|
|
144
|
+
const [endDate, setEndDate] = useState('');
|
|
143
145
|
const elementsPerPage = 10;
|
|
144
146
|
const { t, i18n } = useTranslation();
|
|
145
147
|
|
|
@@ -148,7 +150,9 @@ export const HistoryDialog = ({ modelName, recordId, onClose }) => {
|
|
|
148
150
|
setLoading(true);
|
|
149
151
|
setError(null);
|
|
150
152
|
try {
|
|
151
|
-
const params = new URLSearchParams({ page, limit: elementsPerPage });
|
|
153
|
+
const params = new URLSearchParams({ page, limit: elementsPerPage, lang: i18n.language });
|
|
154
|
+
if (startDate) params.append('startDate', startDate);
|
|
155
|
+
if (endDate) params.append('endDate', endDate);
|
|
152
156
|
const query = await fetch(`/api/data/history/${modelName}/${recordId}?${params.toString()}`);
|
|
153
157
|
const response = await query.json();
|
|
154
158
|
if (response.success) {
|
|
@@ -163,7 +167,12 @@ export const HistoryDialog = ({ modelName, recordId, onClose }) => {
|
|
|
163
167
|
} finally {
|
|
164
168
|
setLoading(false);
|
|
165
169
|
}
|
|
166
|
-
}, [modelName, recordId, i18n, page, elementsPerPage]);
|
|
170
|
+
}, [modelName, recordId, i18n.language, page, elementsPerPage, startDate, endDate]);
|
|
171
|
+
|
|
172
|
+
// Réinitialise la page à 1 lorsque les filtres de date changent
|
|
173
|
+
useEffect(() => {
|
|
174
|
+
setPage(1);
|
|
175
|
+
}, [startDate, endDate]);
|
|
167
176
|
|
|
168
177
|
useEffect(() => {
|
|
169
178
|
fetchHistory();
|
|
@@ -232,6 +241,19 @@ export const HistoryDialog = ({ modelName, recordId, onClose }) => {
|
|
|
232
241
|
<div className="history-dialog-content-split">
|
|
233
242
|
<div className="history-list-container">
|
|
234
243
|
{loading && <div><Trans i18nKey={"history.loading"}>Chargement de l'historique..</Trans></div>}
|
|
244
|
+
<div className="history-filters">
|
|
245
|
+
<div className="date-filter">
|
|
246
|
+
<label htmlFor="startDate"><Trans i18nKey="history.startDate">From</Trans></label>
|
|
247
|
+
<input type="date" id="startDate" value={startDate} onChange={(e) => setStartDate(e.target.value)} />
|
|
248
|
+
</div>
|
|
249
|
+
<div className="date-filter">
|
|
250
|
+
<label htmlFor="endDate"><Trans i18nKey="history.endDate">To</Trans></label>
|
|
251
|
+
<input type="date" id="endDate" value={endDate} onChange={(e) => setEndDate(e.target.value)} />
|
|
252
|
+
</div>
|
|
253
|
+
<Button className="btn-clear-filters" onClick={() => { setStartDate(''); setEndDate(''); }} title={t('history.clearDates', 'Clear date filters')}>
|
|
254
|
+
<Trans i18nKey="history.clear">Clear</Trans>
|
|
255
|
+
</Button>
|
|
256
|
+
</div>
|
|
235
257
|
{error && <div className="error-message">{error}</div>}
|
|
236
258
|
{!loading && !error && (<>
|
|
237
259
|
<div className="history-list">
|