@irontec/ivoz-ui 1.5.2 → 1.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.
@@ -3,8 +3,9 @@ import { Link } from 'react-router-dom';
3
3
  import _ from '../../../services/translations/translate';
4
4
  import { SolidButton } from '../../shared/Button/Button.styles';
5
5
  import { useTranslation } from 'react-i18next';
6
- import { Fade } from '@mui/material';
6
+ import { Box, Fade } from '@mui/material';
7
7
  import { useStoreState } from '../../../store';
8
+ import { MultiselectMoreChildEntityLinks } from './Shared/MultiselectMoreChildEntityLinks';
8
9
  export const Empty = (props) => {
9
10
  const { entityService, className } = props;
10
11
  const { t } = useTranslation();
@@ -22,10 +23,17 @@ export const Empty = (props) => {
22
23
  singularTitle = t(translationKey, { count: 1 }).toLowerCase();
23
24
  pluralTitle = t(translationKey, { count: 2 }).toLowerCase();
24
25
  }
26
+ const globalActions = Object.values(entity.customActions).filter((action) => action.global);
25
27
  return (_jsx(Fade, Object.assign({ in: true, style: {
26
28
  transitionDelay: '750ms',
27
29
  }, unmountOnExit: true }, { children: _jsxs("section", Object.assign({ className: className }, { children: [_jsx("img", { src: 'assets/img/empty.svg', alt: '' }), _jsx("h3", { children: _('No {{entity}} yet', { entity: pluralTitle }) }), _jsx("p", { children: _('You haven’t created any {{entity}} yet.', {
28
30
  entity: singularTitle,
29
- }) }), create && (_jsx(Link, Object.assign({ to: location.pathname + '/create' }, { children: _jsx(SolidButton, { children: _('New {{entity}}', { entity: singularTitle }) }) })))] })) })));
31
+ }) }), create && (_jsxs(Box, Object.assign({ className: 'empty-actions' }, { children: [globalActions &&
32
+ globalActions.length < 2 &&
33
+ globalActions
34
+ .map((item) => item.action)
35
+ .map((Action, key) => {
36
+ return (_jsx(Action, { rows: [], selectedValues: [], entityService: entityService }, key));
37
+ }), globalActions && globalActions.length > 1 && (_jsx(MultiselectMoreChildEntityLinks, { childActions: globalActions, selectedValues: [], rows: [], entityService: entityService })), _jsx(Link, Object.assign({ to: location.pathname + '/create' }, { children: _jsx(SolidButton, { children: _('New {{entity}}', { entity: singularTitle }) }) }))] })))] })) })));
30
38
  };
31
39
  export default Empty;
@@ -20,5 +20,12 @@ export const StyledEmpty = styled(Empty)(() => {
20
20
  '& img': {
21
21
  maxWidth: '100%',
22
22
  },
23
+ '& .empty-actions': {
24
+ display: 'flex',
25
+ flexDirection: 'row',
26
+ '& a': {
27
+ marginLeft: '8px',
28
+ },
29
+ },
23
30
  };
24
31
  });
@@ -69,7 +69,7 @@ const FastSearchField = (props, ref) => {
69
69
  };
70
70
  useEffect(() => {
71
71
  //reset value
72
- setValue((firstColumnCriteria === null || firstColumnCriteria === void 0 ? void 0 : firstColumnCriteria.value) || '');
72
+ setValue(decodeURIComponent(firstColumnCriteria === null || firstColumnCriteria === void 0 ? void 0 : firstColumnCriteria.value) || '');
73
73
  }, [firstColumnCriteria]);
74
74
  useEffect(() => {
75
75
  if (isDatetime) {
@@ -45,7 +45,7 @@ export default function ContentFilterSelector(props) {
45
45
  newCriteria[idx] = {
46
46
  name,
47
47
  type,
48
- value,
48
+ value: decodeURIComponent(value),
49
49
  };
50
50
  setCriteria(newCriteria);
51
51
  };
@@ -99,7 +99,10 @@ const List = function (props) {
99
99
  }
100
100
  setPrevReqQuerystring(reqQuerystring);
101
101
  const criteria = queryStringToCriteria();
102
- setQueryStringCriteria(criteria);
102
+ const sanitizeData = criteria.map((row) => {
103
+ return Object.assign(Object.assign({}, row), { value: encodeURIComponent(row.value) });
104
+ });
105
+ setQueryStringCriteria(sanitizeData);
103
106
  setCriteriaIsReady(true);
104
107
  }, [
105
108
  reqQuerystring,
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { ListContent } from '../../components/List/Content/';
3
3
  const List = (props) => {
4
- return _jsx(ListContent, Object.assign({}, props));
4
+ return (_jsx(ListContent, Object.assign({}, props)));
5
5
  };
6
6
  export default List;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@irontec/ivoz-ui",
3
- "version": "1.5.2",
3
+ "version": "1.6.1",
4
4
  "description": "UI library used in ivozprovider",
5
5
  "license": "GPL-3.0",
6
6
  "main": "index.js",