data-primals-engine 1.3.1 → 1.3.3-rc.1

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.
@@ -1,73 +1,320 @@
1
- .history-dialog {
2
-
3
- .dialog-content {
4
- display: flex;
5
- flex-direction: column;
6
- height: 100%;
7
- padding: 0; // Le padding sera sur le content wrapper
8
- }
9
- }
10
-
11
- .history-dialog-content {
12
- overflow-y: auto;
13
- padding: 1rem;
14
- background-color: #f4f4f4;
15
- }
16
-
17
- .history-list {
18
- display: flex;
19
- flex-direction: column;
20
- gap: 1rem;
21
- }
22
-
23
- .history-entry {
24
- border: 1px solid #ddd;
25
- border-radius: 4px;
26
- background-color: #fff;
27
- box-shadow: 0 1px 3px rgba(0,0,0,0.05);
28
-
29
- .history-entry-header {
30
- display: flex;
31
- align-items: center;
32
- gap: 1rem;
33
- padding: 0.5rem 1rem;
34
- background-color: #f9f9f9;
35
- border-bottom: 1px solid #eee;
36
- font-size: 0.9em;
37
- color: #333;
38
-
39
- .op-badge {
40
- padding: 0.2rem 0.6rem;
41
- border-radius: 12px;
42
- color: white;
43
- font-weight: bold;
44
- font-size: 0.8em;
45
- text-transform: uppercase;
46
- }
47
-
48
- .op-insert { background-color: #28a745; } // green
49
- .op-update { background-color: #007bff; } // blue
50
- .op-delete { background-color: #dc3545; } // red
51
-
52
- .history-version {
53
- margin-left: auto;
54
- font-weight: bold;
55
- }
56
- }
57
-
58
- .history-entry-data {
59
- padding: 1rem;
60
-
61
- pre {
62
- white-space: pre-wrap;
63
- word-wrap: break-word;
64
- background-color: #2d2d2d;
65
- color: #f8f8f2;
66
- padding: 1rem;
67
- border-radius: 4px;
68
- margin: 0;
69
- font-family: 'Courier New', Courier, monospace;
70
- font-size: 0.85em;
71
- }
72
- }
1
+ .history-dialog {
2
+
3
+ .dialog-content {
4
+ display: flex;
5
+ flex-direction: column;
6
+ height: 100%;
7
+ padding: 0; // Le padding sera sur le content wrapper
8
+ }
9
+ }
10
+
11
+ .history-dialog-content {
12
+ overflow-y: auto;
13
+ padding: 1rem;
14
+ background-color: #f4f4f4;
15
+ }
16
+
17
+ .history-list {
18
+ display: flex;
19
+ flex-direction: column;
20
+ gap: 1rem;
21
+ }
22
+
23
+ .history-entry {
24
+ border: 1px solid #ddd;
25
+ border-radius: 4px;
26
+ background-color: #fff;
27
+ box-shadow: 0 1px 3px rgba(0,0,0,0.05);
28
+
29
+ .history-entry-header {
30
+ display: flex;
31
+ align-items: center;
32
+ gap: 1rem;
33
+ padding: 0.5rem 1rem;
34
+ background-color: #f9f9f9;
35
+ border-bottom: 1px solid #eee;
36
+ font-size: 0.9em;
37
+ color: #333;
38
+
39
+ .op-badge {
40
+ padding: 0.2rem 0.6rem;
41
+ border-radius: 12px;
42
+ color: white;
43
+ font-weight: bold;
44
+ font-size: 0.8em;
45
+ text-transform: uppercase;
46
+ }
47
+
48
+ .op-insert { background-color: #28a745; } // green
49
+ .op-update { background-color: #007bff; } // blue
50
+ .op-delete { background-color: #dc3545; } // red
51
+
52
+ .history-version {
53
+ margin-left: auto;
54
+ font-weight: bold;
55
+ }
56
+ }
57
+
58
+ .history-entry-data {
59
+ padding: 1rem;
60
+
61
+ pre {
62
+ white-space: pre-wrap;
63
+ word-wrap: break-word;
64
+ background-color: #2d2d2d;
65
+ color: #f8f8f2;
66
+ padding: 1rem;
67
+ border-radius: 4px;
68
+ margin: 0;
69
+ font-family: 'Courier New', Courier, monospace;
70
+ font-size: 0.85em;
71
+ }
72
+ }
73
+ }
74
+
75
+ // In C:/Dev/data-primals-engine/client/src/HistoryDialog.scss
76
+
77
+ .history-dialog .dialog-content {
78
+ // The new layout handles its own padding and structure.
79
+ padding: 0;
80
+ }
81
+
82
+ .history-dialog-content-split {
83
+ display: flex;
84
+ gap: 1rem;
85
+ height: 65vh; /* Adjust height as needed */
86
+ max-height: 700px;
87
+ }
88
+
89
+ .history-list-container {
90
+ flex: 1;
91
+ overflow-y: auto;
92
+ border-right: 1px solid #e2e2e2;
93
+ padding: 0 1rem 1rem 0;
94
+ min-width: 300px;
95
+ }
96
+
97
+ .history-preview-container {
98
+ flex: 0.8; /* Give preview a bit more space */
99
+ display: flex;
100
+ flex-direction: column;
101
+ min-width: 300px;
102
+
103
+ .preview-header {
104
+ display: flex;
105
+ justify-content: space-between;
106
+ align-items: center;
107
+ margin-bottom: 0.5rem;
108
+ padding-bottom: 0.5rem;
109
+ border-bottom: 1px solid #e2e2e2;
110
+
111
+ h4 {
112
+ margin: 0;
113
+ padding: 0;
114
+ border: none;
115
+ }
116
+
117
+ .btn-revert {
118
+ padding: 0.3rem 0.8rem;
119
+ font-size: 0.85em;
120
+ background-color: #ffc107; // A warning color like amber
121
+ color: black;
122
+ border: 1px solid #e0a800;
123
+
124
+ &:hover:not(:disabled) {
125
+ background-color: #e0a800;
126
+ }
127
+
128
+ &:disabled {
129
+ background-color: #ffca2c;
130
+ opacity: 0.7;
131
+ cursor: not-allowed;
132
+ }
133
+ }
134
+ }
135
+ }
136
+
137
+ .history-preview-area {
138
+ flex-grow: 1;
139
+ overflow-y: auto;
140
+ background-color: #f9f9f9;
141
+ padding: 0.75rem;
142
+ border: 1px solid #ddd;
143
+ border-radius: 4px;
144
+
145
+ pre {
146
+ white-space: pre-wrap;
147
+ word-wrap: break-word;
148
+ margin: 0;
149
+ }
150
+
151
+ .placeholder {
152
+ color: #666;
153
+ display: flex;
154
+ align-items: center;
155
+ justify-content: center;
156
+ height: 100%;
157
+ text-align: center;
158
+ }
159
+ }
160
+
161
+ .history-entry {
162
+ border: 1px solid #ddd;
163
+ border-radius: 4px;
164
+ margin-bottom: 0.75rem;
165
+ padding: 0.75rem;
166
+ transition: border-color 0.2s, box-shadow 0.2s;
167
+
168
+ &.selected {
169
+ border-color: #007bff;
170
+ box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
171
+ }
172
+ }
173
+
174
+ .history-entry-header {
175
+ display: flex;
176
+ align-items: center;
177
+ flex-wrap: wrap;
178
+ gap: 0.5rem 1rem;
179
+ margin-bottom: 0.5rem;
180
+
181
+ .btn-preview {
182
+ margin-left: auto;
183
+ padding: 0.2rem 0.6rem;
184
+ font-size: 0.8em;
185
+ }
186
+ }
187
+
188
+ .history-entry-data pre {
189
+ background-color: #f0f0f0;
190
+ padding: 0.5rem;
191
+ border-radius: 4px;
192
+ max-height: 150px;
193
+ overflow-y: auto;
194
+ margin: 0;
195
+ }
196
+
197
+ /* Dark Theme Adjustments */
198
+ .dark .history-list-container { border-right-color: #3f3f3f;
199
+ }
200
+ .dark .history-preview-container .preview-header {
201
+ border-bottom-color: #3f3f3f;
202
+ .btn-revert {
203
+ background-color: #d8a100;
204
+ border-color: #b38600;
205
+ color: white;
206
+ &:hover:not(:disabled) {
207
+ background-color: #b38600;
208
+ }
209
+ }
210
+ }
211
+ .dark .history-preview-area { background-color: #2a2a2a; border-color: #3f3f3f; }
212
+ .dark .history-entry { border-color: #3f3f3f; }
213
+ .dark .history-entry.selected { border-color: #58a6ff; box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.25); }
214
+ .dark .history-entry-data pre { background-color: #2a2a2a; }
215
+
216
+ /* Styles for human-friendly history data display */
217
+ .history-entry-data {
218
+ padding: 0.75rem 1rem;
219
+ font-size: 0.9em;
220
+ background-color: #fdfdfd;
221
+ border-top: 1px solid #f0f0f0;
222
+
223
+ /* The new implementation doesn't use <pre> here anymore */
224
+ pre {
225
+ display: none;
226
+ }
227
+ }
228
+
229
+ .changes-list, .snapshot-list {
230
+ display: flex;
231
+ flex-direction: column;
232
+ gap: 0.5rem;
233
+ }
234
+
235
+ .change-detail, .snapshot-item {
236
+ display: grid;
237
+ grid-template-columns: minmax(100px, 150px) 1fr;
238
+ gap: 0.5rem;
239
+ align-items: start;
240
+ }
241
+
242
+ .change-field-name, .snapshot-key {
243
+ font-weight: 600;
244
+ color: #333;
245
+ white-space: nowrap;
246
+ overflow: hidden;
247
+ text-overflow: ellipsis;
248
+ padding-top: 4px; /* Align with value */
249
+ }
250
+
251
+ .change-values {
252
+ display: flex;
253
+ align-items: center;
254
+ gap: 0.5rem;
255
+ background-color: #f0f0f0;
256
+ padding: 0.25rem 0.5rem;
257
+ border-radius: 4px;
258
+ overflow: hidden;
259
+ }
260
+
261
+ .change-arrow {
262
+ color: #888;
263
+ font-weight: bold;
264
+ }
265
+
266
+ .value-from {
267
+ text-decoration: line-through;
268
+ color: #d9534f; /* red-ish */
269
+ }
270
+
271
+ .value-to {
272
+ color: #5cb85c; /* green-ish */
273
+ font-weight: 500;
274
+ }
275
+
276
+ .snapshot-value, .value-from, .value-to {
277
+ white-space: nowrap;
278
+ overflow: hidden;
279
+ text-overflow: ellipsis;
280
+ display: block; /* Ensure it takes up the block for ellipsis */
281
+ }
282
+
283
+ .value-empty {
284
+ color: #999;
285
+ font-style: italic;
286
+ }
287
+
288
+ .value-object, .value-boolean {
289
+ font-family: 'Courier New', Courier, monospace;
290
+ background-color: #e9e9e9;
291
+ padding: 0.1rem 0.3rem;
292
+ border-radius: 3px;
293
+ display: inline-block;
294
+ }
295
+
296
+ .no-changes-text {
297
+ color: #777;
298
+ font-style: italic;
299
+ padding: 0.5rem 0;
300
+ }
301
+
302
+ /* Dark Theme Adjustments */
303
+ .dark .history-entry-data {
304
+ background-color: #2c2c2c;
305
+ border-top-color: #3a3a3a;
306
+ }
307
+ .dark .change-field-name, .dark .snapshot-key {
308
+ color: #e0e0e0;
309
+ }
310
+ .dark .change-values {
311
+ background-color: #3a3a3a;
312
+ }
313
+ .dark .value-from { color: #ff7b7b; }
314
+ .dark .value-to { color: #73d173; }
315
+ .dark .value-object, .dark .value-boolean {
316
+ background-color: #444;
317
+ }
318
+ .dark .no-changes-text, .dark .value-empty {
319
+ color: #888;
73
320
  }
@@ -8,9 +8,9 @@ import { Tooltip } from 'react-tooltip';
8
8
 
9
9
  import "./ViewSwitcher.scss"
10
10
  const viewOptions = [
11
- { id: 'table', icon: <FaTable />, labelKey: 'views.table' },
12
- { id: 'kanban', icon: <FaColumns />, labelKey: 'views.kanban' },
13
- //{ id: 'calendar', icon: <FaRegCalendarAlt />, labelKey: 'views.calendar' },
11
+ { id: 'table', icon: <FaTable />, labelKey: 'views.table', defaultLabel: 'Tableau' },
12
+ { id: 'kanban', icon: <FaColumns />, labelKey: 'views.kanban', defaultLabel: 'Kanban' },
13
+ { id: 'calendar', icon: <FaRegCalendarAlt />, labelKey: 'views.calendar', defaultLabel: 'Calendrier' },
14
14
  ];
15
15
 
16
16
  const ViewSwitcher = ({ currentView, onViewChange, configuredViews, onConfigureView }) => {
@@ -27,10 +27,10 @@ const ViewSwitcher = ({ currentView, onViewChange, configuredViews, onConfigureV
27
27
  <Button
28
28
  onClick={() => onViewChange(view.id)}
29
29
  className={`btn-view ${isActive ? 'active' : ''}`}
30
- title={t(view.labelKey, view.id)}
30
+ title={t(view.labelKey, view.defaultLabel)}
31
31
  >
32
32
  {view.icon}
33
- <span className="hidden md:inline-block ml-2">{t(view.labelKey, view.id)}</span>
33
+ <span className="hidden md:inline-block ml-2">{t(view.labelKey, view.defaultLabel)}</span>
34
34
  </Button>
35
35
  {/* AJOUT : Bouton de configuration pour la vue active */}
36
36
  {isActive && view.id !== 'table' && (
@@ -38,7 +38,7 @@ const ViewSwitcher = ({ currentView, onViewChange, configuredViews, onConfigureV
38
38
  onClick={onConfigureView}
39
39
  className="btn-view-settings"
40
40
  data-tooltip-id="view-settings-tooltip"
41
- data-tooltip-content={t('views.configure', { view: t(view.labelKey) })}
41
+ data-tooltip-content={t('views.configure', 'Configurer la vue {{view}}', { view: t(view.labelKey, view.defaultLabel) })}
42
42
  >
43
43
  <FaCog />
44
44
  </Button>