-
Notifications
You must be signed in to change notification settings - Fork 5
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
✨ OSIDB-3562: Flaw history filtering #477
base: main
Are you sure you want to change the base?
Conversation
let subject: VueWrapper<InstanceType<typeof FlawHistory>>; | ||
|
||
osimEmptyFlawTest('is not shown if no history present on flaw', async ({ flaw }) => { | ||
const subject = mount(FlawHistory, { | ||
subject = mount(FlawHistory, { |
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.
Why this change?
This is the only test that uses the top level subject
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.
That was probably missed from a reverted change I tried. I'll correct it.
461164b
to
7223c06
Compare
src/components/FlawHistory.vue
Outdated
return !startDate.value && !endDate.value; | ||
}); | ||
|
||
const validDateRange = computed(() => { |
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.
const validDateRange = computed(() => { | |
const isDateRangeValid = computed(() => { |
src/components/FlawHistory.vue
Outdated
const start = new Date(startDate.value!); | ||
const end = new Date(endDate.value!); |
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.
specify time boundaries here: for start use 00:00 UTC and for end 23:59 UTC
src/components/FlawHistory.vue
Outdated
return itemDate.toDateString() === start.toDateString(); | ||
} else { | ||
// Otherwise, return items within the range | ||
return itemDate >= start && itemDate <= end; |
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.
return itemDate >= start && itemDate <= end; | |
// if you have end date be one day ahead of the user selected end date | |
return itemDate >= start && itemDate < end; |
src/components/FlawHistory.vue
Outdated
if (start.toDateString() === end.toDateString()) { | ||
// Check if the item's date is on the exact day of start and end | ||
return itemDate.toDateString() === start.toDateString(); |
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.
if (start.toDateString() === end.toDateString()) { | |
// Check if the item's date is on the exact day of start and end | |
return itemDate.toDateString() === start.toDateString(); | |
if (start === end) { | |
// Check if the item's date is on the exact day of start and end | |
return itemDate === start; |
7223c06
to
75ce7a3
Compare
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.
This widget is lacking tests, maybe is a good opportunity to add them, at least to test the new functionality
CHANGELOG.md
Outdated
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.
Fix the changelog after release merge
♻️ Use history as component property instead whole flaw ✨ Allow custom placeholder
✨ Clear filters button
75ce7a3
to
fbe38f5
Compare
Co-authored-by: James Reichard <[email protected]>
stubs: { | ||
EditableDate: true, | ||
}, | ||
}, | ||
}); | ||
const historyListItem = subject.find('li div'); | ||
expect(historyListItem?.text()).includes('Update Owner:'); |
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.
Adding tests for the date range filtering would be awesome
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.
Will do that, and also as discussed adding a test for EditableDate
making sure that it renders and the property placeholder works as expected.
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.
We could add tests for date range filtering which would allow us to be confident the filtering is working as intended
OSIDB-3562: Flaw history filtering
Checklist:
Summary:
Implementation of date range filter on the flaw history.
Changes:
EditableDate
FlawHistory
test cases and snapshotsConsiderations:
Closes OSIDB-3562