diff --git a/client/COPY.json b/client/COPY.json index c9fad28a95c..02c9fd85d1f 100644 --- a/client/COPY.json +++ b/client/COPY.json @@ -328,7 +328,7 @@ "ORGANIZATIONAL_QUEUE_PAGE_ASSIGNED_TAB_TITLE": "Assigned (%d)", "ORGANIZATIONAL_QUEUE_PAGE_IN_PROGRESS_TAB_TITLE": "In Progress (%d)", "ORGANIZATIONAL_QUEUE_ON_HOLD_TAB_TITLE": "On Hold (%d)", - "VHA_QUEUE_PAGE_COMPLETE_TASKS_DESCRIPTION": "Cases completed:", + "VHA_QUEUE_PAGE_COMPLETE_TASKS_DESCRIPTION": "Cases completed", "VHA_QUEUE_PAGE_COMPLETE_TASKS_DESCRIPTION_WITH_FILTER": "Cases completed (%s)", "EDUCATION_RPO_QUEUE_PAGE_COMPLETED_TASKS_DESCRIPTION": "Cases completed in the last 7 days:", "VHA_ORGANIZATIONAL_QUEUE_PAGE_READY_FOR_REVIEW_TAB_TITLE": "Ready for Review", diff --git a/client/app/components/DatePicker.jsx b/client/app/components/DatePicker.jsx index 0a7817d2c84..4133b23c128 100644 --- a/client/app/components/DatePicker.jsx +++ b/client/app/components/DatePicker.jsx @@ -161,6 +161,13 @@ class DatePicker extends React.PureComponent { apply() { const { onChange } = this.props; + if (this.state.mode === 'all') { + this.clearFilter(); + this.hideDropdown(); + + return true; + } + if (onChange) { onChange(`${this.state.mode },${ this.state.startDate },${ this.state.endDate}`); } @@ -225,6 +232,8 @@ class DatePicker extends React.PureComponent { } } else if (this.state.mode !== '') { disabled = this.state.startDate === ''; + } else if (this.state.mode === 'all') { + disabled = false; } return disabled; @@ -243,19 +252,22 @@ class DatePicker extends React.PureComponent { } updateMode = (mode) => { + const format = 'YYYY-MM-DD'; + this.setState({ mode }); if (mode !== 'between') { this.setState({ endDate: '' }); } if (mode === 'last7') { - this.setState({ startDate: moment().subtract(7, 'days') }); + this.setState({ startDate: moment().subtract(7, 'days'). + format(format) }); } else if (mode === 'last30') { - this.setState({ startDate: moment().subtract(30, 'days') }); + this.setState({ startDate: moment().subtract(30, 'days'). + format(format) }); } else if (mode === 'last365') { - this.setState({ startDate: moment().subtract(365, 'days') }); - } else if (mode === 'all') { - this.setState({ startDate: moment().subtract(300, 'years') }); + this.setState({ startDate: moment().subtract(365, 'days'). + format(format) }); } } diff --git a/client/app/nonComp/components/NonCompTabs.jsx b/client/app/nonComp/components/NonCompTabs.jsx index 46109b3097e..2701bc75a2b 100644 --- a/client/app/nonComp/components/NonCompTabs.jsx +++ b/client/app/nonComp/components/NonCompTabs.jsx @@ -52,7 +52,9 @@ const NonCompTabsUnconnected = (props) => { const buildCompletedTabDescriptionFromFilter = (filters) => { const completedDateFilter = filters.find((value) => value.includes('col=completedDateColumn')); - if (completedDateFilter) { + if (!isVhaBusinessLine) { + return COPY.QUEUE_PAGE_COMPLETE_LAST_SEVEN_DAYS_TASKS_DESCRIPTION; + } else if (completedDateFilter) { const match = completedDateFilter.match(/val=([^&]*)/); if (match) { @@ -78,11 +80,9 @@ const NonCompTabsUnconnected = (props) => { completedDateFilterModeHandlers[mode]); } - } else if (!isVhaBusinessLine) { - return COPY.QUEUE_PAGE_COMPLETE_LAST_SEVEN_DAYS_TASKS_DESCRIPTION; } - return COPY.QUEUE_PAGE_COMPLETE_TASKS_DESCRIPTION; + return COPY.VHA_QUEUE_PAGE_COMPLETE_TASKS_DESCRIPTION; }; diff --git a/client/app/queue/QueueTable.jsx b/client/app/queue/QueueTable.jsx index 90f7aa53333..71a7f8d3a55 100644 --- a/client/app/queue/QueueTable.jsx +++ b/client/app/queue/QueueTable.jsx @@ -423,7 +423,7 @@ export default class QueueTable extends React.PureComponent { }); } - return filters; + return _.omit(filters, 'undefined'); }; defaultRowClassNames = () => ''; diff --git a/client/test/app/components/DatePicker.test.js b/client/test/app/components/DatePicker.test.js index eada26082f6..4a6996555e6 100644 --- a/client/test/app/components/DatePicker.test.js +++ b/client/test/app/components/DatePicker.test.js @@ -157,7 +157,7 @@ describe('DatePicker', () => { clickSubmissionButton('Apply Filter'); - expect(handleChange).toHaveBeenCalledWith('last7,Wed Jan 10 2024 02:00:00 GMT-0500,'); + expect(handleChange).toHaveBeenCalledWith('last7,2024-01-10,'); }); it('quick select options can select last 30 days', async () => { @@ -173,7 +173,7 @@ describe('DatePicker', () => { clickSubmissionButton('Apply Filter'); - expect(handleChange).toHaveBeenCalledWith('last30,Mon Dec 18 2023 02:00:00 GMT-0500,'); + expect(handleChange).toHaveBeenCalledWith('last30,2023-12-18,'); }); it('quick select options can select last 365 days', async () => { @@ -189,7 +189,7 @@ describe('DatePicker', () => { clickSubmissionButton('Apply Filter'); - expect(handleChange).toHaveBeenCalledWith('last365,Tue Jan 17 2023 02:00:00 GMT-0500,'); + expect(handleChange).toHaveBeenCalledWith('last365,2023-01-17,'); }); it('disables Apply Filter button if between is selected and the start date is after the end date', () => { diff --git a/client/test/app/nonComp/NonCompTabs.test.js b/client/test/app/nonComp/NonCompTabs.test.js index a85b9590731..d08de1d322f 100644 --- a/client/test/app/nonComp/NonCompTabs.test.js +++ b/client/test/app/nonComp/NonCompTabs.test.js @@ -178,7 +178,7 @@ describe('NonCompTabsVha', () => { await waitFor(() => { // expect(screen.getByText('Cases completed (last 7 days):')).toBeInTheDocument(); - expect(screen.getByText('Cases completed:')).toBeInTheDocument(); + expect(screen.getByText('Cases completed')).toBeInTheDocument(); }); // Check for the correct completed tasks header values diff --git a/spec/feature/non_comp/reviews_spec.rb b/spec/feature/non_comp/reviews_spec.rb index b048313b660..c330b9f69c6 100644 --- a/spec/feature/non_comp/reviews_spec.rb +++ b/spec/feature/non_comp/reviews_spec.rb @@ -585,7 +585,7 @@ def current_table_rows # Verify the filter counts for the completed tab click_on "Completed Tasks" - expect(page).to have_content(COPY::QUEUE_PAGE_COMPLETE_TASKS_DESCRIPTION) + expect(page).to have_content(COPY::VHA_QUEUE_PAGE_COMPLETE_TASKS_DESCRIPTION) # Turn this back on after last 7 days prefilter is added # expect(page).to have_content(COPY::QUEUE_PAGE_COMPLETE_LAST_SEVEN_DAYS_TASKS_DESCRIPTION) find("[aria-label='Filter by issue type']").click @@ -1003,7 +1003,7 @@ def current_table_rows # expect(page).to have_content("Viewing 1-2 of 2 total") # Remove these 3 once Last 7 days pre filter is added back - expect(page).to have_content("Cases completed:") + expect(page).to have_content(COPY::VHA_QUEUE_PAGE_COMPLETE_TASKS_DESCRIPTION) expect(page).to_not have_content("Date Completed (1)") expect(page).to have_content("Viewing 1-3 of 3 total")