From 2bcc525e4604235f0b110bb3658b60e671149e09 Mon Sep 17 00:00:00 2001 From: Logan Cunningham Date: Thu, 22 Feb 2024 18:47:59 +0000 Subject: [PATCH 01/19] added search tab to SC queue --- .../MoveSearchForm/MoveSearchForm.jsx | 162 +++++++++++------- src/components/Table/TableQueue.jsx | 9 + src/constants/routes.js | 2 + .../ServicesCounselingQueue.jsx | 74 +++++++- .../ServicesCounselingQueue.module.scss | 2 +- 5 files changed, 185 insertions(+), 64 deletions(-) diff --git a/src/components/MoveSearchForm/MoveSearchForm.jsx b/src/components/MoveSearchForm/MoveSearchForm.jsx index bb09c9d5120..994f8862a3b 100644 --- a/src/components/MoveSearchForm/MoveSearchForm.jsx +++ b/src/components/MoveSearchForm/MoveSearchForm.jsx @@ -4,12 +4,16 @@ import classnames from 'classnames'; import { Button, Radio } from '@trussworks/react-uswds'; import * as Yup from 'yup'; import PropTypes from 'prop-types'; +import { NavLink } from 'react-router-dom'; import styles from './MoveSearchForm.module.scss'; import { Form } from 'components/form/Form'; import TextField from 'components/form/fields/TextField/TextField'; import formStyles from 'styles/form.module.scss'; +import { roleTypes } from 'constants/userRoles'; +import TabNav from 'components/TabNav'; +import { servicesCounselingRoutes } from 'constants/routes'; const validationSchema = Yup.object().shape({ searchType: Yup.string().required('searchtype error'), @@ -25,68 +29,104 @@ const validationSchema = Yup.object().shape({ }), }); -const MoveSearchForm = ({ onSubmit }) => { +const MoveSearchForm = ({ onSubmit, role }) => { return ( - - {(formik) => { - return ( -
- What do you want to search for? -
- - - -
-
- Search} - name="searchText" - type="search" - button={ - - } - /> -
-
- ); - }} -
+ <> + {role === roleTypes.SERVICES_COUNSELOR ? ( + (isActive ? 'usa-current' : '')} + to={servicesCounselingRoutes.BASE_QUEUE_COUNSELING_PATH} + > + + Counseling + + , + (isActive ? 'usa-current' : '')} + to={servicesCounselingRoutes.BASE_QUEUE_CLOSEOUT_PATH} + > + + PPM Closeout + + , + (isActive ? 'usa-current' : '')} + to={servicesCounselingRoutes.BASE_QUEUE_SEARCH_PATH} + > + + Search + + , + ]} + /> + ) : null} + + {(formik) => { + return ( +
+ What do you want to search for? +
+ + + +
+
+ Search} + name="searchText" + type="search" + button={ + + } + /> +
+
+ ); + }} +
+ ); }; diff --git a/src/components/Table/TableQueue.jsx b/src/components/Table/TableQueue.jsx index 44c5546cbdd..ef03fa8b381 100644 --- a/src/components/Table/TableQueue.jsx +++ b/src/components/Table/TableQueue.jsx @@ -140,6 +140,15 @@ const TableQueue = ({ PPM Closeout , + (isActive ? 'usa-current' : '')} + to={servicesCounselingRoutes.BASE_QUEUE_SEARCH_PATH} + > + + Search + + , ]} /> )} diff --git a/src/constants/routes.js b/src/constants/routes.js index 9b44d7c0c05..2201891318d 100644 --- a/src/constants/routes.js +++ b/src/constants/routes.js @@ -53,6 +53,8 @@ export const servicesCounselingRoutes = { BASE_QUEUE_COUNSELING_PATH: '/counseling', QUEUE_CLOSEOUT_PATH: 'PPM-closeout', BASE_QUEUE_CLOSEOUT_PATH: '/PPM-closeout', + QUEUE_SEARCH_PATH: 'Search', + BASE_QUEUE_SEARCH_PATH: '/Search', BASE_COUNSELING_MOVE_PATH, BASE_ALLOWANCES_EDIT_PATH: `${BASE_COUNSELING_MOVE_PATH}/allowances`, ALLOWANCES_EDIT_PATH: 'allowances', diff --git a/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx b/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx index bbaafe00a56..be85dfc8f9f 100644 --- a/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx +++ b/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useCallback, useState } from 'react'; import { generatePath, useNavigate, Navigate, useParams } from 'react-router-dom'; import styles from './ServicesCounselingQueue.module.scss'; @@ -16,12 +16,20 @@ import { SERVICE_COUNSELING_PPM_TYPE_LABELS, } from 'constants/queues'; import { servicesCounselingRoutes } from 'constants/routes'; -import { useServicesCounselingQueueQueries, useServicesCounselingQueuePPMQueries, useUserQueries } from 'hooks/queries'; +import { + useServicesCounselingQueueQueries, + useServicesCounselingQueuePPMQueries, + useUserQueries, + useQAECSRMoveSearchQueries, +} from 'hooks/queries'; import { DATE_FORMAT_STRING } from 'shared/constants'; import { formatDateFromIso, serviceMemberAgencyLabel } from 'utils/formatters'; import LoadingPlaceholder from 'shared/LoadingPlaceholder'; import SomethingWentWrong from 'shared/SomethingWentWrong'; import NotFound from 'components/NotFound/NotFound'; +import MoveSearchForm from 'components/MoveSearchForm/MoveSearchForm'; +import { roleTypes } from 'constants/userRoles'; +import SearchResultsTable from 'components/Table/SearchResultsTable'; const counselingColumns = () => [ createHeader('ID', 'id'), @@ -187,6 +195,28 @@ const ServicesCounselingQueue = () => { navigate(generatePath(servicesCounselingRoutes.BASE_MOVE_VIEW_PATH, { moveCode: values.locator })); }; + const [search, setSearch] = useState({ moveCode: null, dodID: null, customerName: null }); + const [searchHappened, setSearchHappened] = useState(false); + + const onSubmit = useCallback((values) => { + const payload = { + moveCode: null, + dodID: null, + customerName: null, + }; + + if (values.searchType === 'moveCode') { + payload.moveCode = values.searchText; + } else if (values.searchType === 'dodID') { + payload.dodID = values.searchText; + } else if (values.searchType === 'customerName') { + payload.customerName = values.searchText; + } + + setSearch(payload); + setSearchHappened(true); + }, []); + // If the office user is in a closeout GBLOC and on the closeout tab, then we will want to disable // the column filter for the closeout location column because it will have no effect. const officeUserGBLOC = data?.office_user?.transportation_office?.gbloc; @@ -201,6 +231,46 @@ const ServicesCounselingQueue = () => { ); } + if (queueType === 'Search') { + return ( +
+

Search for a move

+ + {searchHappened && ( + // + + )} +
+ ); + } + if (queueType === 'PPM-closeout') { return (
diff --git a/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.module.scss b/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.module.scss index ea5c2c50cc5..2795fc9be38 100644 --- a/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.module.scss +++ b/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.module.scss @@ -7,4 +7,4 @@ flex: auto; border: (1px, solid, green); background-color: $bg-gray; -} +} \ No newline at end of file From 8e83bf8fe0ca71e9e831242ade521bf2b6935197 Mon Sep 17 00:00:00 2001 From: Logan Cunningham Date: Fri, 23 Feb 2024 03:17:42 +0000 Subject: [PATCH 02/19] cleaned up css --- .../MoveSearchForm/MoveSearchForm.module.scss | 6 ++++++ .../Table/SearchResultsTable.module.scss | 11 ----------- src/components/Table/TableQueue.module.scss | 14 +++++++++++++- .../ServicesCounselingQueue.jsx | 17 +---------------- .../ServicesCounselingQueue.module.scss | 11 ++++++++++- 5 files changed, 30 insertions(+), 29 deletions(-) diff --git a/src/components/MoveSearchForm/MoveSearchForm.module.scss b/src/components/MoveSearchForm/MoveSearchForm.module.scss index e913ff400f2..e4495d6153c 100644 --- a/src/components/MoveSearchForm/MoveSearchForm.module.scss +++ b/src/components/MoveSearchForm/MoveSearchForm.module.scss @@ -58,3 +58,9 @@ width: 356px; } } + +.tableTabs { + @include u-margin-x(1); + @include u-margin-bottom(2); + border-bottom: (2px solid rgb(236, 234, 234)); +} \ No newline at end of file diff --git a/src/components/Table/SearchResultsTable.module.scss b/src/components/Table/SearchResultsTable.module.scss index 494866929e9..7a1ff8439ce 100644 --- a/src/components/Table/SearchResultsTable.module.scss +++ b/src/components/Table/SearchResultsTable.module.scss @@ -9,17 +9,6 @@ flex-direction: column; flex: auto; - p { - @include u-margin(0); - @include u-padding-left(0.5); - } - - h2 { - @include u-margin-top(4); - @include u-margin-bottom(2); - @include u-padding-left(0.5); - } - .tableContainer { flex: auto; @include u-margin-top(1); diff --git a/src/components/Table/TableQueue.module.scss b/src/components/Table/TableQueue.module.scss index ea2341b54c1..64ad7ec1b62 100644 --- a/src/components/Table/TableQueue.module.scss +++ b/src/components/Table/TableQueue.module.scss @@ -4,12 +4,24 @@ .TableQueue { @include u-display(flex); + @include u-margin-x(0); + @include u-padding-x(0); flex-direction: column; flex: auto; + min-width: 100%; + + p { + @include u-margin(0); + @include u-padding-left(0.5); + } + + h2 { + @include u-margin-top(4); + @include u-padding-left(0.5); + } .tableContainer { flex: auto; - @include u-margin-top(1); max-width: 100%; overflow-x: auto; diff --git a/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx b/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx index be85dfc8f9f..1de77510a5e 100644 --- a/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx +++ b/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx @@ -233,25 +233,10 @@ const ServicesCounselingQueue = () => { if (queueType === 'Search') { return ( -
+

Search for a move

{searchHappened && ( - // Date: Fri, 23 Feb 2024 11:40:38 +0000 Subject: [PATCH 03/19] added test --- .../MoveSearchForm/MoveSearchForm.jsx | 2 +- .../MoveSearchForm/MoveSearchForm.test.jsx | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/components/MoveSearchForm/MoveSearchForm.jsx b/src/components/MoveSearchForm/MoveSearchForm.jsx index 994f8862a3b..5c0fa38b487 100644 --- a/src/components/MoveSearchForm/MoveSearchForm.jsx +++ b/src/components/MoveSearchForm/MoveSearchForm.jsx @@ -59,7 +59,7 @@ const MoveSearchForm = ({ onSubmit, role }) => { className={({ isActive }) => (isActive ? 'usa-current' : '')} to={servicesCounselingRoutes.BASE_QUEUE_SEARCH_PATH} > - + Search , diff --git a/src/components/MoveSearchForm/MoveSearchForm.test.jsx b/src/components/MoveSearchForm/MoveSearchForm.test.jsx index 794685bf385..49233009e6d 100644 --- a/src/components/MoveSearchForm/MoveSearchForm.test.jsx +++ b/src/components/MoveSearchForm/MoveSearchForm.test.jsx @@ -1,15 +1,31 @@ import React from 'react'; -import { render, waitFor } from '@testing-library/react'; +import { render, waitFor, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import MoveSearchForm from './MoveSearchForm'; +import { MockProviders } from 'testUtils'; +import { roleTypes } from 'constants/userRoles'; + describe('MoveSearchForm', () => { it('renders', () => { const { getByText } = render( {}} />); expect(getByText('What do you want to search for?')).toBeInTheDocument(); }); + it('check tabs if tabs load when logged in as a services counselor', async () => { + const onSubmit = jest.fn(); + render( + + + , + ); + + expect(screen.getByTestId('counseling-tab-link')).toBeInTheDocument(); + expect(screen.getByTestId('closeout-tab-link')).toBeInTheDocument(); + expect(screen.getByTestId('search-tab-link')).toBeInTheDocument(); + }); + describe('check validation', () => { it('can submit move code', async () => { const onSubmit = jest.fn(); From 19d2f0cdb0f15c278b986ac6159b808e92e2aa5a Mon Sep 17 00:00:00 2001 From: Logan Cunningham Date: Fri, 23 Feb 2024 11:55:15 +0000 Subject: [PATCH 04/19] moved tabs from movesearch component into the ServicesCounselorQueue and removed tabs from TableQueue --- .../MoveSearchForm/MoveSearchForm.jsx | 162 +++++++----------- .../MoveSearchForm/MoveSearchForm.test.jsx | 18 +- src/components/Table/TableQueue.jsx | 42 ----- .../ServicesCounselingQueue.jsx | 46 ++++- .../ServicesCounselingQueue.test.jsx | 19 +- 5 files changed, 117 insertions(+), 170 deletions(-) diff --git a/src/components/MoveSearchForm/MoveSearchForm.jsx b/src/components/MoveSearchForm/MoveSearchForm.jsx index 5c0fa38b487..bb09c9d5120 100644 --- a/src/components/MoveSearchForm/MoveSearchForm.jsx +++ b/src/components/MoveSearchForm/MoveSearchForm.jsx @@ -4,16 +4,12 @@ import classnames from 'classnames'; import { Button, Radio } from '@trussworks/react-uswds'; import * as Yup from 'yup'; import PropTypes from 'prop-types'; -import { NavLink } from 'react-router-dom'; import styles from './MoveSearchForm.module.scss'; import { Form } from 'components/form/Form'; import TextField from 'components/form/fields/TextField/TextField'; import formStyles from 'styles/form.module.scss'; -import { roleTypes } from 'constants/userRoles'; -import TabNav from 'components/TabNav'; -import { servicesCounselingRoutes } from 'constants/routes'; const validationSchema = Yup.object().shape({ searchType: Yup.string().required('searchtype error'), @@ -29,104 +25,68 @@ const validationSchema = Yup.object().shape({ }), }); -const MoveSearchForm = ({ onSubmit, role }) => { +const MoveSearchForm = ({ onSubmit }) => { return ( - <> - {role === roleTypes.SERVICES_COUNSELOR ? ( - (isActive ? 'usa-current' : '')} - to={servicesCounselingRoutes.BASE_QUEUE_COUNSELING_PATH} - > - - Counseling - - , - (isActive ? 'usa-current' : '')} - to={servicesCounselingRoutes.BASE_QUEUE_CLOSEOUT_PATH} - > - - PPM Closeout - - , - (isActive ? 'usa-current' : '')} - to={servicesCounselingRoutes.BASE_QUEUE_SEARCH_PATH} - > - - Search - - , - ]} - /> - ) : null} - - {(formik) => { - return ( -
- What do you want to search for? -
- - - -
-
- Search} - name="searchText" - type="search" - button={ - - } - /> -
-
- ); - }} -
- + + {(formik) => { + return ( +
+ What do you want to search for? +
+ + + +
+
+ Search} + name="searchText" + type="search" + button={ + + } + /> +
+
+ ); + }} +
); }; diff --git a/src/components/MoveSearchForm/MoveSearchForm.test.jsx b/src/components/MoveSearchForm/MoveSearchForm.test.jsx index 49233009e6d..794685bf385 100644 --- a/src/components/MoveSearchForm/MoveSearchForm.test.jsx +++ b/src/components/MoveSearchForm/MoveSearchForm.test.jsx @@ -1,31 +1,15 @@ import React from 'react'; -import { render, waitFor, screen } from '@testing-library/react'; +import { render, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import MoveSearchForm from './MoveSearchForm'; -import { MockProviders } from 'testUtils'; -import { roleTypes } from 'constants/userRoles'; - describe('MoveSearchForm', () => { it('renders', () => { const { getByText } = render( {}} />); expect(getByText('What do you want to search for?')).toBeInTheDocument(); }); - it('check tabs if tabs load when logged in as a services counselor', async () => { - const onSubmit = jest.fn(); - render( - - - , - ); - - expect(screen.getByTestId('counseling-tab-link')).toBeInTheDocument(); - expect(screen.getByTestId('closeout-tab-link')).toBeInTheDocument(); - expect(screen.getByTestId('search-tab-link')).toBeInTheDocument(); - }); - describe('check validation', () => { it('can submit move code', async () => { const onSubmit = jest.fn(); diff --git a/src/components/Table/TableQueue.jsx b/src/components/Table/TableQueue.jsx index ef03fa8b381..d3cc81b8a3e 100644 --- a/src/components/Table/TableQueue.jsx +++ b/src/components/Table/TableQueue.jsx @@ -2,7 +2,6 @@ import React, { useState, useEffect, useMemo } from 'react'; import { GridContainer } from '@trussworks/react-uswds'; import { useTable, useFilters, usePagination, useSortBy } from 'react-table'; import PropTypes from 'prop-types'; -import { NavLink } from 'react-router-dom'; import styles from './TableQueue.module.scss'; @@ -11,8 +10,6 @@ import LoadingPlaceholder from 'shared/LoadingPlaceholder'; import SomethingWentWrong from 'shared/SomethingWentWrong'; import TextBoxFilter from 'components/Table/Filters/TextBoxFilter'; import { SortShape } from 'constants/queues'; -import TabNav from 'components/TabNav'; -import { servicesCounselingRoutes } from 'constants/routes'; // TableQueue is a react-table that uses react-hooks to fetch, filter, sort and page data const TableQueue = ({ @@ -29,7 +26,6 @@ const TableQueue = ({ useQueries, showFilters, showPagination, - showTabs, }) => { const [paramSort, setParamSort] = useState(defaultSortedColumns); const [paramFilters, setParamFilters] = useState([]); @@ -118,43 +114,8 @@ const TableQueue = ({ return (

{`${title} (${totalCount})`}

- {showTabs && ( - (isActive ? 'usa-current' : '')} - to={servicesCounselingRoutes.BASE_QUEUE_COUNSELING_PATH} - > - - Counseling - - , - (isActive ? 'usa-current' : '')} - to={servicesCounselingRoutes.BASE_QUEUE_CLOSEOUT_PATH} - > - - PPM Closeout - - , - (isActive ? 'usa-current' : '')} - to={servicesCounselingRoutes.BASE_QUEUE_SEARCH_PATH} - > - - Search - - , - ]} - /> - )}
[ createHeader('ID', 'id'), @@ -231,14 +232,51 @@ const ServicesCounselingQueue = () => { ); } + const renderNavBar = () => { + return ( + (isActive ? 'usa-current' : '')} + to={servicesCounselingRoutes.BASE_QUEUE_COUNSELING_PATH} + > + + Counseling + + , + (isActive ? 'usa-current' : '')} + to={servicesCounselingRoutes.BASE_QUEUE_CLOSEOUT_PATH} + > + + PPM Closeout + + , + (isActive ? 'usa-current' : '')} + to={servicesCounselingRoutes.BASE_QUEUE_SEARCH_PATH} + > + + Search + + , + ]} + /> + ); + }; + if (queueType === 'Search') { return (
+ {renderNavBar()}

Search for a move

{searchHappened && ( { if (queueType === 'PPM-closeout') { return (
+ {renderNavBar()} { if (queueType === 'counseling') { return (
+ {renderNavBar()} ({ useUserQueries: jest.fn(), @@ -318,10 +319,10 @@ describe('ServicesCounselingQueue', () => { ); it.each([ - ['counselor', servicesCounselingRoutes.QUEUE_COUNSELING_PATH, true, serviceCounselorUser], - ['counselor', servicesCounselingRoutes.QUEUE_CLOSEOUT_PATH, false, serviceCounselorUser], - ['closeout', servicesCounselingRoutes.QUEUE_COUNSELING_PATH, true, serviceCounselorUserForCloseout], - ['closeout', servicesCounselingRoutes.QUEUE_CLOSEOUT_PATH, false, serviceCounselorUserForCloseout], + ['counselor', servicesCounselingRoutes.QUEUE_COUNSELING_PATH, 'counseling', serviceCounselorUser], + ['counselor', servicesCounselingRoutes.QUEUE_CLOSEOUT_PATH, 'closeout', serviceCounselorUser], + ['closeout', servicesCounselingRoutes.QUEUE_COUNSELING_PATH, 'counseling', serviceCounselorUserForCloseout], + ['closeout', servicesCounselingRoutes.QUEUE_CLOSEOUT_PATH, 'closeout', serviceCounselorUserForCloseout], ])('a %s user accessing path "%s"', (userDescription, queueType, showsCounselingTab, user) => { useUserQueries.mockReturnValue(user); useServicesCounselingQueueQueries.mockReturnValue(serviceCounselingCompletedMoves); @@ -332,7 +333,7 @@ describe('ServicesCounselingQueue', () => { , ); - if (showsCounselingTab) { + if (showsCounselingTab === 'counseling') { // Make sure "Counseling" is the active tab. const counselingActive = screen.getByText('Counseling', { selector: '.usa-current .tab-title' }); expect(counselingActive).toBeInTheDocument(); @@ -342,7 +343,7 @@ describe('ServicesCounselingQueue', () => { expect(screen.getByText(/Requested move date/)).toBeInTheDocument(); expect(screen.getByText(/Date submitted/)).toBeInTheDocument(); expect(screen.getByText(/Origin GBLOC/)).toBeInTheDocument(); - } else { + } else if (showsCounselingTab === 'closeout') { // Make sure "PPM Closeout" is the active tab. const ppmCloseoutActive = screen.getByText('PPM Closeout', { selector: '.usa-current .tab-title' }); expect(ppmCloseoutActive).toBeInTheDocument(); @@ -352,7 +353,13 @@ describe('ServicesCounselingQueue', () => { expect(screen.getByText(/PPM closeout location/)).toBeInTheDocument(); expect(screen.getByText(/Full or partial PPM/)).toBeInTheDocument(); expect(screen.getByText(/Destination duty location/)).toBeInTheDocument(); + } else { + const searchActive = screen.getByText('Search', { selector: '.usa-current .tab-title' }); + expect(searchActive).toBeInTheDocument(); + expect(MoveSearchForm).toBeInTheDocument(); } }); }); + + it('service counseling search tab', () => {}); }); From 6b0d39ddf85e655911b5a514b75cd47aad378239 Mon Sep 17 00:00:00 2001 From: Logan Cunningham Date: Fri, 23 Feb 2024 12:02:46 +0000 Subject: [PATCH 05/19] removed old css and clean up --- .../MoveSearchForm/MoveSearchForm.module.scss | 6 ------ src/components/Table/TableQueue.module.scss | 6 ------ .../ServicesCounselingQueue.jsx | 2 +- .../ServicesCounselingQueue.module.scss | 10 +++++----- 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/components/MoveSearchForm/MoveSearchForm.module.scss b/src/components/MoveSearchForm/MoveSearchForm.module.scss index e4495d6153c..e913ff400f2 100644 --- a/src/components/MoveSearchForm/MoveSearchForm.module.scss +++ b/src/components/MoveSearchForm/MoveSearchForm.module.scss @@ -58,9 +58,3 @@ width: 356px; } } - -.tableTabs { - @include u-margin-x(1); - @include u-margin-bottom(2); - border-bottom: (2px solid rgb(236, 234, 234)); -} \ No newline at end of file diff --git a/src/components/Table/TableQueue.module.scss b/src/components/Table/TableQueue.module.scss index 64ad7ec1b62..ebd9a94813f 100644 --- a/src/components/Table/TableQueue.module.scss +++ b/src/components/Table/TableQueue.module.scss @@ -35,9 +35,3 @@ } } } - -.tableTabs { - @include u-margin-x(1); - @include u-margin-bottom(2); - border-bottom: (2px solid rgb(236, 234, 234)); -} diff --git a/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx b/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx index c183fe914e9..071f269dfcb 100644 --- a/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx +++ b/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx @@ -271,7 +271,7 @@ const ServicesCounselingQueue = () => { if (queueType === 'Search') { return ( -
+
{renderNavBar()}

Search for a move

diff --git a/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.module.scss b/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.module.scss index 308b3abe9ce..518ba8a99f9 100644 --- a/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.module.scss +++ b/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.module.scss @@ -11,9 +11,9 @@ width: 100%; } -.ServicesCounselingSearchQueue { - @include u-display(flex); - @include u-padding-x(4); - flex-direction: column; - flex: auto; +.tableTabs { + @include u-margin-y(1); + @include u-margin-x(1); + @include u-margin-bottom(2); + border-bottom: (2px solid rgb(236, 234, 234)); } From 5b4b50fad62432f76fadba38cc26ab17fee0c1ef Mon Sep 17 00:00:00 2001 From: Logan Cunningham Date: Fri, 23 Feb 2024 21:36:23 +0000 Subject: [PATCH 06/19] added status filtering based on office role --- src/components/Table/SearchResultsTable.jsx | 21 ++++++++++++++----- src/constants/queues.js | 10 +++++++++ .../ServicesCounselingQueue.jsx | 1 + 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/components/Table/SearchResultsTable.jsx b/src/components/Table/SearchResultsTable.jsx index 0c1eaa68873..775de453840 100644 --- a/src/components/Table/SearchResultsTable.jsx +++ b/src/components/Table/SearchResultsTable.jsx @@ -9,12 +9,13 @@ import Table from 'components/Table/Table'; import LoadingPlaceholder from 'shared/LoadingPlaceholder'; import SomethingWentWrong from 'shared/SomethingWentWrong'; import TextBoxFilter from 'components/Table/Filters/TextBoxFilter'; -import { BRANCH_OPTIONS, MOVE_STATUS_LABELS, MOVE_STATUS_OPTIONS, SortShape } from 'constants/queues'; +import { BRANCH_OPTIONS, MOVE_STATUS_LABELS, ROLE_TYPE_OPTIONS, SortShape } from 'constants/queues'; import { serviceMemberAgencyLabel } from 'utils/formatters'; import MultiSelectCheckBoxFilter from 'components/Table/Filters/MultiSelectCheckBoxFilter'; import SelectFilter from 'components/Table/Filters/SelectFilter'; +import { roleTypes } from 'constants/userRoles'; -const columns = [ +const columns = (roleType) => [ createHeader('Move code', 'locator', { id: 'locator', isFilterable: false, @@ -41,8 +42,15 @@ const columns = [ { id: 'status', isFilterable: true, - // eslint-disable-next-line react/jsx-props-no-spreading - Filter: (props) => , + Filter: (props) => { + return ( + + ); + }, }, ), createHeader( @@ -104,6 +112,7 @@ const SearchResultsTable = (props) => { dodID, moveCode, customerName, + roleType, } = props; const [paramSort, setParamSort] = useState(defaultSortedColumns); const [paramFilters, setParamFilters] = useState([]); @@ -139,7 +148,7 @@ const SearchResultsTable = (props) => { [], ); const tableData = useMemo(() => data, [data]); - const tableColumns = useMemo(() => columns, []); + const tableColumns = useMemo(() => columns(roleType), [roleType]); const { getTableProps, getTableBodyProps, @@ -270,6 +279,7 @@ SearchResultsTable.propTypes = { moveCode: PropTypes.string, // customerName is the customer name search text customerName: PropTypes.string, + roleType: PropTypes.string, }; SearchResultsTable.defaultProps = { @@ -283,6 +293,7 @@ SearchResultsTable.defaultProps = { dodID: null, moveCode: null, customerName: null, + roleType: roleTypes.QAE_CSR, }; export default SearchResultsTable; diff --git a/src/constants/queues.js b/src/constants/queues.js index ff36be7fcd2..f2893192b35 100644 --- a/src/constants/queues.js +++ b/src/constants/queues.js @@ -1,5 +1,7 @@ import { shape, string, bool, arrayOf } from 'prop-types'; +import { roleTypes } from './userRoles'; + import MOVE_STATUSES from 'constants/moves'; export const MOVE_STATUS_OPTIONS = [ @@ -12,8 +14,10 @@ export const MOVE_STATUS_OPTIONS = [ // queue as well as those that completed services counseling should have the // status label of New move export const MOVE_STATUS_LABELS = { + [MOVE_STATUSES.DRAFT]: 'Draft', [MOVE_STATUSES.SUBMITTED]: 'New move', [MOVE_STATUSES.SERVICE_COUNSELING_COMPLETED]: 'New move', + [MOVE_STATUSES.NEEDS_SERVICE_COUNSELING]: 'Needs Service Counseling', [MOVE_STATUSES.APPROVALS_REQUESTED]: 'Approvals requested', [MOVE_STATUSES.APPROVED]: 'Move approved', }; @@ -37,6 +41,12 @@ export const PAYMENT_REQUEST_STATUS_OPTIONS = [ { value: 'Error', label: 'Error' }, ]; +export const ROLE_TYPE_OPTIONS = { + [roleTypes.SERVICES_COUNSELOR]: SERVICE_COUNSELING_MOVE_STATUS_OPTIONS, + [roleTypes.QAE_CSR]: MOVE_STATUS_OPTIONS, + [roleTypes.TIO]: PAYMENT_REQUEST_STATUS_OPTIONS, +}; + export const BRANCH_OPTIONS = [ { value: '', label: 'All' }, { value: 'ARMY', label: 'Army' }, diff --git a/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx b/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx index 071f269dfcb..0bf119bb424 100644 --- a/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx +++ b/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx @@ -288,6 +288,7 @@ const ServicesCounselingQueue = () => { moveCode={search.moveCode} dodID={search.dodID} customerName={search.customerName} + roleType={roleTypes.SERVICES_COUNSELOR} /> )}
From 2ed61b07fe04b1f0c0a2b18f291c6e0448ccf485 Mon Sep 17 00:00:00 2001 From: Logan Cunningham Date: Mon, 26 Feb 2024 15:24:03 +0000 Subject: [PATCH 07/19] search queue now only shows results for services counselors when appropriate --- pkg/gen/ghcapi/embedded_spec.go | 8 ++++++-- pkg/gen/ghcapi/ghcoperations/move/search_moves.go | 2 +- pkg/services/move/move_searcher.go | 11 +++++++++++ swagger-def/ghc.yaml | 2 ++ swagger/ghc.yaml | 2 ++ 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go index 0fa6c815434..10ed56323dd 100644 --- a/pkg/gen/ghcapi/embedded_spec.go +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -1636,7 +1636,9 @@ func init() { "enum": [ "SUBMITTED", "APPROVALS REQUESTED", - "APPROVED" + "APPROVED", + "NEEDS SERVICE COUNSELING", + "SERVICE COUNSELING COMPLETED" ] } } @@ -12410,7 +12412,9 @@ func init() { "enum": [ "SUBMITTED", "APPROVALS REQUESTED", - "APPROVED" + "APPROVED", + "NEEDS SERVICE COUNSELING", + "SERVICE COUNSELING COMPLETED" ] } } diff --git a/pkg/gen/ghcapi/ghcoperations/move/search_moves.go b/pkg/gen/ghcapi/ghcoperations/move/search_moves.go index a8b065d1480..81178c64d40 100644 --- a/pkg/gen/ghcapi/ghcoperations/move/search_moves.go +++ b/pkg/gen/ghcapi/ghcoperations/move/search_moves.go @@ -298,7 +298,7 @@ var searchMovesBodyStatusItemsEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["SUBMITTED","APPROVALS REQUESTED","APPROVED"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["SUBMITTED","APPROVALS REQUESTED","APPROVED","NEEDS SERVICE COUNSELING","SERVICE COUNSELING COMPLETED"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/pkg/services/move/move_searcher.go b/pkg/services/move/move_searcher.go index 3b61b9f4744..dda315674aa 100644 --- a/pkg/services/move/move_searcher.go +++ b/pkg/services/move/move_searcher.go @@ -11,6 +11,7 @@ import ( "github.com/transcom/mymove/pkg/appcontext" "github.com/transcom/mymove/pkg/apperror" "github.com/transcom/mymove/pkg/models" + "github.com/transcom/mymove/pkg/models/roles" "github.com/transcom/mymove/pkg/services" ) @@ -63,6 +64,16 @@ func (s moveSearcher) SearchMoves(appCtx appcontext.AppContext, params *services GroupBy("moves.id", "service_members.id", "origin_addresses.id", "new_addresses.id"). Where("show = TRUE") + // Services Counselor Statuses + if appCtx.Session().Roles.HasRole(roles.RoleType("services_counselor")) { + query.Where("moves.status = 'NEEDS SERVICE COUNSELING' OR moves.status = 'SERVICE COUNSELING COMPLETED'") + } + + // TIO Statuses + // if appCtx.Session().Roles.HasRole(roles.RoleType("transportation_invoicing_officer")) { + // query.Where("moves.status = 'PAYMENT REQUESTED' or moves.status = 'REVIEWED' or moves.status = 'REJECTED' or moves.status = 'PAID' or moves.status = 'DEPRECATED' or moves.status = 'ERROR'") + // } + customerNameQuery := customerNameSearch(params.CustomerName) locatorQuery := locatorFilter(params.Locator) dodIDQuery := dodIDFilter(params.DodID) diff --git a/swagger-def/ghc.yaml b/swagger-def/ghc.yaml index e2db26aad5a..ef519198aeb 100644 --- a/swagger-def/ghc.yaml +++ b/swagger-def/ghc.yaml @@ -3070,6 +3070,8 @@ paths: - SUBMITTED - APPROVALS REQUESTED - APPROVED + - NEEDS SERVICE COUNSELING + - SERVICE COUNSELING COMPLETED originPostalCode: type: string x-nullable: true diff --git a/swagger/ghc.yaml b/swagger/ghc.yaml index accd7cf75cb..1305ec0ff7e 100644 --- a/swagger/ghc.yaml +++ b/swagger/ghc.yaml @@ -3193,6 +3193,8 @@ paths: - SUBMITTED - APPROVALS REQUESTED - APPROVED + - NEEDS SERVICE COUNSELING + - SERVICE COUNSELING COMPLETED originPostalCode: type: string x-nullable: true From 022c826e07c773ffcb69dff62eb1b21c45f19db5 Mon Sep 17 00:00:00 2001 From: Logan Cunningham Date: Mon, 26 Feb 2024 15:41:55 +0000 Subject: [PATCH 08/19] removed empty test --- .../ServicesCounselingQueue/ServicesCounselingQueue.test.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.test.jsx b/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.test.jsx index be66c40688a..3c1ef5232e7 100644 --- a/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.test.jsx +++ b/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.test.jsx @@ -354,12 +354,11 @@ describe('ServicesCounselingQueue', () => { expect(screen.getByText(/Full or partial PPM/)).toBeInTheDocument(); expect(screen.getByText(/Destination duty location/)).toBeInTheDocument(); } else { + // Check for the "Search" tab const searchActive = screen.getByText('Search', { selector: '.usa-current .tab-title' }); expect(searchActive).toBeInTheDocument(); expect(MoveSearchForm).toBeInTheDocument(); } }); }); - - it('service counseling search tab', () => {}); }); From c165aa3afd8cab75eb0ca49539f044c95a39f06f Mon Sep 17 00:00:00 2001 From: Logan Cunningham Date: Tue, 27 Feb 2024 03:52:01 +0000 Subject: [PATCH 09/19] added/updated move searcher tests --- pkg/services/move/move_searcher_test.go | 142 ++++++++++++++++++++++-- 1 file changed, 132 insertions(+), 10 deletions(-) diff --git a/pkg/services/move/move_searcher_test.go b/pkg/services/move/move_searcher_test.go index 5e58fd56ebb..8a5f2d06f57 100644 --- a/pkg/services/move/move_searcher_test.go +++ b/pkg/services/move/move_searcher_test.go @@ -3,8 +3,10 @@ package move import ( "fmt" + "github.com/transcom/mymove/pkg/auth" "github.com/transcom/mymove/pkg/factory" "github.com/transcom/mymove/pkg/models" + "github.com/transcom/mymove/pkg/models/roles" "github.com/transcom/mymove/pkg/services" ) @@ -12,6 +14,15 @@ func (suite *MoveServiceSuite) TestMoveSearch() { searcher := NewMoveSearcher() suite.Run("search with no filters should fail", func() { + qaeUser := factory.BuildOfficeUserWithRoles(suite.DB(), nil, []roles.RoleType{roles.RoleTypeQaeCsr}) + session := auth.Session{ + ApplicationName: auth.OfficeApp, + Roles: qaeUser.User.Roles, + OfficeUserID: qaeUser.ID, + IDToken: "fake_token", + AccessToken: "fakeAccessToken", + } + factory.BuildMove(suite.DB(), []factory.Customization{ { Model: models.Move{ @@ -28,10 +39,19 @@ func (suite *MoveServiceSuite) TestMoveSearch() { }, }, nil) - _, _, err := searcher.SearchMoves(suite.AppContextForTest(), &services.SearchMovesParams{}) + _, _, err := searcher.SearchMoves(suite.AppContextWithSessionForTest(&session), &services.SearchMovesParams{}) suite.Error(err) }) suite.Run("search with valid locator", func() { + qaeUser := factory.BuildOfficeUserWithRoles(suite.DB(), nil, []roles.RoleType{roles.RoleTypeQaeCsr}) + session := auth.Session{ + ApplicationName: auth.OfficeApp, + Roles: qaeUser.User.Roles, + OfficeUserID: qaeUser.ID, + IDToken: "fake_token", + AccessToken: "fakeAccessToken", + } + firstMove := factory.BuildMove(suite.DB(), []factory.Customization{ { Model: models.Move{ @@ -48,12 +68,21 @@ func (suite *MoveServiceSuite) TestMoveSearch() { }, }, nil) - moves, _, err := searcher.SearchMoves(suite.AppContextForTest(), &services.SearchMovesParams{Locator: &firstMove.Locator}) + moves, _, err := searcher.SearchMoves(suite.AppContextWithSessionForTest(&session), &services.SearchMovesParams{Locator: &firstMove.Locator}) suite.NoError(err) suite.Len(moves, 1) suite.Equal(firstMove.Locator, moves[0].Locator) }) suite.Run("search with valid DOD ID", func() { + qaeUser := factory.BuildOfficeUserWithRoles(suite.DB(), nil, []roles.RoleType{roles.RoleTypeQaeCsr}) + session := auth.Session{ + ApplicationName: auth.OfficeApp, + Roles: qaeUser.User.Roles, + OfficeUserID: qaeUser.ID, + IDToken: "fake_token", + AccessToken: "fakeAccessToken", + } + factory.BuildMove(suite.DB(), []factory.Customization{ { Model: models.Move{ @@ -70,12 +99,21 @@ func (suite *MoveServiceSuite) TestMoveSearch() { }, }, nil) - moves, _, err := searcher.SearchMoves(suite.AppContextForTest(), &services.SearchMovesParams{DodID: secondMove.Orders.ServiceMember.Edipi}) + moves, _, err := searcher.SearchMoves(suite.AppContextWithSessionForTest(&session), &services.SearchMovesParams{DodID: secondMove.Orders.ServiceMember.Edipi}) suite.NoError(err) suite.Len(moves, 1) suite.Equal(secondMove.Locator, moves[0].Locator) }) suite.Run("search with customer name", func() { + qaeUser := factory.BuildOfficeUserWithRoles(suite.DB(), nil, []roles.RoleType{roles.RoleTypeQaeCsr}) + session := auth.Session{ + ApplicationName: auth.OfficeApp, + Roles: qaeUser.User.Roles, + OfficeUserID: qaeUser.ID, + IDToken: "fake_token", + AccessToken: "fakeAccessToken", + } + firstMove := factory.BuildMove(suite.DB(), []factory.Customization{ { Model: models.Move{ @@ -98,12 +136,20 @@ func (suite *MoveServiceSuite) TestMoveSearch() { }, }, nil) - moves, _, err := searcher.SearchMoves(suite.AppContextForTest(), &services.SearchMovesParams{CustomerName: models.StringPointer("Grace Griffin")}) + moves, _, err := searcher.SearchMoves(suite.AppContextWithSessionForTest(&session), &services.SearchMovesParams{CustomerName: models.StringPointer("Grace Griffin")}) suite.NoError(err) suite.Len(moves, 1) suite.Equal(firstMove.Locator, moves[0].Locator) }) suite.Run("search with both DOD ID and locator filters should fail", func() { + qaeUser := factory.BuildOfficeUserWithRoles(suite.DB(), nil, []roles.RoleType{roles.RoleTypeQaeCsr}) + session := auth.Session{ + ApplicationName: auth.OfficeApp, + Roles: qaeUser.User.Roles, + OfficeUserID: qaeUser.ID, + IDToken: "fake_token", + AccessToken: "fakeAccessToken", + } firstMove := factory.BuildMove(suite.DB(), []factory.Customization{ { @@ -122,20 +168,38 @@ func (suite *MoveServiceSuite) TestMoveSearch() { }, nil) // Search for Locator of one move and DOD ID of another move - _, _, err := searcher.SearchMoves(suite.AppContextForTest(), &services.SearchMovesParams{ + _, _, err := searcher.SearchMoves(suite.AppContextWithSessionForTest(&session), &services.SearchMovesParams{ Locator: &firstMove.Locator, DodID: secondMove.Orders.ServiceMember.Edipi, }) suite.Error(err) }) suite.Run("search with no results", func() { + qaeUser := factory.BuildOfficeUserWithRoles(suite.DB(), nil, []roles.RoleType{roles.RoleTypeQaeCsr}) + session := auth.Session{ + ApplicationName: auth.OfficeApp, + Roles: qaeUser.User.Roles, + OfficeUserID: qaeUser.ID, + IDToken: "fake_token", + AccessToken: "fakeAccessToken", + } + nonexistantLocator := "CCCCCC" - moves, _, err := searcher.SearchMoves(suite.AppContextForTest(), &services.SearchMovesParams{Locator: &nonexistantLocator}) + moves, _, err := searcher.SearchMoves(suite.AppContextWithSessionForTest(&session), &services.SearchMovesParams{Locator: &nonexistantLocator}) suite.NoError(err) suite.Len(moves, 0) }) suite.Run("test pagination", func() { + qaeUser := factory.BuildOfficeUserWithRoles(suite.DB(), nil, []roles.RoleType{roles.RoleTypeQaeCsr}) + session := auth.Session{ + ApplicationName: auth.OfficeApp, + Roles: qaeUser.User.Roles, + OfficeUserID: qaeUser.ID, + IDToken: "fake_token", + AccessToken: "fakeAccessToken", + } + firstMove := factory.BuildMove(suite.DB(), []factory.Customization{ { Model: models.Move{ @@ -164,7 +228,7 @@ func (suite *MoveServiceSuite) TestMoveSearch() { }, }, nil) // get first page - moves, totalCount, err := searcher.SearchMoves(suite.AppContextForTest(), &services.SearchMovesParams{ + moves, totalCount, err := searcher.SearchMoves(suite.AppContextWithSessionForTest(&session), &services.SearchMovesParams{ CustomerName: models.StringPointer("grace griffin"), PerPage: 1, Page: 1, @@ -175,7 +239,7 @@ func (suite *MoveServiceSuite) TestMoveSearch() { suite.Equal(2, totalCount) // get second page - moves, totalCount, err = searcher.SearchMoves(suite.AppContextForTest(), &services.SearchMovesParams{ + moves, totalCount, err = searcher.SearchMoves(suite.AppContextWithSessionForTest(&session), &services.SearchMovesParams{ CustomerName: models.StringPointer("grace griffin"), PerPage: 1, Page: 2, @@ -300,6 +364,15 @@ func (suite *MoveServiceSuite) TestMoveSearchOrdering() { testMoves := models.Moves{} suite.NoError(suite.DB().EagerPreload("Orders", "Orders.NewDutyLocation", "Orders.NewDutyLocation.Address").All(&testMoves)) + qaeUser := factory.BuildOfficeUserWithRoles(suite.DB(), nil, []roles.RoleType{roles.RoleTypeQaeCsr}) + session := auth.Session{ + ApplicationName: auth.OfficeApp, + Roles: qaeUser.User.Roles, + OfficeUserID: qaeUser.ID, + IDToken: "fake_token", + AccessToken: "fakeAccessToken", + } + searcher := NewMoveSearcher() columns := []string{"status", "originPostalCode", "destinationPostalCode", "branch", "shipmentsCount"} for _, order := range []string{"asc", "desc"} { @@ -310,7 +383,7 @@ func (suite *MoveServiceSuite) TestMoveSearchOrdering() { Sort: &columns[ci], Order: &order, } - moves, _, err := searcher.SearchMoves(suite.AppContextForTest(), ¶ms) + moves, _, err := searcher.SearchMoves(suite.AppContextWithSessionForTest(&session), ¶ms) suite.NoError(err) suite.Len(moves, 2) message := fmt.Sprintf("Sort by %s, %s failed", col, order) @@ -329,6 +402,15 @@ func (suite *MoveServiceSuite) TestMoveSearchOrdering() { nameToSearch := "maria johnson" searcher := NewMoveSearcher() + qaeUser := factory.BuildOfficeUserWithRoles(suite.DB(), nil, []roles.RoleType{roles.RoleTypeQaeCsr}) + session := auth.Session{ + ApplicationName: auth.OfficeApp, + Roles: qaeUser.User.Roles, + OfficeUserID: qaeUser.ID, + IDToken: "fake_token", + AccessToken: "fakeAccessToken", + } + cases := []struct { column string value string @@ -342,10 +424,50 @@ func (suite *MoveServiceSuite) TestMoveSearchOrdering() { } for _, testCase := range cases { message := fmt.Sprintf("Filtering results of search by column %s = %s has failed", testCase.column, testCase.value) - moves, _, err := searcher.SearchMoves(suite.AppContextForTest(), &testCase.SearchMovesParams) + moves, _, err := searcher.SearchMoves(suite.AppContextWithSessionForTest(&session), &testCase.SearchMovesParams) suite.NoError(err) suite.Len(moves, 1, message) suite.Equal(secondMove.Locator, moves[0].Locator, message) } }) } + +func (suite *MoveServiceSuite) TestShowServicesCounselorsResults() { + suite.Run("search results when logged in as a services counselor", func() { + firstMove, secondMove := setupTestData(suite) + testMoves := models.Moves{} + + officeUser := factory.BuildOfficeUserWithRoles(suite.DB(), nil, []roles.RoleType{roles.RoleTypeServicesCounselor}) + session := auth.Session{ + ApplicationName: auth.OfficeApp, + Roles: officeUser.User.Roles, + OfficeUserID: officeUser.ID, + } + + suite.NoError(suite.DB().EagerPreload("Orders", "Orders.NewDutyLocation", "Orders.NewDutyLocation.Address").All(&testMoves)) + + searcher := NewMoveSearcher() + columns := []string{"status", "originPostalCode", "destinationPostalCode", "branch", "shipmentsCount"} + for _, order := range []string{"asc", "desc"} { + order := order + for ci, col := range columns { + params := services.SearchMovesParams{ + CustomerName: models.StringPointer("maria johnson"), + Sort: &columns[ci], + Order: &order, + } + moves, _, err := searcher.SearchMoves(suite.AppContextWithSessionForTest(&session), ¶ms) + suite.NoError(err) + suite.Len(moves, 1) + message := fmt.Sprintf("Sort by %s, %s failed", col, order) + if order == "asc" { + suite.Equal(secondMove.Locator, moves[0].Locator, message) + } else { + suite.Equal(secondMove.Locator, moves[0].Locator, message) + } + + suite.NotEqual(firstMove.Locator, moves[0]) + } + } + }) +} From 766500c66cec6e9ce50deb5c55f8a2c4dff00e25 Mon Sep 17 00:00:00 2001 From: Logan Cunningham Date: Tue, 27 Feb 2024 05:13:43 +0000 Subject: [PATCH 10/19] minor fix to move searcher test --- pkg/services/move/move_searcher_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/services/move/move_searcher_test.go b/pkg/services/move/move_searcher_test.go index 8a5f2d06f57..ce26980cc01 100644 --- a/pkg/services/move/move_searcher_test.go +++ b/pkg/services/move/move_searcher_test.go @@ -466,7 +466,7 @@ func (suite *MoveServiceSuite) TestShowServicesCounselorsResults() { suite.Equal(secondMove.Locator, moves[0].Locator, message) } - suite.NotEqual(firstMove.Locator, moves[0]) + suite.NotEqual(firstMove.Locator, moves[0].Locator) } } }) From 036cb60d1410a3f0a43974c7e115f8e7c65bd78b Mon Sep 17 00:00:00 2001 From: Logan Cunningham Date: Tue, 27 Feb 2024 15:11:19 +0000 Subject: [PATCH 11/19] clean up --- pkg/services/move/move_searcher.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/services/move/move_searcher.go b/pkg/services/move/move_searcher.go index dda315674aa..efe207b9b83 100644 --- a/pkg/services/move/move_searcher.go +++ b/pkg/services/move/move_searcher.go @@ -65,12 +65,12 @@ func (s moveSearcher) SearchMoves(appCtx appcontext.AppContext, params *services Where("show = TRUE") // Services Counselor Statuses - if appCtx.Session().Roles.HasRole(roles.RoleType("services_counselor")) { + if appCtx.Session().Roles.HasRole(roles.RoleTypeServicesCounselor) { query.Where("moves.status = 'NEEDS SERVICE COUNSELING' OR moves.status = 'SERVICE COUNSELING COMPLETED'") } // TIO Statuses - // if appCtx.Session().Roles.HasRole(roles.RoleType("transportation_invoicing_officer")) { + // if appCtx.Session().Roles.HasRole(roles.RoleTypeTIO) { // query.Where("moves.status = 'PAYMENT REQUESTED' or moves.status = 'REVIEWED' or moves.status = 'REJECTED' or moves.status = 'PAID' or moves.status = 'DEPRECATED' or moves.status = 'ERROR'") // } From 1b3cc800022a8a46ddb73f79059c0bae5f877e9a Mon Sep 17 00:00:00 2001 From: Logan Cunningham Date: Tue, 27 Feb 2024 17:06:18 +0000 Subject: [PATCH 12/19] renamed search query --- src/hooks/queries.js | 2 +- src/pages/Office/QAECSRMoveSearch/QAECSRMoveSearch.jsx | 4 ++-- .../ServicesCounselingQueue/ServicesCounselingQueue.jsx | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hooks/queries.js b/src/hooks/queries.js index 92aa2ad6dc0..18e0d6f146b 100644 --- a/src/hooks/queries.js +++ b/src/hooks/queries.js @@ -821,7 +821,7 @@ export const useGHCGetMoveHistory = ({ }; }; -export const useQAECSRMoveSearchQueries = ({ +export const useMoveSearchQueries = ({ sort, order, filters = [], diff --git a/src/pages/Office/QAECSRMoveSearch/QAECSRMoveSearch.jsx b/src/pages/Office/QAECSRMoveSearch/QAECSRMoveSearch.jsx index 0599b244c46..2d4274e1221 100644 --- a/src/pages/Office/QAECSRMoveSearch/QAECSRMoveSearch.jsx +++ b/src/pages/Office/QAECSRMoveSearch/QAECSRMoveSearch.jsx @@ -3,7 +3,7 @@ import { useNavigate } from 'react-router-dom'; import styles from './QAECSRMoveSearch.module.scss'; -import { useQAECSRMoveSearchQueries } from 'hooks/queries'; +import { useMoveSearchQueries } from 'hooks/queries'; import SearchResultsTable from 'components/Table/SearchResultsTable'; import MoveSearchForm from 'components/MoveSearchForm/MoveSearchForm'; @@ -49,7 +49,7 @@ const QAECSRMoveSearch = () => { disableSortBy={false} title="Results" handleClick={handleClick} - useQueries={useQAECSRMoveSearchQueries} + useQueries={useMoveSearchQueries} moveCode={search.moveCode} dodID={search.dodID} customerName={search.customerName} diff --git a/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx b/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx index 0bf119bb424..430e8a70c19 100644 --- a/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx +++ b/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx @@ -20,7 +20,7 @@ import { useServicesCounselingQueueQueries, useServicesCounselingQueuePPMQueries, useUserQueries, - useQAECSRMoveSearchQueries, + useMoveSearchQueries, } from 'hooks/queries'; import { DATE_FORMAT_STRING } from 'shared/constants'; import { formatDateFromIso, serviceMemberAgencyLabel } from 'utils/formatters'; @@ -284,7 +284,7 @@ const ServicesCounselingQueue = () => { disableSortBy={false} title="Results" handleClick={handleClick} - useQueries={useQAECSRMoveSearchQueries} + useQueries={useMoveSearchQueries} moveCode={search.moveCode} dodID={search.dodID} customerName={search.customerName} From 2c5fb8f1cce5706810b5b728656dde16b572076b Mon Sep 17 00:00:00 2001 From: Logan Cunningham Date: Tue, 27 Feb 2024 18:21:27 +0000 Subject: [PATCH 13/19] fixed filtering on services counselor --- pkg/services/move/move_searcher.go | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/pkg/services/move/move_searcher.go b/pkg/services/move/move_searcher.go index efe207b9b83..30531109937 100644 --- a/pkg/services/move/move_searcher.go +++ b/pkg/services/move/move_searcher.go @@ -66,14 +66,23 @@ func (s moveSearcher) SearchMoves(appCtx appcontext.AppContext, params *services // Services Counselor Statuses if appCtx.Session().Roles.HasRole(roles.RoleTypeServicesCounselor) { - query.Where("moves.status = 'NEEDS SERVICE COUNSELING' OR moves.status = 'SERVICE COUNSELING COMPLETED'") + query = appCtx.DB().EagerPreload( + "MTOShipments", + "Orders.ServiceMember", + "Orders.NewDutyLocation.Address", + "Orders.OriginDutyLocation.Address", + ). + Join("orders", "orders.id = moves.orders_id"). + Join("service_members", "service_members.id = orders.service_member_id"). + LeftJoin("duty_locations as origin_duty_locations", "origin_duty_locations.id = orders.origin_duty_location_id"). + Join("addresses as origin_addresses", "origin_addresses.id = origin_duty_locations.address_id"). + Join("duty_locations as new_duty_locations", "new_duty_locations.id = orders.new_duty_location_id"). + Join("addresses as new_addresses", "new_addresses.id = new_duty_locations.address_id"). + LeftJoin("mto_shipments", "mto_shipments.move_id = moves.id AND mto_shipments.status <> 'DRAFT'"). + GroupBy("moves.id", "service_members.id", "origin_addresses.id", "new_addresses.id"). + Where("show = TRUE and (moves.status = 'NEEDS SERVICE COUNSELING' OR moves.status = 'SERVICE COUNSELING COMPLETED')") } - // TIO Statuses - // if appCtx.Session().Roles.HasRole(roles.RoleTypeTIO) { - // query.Where("moves.status = 'PAYMENT REQUESTED' or moves.status = 'REVIEWED' or moves.status = 'REJECTED' or moves.status = 'PAID' or moves.status = 'DEPRECATED' or moves.status = 'ERROR'") - // } - customerNameQuery := customerNameSearch(params.CustomerName) locatorQuery := locatorFilter(params.Locator) dodIDQuery := dodIDFilter(params.DodID) From 5386944dd13367b7da97c04eb1ed1577d61a960d Mon Sep 17 00:00:00 2001 From: Logan Cunningham Date: Tue, 27 Feb 2024 18:37:31 +0000 Subject: [PATCH 14/19] added submitted and approved status to move searcher query for services counselor and updated tab names --- pkg/services/move/move_searcher.go | 36 ++++++++++--------- .../ServicesCounselingQueue.jsx | 4 +-- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/pkg/services/move/move_searcher.go b/pkg/services/move/move_searcher.go index 30531109937..ea802243aa6 100644 --- a/pkg/services/move/move_searcher.go +++ b/pkg/services/move/move_searcher.go @@ -48,21 +48,25 @@ func (s moveSearcher) SearchMoves(appCtx appcontext.AppContext, params *services return nil, 0, err } - query := appCtx.DB().EagerPreload( - "MTOShipments", - "Orders.ServiceMember", - "Orders.NewDutyLocation.Address", - "Orders.OriginDutyLocation.Address", - ). - Join("orders", "orders.id = moves.orders_id"). - Join("service_members", "service_members.id = orders.service_member_id"). - LeftJoin("duty_locations as origin_duty_locations", "origin_duty_locations.id = orders.origin_duty_location_id"). - Join("addresses as origin_addresses", "origin_addresses.id = origin_duty_locations.address_id"). - Join("duty_locations as new_duty_locations", "new_duty_locations.id = orders.new_duty_location_id"). - Join("addresses as new_addresses", "new_addresses.id = new_duty_locations.address_id"). - LeftJoin("mto_shipments", "mto_shipments.move_id = moves.id AND mto_shipments.status <> 'DRAFT'"). - GroupBy("moves.id", "service_members.id", "origin_addresses.id", "new_addresses.id"). - Where("show = TRUE") + var query *pop.Query + + if appCtx.Session().Roles.HasRole(roles.RoleTypeQaeCsr) { + query = appCtx.DB().EagerPreload( + "MTOShipments", + "Orders.ServiceMember", + "Orders.NewDutyLocation.Address", + "Orders.OriginDutyLocation.Address", + ). + Join("orders", "orders.id = moves.orders_id"). + Join("service_members", "service_members.id = orders.service_member_id"). + LeftJoin("duty_locations as origin_duty_locations", "origin_duty_locations.id = orders.origin_duty_location_id"). + Join("addresses as origin_addresses", "origin_addresses.id = origin_duty_locations.address_id"). + Join("duty_locations as new_duty_locations", "new_duty_locations.id = orders.new_duty_location_id"). + Join("addresses as new_addresses", "new_addresses.id = new_duty_locations.address_id"). + LeftJoin("mto_shipments", "mto_shipments.move_id = moves.id AND mto_shipments.status <> 'DRAFT'"). + GroupBy("moves.id", "service_members.id", "origin_addresses.id", "new_addresses.id"). + Where("show = TRUE") + } // Services Counselor Statuses if appCtx.Session().Roles.HasRole(roles.RoleTypeServicesCounselor) { @@ -80,7 +84,7 @@ func (s moveSearcher) SearchMoves(appCtx appcontext.AppContext, params *services Join("addresses as new_addresses", "new_addresses.id = new_duty_locations.address_id"). LeftJoin("mto_shipments", "mto_shipments.move_id = moves.id AND mto_shipments.status <> 'DRAFT'"). GroupBy("moves.id", "service_members.id", "origin_addresses.id", "new_addresses.id"). - Where("show = TRUE and (moves.status = 'NEEDS SERVICE COUNSELING' OR moves.status = 'SERVICE COUNSELING COMPLETED')") + Where("show = TRUE and (moves.status = 'SUBMITTED' OR moves.status = 'NEEDS SERVICE COUNSELING' OR moves.status = 'SERVICE COUNSELING COMPLETED' OR moves.status = 'APPROVED')") } customerNameQuery := customerNameSearch(params.CustomerName) diff --git a/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx b/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx index 430e8a70c19..0a4de238c65 100644 --- a/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx +++ b/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx @@ -243,7 +243,7 @@ const ServicesCounselingQueue = () => { to={servicesCounselingRoutes.BASE_QUEUE_COUNSELING_PATH} > - Counseling + Counseling Queue , { to={servicesCounselingRoutes.BASE_QUEUE_CLOSEOUT_PATH} > - PPM Closeout + PPM Closeout Queue , Date: Tue, 27 Feb 2024 18:56:27 +0000 Subject: [PATCH 15/19] removed submitted status --- pkg/services/move/move_searcher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/services/move/move_searcher.go b/pkg/services/move/move_searcher.go index ea802243aa6..1415be628e6 100644 --- a/pkg/services/move/move_searcher.go +++ b/pkg/services/move/move_searcher.go @@ -84,7 +84,7 @@ func (s moveSearcher) SearchMoves(appCtx appcontext.AppContext, params *services Join("addresses as new_addresses", "new_addresses.id = new_duty_locations.address_id"). LeftJoin("mto_shipments", "mto_shipments.move_id = moves.id AND mto_shipments.status <> 'DRAFT'"). GroupBy("moves.id", "service_members.id", "origin_addresses.id", "new_addresses.id"). - Where("show = TRUE and (moves.status = 'SUBMITTED' OR moves.status = 'NEEDS SERVICE COUNSELING' OR moves.status = 'SERVICE COUNSELING COMPLETED' OR moves.status = 'APPROVED')") + Where("show = TRUE and (moves.status = 'NEEDS SERVICE COUNSELING' OR moves.status = 'SERVICE COUNSELING COMPLETED' OR moves.status = 'APPROVED')") } customerNameQuery := customerNameSearch(params.CustomerName) From 18a606959d3b477203e1228b81f3394a73c375f0 Mon Sep 17 00:00:00 2001 From: Logan Cunningham Date: Tue, 27 Feb 2024 19:21:45 +0000 Subject: [PATCH 16/19] update tests to match new tab names --- .../ServicesCounselingQueue/ServicesCounselingQueue.test.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.test.jsx b/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.test.jsx index 3c1ef5232e7..84e8c8931dd 100644 --- a/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.test.jsx +++ b/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.test.jsx @@ -335,7 +335,7 @@ describe('ServicesCounselingQueue', () => { if (showsCounselingTab === 'counseling') { // Make sure "Counseling" is the active tab. - const counselingActive = screen.getByText('Counseling', { selector: '.usa-current .tab-title' }); + const counselingActive = screen.getByText('Counseling Queue', { selector: '.usa-current .tab-title' }); expect(counselingActive).toBeInTheDocument(); // Check for the "Counseling" columns. @@ -345,7 +345,7 @@ describe('ServicesCounselingQueue', () => { expect(screen.getByText(/Origin GBLOC/)).toBeInTheDocument(); } else if (showsCounselingTab === 'closeout') { // Make sure "PPM Closeout" is the active tab. - const ppmCloseoutActive = screen.getByText('PPM Closeout', { selector: '.usa-current .tab-title' }); + const ppmCloseoutActive = screen.getByText('PPM Closeout Queue', { selector: '.usa-current .tab-title' }); expect(ppmCloseoutActive).toBeInTheDocument(); // Check for the "PPM Closeout" columns. From 7dad31fb6be85b7992ec65227d9a3084f77e4433 Mon Sep 17 00:00:00 2001 From: Logan Cunningham Date: Wed, 28 Feb 2024 16:03:00 +0000 Subject: [PATCH 17/19] fixed issue when filtering in search where you can't clear filters if there's no results, fixed pagination being blocked by QueryDevTools, added all statuses for SC search, cleaned up query for search --- pkg/gen/ghcapi/embedded_spec.go | 2 + .../ghcapi/ghcoperations/move/search_moves.go | 2 +- pkg/services/move/move_searcher.go | 21 +------- pkg/services/move/move_searcher_test.go | 40 --------------- src/components/Table/SearchResultsTable.jsx | 49 +++++++++---------- src/components/Table/Table.module.scss | 1 + src/constants/queues.js | 5 +- swagger-def/ghc.yaml | 1 + swagger/ghc.yaml | 1 + 9 files changed, 34 insertions(+), 88 deletions(-) diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go index 10ed56323dd..410d120b4a9 100644 --- a/pkg/gen/ghcapi/embedded_spec.go +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -1634,6 +1634,7 @@ func init() { "items": { "type": "string", "enum": [ + "DRAFT", "SUBMITTED", "APPROVALS REQUESTED", "APPROVED", @@ -12410,6 +12411,7 @@ func init() { "items": { "type": "string", "enum": [ + "DRAFT", "SUBMITTED", "APPROVALS REQUESTED", "APPROVED", diff --git a/pkg/gen/ghcapi/ghcoperations/move/search_moves.go b/pkg/gen/ghcapi/ghcoperations/move/search_moves.go index 81178c64d40..0fc2e80755e 100644 --- a/pkg/gen/ghcapi/ghcoperations/move/search_moves.go +++ b/pkg/gen/ghcapi/ghcoperations/move/search_moves.go @@ -298,7 +298,7 @@ var searchMovesBodyStatusItemsEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["SUBMITTED","APPROVALS REQUESTED","APPROVED","NEEDS SERVICE COUNSELING","SERVICE COUNSELING COMPLETED"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["DRAFT","SUBMITTED","APPROVALS REQUESTED","APPROVED","NEEDS SERVICE COUNSELING","SERVICE COUNSELING COMPLETED"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/pkg/services/move/move_searcher.go b/pkg/services/move/move_searcher.go index 1415be628e6..a9d9b13f2c5 100644 --- a/pkg/services/move/move_searcher.go +++ b/pkg/services/move/move_searcher.go @@ -50,7 +50,7 @@ func (s moveSearcher) SearchMoves(appCtx appcontext.AppContext, params *services var query *pop.Query - if appCtx.Session().Roles.HasRole(roles.RoleTypeQaeCsr) { + if appCtx.Session().Roles.HasRole(roles.RoleTypeQaeCsr) || appCtx.Session().Roles.HasRole(roles.RoleTypeServicesCounselor) { query = appCtx.DB().EagerPreload( "MTOShipments", "Orders.ServiceMember", @@ -68,25 +68,6 @@ func (s moveSearcher) SearchMoves(appCtx appcontext.AppContext, params *services Where("show = TRUE") } - // Services Counselor Statuses - if appCtx.Session().Roles.HasRole(roles.RoleTypeServicesCounselor) { - query = appCtx.DB().EagerPreload( - "MTOShipments", - "Orders.ServiceMember", - "Orders.NewDutyLocation.Address", - "Orders.OriginDutyLocation.Address", - ). - Join("orders", "orders.id = moves.orders_id"). - Join("service_members", "service_members.id = orders.service_member_id"). - LeftJoin("duty_locations as origin_duty_locations", "origin_duty_locations.id = orders.origin_duty_location_id"). - Join("addresses as origin_addresses", "origin_addresses.id = origin_duty_locations.address_id"). - Join("duty_locations as new_duty_locations", "new_duty_locations.id = orders.new_duty_location_id"). - Join("addresses as new_addresses", "new_addresses.id = new_duty_locations.address_id"). - LeftJoin("mto_shipments", "mto_shipments.move_id = moves.id AND mto_shipments.status <> 'DRAFT'"). - GroupBy("moves.id", "service_members.id", "origin_addresses.id", "new_addresses.id"). - Where("show = TRUE and (moves.status = 'NEEDS SERVICE COUNSELING' OR moves.status = 'SERVICE COUNSELING COMPLETED' OR moves.status = 'APPROVED')") - } - customerNameQuery := customerNameSearch(params.CustomerName) locatorQuery := locatorFilter(params.Locator) dodIDQuery := dodIDFilter(params.DodID) diff --git a/pkg/services/move/move_searcher_test.go b/pkg/services/move/move_searcher_test.go index ce26980cc01..4f554dce4e1 100644 --- a/pkg/services/move/move_searcher_test.go +++ b/pkg/services/move/move_searcher_test.go @@ -431,43 +431,3 @@ func (suite *MoveServiceSuite) TestMoveSearchOrdering() { } }) } - -func (suite *MoveServiceSuite) TestShowServicesCounselorsResults() { - suite.Run("search results when logged in as a services counselor", func() { - firstMove, secondMove := setupTestData(suite) - testMoves := models.Moves{} - - officeUser := factory.BuildOfficeUserWithRoles(suite.DB(), nil, []roles.RoleType{roles.RoleTypeServicesCounselor}) - session := auth.Session{ - ApplicationName: auth.OfficeApp, - Roles: officeUser.User.Roles, - OfficeUserID: officeUser.ID, - } - - suite.NoError(suite.DB().EagerPreload("Orders", "Orders.NewDutyLocation", "Orders.NewDutyLocation.Address").All(&testMoves)) - - searcher := NewMoveSearcher() - columns := []string{"status", "originPostalCode", "destinationPostalCode", "branch", "shipmentsCount"} - for _, order := range []string{"asc", "desc"} { - order := order - for ci, col := range columns { - params := services.SearchMovesParams{ - CustomerName: models.StringPointer("maria johnson"), - Sort: &columns[ci], - Order: &order, - } - moves, _, err := searcher.SearchMoves(suite.AppContextWithSessionForTest(&session), ¶ms) - suite.NoError(err) - suite.Len(moves, 1) - message := fmt.Sprintf("Sort by %s, %s failed", col, order) - if order == "asc" { - suite.Equal(secondMove.Locator, moves[0].Locator, message) - } else { - suite.Equal(secondMove.Locator, moves[0].Locator, message) - } - - suite.NotEqual(firstMove.Locator, moves[0].Locator) - } - } - }) -} diff --git a/src/components/Table/SearchResultsTable.jsx b/src/components/Table/SearchResultsTable.jsx index 775de453840..e48e2ea7373 100644 --- a/src/components/Table/SearchResultsTable.jsx +++ b/src/components/Table/SearchResultsTable.jsx @@ -203,6 +203,7 @@ const SearchResultsTable = (props) => { // Update filters when we get a new search or a column filter is edited useEffect(() => { + setParamFilters([]); const filtersToAdd = []; if (moveCode) { filtersToAdd.push({ id: 'locator', value: moveCode }); @@ -222,32 +223,28 @@ const SearchResultsTable = (props) => { return (

{`${title} (${totalCount})`}

- {totalCount > 0 ? ( -
-
- - ) : ( -

No results found.

- )} +
+
+ ); }; diff --git a/src/components/Table/Table.module.scss b/src/components/Table/Table.module.scss index 101fd806098..06ddde33dc8 100644 --- a/src/components/Table/Table.module.scss +++ b/src/components/Table/Table.module.scss @@ -95,6 +95,7 @@ @include u-padding(1); @include u-margin-top(1); @include u-margin-bottom(0); + @include u-margin-right(3); display: flex; align-items: center; diff --git a/src/constants/queues.js b/src/constants/queues.js index f2893192b35..8c171986021 100644 --- a/src/constants/queues.js +++ b/src/constants/queues.js @@ -16,15 +16,18 @@ export const MOVE_STATUS_OPTIONS = [ export const MOVE_STATUS_LABELS = { [MOVE_STATUSES.DRAFT]: 'Draft', [MOVE_STATUSES.SUBMITTED]: 'New move', - [MOVE_STATUSES.SERVICE_COUNSELING_COMPLETED]: 'New move', + [MOVE_STATUSES.SERVICE_COUNSELING_COMPLETED]: 'Service Counseling Completed', [MOVE_STATUSES.NEEDS_SERVICE_COUNSELING]: 'Needs Service Counseling', [MOVE_STATUSES.APPROVALS_REQUESTED]: 'Approvals requested', [MOVE_STATUSES.APPROVED]: 'Move approved', }; export const SERVICE_COUNSELING_MOVE_STATUS_OPTIONS = [ + { value: MOVE_STATUSES.DRAFT, label: 'Draft' }, + { value: MOVE_STATUSES.SUBMITTED, label: 'New Move' }, { value: MOVE_STATUSES.NEEDS_SERVICE_COUNSELING, label: 'Needs counseling' }, { value: MOVE_STATUSES.SERVICE_COUNSELING_COMPLETED, label: 'Service counseling completed' }, + { value: MOVE_STATUSES.APPROVED, label: 'Move Approved' }, ]; export const SERVICE_COUNSELING_MOVE_STATUS_LABELS = { diff --git a/swagger-def/ghc.yaml b/swagger-def/ghc.yaml index ef519198aeb..2741d300aaf 100644 --- a/swagger-def/ghc.yaml +++ b/swagger-def/ghc.yaml @@ -3067,6 +3067,7 @@ paths: items: type: string enum: + - DRAFT - SUBMITTED - APPROVALS REQUESTED - APPROVED diff --git a/swagger/ghc.yaml b/swagger/ghc.yaml index 1305ec0ff7e..9fd7483fdf0 100644 --- a/swagger/ghc.yaml +++ b/swagger/ghc.yaml @@ -3190,6 +3190,7 @@ paths: items: type: string enum: + - DRAFT - SUBMITTED - APPROVALS REQUESTED - APPROVED From c774385fc8bfc6b09f293ca361500a704b204d62 Mon Sep 17 00:00:00 2001 From: Logan Cunningham Date: Wed, 28 Feb 2024 16:47:07 +0000 Subject: [PATCH 18/19] readded no results text to queue --- src/components/Table/SearchResultsTable.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Table/SearchResultsTable.jsx b/src/components/Table/SearchResultsTable.jsx index e48e2ea7373..ec955de532c 100644 --- a/src/components/Table/SearchResultsTable.jsx +++ b/src/components/Table/SearchResultsTable.jsx @@ -244,6 +244,7 @@ const SearchResultsTable = (props) => { pageCount={pageCount} pageOptions={pageOptions} /> + {totalCount > 0 ?

No results found.

: null} ); From 7397ec99d5d7dca7e416eb96cd66e8f0fb213beb Mon Sep 17 00:00:00 2001 From: Logan Cunningham Date: Wed, 28 Feb 2024 17:39:55 +0000 Subject: [PATCH 19/19] fixed playwright test --- playwright/tests/office/qaecsr/moveSearchFlows.spec.js | 2 +- src/components/Table/SearchResultsTable.jsx | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/playwright/tests/office/qaecsr/moveSearchFlows.spec.js b/playwright/tests/office/qaecsr/moveSearchFlows.spec.js index 14180a8c6d8..e617b4f1d48 100644 --- a/playwright/tests/office/qaecsr/moveSearchFlows.spec.js +++ b/playwright/tests/office/qaecsr/moveSearchFlows.spec.js @@ -103,6 +103,6 @@ test.describe('QAE/CSR Move Search', () => { // Verify no results await expect(page.locator('[data-testid=table-queue] > h2')).toContainText('Results (0)'); - await expect(page.locator('[data-testid=table-queue] > p')).toContainText('No results found.'); + await expect(page.locator('[data-testid=table-queue] > h2')).toContainText('No results found.'); }); }); diff --git a/src/components/Table/SearchResultsTable.jsx b/src/components/Table/SearchResultsTable.jsx index ec955de532c..2c443325181 100644 --- a/src/components/Table/SearchResultsTable.jsx +++ b/src/components/Table/SearchResultsTable.jsx @@ -222,7 +222,9 @@ const SearchResultsTable = (props) => { return (
-

{`${title} (${totalCount})`}

+

+ {`${title} (${totalCount})`} {totalCount > 0 ? null :

No results found.

} +

{ pageCount={pageCount} pageOptions={pageOptions} /> - {totalCount > 0 ?

No results found.

: null} );