@uxland/primary-shell 5.5.0 → 5.6.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.
- package/dist/flow-D-0MTYCm.js.map +1 -1
- package/dist/index.js +21959 -22178
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +2008 -1954
- package/dist/index.umd.cjs.map +1 -1
- package/dist/primary/shell/src/UI/components/primaria-shell/shell-header/header-divider/header-divider.d.ts +6 -0
- package/dist/primary/shell/src/UI/components/primaria-shell/shell-header/header-divider/template.d.ts +3 -0
- package/dist/primary/shell/src/UI/components/primaria-shell/shell-header/shell-header.d.ts +1 -0
- package/dist/primary/shell/src/features/utils.d.ts +1 -2
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/add/handle-busy/busy-component/component.d.ts +2 -1
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/add/handle-busy/selectors.d.ts +1 -1
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/list/UI/main-view/activity-history-main.d.ts +2 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/list/UI/timeline/activity-history-timeline.d.ts +19 -0
- package/package.json +2 -2
- package/src/UI/components/bootstrapper.ts +2 -0
- package/src/UI/components/primaria-shell/shell-header/header-divider/header-divider.ts +13 -0
- package/src/UI/components/primaria-shell/shell-header/header-divider/styles.css +5 -0
- package/src/UI/components/primaria-shell/shell-header/header-divider/template.ts +8 -0
- package/src/UI/components/primaria-shell/shell-header/shell-header.ts +27 -0
- package/src/UI/components/primaria-shell/shell-header/styles.css +4 -4
- package/src/UI/components/primaria-shell/shell-header/template.ts +2 -0
- package/src/UI/components/primaria-shell/styles.css +7 -6
- package/src/UI/internal-views/handle-views.ts +1 -1
- package/src/UI/internal-views/lower-nav-menu-views.ts +0 -17
- package/src/UI/internal-views/upper-nav-views.ts +30 -4
- package/src/UI/shared-components/primaria-text-editor/styles.css +0 -3
- package/src/features/utils.ts +3 -3
- package/src/internal-plugins/activity-history/activity-history-item/add/handle-busy/busy-component/component.ts +7 -6
- package/src/internal-plugins/activity-history/activity-history-item/add/handle-busy/busy-component/styles.css +11 -14
- package/src/internal-plugins/activity-history/activity-history-item/add/handle-busy/busy-component/template.ts +2 -2
- package/src/internal-plugins/activity-history/activity-history-item/add/handle-busy/selectors.ts +6 -6
- package/src/internal-plugins/activity-history/activity-history-item/add/handle-error/selectors.ts +4 -6
- package/src/internal-plugins/activity-history/activity-history-item/domain/specs/search-string-spec.ts +1 -1
- package/src/internal-plugins/activity-history/activity-history-item/filter/UI/active-filters-badges/active-filters-badges.ts +14 -13
- package/src/internal-plugins/activity-history/activity-history-item/filter/UI/active-filters-badges/template.ts +22 -7
- package/src/internal-plugins/activity-history/activity-history-item/filter/UI/activity-history-filters/template.ts +3 -2
- package/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/set-custom-filter-value/reducer.ts +6 -0
- package/src/internal-plugins/activity-history/activity-history-item/list/UI/main-view/activity-history-main.ts +11 -9
- package/src/internal-plugins/activity-history/activity-history-item/list/UI/main-view/template.ts +2 -2
- package/src/internal-plugins/activity-history/activity-history-item/list/UI/timeline/activity-history-timeline.ts +3 -6
- package/src/internal-plugins/activity-history/activity-history-item/list/UI/timeline/template.ts +1 -1
- package/dist/primary/shell/src/infrastructure/ioc/container.d.ts +0 -7
- package/dist/primary/shell/src/internal-plugins/activity-history/infrastructure/ioc/container.d.ts +0 -8
|
@@ -2,7 +2,6 @@ import { Container, interfaces } from 'inversify';
|
|
|
2
2
|
import { IRequestClass } from '..';
|
|
3
3
|
import { PrimariaApi } from '../api/api';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
export declare const registerRequest: (api: PrimariaApi, container: Container) => (command: IRequestClass<any>, handler: Newable<any>) => {
|
|
5
|
+
export declare const registerRequest: (api: PrimariaApi, container: Container) => (command: IRequestClass<any>, handler: interfaces.Newable<any>) => {
|
|
7
6
|
dispose: () => void;
|
|
8
7
|
};
|
|
@@ -3,6 +3,7 @@ import { LitElement } from 'lit';
|
|
|
3
3
|
export declare class ActivityHistoryBusy extends LitElement {
|
|
4
4
|
render(): import('lit').TemplateResult<1>;
|
|
5
5
|
static styles: import('lit').CSSResult;
|
|
6
|
-
|
|
6
|
+
isCollectionInitialState: boolean;
|
|
7
7
|
isSomeCollectionLoadedAndOtherLoading: boolean;
|
|
8
|
+
get skeletons(): import('lit').TemplateResult<1>[];
|
|
8
9
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { RootState } from '../../../infrastructure/state/store';
|
|
2
2
|
|
|
3
|
-
export declare const isAnyCollectionLoadingWithoutAnyLoaded: (state: RootState) => boolean;
|
|
4
3
|
export declare const isSomeCollectionLoadedAndOtherLoading: (state: RootState) => boolean;
|
|
4
|
+
export declare const isCollectionInitialState: (state: RootState) => boolean;
|
|
@@ -11,6 +11,8 @@ export declare class ActivityHistoryMain extends ActivityHistoryMain_base {
|
|
|
11
11
|
maximized: boolean;
|
|
12
12
|
api: PrimariaApi;
|
|
13
13
|
historyItems: any[];
|
|
14
|
+
isCollectionInitialState: boolean;
|
|
15
|
+
isSomeCollectionLoadedAndOtherLoading: boolean;
|
|
14
16
|
_maximize(): void;
|
|
15
17
|
_minimize(): void;
|
|
16
18
|
_subscribeEvents(): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
import { IActivityHistoryGroup } from '../../../domain/model';
|
|
3
|
+
|
|
4
|
+
export declare class ActivityHistoryTimeline extends LitElement {
|
|
5
|
+
render(): import('lit').TemplateResult<1>;
|
|
6
|
+
static styles: import('lit').CSSResult;
|
|
7
|
+
historyGroups: IActivityHistoryGroup[];
|
|
8
|
+
isCollectionInitialState: boolean;
|
|
9
|
+
isSomeCollectionLoadedAndOtherLoading: boolean;
|
|
10
|
+
searchString: string;
|
|
11
|
+
private _virtualizer;
|
|
12
|
+
_hasUpdatedOnce: boolean;
|
|
13
|
+
firstUpdated(_changeProps: PropertyValues): void;
|
|
14
|
+
updated(changedProperties: any): Promise<void>;
|
|
15
|
+
prepareComponents(historyGroups: any): Promise<void>;
|
|
16
|
+
highlightMatch(text: string, searchString: string): string;
|
|
17
|
+
highlighted(text?: string): import('lit/directive.js').DirectiveResult<typeof import('lit/directives/unsafe-html.js').UnsafeHTMLDirective> | null;
|
|
18
|
+
_scrollIntoDate(selectedDate: number): void;
|
|
19
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxland/primary-shell",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.6.1",
|
|
4
4
|
"description": "Primaria Shell",
|
|
5
5
|
"author": "UXLand <dev@uxland.es>",
|
|
6
6
|
"homepage": "https://github.com/uxland/harmonix/tree/app#readme",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@primaria/plugins-core": "^1.0.14",
|
|
33
33
|
"@reduxjs/toolkit": "^2.6.1",
|
|
34
|
-
"@salut/design-system-salut": "../../design-system-salut-2.
|
|
34
|
+
"@salut/design-system-salut": "../../design-system-salut-2.6.0.tgz",
|
|
35
35
|
"@types/react": "^19.0.12",
|
|
36
36
|
"@uxland/lit-utilities": "^1.0.0",
|
|
37
37
|
"@uxland/localization": "^1.0.3",
|
|
@@ -7,6 +7,7 @@ import { PocEventsEcap } from "./poc-events-ecap/poc-events-ecap";
|
|
|
7
7
|
import { FinalizeVisitButton } from "../../features/visit/finalize-visit/component/finalize-visit-button";
|
|
8
8
|
import { PrimariaAccordion } from "./primaria-accordion/primaria-accordion";
|
|
9
9
|
import { CommunicationActionMenu } from "./communication-action-menu/communication-action-menu";
|
|
10
|
+
import { HeaderDivider } from "./primaria-shell/shell-header/header-divider/header-divider";
|
|
10
11
|
|
|
11
12
|
export const useComponents = () => {
|
|
12
13
|
//@ts-ignore
|
|
@@ -16,6 +17,7 @@ export const useComponents = () => {
|
|
|
16
17
|
customElement("primaria-error-view")(PrimariaErrorView);
|
|
17
18
|
customElement("quick-actions-menu")(QuickActionsMenu);
|
|
18
19
|
customElement("finalize-visit-button")(FinalizeVisitButton);
|
|
20
|
+
customElement('header-divider')(HeaderDivider);
|
|
19
21
|
customElement("communication-action-menu")(CommunicationActionMenu);
|
|
20
22
|
//@ts-ignore
|
|
21
23
|
customElement("poc-events-ecap")(PocEventsEcap);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { html, LitElement, css, unsafeCSS } from "lit";
|
|
2
|
+
import styles from "./styles.css?inline";
|
|
3
|
+
import { template } from "./template";
|
|
4
|
+
|
|
5
|
+
export class HeaderDivider extends LitElement {
|
|
6
|
+
render() {
|
|
7
|
+
return html`${template(this)}`;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
static styles = css`
|
|
11
|
+
${unsafeCSS(styles)}
|
|
12
|
+
`;
|
|
13
|
+
}
|
|
@@ -44,4 +44,31 @@ export class PrimariaShellHeader extends PrimariaRegionHost(LitElement) {
|
|
|
44
44
|
this.professional = response;
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
+
|
|
48
|
+
firstUpdated() {
|
|
49
|
+
const container = this.renderRoot?.querySelector('#header-region-container');
|
|
50
|
+
if (!container) return;
|
|
51
|
+
|
|
52
|
+
let observer: MutationObserver;
|
|
53
|
+
|
|
54
|
+
const updateDividers = () => {
|
|
55
|
+
observer.disconnect();
|
|
56
|
+
|
|
57
|
+
Array.from(container.querySelectorAll('header-divider')).forEach(div => (div as HTMLElement).remove());
|
|
58
|
+
|
|
59
|
+
const children = Array.from(container.children).filter(
|
|
60
|
+
el => (el as HTMLElement).tagName !== 'HEADER-DIVIDER'
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
for (let i = 1; i < children.length; i++) {
|
|
64
|
+
const divider = document.createElement('header-divider');
|
|
65
|
+
container.insertBefore(divider, children[i]);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
observer.observe(container, { childList: true });
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
observer = new MutationObserver(updateDividers);
|
|
72
|
+
observer.observe(container, { childList: true });
|
|
73
|
+
}
|
|
47
74
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
:host {
|
|
2
|
-
z-index:
|
|
2
|
+
z-index: 205;
|
|
3
3
|
}
|
|
4
4
|
.header {
|
|
5
5
|
display: flex;
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
display: flex;
|
|
19
19
|
flex-direction: row;
|
|
20
20
|
align-items: center;
|
|
21
|
-
gap:
|
|
21
|
+
gap: 16px;
|
|
22
22
|
|
|
23
23
|
.header-logo {
|
|
24
24
|
align-self: center;
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
display: flex;
|
|
28
28
|
flex-direction: row;
|
|
29
29
|
align-items: center;
|
|
30
|
-
gap:
|
|
30
|
+
gap: 16px;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
display: flex;
|
|
36
36
|
flex-direction: row;
|
|
37
37
|
align-items: center;
|
|
38
|
-
gap:
|
|
38
|
+
gap: 16px;
|
|
39
39
|
|
|
40
40
|
#header-actions-region-container {
|
|
41
41
|
display: flex;
|
|
@@ -15,11 +15,13 @@ export const template = (props: PrimariaShellHeader) => {
|
|
|
15
15
|
<div class="header-logo">
|
|
16
16
|
<img src=${salutLogo} alt="logo" />
|
|
17
17
|
</div>
|
|
18
|
+
<header-divider></header-divider>
|
|
18
19
|
<div id="header-region-container"></div>
|
|
19
20
|
</div>
|
|
20
21
|
<div class="header__right">
|
|
21
22
|
<finalize-visit-button></finalize-visit-button>
|
|
22
23
|
<div id="header-actions-region-container"></div>
|
|
24
|
+
<header-divider></header-divider>
|
|
23
25
|
${when(
|
|
24
26
|
props.professional,
|
|
25
27
|
() => html`<dss-header-menu-professional @onExit=${props.logout} slot="professional-menu" name="${props.professional.firstName} ${props.professional?.familyName} ${props.professional?.lastName}" center="${props.professional.workCenter}" collegiate="${props.professional.registrationNumber}">
|
|
@@ -57,16 +57,13 @@
|
|
|
57
57
|
display: flex;
|
|
58
58
|
flex-direction: column;
|
|
59
59
|
gap: 4px;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/*Temporary scrollbar*/
|
|
63
|
-
#menu-region-container {
|
|
64
60
|
overflow-y: auto;
|
|
65
61
|
margin-right: -14px;
|
|
66
62
|
padding-right: 14px;
|
|
67
|
-
scrollbar-color: var(--color-primary-
|
|
63
|
+
scrollbar-color: var(--color-primary-200) var(--color-primary-700);
|
|
68
64
|
scrollbar-width: thin;
|
|
69
65
|
}
|
|
66
|
+
|
|
70
67
|
#menu-region-container::-webkit-scrollbar {
|
|
71
68
|
width: 6px;
|
|
72
69
|
}
|
|
@@ -77,7 +74,6 @@
|
|
|
77
74
|
background-color: var(--color-primary-400);
|
|
78
75
|
border-radius: 4px;
|
|
79
76
|
}
|
|
80
|
-
/**/
|
|
81
77
|
|
|
82
78
|
.bottom-content {
|
|
83
79
|
display: flex;
|
|
@@ -140,6 +136,11 @@
|
|
|
140
136
|
height: 100%;
|
|
141
137
|
flex: 1;
|
|
142
138
|
}
|
|
139
|
+
#navigation-menu-lower-region-container{
|
|
140
|
+
display: flex;
|
|
141
|
+
flex-direction: column;
|
|
142
|
+
gap: 4px;
|
|
143
|
+
}
|
|
143
144
|
#floating-region-container {
|
|
144
145
|
position: fixed;
|
|
145
146
|
z-index: 300;
|
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
import { shellApi } from "../../api/api";
|
|
2
|
-
import { shellRegions } from "../../api/region-manager/regions";
|
|
3
|
-
import { PrimariaNavItem } from "../shared-components/primaria-nav-item/primaria-nav-item";
|
|
4
|
-
|
|
5
1
|
export const registerLowerNavMenuViews = () => {
|
|
6
|
-
shellApi.regionManager.registerView(shellRegions.navigationLowerLeftMenu, {
|
|
7
|
-
id: "configuration-center",
|
|
8
|
-
factory: () => {
|
|
9
|
-
const menuItem = new PrimariaNavItem({
|
|
10
|
-
icon: "settings",
|
|
11
|
-
label: "Centre de configuració",
|
|
12
|
-
callbackFn: () => {
|
|
13
|
-
// shellApi.regionManager.activateView(shellRegions.main, "");
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
return Promise.resolve(menuItem);
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
2
|
};
|
|
@@ -7,6 +7,7 @@ import { CommunicationActionMenu } from "../components/communication-action-menu
|
|
|
7
7
|
import { QuickActionItem } from "../shared-components/quick-action-item/quick-action-item";
|
|
8
8
|
import { PrimariaNavItem } from "../shared-components/primaria-nav-item/primaria-nav-item";
|
|
9
9
|
import { PrimariaNavTreeMenu } from "../shared-components/primaria-nav-tree-menu/primaria-nav-tree-menu";
|
|
10
|
+
import { GetVisitId } from "../../features/visit/get-visit-id/request";
|
|
10
11
|
|
|
11
12
|
type MenuItemConfig =
|
|
12
13
|
| {
|
|
@@ -56,7 +57,7 @@ const upperNavMenuItems: MenuItemConfig[] = [
|
|
|
56
57
|
actionMenuItems: [
|
|
57
58
|
{
|
|
58
59
|
icon: "open_in_new",
|
|
59
|
-
label: "ARES",
|
|
60
|
+
label: "Proces d'atenció - ARES",
|
|
60
61
|
callbackFn: () => navigateToEcapWithoutClosingWithCip("PROCES_ATENCIO"),
|
|
61
62
|
},
|
|
62
63
|
{
|
|
@@ -89,7 +90,7 @@ const upperNavMenuItems: MenuItemConfig[] = [
|
|
|
89
90
|
{
|
|
90
91
|
id: "unique-petition",
|
|
91
92
|
icon: "playlist_add",
|
|
92
|
-
label: "
|
|
93
|
+
label: "Peticionari",
|
|
93
94
|
type: "tree",
|
|
94
95
|
sortHint: "0050",
|
|
95
96
|
actionMenuItems: [
|
|
@@ -273,8 +274,33 @@ export const registerCommunicationMenuActions = () => {
|
|
|
273
274
|
});
|
|
274
275
|
},
|
|
275
276
|
},
|
|
276
|
-
{
|
|
277
|
-
|
|
277
|
+
{
|
|
278
|
+
id: "2",
|
|
279
|
+
sortHint: "0020",
|
|
280
|
+
icon: "open_in_new",
|
|
281
|
+
label: "eConsulta",
|
|
282
|
+
callbackFn: async () => {
|
|
283
|
+
const CIP = await getPatientCip(shellApi);
|
|
284
|
+
const visiId = (await shellApi.broker.send(new GetVisitId())) as string;
|
|
285
|
+
|
|
286
|
+
shellApi.ecapEventManager.publish("NAVEGACIO_ECAP_ECONSULTA", "NO_TANCAR", {
|
|
287
|
+
CIP: CIP || "",
|
|
288
|
+
VisiID: visiId || "",
|
|
289
|
+
});
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
id: "3",
|
|
294
|
+
icon: "open_in_new",
|
|
295
|
+
label: "Mail",
|
|
296
|
+
callbackFn: async () => {
|
|
297
|
+
const CIP = await getPatientCip(shellApi);
|
|
298
|
+
shellApi.ecapEventManager.publish("COMUNICACIO_MISSATGES_CREAR", "NO_TANCAR", {
|
|
299
|
+
CIP: CIP || "",
|
|
300
|
+
TipusMissatge: "SMS",
|
|
301
|
+
});
|
|
302
|
+
},
|
|
303
|
+
},
|
|
278
304
|
{
|
|
279
305
|
id: "4",
|
|
280
306
|
sortHint: "0030",
|
package/src/features/utils.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Container, injectable
|
|
1
|
+
import { Container, injectable } from "inversify";
|
|
2
|
+
import type { interfaces } from "inversify";
|
|
2
3
|
import { IRequest, IRequestClass } from "..";
|
|
3
4
|
import { PrimariaApi } from "../api/api";
|
|
4
|
-
import Newable = interfaces.Newable;
|
|
5
5
|
|
|
6
6
|
//TODO aixo ho fan ja les Broker extensions de plugins/core. Veure si s'ha de canviar
|
|
7
7
|
export const registerRequest =
|
|
8
8
|
(api: PrimariaApi, container: Container) =>
|
|
9
|
-
(command: IRequestClass<any>, handler: Newable<any>) => {
|
|
9
|
+
(command: IRequestClass<any>, handler: interfaces.Newable<any>) => {
|
|
10
10
|
container.bind(handler).to(handler).inTransientScope();
|
|
11
11
|
injectable()(handler);
|
|
12
12
|
const disposable = api.broker.registerRequest(command, (cmd: IRequest<any>) => {
|
|
@@ -3,10 +3,7 @@ import { customElement } from "lit/decorators.js";
|
|
|
3
3
|
import styles from "./styles.css?inline";
|
|
4
4
|
import { template } from "./template";
|
|
5
5
|
import { connectedProperty } from "../../../../infrastructure/state/connected-property";
|
|
6
|
-
import {
|
|
7
|
-
isAnyCollectionLoadingWithoutAnyLoaded,
|
|
8
|
-
isSomeCollectionLoadedAndOtherLoading,
|
|
9
|
-
} from "../selectors";
|
|
6
|
+
import { isSomeCollectionLoadedAndOtherLoading, isCollectionInitialState } from "../selectors";
|
|
10
7
|
|
|
11
8
|
//@ts-ignore
|
|
12
9
|
@customElement("activity-history-busy")
|
|
@@ -19,9 +16,13 @@ export class ActivityHistoryBusy extends LitElement {
|
|
|
19
16
|
${unsafeCSS(styles)}
|
|
20
17
|
`;
|
|
21
18
|
|
|
22
|
-
@connectedProperty(
|
|
23
|
-
|
|
19
|
+
@connectedProperty(isCollectionInitialState)
|
|
20
|
+
isCollectionInitialState: boolean;
|
|
24
21
|
|
|
25
22
|
@connectedProperty(isSomeCollectionLoadedAndOtherLoading)
|
|
26
23
|
isSomeCollectionLoadedAndOtherLoading: boolean;
|
|
24
|
+
|
|
25
|
+
get skeletons() {
|
|
26
|
+
return Array.from({ length: 12 }, () => html`<dss-skeleton width="100" height="10"></dss-skeleton>`);
|
|
27
|
+
}
|
|
27
28
|
}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
.spinner-container {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
align-items: center;
|
|
14
|
-
justify-content: center;
|
|
15
|
-
}
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: row;
|
|
4
|
+
align-items: center;
|
|
5
|
+
gap: 24px;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
padding-top:16px
|
|
8
|
+
}
|
|
9
|
+
.skeleton-container {
|
|
10
|
+
padding: 20px;
|
|
11
|
+
height: 100%;
|
|
12
|
+
}
|
|
@@ -3,8 +3,8 @@ import { ActivityHistoryBusy } from "./component";
|
|
|
3
3
|
import { translate } from "../../../../localization";
|
|
4
4
|
|
|
5
5
|
export const template = (props: ActivityHistoryBusy) =>
|
|
6
|
-
props.
|
|
7
|
-
? html`<div class="
|
|
6
|
+
props.isCollectionInitialState
|
|
7
|
+
? html`<div class="skeleton-container">${props.skeletons}</div>`
|
|
8
8
|
: props.isSomeCollectionLoadedAndOtherLoading
|
|
9
9
|
? html`<div class="spinner-container"><dss-spinner size="sm"></dss-spinner><div class="busy-description">${translate("busyEntriesLoading")}</div></div>`
|
|
10
10
|
: nothing;
|
package/src/internal-plugins/activity-history/activity-history-item/add/handle-busy/selectors.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { RootState } from "../../../infrastructure/state/store";
|
|
2
2
|
|
|
3
|
-
const isAnyCollectionBusySelector = (state: RootState) =>
|
|
4
|
-
state.activityHistoryCollections.busy.length > 0;
|
|
5
|
-
export const isAnyCollectionLoadingWithoutAnyLoaded = (state: RootState) => {
|
|
6
|
-
const collections = Object.values(state.activityHistoryCollections.collections);
|
|
7
|
-
return !collections?.length && isAnyCollectionBusySelector(state);
|
|
8
|
-
};
|
|
3
|
+
const isAnyCollectionBusySelector = (state: RootState) => state.activityHistoryCollections.busy.length > 0;
|
|
9
4
|
|
|
10
5
|
export const isSomeCollectionLoadedAndOtherLoading = (state: RootState) => {
|
|
11
6
|
const collections = Object.values(state.activityHistoryCollections.collections);
|
|
12
7
|
return collections && isAnyCollectionBusySelector(state);
|
|
13
8
|
};
|
|
9
|
+
|
|
10
|
+
export const isCollectionInitialState = (state: RootState) => {
|
|
11
|
+
const collections = Object.values(state.activityHistoryCollections.collections);
|
|
12
|
+
return !collections?.length && !isAnyCollectionBusySelector(state);
|
|
13
|
+
};
|
package/src/internal-plugins/activity-history/activity-history-item/add/handle-error/selectors.ts
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import { RootState } from "../../../infrastructure/state/store";
|
|
2
|
-
import {
|
|
2
|
+
import { isSomeCollectionLoadedAndOtherLoading } from "../handle-busy/selectors";
|
|
3
3
|
|
|
4
4
|
export const isErrorOccurred = (state: RootState) => state.activityHistoryCollections.error.length > 0;
|
|
5
5
|
|
|
6
6
|
const areCollectionsEmpty = (state: RootState) => {
|
|
7
7
|
const collections = state.activityHistoryCollections.collections;
|
|
8
8
|
|
|
9
|
-
return Object.values(collections).every(collection => {
|
|
9
|
+
return Object.values(collections).every((collection) => {
|
|
10
10
|
return !collection.items || collection.items.length === 0;
|
|
11
11
|
});
|
|
12
12
|
};
|
|
13
13
|
export const isAllDataFailedToLoad = (state: RootState) => {
|
|
14
|
-
return !
|
|
15
|
-
!isSomeCollectionLoadedAndOtherLoading(state) &&
|
|
16
|
-
isErrorOccurred(state) && areCollectionsEmpty(state);
|
|
14
|
+
return !isSomeCollectionLoadedAndOtherLoading(state) && isErrorOccurred(state) && areCollectionsEmpty(state);
|
|
17
15
|
};
|
|
18
16
|
|
|
19
|
-
export const selectErrorMessages = (state: RootState) => state.activityHistoryCollections.error;
|
|
17
|
+
export const selectErrorMessages = (state: RootState) => state.activityHistoryCollections.error;
|
|
@@ -12,7 +12,7 @@ const commonFieldsSearchPredicate = (item: IActivityHistoryItem, searchString: s
|
|
|
12
12
|
item.professional?.role?.description && propContainsString(item.professional?.role.description, searchString);
|
|
13
13
|
const serviceNameContainsSearchString = item.service?.description && propContainsString(item.service.description, searchString);
|
|
14
14
|
const diagnosticsMatch = item.diagnostics?.some(
|
|
15
|
-
(diagnostic) => propContainsString(diagnostic.
|
|
15
|
+
(diagnostic) => propContainsString(diagnostic.descripcio, searchString),
|
|
16
16
|
);
|
|
17
17
|
return (
|
|
18
18
|
professionalNameContainsSearchString ||
|
|
@@ -6,9 +6,15 @@ import { PrimariaApi } from "../../../../../../api/api";
|
|
|
6
6
|
import { TYPES } from "../../../../infrastructure/ioc/types";
|
|
7
7
|
import { template } from "./template";
|
|
8
8
|
import styles from "./styles.css?inline";
|
|
9
|
-
|
|
9
|
+
|
|
10
10
|
import { SetCustomFilterValue } from "../../custom-filters/set-custom-filter-value/request";
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
IActivityHistoryCustomFilter,
|
|
13
|
+
IActivityHistoryCustomFilterGroup,
|
|
14
|
+
IActivityHistoryDiagnosticsFilter,
|
|
15
|
+
IActivityHistoryFilter,
|
|
16
|
+
IActivityHistoryUpFilter,
|
|
17
|
+
} from "../../model";
|
|
12
18
|
import { activityHistoryEnabledCommonFiltersSelector } from "../../common-filters/selectors";
|
|
13
19
|
import { SetCommonFilter } from "../../common-filters/set-common-filter/request";
|
|
14
20
|
import { diagnosticFilterSelector } from "../../diagnostic-filters/selectors";
|
|
@@ -17,6 +23,7 @@ import { ResetCommonFilter } from "../../common-filters/reset-common-filter/requ
|
|
|
17
23
|
import { ResetCustomFilter } from "../../custom-filters/reset-custom-filter/request";
|
|
18
24
|
import { upFilterSelector } from "../../up-filters/selectors";
|
|
19
25
|
import { SetUpFiltersCommand } from "../../up-filters/set/request";
|
|
26
|
+
import { customFilterGroupsWithOptionsSelector } from "../../../selectors";
|
|
20
27
|
|
|
21
28
|
//@ts-ignore
|
|
22
29
|
@customElement("active-filters-badges")
|
|
@@ -37,12 +44,12 @@ export class ActiveFiltersBadges extends LitElement {
|
|
|
37
44
|
@connectedProperty(activityHistoryEnabledCommonFiltersSelector)
|
|
38
45
|
enabledCommonFilters: IActivityHistoryFilter[];
|
|
39
46
|
|
|
40
|
-
@connectedProperty(
|
|
47
|
+
@connectedProperty(customFilterGroupsWithOptionsSelector)
|
|
41
48
|
enabledFilters: IActivityHistoryCustomFilterGroup[];
|
|
42
49
|
|
|
43
50
|
@connectedProperty(diagnosticFilterSelector)
|
|
44
51
|
diagnosticFilterEnabled: IActivityHistoryDiagnosticsFilter;
|
|
45
|
-
|
|
52
|
+
|
|
46
53
|
@connectedProperty(upFilterSelector)
|
|
47
54
|
upFilterEnabled: IActivityHistoryUpFilter;
|
|
48
55
|
|
|
@@ -63,18 +70,12 @@ export class ActiveFiltersBadges extends LitElement {
|
|
|
63
70
|
|
|
64
71
|
_onDeleteDiagnosticFilterValue(diagnosticValue: string) {
|
|
65
72
|
this.api.broker.send(
|
|
66
|
-
new SetDiagnosticFiltersCommand([
|
|
67
|
-
...this.diagnosticFilterEnabled.enabledValues.filter((v) => v !== diagnosticValue),
|
|
68
|
-
]),
|
|
73
|
+
new SetDiagnosticFiltersCommand([...this.diagnosticFilterEnabled.enabledValues.filter((v) => v !== diagnosticValue)]),
|
|
69
74
|
);
|
|
70
75
|
}
|
|
71
76
|
|
|
72
|
-
|
|
73
|
-
this.api.broker.send(
|
|
74
|
-
new SetUpFiltersCommand([
|
|
75
|
-
...this.upFilterEnabled.enabledValues.filter((v) => v !== upValue),
|
|
76
|
-
]),
|
|
77
|
-
);
|
|
77
|
+
_onDeleteUpFilterValue(upValue: string) {
|
|
78
|
+
this.api.broker.send(new SetUpFiltersCommand([...this.upFilterEnabled.enabledValues.filter((v) => v !== upValue)]));
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
resetFilters() {
|
|
@@ -5,14 +5,14 @@ import { formatShowFilterTitle, normalizeDeletedFilterBooleanValue, normalizeEmp
|
|
|
5
5
|
|
|
6
6
|
const MAX_VISIBLE_CHIPS = 5;
|
|
7
7
|
|
|
8
|
-
const renderChip = (id, filter,
|
|
8
|
+
const renderChip = (id, filter, option, props) => html`
|
|
9
9
|
<dss-chip
|
|
10
|
-
label=${normalizeEmptyFilterValue(
|
|
10
|
+
label=${normalizeEmptyFilterValue(option.title, filter.title)}
|
|
11
11
|
size="sm"
|
|
12
12
|
hasdelete
|
|
13
13
|
selected
|
|
14
|
-
@click=${() => props._onDeleteFilterValue(id, filter.id,
|
|
15
|
-
@onDelete=${() => props._onDeleteFilterValue(id, filter.id,
|
|
14
|
+
@click=${() => props._onDeleteFilterValue(id, filter.id, option.id, false)}
|
|
15
|
+
@onDelete=${() => props._onDeleteFilterValue(id, filter.id, option.id, false)}
|
|
16
16
|
></dss-chip>
|
|
17
17
|
`;
|
|
18
18
|
|
|
@@ -52,6 +52,7 @@ const renderUpChip = (id, value, props) => html`
|
|
|
52
52
|
const renderFilterTitle = (title) => html`<div class="filter-title">${`${title}:`}</div>`;
|
|
53
53
|
|
|
54
54
|
export const template = (props: ActiveFiltersBadges) => {
|
|
55
|
+
//TODO: refactor chips render
|
|
55
56
|
if (
|
|
56
57
|
props.enabledFilters.length === 0 &&
|
|
57
58
|
props.enabledCommonFilters.length === 0 &&
|
|
@@ -97,7 +98,7 @@ export const template = (props: ActiveFiltersBadges) => {
|
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
100
|
|
|
100
|
-
const up = props.upFilterEnabled;
|
|
101
|
+
const up = props.upFilterEnabled;
|
|
101
102
|
|
|
102
103
|
if (up) {
|
|
103
104
|
const { title, values, enabledValues } = up;
|
|
@@ -127,7 +128,7 @@ export const template = (props: ActiveFiltersBadges) => {
|
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
130
|
}
|
|
130
|
-
}
|
|
131
|
+
}
|
|
131
132
|
|
|
132
133
|
for (const filter of props.enabledCommonFilters) {
|
|
133
134
|
const chip = renderCommonChip(filter, props);
|
|
@@ -147,7 +148,21 @@ export const template = (props: ActiveFiltersBadges) => {
|
|
|
147
148
|
|
|
148
149
|
for (const filter of filters) {
|
|
149
150
|
for (const value of [...new Set(filter.enabledValues)]) {
|
|
150
|
-
|
|
151
|
+
let filterOption = filter?.options?.find((o) => o.id === value);
|
|
152
|
+
|
|
153
|
+
if (filterOption) {
|
|
154
|
+
//Fill when filter option doesnt have title (description)
|
|
155
|
+
filterOption.title = filterOption.title !== "" ? filterOption.title : value;
|
|
156
|
+
} else {
|
|
157
|
+
//Hi ha un filtre de curs clinic "veure eliminats" booleà que no serà un filterOption, per tant entra aquí
|
|
158
|
+
//Aqui es crea el objecte que es passa al chip
|
|
159
|
+
const deletedFiltersOption = normalizeDeletedFilterBooleanValue(value);
|
|
160
|
+
filterOption = { title: deletedFiltersOption, id: deletedFiltersOption };
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
//const chip2 = renderChip(id, filter, normalizeDeletedFilterBooleanValue(value), props);
|
|
164
|
+
|
|
165
|
+
const chip = renderChip(id, filter, filterOption, props);
|
|
151
166
|
|
|
152
167
|
if (visibleCount < MAX_VISIBLE_CHIPS) {
|
|
153
168
|
if (!titleAddedToVisible) {
|