From bb68f119161c563a507c6508d50bf06c2e5c6b28 Mon Sep 17 00:00:00 2001 From: wrigh393 Date: Fri, 8 Jan 2021 11:09:09 -0500 Subject: [PATCH 1/7] Implement logic for default sorting order of ItemTable --- src/components/ItemTable/ItemTable.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/ItemTable/ItemTable.js b/src/components/ItemTable/ItemTable.js index 6c4df69..e3e1bda 100644 --- a/src/components/ItemTable/ItemTable.js +++ b/src/components/ItemTable/ItemTable.js @@ -9,7 +9,7 @@ import { ArrowDownward, ArrowUpward } from "@material-ui/icons"; export default function ItemTable({ data, rowCanBeSelected }) { - const [selectedRow, setSelectedRow] = useState({ queue: null, number: null}); + const [selectedRow, setSelectedRow] = useState({ queue: null, number: null }); const theme = useTheme(); const useStyles = makeStyles({ @@ -69,8 +69,14 @@ export default function ItemTable({ data, rowCanBeSelected }) { ); } }, + initialState: { + sortBy: [ + { id: 'number', desc: false }, + { id: 'lastUpdated', desc: false }, + ] + } }, - useFilters, useFlexLayout, useSortBy, + useFilters, useFlexLayout, useSortBy, ); const { getTableProps, getTableBodyProps, headerGroups, rows, prepareRow, } = tableInstance; From 7373d88d6131dcf957ff09f20f66aa1c61fd3acf Mon Sep 17 00:00:00 2001 From: wrigh393 Date: Fri, 8 Jan 2021 13:32:32 -0500 Subject: [PATCH 2/7] Removed uncessary desc key from intialState.sortBy in the table option in ItemTable component --- src/components/ItemTable/ItemTable.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/ItemTable/ItemTable.js b/src/components/ItemTable/ItemTable.js index e3e1bda..3f330c0 100644 --- a/src/components/ItemTable/ItemTable.js +++ b/src/components/ItemTable/ItemTable.js @@ -21,6 +21,9 @@ export default function ItemTable({ data, rowCanBeSelected }) { inactiveSortIcon: { opacity: 0.2, }, + container: { + maxHeight: 500, + }, rowSelected: { backgroundColor: theme.palette.type === 'light' ? theme.palette.primary[100] : theme.palette.primary[600], }, @@ -71,9 +74,9 @@ export default function ItemTable({ data, rowCanBeSelected }) { }, initialState: { sortBy: [ - { id: 'number', desc: false }, - { id: 'lastUpdated', desc: false }, - ] + { id: 'number' }, + { id: 'lastUpdated' }, + ], } }, useFilters, useFlexLayout, useSortBy, @@ -81,8 +84,8 @@ export default function ItemTable({ data, rowCanBeSelected }) { const { getTableProps, getTableBodyProps, headerGroups, rows, prepareRow, } = tableInstance; return ( - - + +
{headerGroups.map(headerGroup => ( From ea9dec3832c59a46dee0a35ae15ce2deb0e4da78 Mon Sep 17 00:00:00 2001 From: wrigh393 Date: Tue, 12 Jan 2021 10:45:07 -0500 Subject: [PATCH 3/7] Removed unecesssary classes/props --- src/components/ItemTable/ItemTable.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ItemTable/ItemTable.js b/src/components/ItemTable/ItemTable.js index 3f330c0..acefcc7 100644 --- a/src/components/ItemTable/ItemTable.js +++ b/src/components/ItemTable/ItemTable.js @@ -84,8 +84,8 @@ export default function ItemTable({ data, rowCanBeSelected }) { const { getTableProps, getTableBodyProps, headerGroups, rows, prepareRow, } = tableInstance; return ( - -
+ +
{headerGroups.map(headerGroup => ( From 02b9990f30e3ef22b9be682817f0c20c62c79d9d Mon Sep 17 00:00:00 2001 From: wrigh393 Date: Tue, 12 Jan 2021 10:46:40 -0500 Subject: [PATCH 4/7] Removed unecessary class --- src/components/ItemTable/ItemTable.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/components/ItemTable/ItemTable.js b/src/components/ItemTable/ItemTable.js index acefcc7..2ec28c7 100644 --- a/src/components/ItemTable/ItemTable.js +++ b/src/components/ItemTable/ItemTable.js @@ -21,9 +21,6 @@ export default function ItemTable({ data, rowCanBeSelected }) { inactiveSortIcon: { opacity: 0.2, }, - container: { - maxHeight: 500, - }, rowSelected: { backgroundColor: theme.palette.type === 'light' ? theme.palette.primary[100] : theme.palette.primary[600], }, From 55df82b8785e111355ceed60c15c4901caf3cde3 Mon Sep 17 00:00:00 2001 From: wrigh393 Date: Mon, 1 Feb 2021 10:39:58 -0500 Subject: [PATCH 5/7] Added queue as one of the default sort props --- src/components/ItemTable/ItemTable.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/ItemTable/ItemTable.js b/src/components/ItemTable/ItemTable.js index 2ec28c7..5ed75e7 100644 --- a/src/components/ItemTable/ItemTable.js +++ b/src/components/ItemTable/ItemTable.js @@ -71,6 +71,7 @@ export default function ItemTable({ data, rowCanBeSelected }) { }, initialState: { sortBy: [ + { id: "queue" }, { id: 'number' }, { id: 'lastUpdated' }, ], From 9b8c0109fbbe1cb8686803aac27517e284d7730d Mon Sep 17 00:00:00 2001 From: wrigh393 Date: Mon, 1 Feb 2021 14:40:40 -0500 Subject: [PATCH 6/7] Implemented InvertedSort prop for LastUpdated and DateRecieved columns --- src/components/ItemTable/ItemTable.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ItemTable/ItemTable.js b/src/components/ItemTable/ItemTable.js index 5ed75e7..c4fd422 100644 --- a/src/components/ItemTable/ItemTable.js +++ b/src/components/ItemTable/ItemTable.js @@ -47,10 +47,10 @@ export default function ItemTable({ data, rowCanBeSelected }) { { Header: 'Subject', accessor: 'subject' }, { Header: 'Status', accessor: 'status', }, { Header: 'Priority', accessor: 'priority' }, - { Header: 'Last Updated', accessor: 'lastUpdated', Cell: ({ value }) => }, + { Header: 'Last Updated', accessor: 'lastUpdated', sortInverted: true, Cell: ({ value }) => }, { Header: 'Department', accessor: 'department' }, { Header: 'Building', accessor: 'building' }, - { Header: 'Date Received', accessor: 'dateReceived', Cell: ({ value }) => }, + { Header: 'Date Received', accessor: 'dateReceived', sortInverted: true, Cell: ({ value }) => }, ], []); const tableInstance = useTable( From 75b2ff3eab999a26847f110e500b0a045598ed8f Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Mon, 1 Feb 2021 17:20:55 -0500 Subject: [PATCH 7/7] Update venv-manager to allow 60 second for requirement installation (cherry picked from commit 49106215a8a85a19acc4b3fc4fa11d264c22b1c5) --- utils/venv-manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/venv-manager.py b/utils/venv-manager.py index 72ecd3b..3bb15ce 100644 --- a/utils/venv-manager.py +++ b/utils/venv-manager.py @@ -79,7 +79,7 @@ def get_args() -> argparse.Namespace: return parser.parse_args() -def run_logged_subprocess(command: Union[str, list], timeout: int = 10, shell: bool = True) -> tuple: +def run_logged_subprocess(command: Union[str, list], timeout: int = 60, shell: bool = True) -> tuple: """Executes a shell command using subprocess with logging. stderr is redirected to stdout and stdout is pipped to logger. @@ -96,7 +96,7 @@ def run_logged_subprocess(command: Union[str, list], timeout: int = 10, shell: b Args: command (Union): The command to run. If shell=False, pass a list with the first item being the command and the subsequent items being arguments. If shell=True, pass a string as you would type it into a shell. - timeout (int): The number of seconds to wait for a program before killing it + timeout (int): The number of seconds to wait for a program before killing it. Defaults to 60. Returns: tuple: With the first value being the return code and second being the combined stdout+stderr