[PER-10642] Create edtf date modal component#1052
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## PER-10641-create-edtf-date-dropdpwn-component #1052 +/- ##
=================================================================================
+ Coverage 50.96% 51.53% +0.57%
=================================================================================
Files 352 354 +2
Lines 11905 12055 +150
Branches 2122 2166 +44
=================================================================================
+ Hits 6067 6213 +146
- Misses 5613 5618 +5
+ Partials 225 224 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Same note, but base this on #1047 presumably? That will also make it clear to me / whoever is reviewing what the right order is for review and merge. Thank you! |
2a3db6f to
215f0c0
Compare
@cecilia-donnelly I have managed to do the rebase for this branch as well. Hope this helps! |
There was a problem hiding this comment.
Pull request overview
This PR introduces an EDTF “Edit date and time” modal flow for the file sidebar, expanding EDTF support to handle open/unknown interval endpoints and independent qualifiers on start vs end dates.
Changes:
- Extended
EdtfServiceinterval parsing/serialization to support empty-slot unknown endpoints (/1990-...,.../) and per-side qualifiers viaendQualifiers. - Updated the sidebar date picker display to correctly render open intervals (“Sometime before/after”) and to union qualifiers across both sides.
- Added a new
EditDateTimeModalComponent+ service, and wired the sidebar “More options” action to open it.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/app/shared/services/edtf-service/edtf.service.ts | Adds endQualifiers and updates EDTF interval parsing/serialization for unknown/open endpoints. |
| src/app/shared/services/edtf-service/edtf.service.spec.ts | Updates/extends unit tests for per-side qualifiers and empty-slot intervals. |
| src/app/file-browser/components/sidebar/sidebar.component.ts | Wires sidebar “More options” to the new edit modal and saves results to displayTime. |
| src/app/file-browser/components/sidebar/sidebar.component.spec.ts | Adds tests for opening the modal and saving/dismissing results. |
| src/app/file-browser/components/sidebar-date-picker/sidebar-date-picker.component.ts | Updates qualifier handling and renders interval rows for open/unknown ranges. |
| src/app/file-browser/components/sidebar-date-picker/sidebar-date-picker.component.spec.ts | Adds tests for new interval display + per-side qualifier behaviors. |
| src/app/file-browser/components/sidebar-date-picker/sidebar-date-picker.component.html | Refactors template to render dynamic date rows via rows() (supports open/unknown layouts). |
| src/app/file-browser/components/edit-date-time-modal/edit-date-time-modal.service.ts | New service wrapper around DialogCdkService to open the edit modal. |
| src/app/file-browser/components/edit-date-time-modal/edit-date-time-modal.service.spec.ts | Unit tests validating modal open configuration and return type. |
| src/app/file-browser/components/edit-date-time-modal/edit-date-time-modal.component.ts | New modal component implementing EDTF editing, range support, and qualifiers per side. |
| src/app/file-browser/components/edit-date-time-modal/edit-date-time-modal.component.spec.ts | Unit tests for modal initialization, qualifier toggling, EDTF preview validity, and save/cancel. |
| src/app/file-browser/components/edit-date-time-modal/edit-date-time-modal.component.scss | New styling for the edit modal. |
| src/app/file-browser/components/edit-date-time-modal/edit-date-time-modal.component.html | New modal UI for start/end date cards, qualifiers, EDTF preview, and actions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9b1c23d to
c99bc7c
Compare
215f0c0 to
a71e024
Compare
a71e024 to
3876198
Compare
60d74a5 to
c451946
Compare
In the edtf date dropdown and modal, when year, month or day have undefined digits, replace them with X values for display and leave them as empty in the inputs. PER-10641
In order to be able to input an edtf date, the modal includes components that will help with qualifiers and intervals. Issue: PER-10642
Each date in an interval now has its own Approximate / Uncertain / Unknown toggles. The sidebar reads "Sometime before/after" for open intervals and "Unknown" for unknown sides. Issue: PER-10642
Extract the detault qualifiers into a shared constant. Add a display update in the sidebar when the modal saves a new date. Issue: PER-10642
3876198 to
b6b99b9
Compare
QA InstructionsQA Testing InstructionsSummaryThis PR introduces the When enabled (under the
Test Environment Setup
Test Scenarios1. Single Date with Qualifiers
2. Single Date with Unspecified Digits
3. Open Interval
4. Unknown Interval
5. Cancel Changes
6. Start Date Greater than End Date
7. Persistence after Refresh
Regression Risks
Things to Watch For
Additional Notes
Generated by QA Instructions Action |
omnignorant
left a comment
There was a problem hiding this comment.
OK, this is working great with one exception: the test plan implies that approximate and uncertain toggles can be toggled on while the time is not blank. e.g. 1985-04-12T10:30:00% however, when I attempt to do this there's the error "The date entered is not valid. Please check the values and try again." with the save button disabled.
I don't think that has to be a blocker to merging this, but we should correct it in future improvements.
Also, and I am not sure if this is out of scope, but there is no timezone support in this PR.
|
!!! This functionality is hidden under a flag:
edtf-date. We need to make sure the flag is on only for testing, but not in production.Manual test cases — EDTF edit modal
Setup (run once before the tests):
EXPECTED: The sidebar appears with a Date section.
STEPS TO TEST:
Single date with qualifiers:
EXPECTED: The modal opens with a Start date card.
EXPECTED: The EDTF preview at the bottom of the modal reads
1985-04-12T10:30:00%.EXPECTED: The sidebar shows "April 12, 1985 • 10:30:00 AM" with "Approximate, Uncertain:" in the header.
Single date with unspecified digits:
198in the year input,05in the month, and leave the day empty.EXPECTED: The EDTF preview reads
198X-05.EXPECTED: The sidebar shows "May 198X".
Open interval:
EXPECTED: A second card titled "End date" appears.
EXPECTED: The EDTF preview reads
../1990-06-15.EXPECTED: The sidebar shows two rows with NO From / To labels:
Sometime before
June 15, 1990
EXPECTED: The EDTF preview reads
1985-04-12/...EXPECTED: The sidebar shows two rows with NO From / To labels:
Sometime after
April 12, 1985
Unknown interval:
EXPECTED: The EDTF preview reads
/1990-02-04.EXPECTED: The sidebar shows:
From: Unknown
To: February 04, 1990
EXPECTED: NO qualifier chip appears in the sidebar header.
EXPECTED: The EDTF preview reads
1985-04-12/.EXPECTED: The sidebar shows:
From: April 12, 1985
To: Unknown
Cancel:
EXPECTED: The sidebar shows "April 12, 1985".
EXPECTED: The modal closes and the sidebar still shows "April 12, 1985". No changes are persisted.
Start date greater than end date:
EXPECTED: The footer shows an error message indicating the range is invalid ("The date range is not valid. Please make sure the start date is before the end date.").
EXPECTED: The Save button is disabled.
Persistence with refresh:
EXPECTED: The sidebar shows:
From: April 12, 1985
To: June 15, 1990
EXPECTED: The header reads "Approximate, Uncertain:".
EXPECTED: The sidebar still shows the same dates and the same "Approximate, Uncertain:" header.
EXPECTED: The edit modal reopens with both cards populated, Approximate toggled in the Start card, and Uncertain toggled in the End card.