tycho-components 0.23.5 → 0.23.7

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.
@@ -3,6 +3,7 @@
3
3
  align-items: center;
4
4
  gap: 4px;
5
5
  cursor: pointer;
6
+ width: fit-content;
6
7
 
7
8
  &__title {
8
9
  @include helper-small-1;
@@ -3,5 +3,5 @@ import './style.scss';
3
3
  type Props = {
4
4
  document: Document;
5
5
  };
6
- export default function InconsistencyActions({ document }: Props): import("react/jsx-runtime").JSX.Element;
6
+ export default function InconsistencyActions({ document }: Props): import("react/jsx-runtime").JSX.Element | null;
7
7
  export {};
@@ -11,6 +11,7 @@ export default function InconsistencyActions({ document }) {
11
11
  const { getCorpus, hasParameter } = useCorpusUtils();
12
12
  const [openInconsistency, setOpenInconsistency] = useState(false);
13
13
  const [loading, setLoading] = useState(true);
14
+ const [loadFailed, setLoadFailed] = useState(false);
14
15
  const [inconsistentData, setInconsistentData] = useState();
15
16
  const hasInconsistencies = (data) => {
16
17
  return Object.keys(data).some((d) => {
@@ -21,6 +22,7 @@ export default function InconsistencyActions({ document }) {
21
22
  };
22
23
  const checkInconsistency = () => {
23
24
  setLoading(true);
25
+ setLoadFailed(false);
24
26
  if (hasParameter(getCorpus(), 'useEditionTiers')) {
25
27
  InconsistencyService.verifyForDocument(document.uid)
26
28
  .then((r) => {
@@ -30,6 +32,10 @@ export default function InconsistencyActions({ document }) {
30
32
  else {
31
33
  setInconsistentData(undefined);
32
34
  }
35
+ })
36
+ .catch(() => {
37
+ setLoadFailed(true);
38
+ setInconsistentData(undefined);
33
39
  })
34
40
  .finally(() => {
35
41
  setLoading(false);
@@ -64,5 +70,8 @@ export default function InconsistencyActions({ document }) {
64
70
  title: t('label.consistent'),
65
71
  };
66
72
  }, [loading, inconsistentData, t]);
73
+ if (loadFailed) {
74
+ return null;
75
+ }
67
76
  return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "action-line", onClick: actionOption.onClick, role: actionOption.onClick ? 'button' : undefined, children: [_jsx("div", { className: "action-button", children: _jsx(Icon, { name: actionOption.iconName, size: "medium", className: actionOption.iconClassName }) }), _jsxs("div", { className: "action-desc", children: [_jsx("span", { className: "title", children: actionOption.title }), actionOption.description && _jsx("span", { children: actionOption.description })] })] }), openInconsistency && inconsistentData && (_jsx(Inconsistency, { data: inconsistentData, onClose: () => setOpenInconsistency(false) }))] }));
68
77
  }
@@ -12,7 +12,7 @@ export default function HeaderUser({ navigateLogout, navigateNotLogged, }) {
12
12
  setOpen(false);
13
13
  window.open(import.meta.env.VITE_APP_RESERVED_URL, '_blank');
14
14
  };
15
- return (_jsxs("div", { className: "profile-container", children: [isLogged() ? (_jsx("div", { onClick: () => setOpen(!open), children: _jsx(Avatar, { size: "small", src: getLogged()?.picture, title: getLogged()?.name || getLogged()?.sub }) })) : (_jsx(Button, { text: t('button.sign.in'), size: "small", onClick: navigateNotLogged })), open && isLogged() && (_jsxs("div", { className: "ds-dropdown-list", children: [_jsx("div", { className: "ds-dropdown-itemlist", children: _jsx("span", { className: "label", children: `${t('profile.label.hello')} ${getLogged()?.name || getLogged()?.sub}` }) }), _jsxs("div", { className: "ds-dropdown-itemlist d-none", children: [_jsx(Icon, { name: "colors", size: "x-small" }), _jsx("span", { className: "label", children: t('profile.label.theme') })] }), _jsxs("div", { className: "ds-dropdown-itemlist", onClick: handleProfile, children: [_jsx(Icon, { name: "person", size: "x-small" }), _jsx("span", { className: "label", children: t('profile.label.home') })] }), _jsxs("div", { className: "ds-dropdown-itemlist", children: [_jsx(Icon, { name: "live_help", size: "x-small" }), _jsx("span", { className: "label", children: t('profile.label.help') })] }), _jsxs("div", { className: "ds-dropdown-itemlist", onClick: () => {
15
+ return (_jsxs("div", { className: "profile-container", "data-tour": "header-user", children: [isLogged() ? (_jsx("div", { onClick: () => setOpen(!open), children: _jsx(Avatar, { size: "small", src: getLogged()?.picture, title: getLogged()?.name || getLogged()?.sub }) })) : (_jsx(Button, { text: t('button.sign.in'), size: "small", onClick: navigateNotLogged })), open && isLogged() && (_jsxs("div", { className: "ds-dropdown-list", children: [_jsx("div", { className: "ds-dropdown-itemlist", children: _jsx("span", { className: "label", children: `${t('profile.label.hello')} ${getLogged()?.name || getLogged()?.sub}` }) }), _jsxs("div", { className: "ds-dropdown-itemlist d-none", children: [_jsx(Icon, { name: "colors", size: "x-small" }), _jsx("span", { className: "label", children: t('profile.label.theme') })] }), _jsxs("div", { className: "ds-dropdown-itemlist", onClick: handleProfile, children: [_jsx(Icon, { name: "person", size: "x-small" }), _jsx("span", { className: "label", children: t('profile.label.home') })] }), _jsxs("div", { className: "ds-dropdown-itemlist", children: [_jsx(Icon, { name: "live_help", size: "x-small" }), _jsx("span", { className: "label", children: t('profile.label.help') })] }), _jsxs("div", { className: "ds-dropdown-itemlist", onClick: () => {
16
16
  setOpen(false);
17
17
  navigateLogout && navigateLogout();
18
18
  }, children: [_jsx(Icon, { name: "logout", size: "x-small" }), _jsx("span", { className: "label", children: t('profile.label.logout') })] })] }))] }));
@@ -48,5 +48,5 @@ export default function LanguageSelector({ className, color = 'primary', size =
48
48
  }, []);
49
49
  if (!language)
50
50
  return null;
51
- return (_jsx("div", { className: getClassNames, children: _jsxs("div", { className: "ds-dropdown-container", children: [_jsxs("div", { className: getClassNamesDropdown, onClick: () => setOpen(!open), children: [_jsx("span", { className: "label", children: showFullLanguageLabel ? language.name : language.value }), _jsx(Icon, { name: "arrow_drop_down", className: "icon-arrow" })] }), open && (_jsx("div", { className: "ds-dropdown-list", children: AvailableLanguages.map((item, idx) => (_jsxs("div", { className: "ds-dropdown-itemlist", onClick: () => changeLanguageHandler(item), children: [_jsx("span", { className: "label", children: item.name }), _jsx("span", { className: "sublabel", children: item.value }), item.value === language.value && (_jsx(Icon, { name: "check", size: "x-small", className: "icon-check" }))] }, idx.valueOf()))) }))] }) }));
51
+ return (_jsx("div", { className: getClassNames, "data-tour": "language-selector", children: _jsxs("div", { className: "ds-dropdown-container", children: [_jsxs("div", { className: getClassNamesDropdown, onClick: () => setOpen(!open), children: [_jsx("span", { className: "label", children: showFullLanguageLabel ? language.name : language.value }), _jsx(Icon, { name: "arrow_drop_down", className: "icon-arrow" })] }), open && (_jsx("div", { className: "ds-dropdown-list", children: AvailableLanguages.map((item, idx) => (_jsxs("div", { className: "ds-dropdown-itemlist", onClick: () => changeLanguageHandler(item), children: [_jsx("span", { className: "label", children: item.name }), _jsx("span", { className: "sublabel", children: item.value }), item.value === language.value && (_jsx(Icon, { name: "check", size: "x-small", className: "icon-check" }))] }, idx.valueOf()))) }))] }) }));
52
52
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tycho-components",
3
3
  "private": false,
4
- "version": "0.23.5",
4
+ "version": "0.23.7",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {