@visns-studio/visns-components 6.31.1 → 6.31.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 +13 -0
- package/package.json +1 -1
- package/src/components/MergeEntity.jsx +4 -1
package/README.md
CHANGED
|
@@ -9,6 +9,19 @@ A comprehensive React component library used by the VISNS Studio team for CRM an
|
|
|
9
9
|
|
|
10
10
|
VISNS Components is a React-based UI component library that provides a set of reusable, consistent, and customizable components for building web applications. It includes components for authentication, data grids, forms, navigation, and more, designed to work seamlessly together.
|
|
11
11
|
|
|
12
|
+
## Recent Updates (v6.31.2)
|
|
13
|
+
|
|
14
|
+
### `MergeEntity` compares the two records it is actually merging
|
|
15
|
+
|
|
16
|
+
`processTemplate` substituted `{dataId}` with the current (source) entity
|
|
17
|
+
before applying the caller's own values, so `loadTargetEntity(entityId)`
|
|
18
|
+
fetched the source a second time. Step 3 then diffed the source against
|
|
19
|
+
itself, always reported "no conflicts", and sent an empty `field_overrides`
|
|
20
|
+
map with the merge. Explicit template values now win and `{dataId}` only
|
|
21
|
+
falls back to the current entity when nothing was supplied. Every consumer's
|
|
22
|
+
merge tab (contacts, clients, …) gets a real conflict step without a config
|
|
23
|
+
change.
|
|
24
|
+
|
|
12
25
|
## Recent Updates (v6.31.0)
|
|
13
26
|
|
|
14
27
|
### The header badge self-heals too, and the pop takes its timings from the server
|
package/package.json
CHANGED
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
94
94
|
},
|
|
95
95
|
"name": "@visns-studio/visns-components",
|
|
96
|
-
"version": "6.31.
|
|
96
|
+
"version": "6.31.2",
|
|
97
97
|
"description": "Various packages to assist in the development of our Custom Applications.",
|
|
98
98
|
"main": "src/index.js",
|
|
99
99
|
"files": [
|
|
@@ -174,13 +174,16 @@ const MergeEntity = ({ endpoints, config, dataId, onUpdate = () => {} }) => {
|
|
|
174
174
|
const [showAdvanced, setShowAdvanced] = useState(false);
|
|
175
175
|
|
|
176
176
|
// Replace placeholders in URLs
|
|
177
|
+
// Explicit values win: `{dataId}` only falls back to the current entity
|
|
178
|
+
// when the caller did not supply one (loadTargetEntity passes the target's
|
|
179
|
+
// id, and must not be given the source again).
|
|
177
180
|
const processTemplate = (template, data = {}) => {
|
|
178
181
|
let processed = template;
|
|
179
|
-
processed = processed.replace(/\{dataId\}/g, dataId);
|
|
180
182
|
Object.keys(data).forEach((key) => {
|
|
181
183
|
const placeholder = new RegExp(`\\{${key}\\}`, 'g');
|
|
182
184
|
processed = processed.replace(placeholder, data[key]);
|
|
183
185
|
});
|
|
186
|
+
processed = processed.replace(/\{dataId\}/g, dataId);
|
|
184
187
|
return processed;
|
|
185
188
|
};
|
|
186
189
|
|