@uxland/primary-shell 3.1.0 → 3.1.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/package.json +10 -9
- package/src/UI/components/primaria-shell/styles.scss +15 -5
- package/src/UI/components/primaria-shell/template.ts +1 -1
- package/src/index.ts +1 -0
- package/src/internal-plugins/activity-history/domain/is-valid-history-item/is-valid-history-item.test.ts +22 -0
- package/src/internal-plugins/activity-history/features/state.ts +15 -10
- package/src/internal-plugins/activity-history/index.ts +1 -0
- package/src/internal-plugins/index.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxland/primary-shell",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"description": "Primaria Shell",
|
|
5
5
|
"author": "UXLand <dev@uxland.es>",
|
|
6
6
|
"homepage": "https://github.com/uxland/harmonix/tree/app#readme",
|
|
@@ -21,6 +21,14 @@
|
|
|
21
21
|
"type": "git",
|
|
22
22
|
"url": "git+https://github.com/uxland/harmonix.git"
|
|
23
23
|
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"serve": "vite",
|
|
26
|
+
"start": "ng serve --host 0.0.0.0",
|
|
27
|
+
"build": "vite build",
|
|
28
|
+
"preview": "vite preview",
|
|
29
|
+
"publish-rc": "npm publish --tag rc",
|
|
30
|
+
"publish": "npm publish"
|
|
31
|
+
},
|
|
24
32
|
"bugs": {
|
|
25
33
|
"url": "https://github.com/uxland/harmonix/issues"
|
|
26
34
|
},
|
|
@@ -54,12 +62,5 @@
|
|
|
54
62
|
"jwt-decode": "^4.0.0",
|
|
55
63
|
"@salut/design-system-salut": "../../design-system-salut-1.11.0.tgz",
|
|
56
64
|
"reflect-metadata": "^0.2.2"
|
|
57
|
-
},
|
|
58
|
-
"scripts": {
|
|
59
|
-
"serve": "vite",
|
|
60
|
-
"start": "ng serve --host 0.0.0.0",
|
|
61
|
-
"build": "vite build",
|
|
62
|
-
"preview": "vite preview",
|
|
63
|
-
"publish-rc": "npm publish --tag rc"
|
|
64
65
|
}
|
|
65
|
-
}
|
|
66
|
+
}
|
|
@@ -22,12 +22,22 @@
|
|
|
22
22
|
&__left {
|
|
23
23
|
@include horizontal-center;
|
|
24
24
|
gap: 24px;
|
|
25
|
+
|
|
26
|
+
.header-logo {
|
|
27
|
+
align-self: center;
|
|
28
|
+
}
|
|
29
|
+
#header-region-container {
|
|
30
|
+
@include horizontal-center;
|
|
31
|
+
}
|
|
25
32
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
|
|
34
|
+
&__right {
|
|
35
|
+
@include horizontal-center;
|
|
36
|
+
gap: 24px;
|
|
37
|
+
|
|
38
|
+
#header-actions-region-container {
|
|
39
|
+
@include horizontal-center;
|
|
40
|
+
}
|
|
31
41
|
}
|
|
32
42
|
}
|
|
33
43
|
|
|
@@ -17,8 +17,8 @@ export const template = (props: PrimariaShell) => html`
|
|
|
17
17
|
<div class="header-logo">
|
|
18
18
|
<img src=${salutLogo} alt="logo" />
|
|
19
19
|
</div>
|
|
20
|
-
<primaria-content-switcher id="header-region-container"></primaria-content-switcher>
|
|
21
20
|
<patient-header></patient-header>
|
|
21
|
+
<div id="header-region-container"></div>
|
|
22
22
|
</div>
|
|
23
23
|
<div class="header__right">
|
|
24
24
|
<div id="header-actions-region-container"></div>
|
package/src/index.ts
CHANGED
|
@@ -125,4 +125,26 @@ describe("isValidActivityHistoryItem", () => {
|
|
|
125
125
|
|
|
126
126
|
expect(isValidActivityHistoryItem(invalidItem)).toBe(false);
|
|
127
127
|
});
|
|
128
|
+
it("should return true if all base props are correct, but object contain more extra fields", () => {
|
|
129
|
+
const validItem = {
|
|
130
|
+
id: "123",
|
|
131
|
+
date: "2023-10-07",
|
|
132
|
+
professional: {
|
|
133
|
+
id: "prof-1",
|
|
134
|
+
name: "Dr. John Doe",
|
|
135
|
+
speciality: { id: "spec-1", description: "Cardiology" },
|
|
136
|
+
role: { id: "role-1", description: "Lead Doctor" },
|
|
137
|
+
},
|
|
138
|
+
relevant: true,
|
|
139
|
+
diagnostics: [{ id: "diag-1", description: "High Blood Pressure" }],
|
|
140
|
+
center: { id: "center-1", description: "Main Hospital" },
|
|
141
|
+
up: { id: "up-1", description: "Unit A" },
|
|
142
|
+
ep: { id: "ep-1", description: "Emergency Room" },
|
|
143
|
+
service: { id: "service-1", description: "Cardiac Service" },
|
|
144
|
+
prop1: "value1",
|
|
145
|
+
prop2: "value2",
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
expect(isValidActivityHistoryItem(validItem)).toBe(true);
|
|
149
|
+
});
|
|
128
150
|
});
|
|
@@ -37,17 +37,22 @@ export const activityHistorySlice = createSlice({
|
|
|
37
37
|
addActivityHistoryItems(state, action) {
|
|
38
38
|
const { id, items } = action.payload;
|
|
39
39
|
|
|
40
|
+
// Crea la colección si no existe
|
|
41
|
+
if (!state.collections[id])
|
|
42
|
+
state.collections = { ...state.collections, [id]: action.payload };
|
|
40
43
|
// Si la colección ya existe, fusiona el array existente con el nuevo; si no, crea una nueva entrada
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
else {
|
|
45
|
+
state.collections = {
|
|
46
|
+
...state.collections,
|
|
47
|
+
[id]: {
|
|
48
|
+
...state.collections[id],
|
|
49
|
+
items: [
|
|
50
|
+
...(state.collections[id]?.items || []), // Array existente o vacío si no hay nada
|
|
51
|
+
...items, // Nuevo array de action.payload.items
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
}
|
|
51
56
|
},
|
|
52
57
|
removeErrorHistoryItem(state, action) {
|
|
53
58
|
state.error = state.error.filter((i) => i !== action.payload);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./domain/model";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./activity-history";
|