-
Notifications
You must be signed in to change notification settings - Fork 14
Bugfix: Fix date format helper #2904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
🧪 Review environmenthttps://fkios73lu77wb4zwpydymby3ey0mpahh.lambda-url.ca-central-1.on.aws/ |
thiessenp-cds
approved these changes
Nov 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Works as expected and tests pass. LGTM :)
Merged
dsamojlenko
added a commit
that referenced
this pull request
Nov 28, 2023
* Add API endpoint to support downloading multiple submissions in requested format (#2793) * Add API endpoint to support downloading multiple submissions in requested format * Setup new static HTML download transformer * Add dynamic type for Responses * Setup tailwind/customcss * Add fake translation lib * types * Flesh out html * Add html endpoint * cleaner imports * rename table * refactor to folders * Update styles * Only GoC branding * style fixes * style * Trim ids * Add json format * Massage data a bit more before passing into transformers * Fix up transformers * no need to cast * styles update * type updates * HTML download table implement/refactor * Add question type, join simple arrays * Move components into subfolder * JSON default response, unused import * Quick iteration on HTML downloads frontend * unused import * Update last downloaded * Update by name not id * delete css output file * add readme * Better response for not found * Revert download code * Render dynamic rows in csv * cleanup dynamic row output * Update retrieve syntax * Cast date * Unused import * Placholder for html-zipped * Refactor updateLastDownloadedBy to accept array of responses, use Transact update * Add lang=fr around french section * Refactor a bit cleaner * Refactor logging to individual * Handle unprocessedKeys when hitting limits * typo * Update to chunk responses to accommodate limits of TransactWrite * bugfix * Log errors * Add some comments * comments * Move helper up * move script * remove unused styles * Add zipped-html download option * Make csv header row bilingual * Make csv dynamic row labels bilingual * add bad format error * rename file for clarity * log after updating lastDownloadedBy * Type and response formatting cleanup/refactor * Add explicit json format * Use i18next instead of custom function * add ts alias to public folder * Add french to header row * Add ExpressionAttributeNames * simplify return * no need for null operator * Use toString() * Update batchGet to lib-dynamodb * Update transactWrite to lib-dynamodb * Not a string * fix some types * removed unused import --------- Co-authored-by: Clément Janin <[email protected]> * Wire up download button to new downloadable formats API (#2829) * Update download link to new endpoint * Handle error from api * Remove old endpoint and HTML output code * Remove old test * Configure max response downloads in Settings * Set default/fallback * Allow copy/paste multiple confirmation codes (#2834) * Allow copy/paste multiple rows of confirmation codes * Exclude header row and blank rows * Place csvHeaderRow strings in shareable place * Take a different approach use isUUID * bump * Add JSON Transformer (#2847) * Add clean JSON output * Refactor to switch/case * Add "Select all" header icon to DownloadTable (#2845) * Add check all heading link/icon * styling * Add state tracker and indeterminate state * bit of cleanup/refactor * Rename * comments/refactor * Add title to icon * add role/checked status to checkbox * Move pointer up to span * Make it keyboard operable * Refactor error states on DownloadTable (#2852) * Remove unnecessary maxItemsError * Refactor error states * Responses DownloadTable More menu and single item download (#2848) * Add More menu to Responses table with single Download and Delete placeholer * Add a bit of padding * Import our toast wrapper * Add to translations * Update with latest error refactor * Refactor Responses Download button to component (#2849) * Refactor Download button and handler to component * unused imports * simplify signature * remove comment * unused import * Redundant * Move some checks up * Refactor CheckAll to separate component (#2853) * Refactor Check All to component * Unused import * cleanup * CheckAll Tooltip and small refactor (#2857) * Add SelectAll tooltip, modify tooltip to accept side, cleanup * add wrapper and accept string * Bit of cleanup * Add DownloadTable status filters (#2856) * Add new filter placeholders * Add filters and buggy implementation * Get filter links working properly * Styling * lint * Refactor links to component * Translations * unnecessary style * fix typo * reorder classes * Refactor to use SubNavLink component * fix active status * Fix active status * Add zero-responses message and updated image * add aria-live attribute * unused import * add useEffect dependency * re-add downloadTableButtonId * Refactor: move download endpoint (#2858) Move download endpoint for consistency * Add html aggregated transformer and output (#2855) * Add codes copy to clipboard * Adds lang strings and template layout * Refactors file locations and updates a few styles * Adds more style to aggregated table * Refactoring from PR comments * Refactors scripts * Updates file to use one language for titles * Updates FIP to have a configurable show lang link * Add Download/Confirm panel to Responses (#2859) * start on bottom panel overlay * Reset reducer state on page change * Add initial state to reducer * Pull bottom panel up * Move download button to bottom panel, translation strings * rename actions panel * comment * Unused import * Bugfix/deleted is confirmed (#2866) Use Confirmed status for Deleted tab * Add confirm button and dialog to the Downloaded Responses page (#2867) * Return the confirm button * Updated strings * Add icon * Adjust alignmetn * Update content of ConfirmDialog * Use responseDownloadLimit for max confirmation codes * remove placeholder * fix test * Hide delete on confirmed (#2869) * Hide Delete when on Confirmed Responses screen * bump * Updated signature on DownloadTable * query might not exist * Only show Delete on New Responses screen (#2871) * only show delete on New * lift delete button up * Extract Delete to component and only show on New * Confirm delete new responses dialog (#2872) Add Delete new responses confirmation dialog * Hide delete new responses button (#2873) * Hide the Delete button * Hide behind a conditional * Only mark downloaded for official records (#2870) * Only set status as Downloaded when downloading official records * bit of a refactor and fixing up * Remove duplicate logs * Use responseDownloadLimit setting for listAllSubmissions query (#2874) * Use the responseDownloadLimit config option for maxConfirmationCodes and to limit the vault query * Mock setting in tests * Adds bilingual questions html aggregated (#2868) * Adds bilingual questions html aggregated * Adds more bilingual functionality * Adds bilingual headers and table links * Adds some style updates * Adds one more style change * Removes unneaded comment * Updates page language and skip to link * Updates a style --------- Co-authored-by: Dave Samojlenko <[email protected]> * Download dialog (#2876) * Add download dialog * wire up the download formats * unused import * Remove individual HTML downloads from DownloadDialog * Format date in csv and remove conf codes * Some refactoring and download both csv and html-aggregated together * Move types * finish downloading zip * Enable downloading JSON, add receipt to all download formats * move receipt out of transform * Add optional zipping for all formats * Remove commented out code * remove todo * cleanup * reset state on close * revert unrelated * import * just return * add comment * Translation strings * Add message after downloading * updated csv endpoint params * Rename zip state to zipAllFiles for clarity * Rename dialog visibility prop * fix typo * Bugfix related to clearing DownloadError state on dialog open * Handle possible no checkedItems state * Cleanup error messages that are no longer needed (#2875) * Cleanup error messages that are no longer needed * re-add the download error at bottom * feature: Add label when all responses cannot be displayed (#2879) * html aggregated intro content update (#2881) * Updates intro area content * Bugfix: potential SSR issue (#2882) Fixes potential SSR issue for url params * Additional check for formID (#2884) Check formID as UUID * Report a problem link (#2883) * Add Report a problem link below the DownloadTable * translation string * fix: Code QL security warning (#2886) * Remove isUUID check * Add "sign off" message, new titles, and confirm dialog button (#2887) * Add Sign off message and button * Unused imports * unused imports * Make titles visually hidden on zero results * Prefix downloaded file names (#2888) Update all downloaded filenames * Add number shown to "more responses" alert (#2880) * Add number of responses shown to warning message * Update public/static/locales/en/form-builder-responses.json Co-authored-by: Anik Brazeau <[email protected]> --------- Co-authored-by: Anik Brazeau <[email protected]> * fix json label (#2894) fix label * Download link instead of MoreMenu (#2889) * Render Download link instead of MoreMenu * Remove unused var * add active/hover states * use check that checkedItems does not exceed responseDownloadLimit * DownloadTable updates to titles, descriptions and columns (#2896) * Move ucfirst to clientHelpers * Migrate status columns to NextStep column * Update status strings * Add warning header row * remove downloadedBy * Tab titles and messages * Remove unused component * Adds more padding to table download header * Refactors vaultstatus check into a function * ClassNames order * Adds null check to ucfirst * Refactors table for PR * Refactors to use more enums * Removes no longer needed isStatus check * use array that was passed in for comparison --------- Co-authored-by: Peter Thiessen <[email protected]> * Download and Confirm success alerts (#2895) * show downloadsuccess alert for single downloads * unused import * checkpoint * Wire up Downloads to successAlert * Show confirm success alert * unused prop * removed router * remove old router refresh * remove old strings * unused import * Iterating bilingual content strings (#2903) * add descriptions and table statuses * update confirmation codes to receipt codes and clarify security code nomenclature * download modal content * html responses * missing french strings * Fix tests --------- Co-authored-by: Dave Samojlenko <[email protected]> * Bugfix: Fix date format helper (#2904) Fix date format function * Add confirmation code note to csv (#2902) * Add note to csv * escape quoted * Update string, move to end, add french * Fix for csv in utf8 --------- Co-authored-by: Peter Thiessen <[email protected]> * DownloadTable table row + button semantics (#2905) * Split out the download button. Keep the MoreMenu for future * Add some table row / button semantics for a11y * Add sr-only text to help readability * Add sr-only text to button * don't specify state * Remove limit on confirmation codes, fix retrieval for large numbers of responses (#2900) * Update confirm api endpoint limit to same as max downloads * Fix tests * batch requests to overcome technical limit * check for max confirm setting * update test * Update spelling on enum * update test to remove unused mock --------- Co-authored-by: Bryan Robitaille <[email protected]> * Update confirm dialog content (#2909) * Update ConfirmDialog content * Enable allow custom max-w for dialogs * Fix content jumping for card (#2910) update card alignment * Enhance response generator function. * Escape all csv columns (#2916) Escape CSV column output to prevent conversion to formula * Disable xlsx endpoint and remove package (#2919) * comment out reference to node-xlsx * Remove unused mock in test * Fix logic check in unprocessed cache * Add comment description * protected against unkown status request * Slight refactor on logging for download --------- Co-authored-by: Clément Janin <[email protected]> Co-authored-by: Pete <[email protected]> Co-authored-by: Bryan Robitaille <[email protected]> Co-authored-by: Anik Brazeau <[email protected]> Co-authored-by: Tim Arney <[email protected]> Co-authored-by: Peter Thiessen <[email protected]> Co-authored-by: Bryan Robitaille <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary | Résumé
In some environments the test for the formatDate helper method started to fail. This is because Node 19 included a change to the
toLocaleDateString("en-CA"...
date format, so dates started coming out asmm/dd/yyyy
instead ofyyyy-mm-dd
. See: nodejs/node#45945This PR updates the helper to just use the ISO8601 date, splitting off the time part.