-
Notifications
You must be signed in to change notification settings - Fork 11
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
fix(ObjectSummary): do not display CreateTime if CreateStep is 0 #2018
Conversation
cdcf675
to
549e848
Compare
import {formatDateTime} from '../../../utils/dataFormatters/dataFormatters'; | ||
import i18n from '../i18n'; | ||
import {createInfoFormatter} from '../utils'; | ||
|
||
export const formatCommonItem = createInfoFormatter<TDirEntry>({ | ||
values: { | ||
PathType: (value) => value?.substring('EPathType'.length), | ||
CreateStep: formatDateTime, | ||
CreateStep: (value) => (Number(value) ? formatDateTime(value) : EMPTY_DATA_PLACEHOLDER), |
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.
maybe it would be better to handle zero values in formatDateTime and to pass EMPTY_DATA_PLACEHOLDER as defaultValue ?
Can't imagine anyone would need 1970-01-01 03:00 value (that is returned for formatDateTime(0)) anywhere accross the project
]; | ||
|
||
if (Number(CreateStep)) { |
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.
Mb it would be more consistent to display EMPTY_DATA_PLACEHOLDER (via date formatter and defaultValue) everywhere?
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.
I don't think so. Normally, we have 0 CreateStep
for certain list of entities - Domain, databases, system tables. So in your case there will be always placeholder there. I added placeholder in formatCommonItem
just as fallback, but you are right - it's better to check correctness inside formatDateTime
Closes #1886
Prevent
1970-01-01 03:00
in created timeCI Results
Test Status: ✅ PASSED
📊 Full Report
Test Changes Summary ⏭️1
⏭️ Skipped Tests (1)
Bundle Size: ✅
Current: 83.22 MB | Main: 83.22 MB
Diff: +1.21 KB (0.00%)
✅ Bundle size unchanged.
ℹ️ CI Information