@hortiview/shared-components 0.0.10012 → 0.0.10027

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 CHANGED
@@ -43,6 +43,7 @@ Additionally the library provides form components using [react-hook-form](https:
43
43
  1. [GenericTable](#generictable)
44
44
  1. [HashTabView](#hashtabview)
45
45
  1. [HeaderFilter](#headerfilter)
46
+ 1. [HealthCheckFailed](#healthcheckfailed)
46
47
  1. [InfoGroup](#infogroup)
47
48
  1. [Iconify](#iconify)
48
49
  1. [ListArea](#listarea)
@@ -578,7 +579,70 @@ const [filterValue, setFilterValue] = useState<string>();
578
579
  { value: 'test', label: 'Test' },
579
580
  { value: 'different', label: 'Different' },
580
581
  ]}
581
- />;
582
+ />
583
+ ```
584
+
585
+ ### HealthCheckFailed
586
+
587
+ A screen that shows a health check failed message. It can be used if the check for database health, iot health or HV platform health fails. Please use the following `title` and `subtitle` for each type to ensure a consistent user experience:
588
+
589
+ ```jsx
590
+ import { HealthCheckFailed } from '@hortiview/shared-components';
591
+
592
+ if (isPlatformHealthy === false) {
593
+ return (
594
+ <HealthCheckFailed
595
+ title='The platform data used by this module cannot be retrieved currently.'
596
+ subtitle='Please wait or come back later.'
597
+ type='platform'
598
+ />
599
+ );
600
+ }
601
+
602
+ if (isDbHealthy === false) {
603
+ return (
604
+ <HealthCheckFailed
605
+ title='The data for this module is loading!'
606
+ subtitle='Please wait or come back later.'
607
+ type='database'
608
+ />
609
+ );
610
+ }
611
+
612
+ if (isIotServiceHealthy === false) {
613
+ return (
614
+ <HealthCheckFailed
615
+ title='The data of your devices cannot be retrieved currently.'
616
+ subtitle='The problem is being addressed by our technical team. Please come back later.'
617
+ type='iot'
618
+ />
619
+ );
620
+ }
621
+ ```
622
+
623
+ Set the type to `other` to catch generic errors. Again, please use the `title` and `subtitle` as listed here to ensure a consistent user experience:
624
+
625
+ ```jsx
626
+ <ParentWithVisibleBorders>
627
+ <HealthCheckFailed
628
+ title='Sorry, something went wrong!'
629
+ subtitle='The problem is being addressed by our technical team. Please come back later.'
630
+ type='other'
631
+ />
632
+ </ParentWithVisibleBorders>
633
+ ```
634
+
635
+ You can also control if the card is outlined or not, depending on the position in the UI. The card has a default outline. For design consistency, this prop should only be set to `false` if the card is embedded, e.g. in a table or any other parent that already has a border:
636
+
637
+ ```jsx
638
+ <ParentWithVisibleBorders>
639
+ <HealthCheckFailed
640
+ title='Sorry, something went wrong!'
641
+ subtitle='The problem is being addressed by our technical team. Please come back later.'
642
+ type='other'
643
+ isOutlined={false}
644
+ />
645
+ </ParentWithVisibleBorders>
582
646
  ```
583
647
 
584
648
  ### InfoGroup
@@ -709,8 +773,7 @@ return <>
709
773
  </>
710
774
  ```
711
775
 
712
-
713
- The Loading spinner will automatically change to another text, after a certain waiting time, the text and time are adjustable.
776
+ The Loading spinner will automatically change to another text, after a certain waiting time, the text and time are adjustable.
714
777
  This behavior is enabled per default (10 seconds) - it can be disabled by passing `null` to impatienceMessage.
715
778
 
716
779
  ```JSX
@@ -730,8 +793,6 @@ return <>
730
793
  </>
731
794
  ```
732
795
 
733
-
734
-
735
796
  ### Modal
736
797
 
737
798
  Provides the normal elements modal with one additional change. If you are on fullscreen modal size the max-height and max-width is set to 100svh/svw (Smallest ViewPort height/width).
@@ -0,0 +1 @@
1
+ ._database_11ki8_1{color:var(--lmnt-theme-secondary);animation:_spin_11ki8_1 4s linear infinite}@keyframes _spin_11ki8_1{0%{transform:rotate(0)}to{transform:rotate(-360deg)}}._iot_11ki8_16,._platform_11ki8_17,._other_11ki8_18{color:var(--lmnt-theme-danger)}._crossedOut_11ki8_22{position:relative;display:inline-block}._crossedOut_11ki8_22:after{content:"";position:absolute;width:3rem;height:.25rem;left:50%;top:50%;background:var(--lmnt-theme-danger-on-surface);box-shadow:0 0 0 .125rem var(--lmnt-theme-background);transform:translate(-50%,calc(-50% - .25rem)) rotate(45deg);transform-origin:center;z-index:2}
@@ -26,6 +26,7 @@ import "../../disclaimer.module-BZydt-Q_.js";
26
26
  import "../../genericCard.module-DrQu86jX.js";
27
27
  import "../../HashTabView.module-ZhwSfDeQ.js";
28
28
  import "../../HeaderFilter.module-DiBmulr5.js";
29
+ import "../../healthCheckFailed.module-B5P1ogjs.js";
29
30
  import "../../infoGroup.module-Cxw88dfC.js";
30
31
  import "../../bigLoadingSpinner.module-GgbFol8k.js";
31
32
  import "../../loadingSpinner.module-CLtqSMWA.js";
@@ -35,7 +36,7 @@ import "../../formDatePicker.module-BV3ma_7y.js";
35
36
  import "../../formSelect.module-C6cK23EF.js";
36
37
  import "../../formText.module-C0by6_DK.js";
37
38
  import "../../isPlainObject-BlCDf1Kc.js";
38
- const kt = ({
39
+ const Nt = ({
39
40
  clearFilterText: f,
40
41
  closeCallback: m,
41
42
  currentFilter: i,
@@ -179,5 +180,5 @@ const kt = ({
179
180
  );
180
181
  };
181
182
  export {
182
- kt as Filter
183
+ Nt as Filter
183
184
  };
@@ -24,6 +24,7 @@ import "../../deleteModal.module-Ds3MDzdl.js";
24
24
  import "../../disclaimer.module-BZydt-Q_.js";
25
25
  import "../../HashTabView.module-ZhwSfDeQ.js";
26
26
  import "../../HeaderFilter.module-DiBmulr5.js";
27
+ import "../../healthCheckFailed.module-B5P1ogjs.js";
27
28
  import "../../infoGroup.module-Cxw88dfC.js";
28
29
  import "../../bigLoadingSpinner.module-GgbFol8k.js";
29
30
  import "../../loadingSpinner.module-CLtqSMWA.js";
@@ -35,7 +36,7 @@ import "../../formText.module-C0by6_DK.js";
35
36
  import "../../isPlainObject-BlCDf1Kc.js";
36
37
  import { useGenerateColumns as x, useGenerateTableData as _ } from "./GenericTableService.js";
37
38
  import { GenericCardList as A } from "./Mobile/GenericCardList.js";
38
- const hr = ({
39
+ const yr = ({
39
40
  data: p = [],
40
41
  hiddenColumns: l = [],
41
42
  order: f = [],
@@ -118,5 +119,5 @@ const hr = ({
118
119
  ) });
119
120
  };
120
121
  export {
121
- hr as GenericTable
122
+ yr as GenericTable
122
123
  };
@@ -0,0 +1,22 @@
1
+ type HealthCheckFailedProps = {
2
+ /**
3
+ * Please check the shared components README for the correct title for each type.
4
+ * Font size: 16px, font weight: 700
5
+ */
6
+ title: string;
7
+ /**
8
+ * Please check the shared components README for the correct subtitle for each type.
9
+ * Font size. 14px, font weight: 400, color: 'text-secondary-on-background'
10
+ */
11
+ subtitle: string;
12
+ /**
13
+ * Type of the failed health check. Depending on the type, a different icon of 3rem size will be displayed.
14
+ */
15
+ type: 'database' | 'iot' | 'platform' | 'other';
16
+ /**
17
+ * The card has a default outline. For design consistency, this prop should only be set to 'false' if the card is embedded, e.g. in a table.
18
+ */
19
+ isOutlined?: boolean;
20
+ };
21
+ export declare const HealthCheckFailed: ({ title, subtitle, type, isOutlined, }: HealthCheckFailedProps) => import("react/jsx-runtime").JSX.Element;
22
+ export {};
@@ -0,0 +1,39 @@
1
+ import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
+ import { Card as c, CardContent as d, Padding as s, CardBody as h, Group as m, TypoBody as a } from "@element/react-components";
3
+ import { I as u } from "../../Iconify-DoU6pP1o.js";
4
+ import { s as t } from "../../healthCheckFailed.module-B5P1ogjs.js";
5
+ const v = ({
6
+ title: r,
7
+ subtitle: i,
8
+ type: n,
9
+ isOutlined: o = !0
10
+ }) => /* @__PURE__ */ e(
11
+ c,
12
+ {
13
+ variant: o ? "outlined" : "flat",
14
+ "data-testid": `${n}-health-check-failed-card`,
15
+ children: /* @__PURE__ */ e(d, { children: /* @__PURE__ */ e(s, { variant: "airy", children: /* @__PURE__ */ e(h, { children: /* @__PURE__ */ l(
16
+ m,
17
+ {
18
+ gap: "none",
19
+ primaryAlign: "center",
20
+ secondaryAlign: "center",
21
+ direction: "vertical",
22
+ fullWidth: !0,
23
+ children: [
24
+ /* @__PURE__ */ e(g, { type: n }),
25
+ /* @__PURE__ */ e(a, { level: 1, bold: !0, children: r }),
26
+ /* @__PURE__ */ e(a, { level: 2, themeColor: "text-secondary-on-background", children: i })
27
+ ]
28
+ }
29
+ ) }) }) })
30
+ }
31
+ ), f = {
32
+ database: "sync",
33
+ iot: "settings_input_antenna",
34
+ platform: "engineering",
35
+ other: "error"
36
+ }, g = ({ type: r }) => /* @__PURE__ */ e("span", { className: r === "iot" ? t.crossedOut : "", children: /* @__PURE__ */ e(u, { icon: f[r], className: t[r], iconSize: "xlarge" }) });
37
+ export {
38
+ v as HealthCheckFailed
39
+ };
@@ -0,0 +1,26 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { a as s, s as e } from "../../react.esm-CHvVvf3L.js";
3
+ import { HealthCheckFailed as r } from "./HealthCheckFailed.js";
4
+ import { d as h, t as i, g as t } from "../../vi.JYQecGiw-BpOAB4v6.js";
5
+ h("HealthCheckFailed Component", () => {
6
+ const c = "Test Title", n = "Test Subtitle";
7
+ i("displays the correct title and subtitle", () => {
8
+ s(/* @__PURE__ */ a(r, { title: c, subtitle: n, type: "database" })), t(e.getByText(c)).toBeInTheDocument(), t(e.getByText(n)).toBeInTheDocument();
9
+ }), i('displays the correct icon for type "database"', () => {
10
+ s(/* @__PURE__ */ a(r, { title: c, subtitle: n, type: "database" }));
11
+ const o = e.getByText("sync");
12
+ t(o).toBeInTheDocument(), t(e.getByTestId("database-health-check-failed-card")).toBeInTheDocument();
13
+ }), i('displays the correct icon for type "iot"', () => {
14
+ s(/* @__PURE__ */ a(r, { title: c, subtitle: n, type: "iot" }));
15
+ const o = e.getByText("settings_input_antenna");
16
+ t(o).toBeInTheDocument(), t(e.getByTestId("iot-health-check-failed-card")).toBeInTheDocument();
17
+ }), i('displays the correct icon for type "platform"', () => {
18
+ s(/* @__PURE__ */ a(r, { title: c, subtitle: n, type: "platform" }));
19
+ const o = e.getByText("engineering");
20
+ t(o).toBeInTheDocument(), t(e.getByTestId("platform-health-check-failed-card")).toBeInTheDocument();
21
+ }), i('displays the correct icon for type "other"', () => {
22
+ s(/* @__PURE__ */ a(r, { title: c, subtitle: n, type: "other" }));
23
+ const o = e.getByText("error");
24
+ t(o).toBeInTheDocument(), t(e.getByTestId("other-health-check-failed-card")).toBeInTheDocument();
25
+ });
26
+ });
@@ -0,0 +1,12 @@
1
+ import "./assets/healthCheckFailed.css";
2
+ const t = "_database_11ki8_1", s = "_spin_11ki8_1", o = "_iot_11ki8_16", _ = "_platform_11ki8_17", a = "_other_11ki8_18", i = "_crossedOut_11ki8_22", r = {
3
+ database: t,
4
+ spin: s,
5
+ iot: o,
6
+ platform: _,
7
+ other: a,
8
+ crossedOut: i
9
+ };
10
+ export {
11
+ r as s
12
+ };
package/dist/main.d.ts CHANGED
@@ -11,6 +11,7 @@ export { Filter } from './components/Filter/Filter';
11
11
  export { GenericTable } from './components/GenericTable/GenericTable';
12
12
  export { HashTabView } from './components/HashTabView/HashTabView';
13
13
  export { HeaderFilter } from './components/HeaderFilter/HeaderFilter';
14
+ export { HealthCheckFailed } from './components/HealthCheckFailed/HealthCheckFailed';
14
15
  export { Iconify } from './components/Iconify/Iconify';
15
16
  export { InfoGroup } from './components/InfoGroup/InfoGroup';
16
17
  export { ListArea } from './components/ListArea/ListArea';
package/dist/main.js CHANGED
@@ -3,67 +3,69 @@ import { AlertBanner as t } from "./components/AlertBanner/AlertBanner.js";
3
3
  import { BaseView as p } from "./components/BaseView/BaseView.js";
4
4
  import { BasicHeading as x } from "./components/BasicHeading/BasicHeading.js";
5
5
  import { BlockView as a } from "./components/BlockView/BlockView.js";
6
- import { ChipCard as n } from "./components/ChipCard/ChipCard.js";
6
+ import { ChipCard as c } from "./components/ChipCard/ChipCard.js";
7
7
  import { ContextMenu as s } from "./components/ContextMenu/ContextMenu.js";
8
8
  import { DeleteModal as F } from "./components/DeleteModal/DeleteModal.js";
9
- import { Disclaimer as S } from "./components/Disclaimer/Disclaimer.js";
10
- import { EmptyView as T } from "./components/EmptyView/EmptyView.js";
11
- import { Filter as h } from "./components/Filter/Filter.js";
12
- import { GenericTable as w } from "./components/GenericTable/GenericTable.js";
13
- import { HashTabView as g } from "./components/HashTabView/HashTabView.js";
9
+ import { Disclaimer as B } from "./components/Disclaimer/Disclaimer.js";
10
+ import { EmptyView as S } from "./components/EmptyView/EmptyView.js";
11
+ import { Filter as b } from "./components/Filter/Filter.js";
12
+ import { GenericTable as u } from "./components/GenericTable/GenericTable.js";
13
+ import { HashTabView as V } from "./components/HashTabView/HashTabView.js";
14
14
  import { HeaderFilter as A } from "./components/HeaderFilter/HeaderFilter.js";
15
- import { I } from "./Iconify-DoU6pP1o.js";
16
- import { InfoGroup as v } from "./components/InfoGroup/InfoGroup.js";
17
- import { ListArea as M } from "./components/ListArea/ListArea.js";
18
- import { LoadingSpinner as G } from "./components/LoadingSpinner/Default/LoadingSpinner.js";
19
- import { Modal as E } from "./components/Modal/Modal.js";
20
- import { OverflowTooltip as P } from "./components/OverflowTooltip/OverflowTooltip.js";
21
- import { ScrollbarX as X, ScrollbarY as Y } from "./components/Scrollbar/Scrollbar.js";
22
- import { SearchBar as q } from "./components/SearchBar/SearchBar.js";
23
- import { VerticalDivider as K } from "./components/VerticalDivider/VerticalDivider.js";
24
- import { FormCheckBox as Q } from "./components/FormComponents/FormCheckBox/FormCheckBox.js";
25
- import { FormDatePicker as W } from "./components/FormComponents/FormDatePicker/FormDatePicker.js";
26
- import { FormRadio as _ } from "./components/FormComponents/FormRadio/FormRadio.js";
27
- import { FormSelect as rr } from "./components/FormComponents/FormSelect/FormSelect.js";
28
- import { FormSlider as er } from "./components/FormComponents/FormSlider/FormSlider.js";
29
- import { FormText as mr } from "./components/FormComponents/FormText/FormText.js";
30
- import { AvailableCustomIcons as fr } from "./enums/AvailableCustomIcons.js";
31
- import { ThemeColor as ir } from "./enums/ThemeColor.js";
32
- import { u as lr } from "./useBreakpoints-MzTZ0tCT.js";
33
- import { capitalizeFirstLetters as cr, trimLeadingAndTrailingSpaces as sr } from "./services/UtilService.js";
15
+ import { HealthCheckFailed as H } from "./components/HealthCheckFailed/HealthCheckFailed.js";
16
+ import { I as L } from "./Iconify-DoU6pP1o.js";
17
+ import { InfoGroup as M } from "./components/InfoGroup/InfoGroup.js";
18
+ import { ListArea as G } from "./components/ListArea/ListArea.js";
19
+ import { LoadingSpinner as E } from "./components/LoadingSpinner/Default/LoadingSpinner.js";
20
+ import { Modal as P } from "./components/Modal/Modal.js";
21
+ import { OverflowTooltip as X } from "./components/OverflowTooltip/OverflowTooltip.js";
22
+ import { ScrollbarX as j, ScrollbarY as q } from "./components/Scrollbar/Scrollbar.js";
23
+ import { SearchBar as K } from "./components/SearchBar/SearchBar.js";
24
+ import { VerticalDivider as Q } from "./components/VerticalDivider/VerticalDivider.js";
25
+ import { FormCheckBox as W } from "./components/FormComponents/FormCheckBox/FormCheckBox.js";
26
+ import { FormDatePicker as _ } from "./components/FormComponents/FormDatePicker/FormDatePicker.js";
27
+ import { FormRadio as rr } from "./components/FormComponents/FormRadio/FormRadio.js";
28
+ import { FormSelect as er } from "./components/FormComponents/FormSelect/FormSelect.js";
29
+ import { FormSlider as mr } from "./components/FormComponents/FormSlider/FormSlider.js";
30
+ import { FormText as fr } from "./components/FormComponents/FormText/FormText.js";
31
+ import { AvailableCustomIcons as ir } from "./enums/AvailableCustomIcons.js";
32
+ import { ThemeColor as lr } from "./enums/ThemeColor.js";
33
+ import { u as nr } from "./useBreakpoints-MzTZ0tCT.js";
34
+ import { capitalizeFirstLetters as dr, trimLeadingAndTrailingSpaces as Fr } from "./services/UtilService.js";
34
35
  export {
35
36
  t as AlertBanner,
36
- fr as AvailableCustomIcons,
37
+ ir as AvailableCustomIcons,
37
38
  p as BaseView,
38
39
  x as BasicHeading,
39
40
  a as BlockView,
40
- n as ChipCard,
41
+ c as ChipCard,
41
42
  s as ContextMenu,
42
43
  F as DeleteModal,
43
- S as Disclaimer,
44
- T as EmptyView,
45
- h as Filter,
46
- Q as FormCheckBox,
47
- W as FormDatePicker,
48
- _ as FormRadio,
49
- rr as FormSelect,
50
- er as FormSlider,
51
- mr as FormText,
52
- w as GenericTable,
53
- g as HashTabView,
44
+ B as Disclaimer,
45
+ S as EmptyView,
46
+ b as Filter,
47
+ W as FormCheckBox,
48
+ _ as FormDatePicker,
49
+ rr as FormRadio,
50
+ er as FormSelect,
51
+ mr as FormSlider,
52
+ fr as FormText,
53
+ u as GenericTable,
54
+ V as HashTabView,
54
55
  A as HeaderFilter,
55
- I as Iconify,
56
- v as InfoGroup,
57
- M as ListArea,
58
- G as LoadingSpinner,
59
- E as Modal,
60
- P as OverflowTooltip,
61
- X as ScrollbarX,
62
- Y as ScrollbarY,
63
- q as SearchBar,
64
- ir as ThemeColor,
65
- K as VerticalDivider,
66
- cr as capitalizeFirstLetters,
67
- sr as trimLeadingAndTrailingSpaces,
68
- lr as useBreakpoints
56
+ H as HealthCheckFailed,
57
+ L as Iconify,
58
+ M as InfoGroup,
59
+ G as ListArea,
60
+ E as LoadingSpinner,
61
+ P as Modal,
62
+ X as OverflowTooltip,
63
+ j as ScrollbarX,
64
+ q as ScrollbarY,
65
+ K as SearchBar,
66
+ lr as ThemeColor,
67
+ Q as VerticalDivider,
68
+ dr as capitalizeFirstLetters,
69
+ Fr as trimLeadingAndTrailingSpaces,
70
+ nr as useBreakpoints
69
71
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hortiview/shared-components",
3
3
  "description": "This is a shared component library. It should used in the HortiView platform and its modules.",
4
- "version": "0.0.10012",
4
+ "version": "0.0.10027",
5
5
  "type": "module",
6
6
  "repository": "https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared",
7
7
  "author": "Falk Menge <falk.menge.ext@bayer.com>",