@irontec/ivoz-ui 1.5.1 → 1.6.0
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 && (
|
|
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;
|
|
@@ -28,8 +28,8 @@ export default function ContentFilterSelector(props) {
|
|
|
28
28
|
const firstFilter = Object.keys(filters)[0];
|
|
29
29
|
const currentColumn = columns[firstFilter];
|
|
30
30
|
const propertyFilters = filters[firstFilter] || [];
|
|
31
|
-
let preferredFilter = currentColumn.preferredFilter || 'partial';
|
|
32
|
-
if (!currentColumn.preferredFilter) {
|
|
31
|
+
let preferredFilter = (currentColumn === null || currentColumn === void 0 ? void 0 : currentColumn.preferredFilter) || 'partial';
|
|
32
|
+
if (currentColumn && !currentColumn.preferredFilter) {
|
|
33
33
|
switch (true) {
|
|
34
34
|
case isPropertyScalar(currentColumn) &&
|
|
35
35
|
currentColumn.format === 'date-time':
|