Skip to content

Commit

Permalink
Merge HHS (#487)
Browse files Browse the repository at this point in the history
* Bump validator from 13.6.0 to 13.7.0

Bumps [validator](https://github.com/validatorjs/validator.js) from 13.6.0 to 13.7.0.
- [Release notes](https://github.com/validatorjs/validator.js/releases)
- [Changelog](https://github.com/validatorjs/validator.js/blob/master/CHANGELOG.md)
- [Commits](validatorjs/validator.js@13.6.0...13.7.0)

---
updated-dependencies:
- dependency-name: validator
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* welcoming robots in certain situations

* Update known vulnerabilities

* trying a different approach in the config

* is this how we set vars?

* fix var name

* test on dev since sandbox does not do what I thought

* update trusworks with modal changes

* need to learn how to do bash

* more bash better

* for christmas sake

* testing complete

* fix bash script var names

* updated file uploader modal

* updated external resource modal

* move logic to circlci config

* awaken robot on prod

* Update .circleci/config.yml

Co-authored-by: Josh Salisbury <[email protected]>

* add approvedat migration

* update approvedAt on approval

* clean up constants, add new one

* add approved and created dates to fe landing page

* add approved and created date to csv download

* remove console statement

* fixing tests

* fixed modal unit tests

* updated my alert test

* fixed modal tests for external resource

* partial fixes for ui tests

* clean up prop type

* cleanup UI tests

* more unit test fixes for trussworks2

* idle modal test fixes

* add backend tests

* fixed accessibility issue and added test coverage

* add target populations to ar

* add approved and created date to ar, table css fixes

* fix failing ui test

* fix failing tooltip test

* unique id value

* update known issues

* fix axe

* Update known vulnerabilities

* fix axe again

* fix axe issues again

* try heading axe fix

* update test for axe

* update

* see if remvoing display none fixes issue

* hide headings

* limit number of headings

* added cusom accordion with heading size prop

* added test for accordion

* fix capitalizations while we're here

* fixes based on Kryss comments

* linter fixes

* audit vuln

* change unlock report button css to outline

* remove to be deleted files from test coverage

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: unknown <[email protected]>
Co-authored-by: Adam Levin <[email protected]>
Co-authored-by: Josh Salisbury <[email protected]>
Co-authored-by: Adam Levin <[email protected]>
  • Loading branch information
6 people authored Nov 15, 2021
1 parent 1d127e4 commit 4ef0353
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@
"<rootDir>/src/pages/NotFound/index.js",
"<rootDir>/src/polyfills.js",
"<rootDir>/src/pages/Widgets/index.js",
"<rootDir>/src/widgets/Example.js"
"<rootDir>/src/widgets/Example.js",
"<rootDir>/src/pages/RegionalDashboard/formatDateRange.js",
"<rootDir>/src/pages/RegionalDashboard/constants.js"
],
"coverageThreshold": {
"global": {
Expand Down
15 changes: 15 additions & 0 deletions frontend/src/pages/RegionalDashboard/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export const DATETIME_DATE_FORMAT = 'YYYY/MM/DD';

export const DATE_OPTIONS = [
{
label: 'Last 30 Days',
value: 1,
},
{
label: 'Custom Date Range',
value: 2,
},
];

export const LAST_THIRTY_DAYS = DATE_OPTIONS[0].value;
export const CUSTOM_DATE_RANGE = DATE_OPTIONS[1].value;
39 changes: 39 additions & 0 deletions frontend/src/pages/RegionalDashboard/formatDateRange.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import moment from 'moment';
import { DATETIME_DATE_FORMAT } from './constants';
import { DATE_DISPLAY_FORMAT as DATE_FORMAT } from '../../Constants';

export default function formatDateRange(format = {
lastThirtyDays: false, withSpaces: false, forDateTime: false, sep: '-', string: '',
}) {
const selectedFormat = format.forDateTime ? DATETIME_DATE_FORMAT : DATE_FORMAT;

let { sep } = format;

if (!format.sep) {
sep = '-';
}
if (format.lastThirtyDays) {
const today = moment();
const thirtyDaysAgo = moment().subtract(30, 'days');

if (format.withSpaces) {
return `${thirtyDaysAgo.format(selectedFormat)} ${sep} ${today.format(selectedFormat)}`;
}

return `${thirtyDaysAgo.format(selectedFormat)}${sep}${today.format(selectedFormat)}`;
}

if (format.string) {
const dates = format.string.split('-');

if (dates && dates.length > 1) {
if (format.withSpaces) {
return `${moment(dates[0], DATETIME_DATE_FORMAT).format(selectedFormat)} ${sep} ${moment(dates[1], DATETIME_DATE_FORMAT).format(selectedFormat)}`;
}

return `${moment(dates[0], DATETIME_DATE_FORMAT).format(selectedFormat)}${sep}${moment(dates[1], DATETIME_DATE_FORMAT).format(selectedFormat)}`;
}
}

return '';
}

0 comments on commit 4ef0353

Please sign in to comment.