From 14a8b1d897ba8350b64f6cb7fff70d42daecf8d4 Mon Sep 17 00:00:00 2001 From: Ali <83188384+testA113@users.noreply.github.com> Date: Fri, 8 Jul 2022 01:20:33 +1200 Subject: [PATCH] feat(ui): add sorting icon component and table header cell styling EE-3626 (#7165) * feat(ui): add sorting icons EE-3626 feat(ui): Add react component for sorting icons feat(ui) make component usable in angular * feat(ui): update angular example EE-3626 --- app/__mocks__/svg.js | 2 + app/assets/css/rdash.css | 4 +- app/assets/css/theme.css | 9 + .../datatable-columns-visibility.html | 4 +- .../components/datatables/datatable.css | 44 +++-- .../stacks-datatable/stacksDatatable.html | 168 +++++++++++------- .../stacksDatatableController.js | 7 - app/portainer/filters/filters.js | 8 +- app/portainer/react/components/index.ts | 10 ++ app/react-tools/react2angular.tsx | 8 +- .../datatables/TableHeaderCell.module.css | 7 +- .../components/datatables/TableHeaderCell.tsx | 83 +++++---- .../TableHeaderSortIcons.module.css | 12 ++ .../datatables/TableHeaderSortIcons.tsx | 33 ++++ .../components/datatables/sort-arrow-down.svg | 3 + .../components/datatables/sort-arrow-up.svg | 3 + jest.config.js | 1 + 17 files changed, 271 insertions(+), 135 deletions(-) create mode 100644 app/__mocks__/svg.js create mode 100644 app/react/components/datatables/TableHeaderSortIcons.module.css create mode 100644 app/react/components/datatables/TableHeaderSortIcons.tsx create mode 100644 app/react/components/datatables/sort-arrow-down.svg create mode 100644 app/react/components/datatables/sort-arrow-up.svg diff --git a/app/__mocks__/svg.js b/app/__mocks__/svg.js new file mode 100644 index 000000000..ffe2050a0 --- /dev/null +++ b/app/__mocks__/svg.js @@ -0,0 +1,2 @@ +export default 'SvgrURL'; +export const ReactComponent = 'div'; diff --git a/app/assets/css/rdash.css b/app/assets/css/rdash.css index 6c2158f65..157982744 100644 --- a/app/assets/css/rdash.css +++ b/app/assets/css/rdash.css @@ -111,10 +111,10 @@ div.input-mask { background: var(--bg-widget-table-color); } .widget .widget-body table thead * { - font-size: 14px !important; + font-size: 14px; } .widget .widget-body table tbody * { - font-size: 13px !important; + font-size: 13px; } .widget .widget-body .error { color: #ff0000; diff --git a/app/assets/css/theme.css b/app/assets/css/theme.css index ae1fee7fc..9d0859cfc 100644 --- a/app/assets/css/theme.css +++ b/app/assets/css/theme.css @@ -264,6 +264,9 @@ --bg-multiselect-helpercontainer: var(--white-color); --text-input-textarea: var(--white-color); + --sort-icon-muted: var(--ui-gray-5); + --sort-icon-hover: var(--ui-gray-6); + --sort-icon: var(--ui-gray-9); --border-checkbox: var(--ui-gray-5); --bg-checkbox: var(--white-color); --border-searchbar: var(--ui-gray-5); @@ -443,6 +446,9 @@ --bg-multiselect-helpercontainer: var(--grey-1); --text-input-textarea: var(--grey-1); + --sort-icon-muted: var(--ui-gray-7); + --sort-icon-hover: var(--ui-gray-6); + --sort-icon: var(--ui-gray-3); --border-checkbox: var(--ui-gray-5); --bg-checkbox: var(--white-color); --border-searchbar: var(--ui-gray-5); @@ -614,6 +620,9 @@ --text-cm-string-color: var(--red-7); --text-progress-bar-color: var(--black-color); + --sort-icon-muted: var(--ui-gray-7); + --sort-icon-hover: var(--ui-gray-6); + --sort-icon: var(--ui-gray-3); --border-checkbox: var(--ui-gray-5); --bg-checkbox: var(--white-color); --border-searchbar: var(--ui-gray-5); diff --git a/app/portainer/components/datatables/datatable-columns-visibility/datatable-columns-visibility.html b/app/portainer/components/datatables/datatable-columns-visibility/datatable-columns-visibility.html index 89a5b8f80..7f72a34b5 100644 --- a/app/portainer/components/datatables/datatable-columns-visibility/datatable-columns-visibility.html +++ b/app/portainer/components/datatables/datatable-columns-visibility/datatable-columns-visibility.html @@ -1,5 +1,7 @@ - + + +