@raclettejs/core 0.1.13 → 0.1.14
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/CHANGELOG.md +8 -0
- package/package.json +2 -2
- package/services/frontend/src/core/store/reducers/data/reducers.ts +22 -25
- package/services/frontend/src/core/store/reducers/queries/effects.ts +10 -2
- package/services/frontend/src/core/store/reducers/queries/reducers.ts +2 -2
- package/services/frontend/src/core/store/reducers/queriesCache/reducers.ts +2 -5
- package/services/frontend/src/orchestrator/ProductOrchestrator.vue +4 -2
- package/services/frontend/src/orchestrator/router/routerHooks/afterEach.ts +0 -1
- package/yarn.lock +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.14] - 02.11.2025 <a href="https://gitlab.com/raclettejs/core/-/compare/v0.1.13...v0.1.14" target="_blank" rel="noopener"><b>Overview of all changes</b></a>
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Frontend: prevent welcome screen from disapearing if modal is opened
|
|
15
|
+
- Frontend: parent cache racecondition if child queries get deleted/added in quick succession by the user fixed
|
|
16
|
+
- Frontend: fixed parent cach query child removal
|
|
17
|
+
|
|
10
18
|
## [0.1.13] - 29.10.2025 <a href="https://gitlab.com/raclettejs/core/-/compare/v0.1.12...v0.1.13" target="_blank" rel="noopener"><b>Overview of all changes</b></a>
|
|
11
19
|
|
|
12
20
|
### Fixed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raclettejs/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"description": "racletteJS core package",
|
|
5
5
|
"repository": "https://gitlab.com/raclettejs/core",
|
|
6
6
|
"author": "Pacifico Digital Explorations GmbH <info@raclettejs.com>",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@eslint/js": "9.35.0",
|
|
72
|
-
"@raclettejs/types": "0.1.
|
|
72
|
+
"@raclettejs/types": "0.1.14",
|
|
73
73
|
"@types/fs-extra": "11.0.4",
|
|
74
74
|
"@types/js-yaml": "4.0.9",
|
|
75
75
|
"@types/node": "24.5.1",
|
|
@@ -439,35 +439,32 @@ const dataDelete = (state, action) => {
|
|
|
439
439
|
* @returns {Object} - Returns the new state after removing the data from the cache.
|
|
440
440
|
*/
|
|
441
441
|
const deleteFromCache = (state, action) => {
|
|
442
|
-
if (!action.payload) {
|
|
443
|
-
return state
|
|
444
|
-
}
|
|
445
442
|
const { payload, actionId } = action
|
|
446
|
-
|
|
447
|
-
if (!Array.isArray(payload)) {
|
|
448
|
-
console.error("data delete needs to be an array of uuids")
|
|
449
|
-
|
|
450
|
-
return state
|
|
451
|
-
}
|
|
452
443
|
const dataItems = clone(state)
|
|
453
444
|
|
|
454
445
|
if (actionId) {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
446
|
+
const iterateItems =
|
|
447
|
+
payload?.uuids && payload?.uuids?.length
|
|
448
|
+
? payload?.uuids
|
|
449
|
+
: Object.keys(dataItems)
|
|
450
|
+
if (iterateItems.length) {
|
|
451
|
+
iterateItems.forEach((uuid) => {
|
|
452
|
+
if (!dataItems[uuid]) {
|
|
453
|
+
return
|
|
454
|
+
}
|
|
455
|
+
if (!dataItems[uuid].__requestedFor) {
|
|
456
|
+
delete dataItems[uuid]
|
|
457
|
+
}
|
|
458
|
+
// remove the indicator that this item was requested for the query in deletion process
|
|
459
|
+
if (dataItems[uuid].__requestedFor[actionId]) {
|
|
460
|
+
delete dataItems[uuid].__requestedFor[actionId]
|
|
461
|
+
}
|
|
462
|
+
// if item has no other requesters (i.e also not the global requestor) we can delete the item from the store as it is not needed anymore
|
|
463
|
+
if (!Object.keys(dataItems[uuid].__requestedFor).length) {
|
|
464
|
+
delete dataItems[uuid]
|
|
465
|
+
}
|
|
466
|
+
})
|
|
467
|
+
}
|
|
471
468
|
}
|
|
472
469
|
|
|
473
470
|
return dataItems
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { tap, distinctUntilChanged, ignoreElements } from "rxjs/operators"
|
|
2
2
|
import { actions$, ofType } from "mini-rx-store"
|
|
3
3
|
import { getData } from "@racletteCore/lib/data/dataApi"
|
|
4
|
+
import log from "@racletteCore/lib/logger"
|
|
4
5
|
const queriesEffects = (store) => {
|
|
5
6
|
const queriesAddExecute = actions$.pipe(
|
|
6
7
|
ofType("queries/add/execute"),
|
|
@@ -26,7 +27,7 @@ const queriesEffects = (store) => {
|
|
|
26
27
|
distinctUntilChanged((prev, curr) => !store.hasChanges(prev, curr)),
|
|
27
28
|
|
|
28
29
|
tap((action) => {
|
|
29
|
-
if (Object.keys(action.actionResult
|
|
30
|
+
if (Object.keys(action.actionResult?.updated?.items).length) {
|
|
30
31
|
Object.values(action.actionResult.updated.items).forEach((query) => {
|
|
31
32
|
getData(query.actionId, query.target, query.params || false, {})
|
|
32
33
|
})
|
|
@@ -43,7 +44,14 @@ const queriesEffects = (store) => {
|
|
|
43
44
|
if (updatedQuery) {
|
|
44
45
|
const { item, itemBefore } = updatedQuery
|
|
45
46
|
const { actionId } = action
|
|
46
|
-
if (
|
|
47
|
+
if (!actionId || !item) {
|
|
48
|
+
log.store("effect queries/setCacheKey no Item or ActionId", {
|
|
49
|
+
updatedQuery,
|
|
50
|
+
action,
|
|
51
|
+
})
|
|
52
|
+
return
|
|
53
|
+
}
|
|
54
|
+
if (itemBefore?.cacheKey && itemBefore?.cacheKey !== item?.cacheKey) {
|
|
47
55
|
store.dispatch({
|
|
48
56
|
type: "queriesCache/remove",
|
|
49
57
|
payload: { cacheKey: itemBefore.cacheKey, actionId },
|
|
@@ -37,7 +37,7 @@ const updateQueryItems = (state, action) => {
|
|
|
37
37
|
if (dataItemsToRemove.length > 0) {
|
|
38
38
|
$store.dispatch({
|
|
39
39
|
type: "data/deleteFromCache",
|
|
40
|
-
payload: dataItemsToRemove,
|
|
40
|
+
payload: { uuids: dataItemsToRemove },
|
|
41
41
|
actionId: actionId,
|
|
42
42
|
})
|
|
43
43
|
}
|
|
@@ -228,7 +228,7 @@ const queriesRemove = (state, action) => {
|
|
|
228
228
|
// when we delete a query we will now have to remove all data Items which have been retrieven ONLY for this query. This will be determined in dataDelete reducer
|
|
229
229
|
$store.dispatch({
|
|
230
230
|
type: "data/deleteFromCache",
|
|
231
|
-
payload: query.uuids,
|
|
231
|
+
payload: { uuids: query.uuids },
|
|
232
232
|
actionId: actionId,
|
|
233
233
|
})
|
|
234
234
|
}
|
|
@@ -84,15 +84,12 @@ const cacheCheck = (state: Record<string, ParentQuery>, action) => {
|
|
|
84
84
|
}
|
|
85
85
|
const cacheRemove = (state, action) => {
|
|
86
86
|
const newState = structuredClone(state)
|
|
87
|
-
const { cacheKey
|
|
88
|
-
const cache = state[cacheKey]
|
|
89
|
-
|
|
87
|
+
const { cacheKey } = action.payload
|
|
90
88
|
const childQueries = getChildQueries(cacheKey)
|
|
91
89
|
if (childQueries.length === 0) {
|
|
92
90
|
// We have no further childs for this cache, so we will delete it and it's items
|
|
93
91
|
$store.dispatch({
|
|
94
92
|
type: "data/deleteFromCache",
|
|
95
|
-
payload: cache?.uuids || [],
|
|
96
93
|
actionId: cacheKey,
|
|
97
94
|
})
|
|
98
95
|
delete newState[cacheKey]
|
|
@@ -130,7 +127,7 @@ const cacheChildRemove = (state, action) => {
|
|
|
130
127
|
type: "queriesCache/remove",
|
|
131
128
|
payload: { cacheKey: affectedCacheQuery.cacheKey, actionId },
|
|
132
129
|
})
|
|
133
|
-
},
|
|
130
|
+
}, 500)
|
|
134
131
|
}
|
|
135
132
|
delete cacheMap[actionId]
|
|
136
133
|
return newState
|
|
@@ -156,9 +156,11 @@ const { widgetsLayout, slotLayout } = useCurrentComposition()
|
|
|
156
156
|
|
|
157
157
|
const showWelcomeScreen = computed(() => {
|
|
158
158
|
const isDynamicPage = route.name === "app.space.page"
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
let hasPageIdParameter = Boolean(route.params.pageId?.length)
|
|
160
|
+
//TODO Fix this properly. If we have no page path but a modal on, we need to prevent the disapearance of the welcome screen
|
|
161
|
+
if (route.params?.pageId?.indexOf("modal:") === 0) hasPageIdParameter = false
|
|
161
162
|
|
|
163
|
+
const hasLandingPage = !!landingPage.value
|
|
162
164
|
return isDynamicPage && !hasPageIdParameter && !hasLandingPage
|
|
163
165
|
})
|
|
164
166
|
|
package/yarn.lock
CHANGED
|
@@ -295,10 +295,10 @@
|
|
|
295
295
|
resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.2.9.tgz#d229a7b7f9dac167a156992ef23c7f023653f53b"
|
|
296
296
|
integrity sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==
|
|
297
297
|
|
|
298
|
-
"@raclettejs/types@^0.1.
|
|
299
|
-
version "0.1.
|
|
300
|
-
resolved "https://registry.yarnpkg.com/@raclettejs/types/-/types-0.1.
|
|
301
|
-
integrity sha512-
|
|
298
|
+
"@raclettejs/types@^0.1.14":
|
|
299
|
+
version "0.1.14"
|
|
300
|
+
resolved "https://registry.yarnpkg.com/@raclettejs/types/-/types-0.1.14.tgz#585958921aaecab98dc301be4e1ce7207e90aeae"
|
|
301
|
+
integrity sha512-Uh3006SOIUDQw5LFvPj2ewLKglBnORNY+9IE9cqsDFHXZo++/9eBwaEGPvQKTJ6XbjpJPxUezKvbtaaE8MMIFg==
|
|
302
302
|
dependencies:
|
|
303
303
|
"@types/node" "24.5.2"
|
|
304
304
|
fastify "5.6.0"
|