diff --git a/dashboard/public/icon_1024.png b/dashboard/public/icon_1024.png new file mode 100644 index 0000000000..9f4c81a1e9 Binary files /dev/null and b/dashboard/public/icon_1024.png differ diff --git a/dashboard/public/icon_512.png b/dashboard/public/icon_512.png new file mode 100644 index 0000000000..46897dc0ef Binary files /dev/null and b/dashboard/public/icon_512.png differ diff --git a/dashboard/public/index.html b/dashboard/public/index.html index 782ba46a95..9f77441713 100644 --- a/dashboard/public/index.html +++ b/dashboard/public/index.html @@ -3,6 +3,7 @@ + Mano - Admin diff --git a/dashboard/public/mano.webmanifest b/dashboard/public/mano.webmanifest new file mode 100644 index 0000000000..57dd0faaa6 --- /dev/null +++ b/dashboard/public/mano.webmanifest @@ -0,0 +1,21 @@ +{ + "name": "Mano", + "short_name": "Mano", + "theme_color": "#008e7f", + "background_color": "#008e7f", + "display": "fullscreen", + "scope": "./", + "start_url": "./", + "icons": [ + { + "src": "icon_1024.png", + "type": "image/png", + "sizes": "1024x1024" + }, + { + "src": "icon_512.png", + "type": "image/png", + "sizes": "512x512" + } + ] +} diff --git a/dashboard/src/app.js b/dashboard/src/app.js index 926c65d87c..0e9f508d7d 100644 --- a/dashboard/src/app.js +++ b/dashboard/src/app.js @@ -181,7 +181,7 @@ const RestrictedRoute = ({ component: Component, _isLoggedIn, ...rest }) => { padding: 0 !important; overflow: initial; */} -
+
(user ? : )} />
diff --git a/dashboard/src/components/table.js b/dashboard/src/components/table.js index 1424bf0fdf..e7a3dea31c 100644 --- a/dashboard/src/components/table.js +++ b/dashboard/src/components/table.js @@ -1,9 +1,11 @@ import React, { useCallback, useEffect, useRef } from 'react'; import Sortable from 'sortablejs'; +import useMinimumWidth from '../services/useMinimumWidth'; const Table = ({ columns = [], data = [], + renderCellSmallDevices, rowKey, dataTestId = null, onRowClick, @@ -33,6 +35,8 @@ const Table = ({ } }, [onListChange, isSortable, data.length]); + const isDesktop = useMinimumWidth('sm'); + if (!data.length && noData) { return ( @@ -51,84 +55,95 @@ const Table = ({
); } - return ( - - - {!!title && ( + + if (isDesktop || !renderCellSmallDevices) { + return ( +
+ + {!!title && ( + + + + )} - - - )} - - {columns.map((column) => { - const { onSortBy, onSortOrder, sortBy, sortOrder, sortableKey, dataKey } = column; - const onNameClick = () => { - if (sortBy === sortableKey || sortBy === dataKey) { - onSortOrder(sortOrder === 'ASC' ? 'DESC' : 'ASC'); - return; - } - onSortBy(sortableKey || dataKey); - }; - return ( - - ); - })} - - - - {data - .filter((e) => e) - .map((item) => { - return ( - (!rowDisabled(item) && onRowClick ? onRowClick(item) : null)} - onKeyUp={(event) => { - if (event.key === 'Enter') - if (!rowDisabled(item) && onRowClick) { - onRowClick(item); - } - }} - key={item[rowKey] || item._id} - data-key={item[rowKey] || item._id} - data-test-id={item[dataTestId] || item[rowKey] || item._id} - tabIndex={0} - className={[ - rowDisabled(item) - ? 'tw-cursor-not-allowed' - : isSortable - ? 'tw-cursor-move' - : Boolean(onRowClick) - ? 'tw-cursor-pointer' - : 'tw-cursor-auto', - ].join(' ')} - style={item.style || {}}> - {columns.map((column) => { - return ( - - ); - })} - - ); - })} - + {column.help && <>{column.help}} + {!!onSortBy && (sortBy === sortableKey || sortBy === dataKey) && ( + + )} + + ); + })} + + + + {data + .filter((e) => e) + .map((item) => { + return ( + (!rowDisabled(item) && onRowClick ? onRowClick(item) : null)} + onKeyUp={(event) => { + if (event.key === 'Enter') + if (!rowDisabled(item) && onRowClick) { + onRowClick(item); + } + }} + key={item[rowKey] || item._id} + data-key={item[rowKey] || item._id} + data-test-id={item[dataTestId] || item[rowKey] || item._id} + tabIndex={0} + className={[ + rowDisabled(item) + ? 'tw-cursor-not-allowed' + : isSortable + ? 'tw-cursor-move' + : Boolean(onRowClick) + ? 'tw-cursor-pointer' + : 'tw-cursor-auto', + ].join(' ')} + style={item.style || {}}> + {columns.map((column) => { + return ( + + ); + })} + + ); + })} + +
+ {title} +
- {title} -
- - {column.help && <>{column.help}} - {!!onSortBy && (sortBy === sortableKey || sortBy === dataKey) && ( - + - )} -
- {column.render ? column.render(item) : item[column.dataKey] || nullDisplay} -
+ {column.render ? column.render(item) : item[column.dataKey] || nullDisplay} +
+ ); + } + + return ( + + {data.filter((e) => e).map(renderCellSmallDevices)}
); }; diff --git a/dashboard/src/index.scss b/dashboard/src/index.scss index b7e17a37fa..e7a6415680 100644 --- a/dashboard/src/index.scss +++ b/dashboard/src/index.scss @@ -70,10 +70,6 @@ table.table-selego { background: #fff; -fs-table-paginate: paginate; - thead { - display: table-header-group; - } - thead tr { height: 2.5rem; } diff --git a/dashboard/src/scenes/person/list.js b/dashboard/src/scenes/person/list.js index 3a2e62d0d0..4b3b881820 100644 --- a/dashboard/src/scenes/person/list.js +++ b/dashboard/src/scenes/person/list.js @@ -135,65 +135,109 @@ const List = () => { } /> -
+
-
-
- -
- { - if (page) { - setPage(0); - setSearch(value, { sideEffect: ['page', 0] }); - } else { - setSearch(value); - } - }} - /> -
- -
-
- +
+ Recherche et filtres... +
+
+ +
+ { + if (page) { + setPage(0); + setSearch(value, { sideEffect: ['page', 0] }); + } else { + setSearch(value); + } + }} + /> +
+ +
+
+ +
-
- + + history.push(`/person/${p._id}`)} + renderCellSmallDevices={(p) => { + return ( + + + + ); + }} columns={[ { title: '',
+
+ {!!p.group && ( + + 👪 + + )} + {!!p.alertness && ( + + )} + {p.outOfActiveList ? ( +
+
+ {p.name} + {p.otherNames ? - {p.otherNames} : null} +
+
Sortie de file active : {p.outOfActiveListReasons?.join(', ')}
+
+ ) : ( +
+ {p.name} + {p.otherNames ? - {p.otherNames} : null} +
+ )} +
+ {p.formattedBirthDate} +
+ {p.assignedTeams?.map((teamId) => ( + + ))} +
+