Skip to content
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

Merged
merged 2 commits into from
Mar 19, 2025

Conversation

artemmufazalov
Copy link
Member

@artemmufazalov artemmufazalov commented Mar 17, 2025

Closes #1886

Prevent 1970-01-01 03:00 in created time

Screenshot 2025-03-17 at 18 05 29

CI Results

Test Status: ✅ PASSED

📊 Full Report

Total Passed Failed Flaky Skipped
264 263 0 0 1
Test Changes Summary ⏭️1

⏭️ Skipped Tests (1)

  1. Streaming query shows some results and banner when stop button is clicked (tenant/queryEditor/queryEditor.test.ts)

Bundle Size: ✅

Current: 83.22 MB | Main: 83.22 MB
Diff: +1.21 KB (0.00%)

✅ Bundle size unchanged.

ℹ️ CI Information
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • 📊 indicates links to detailed reports.
  • 🔺 indicates increase, 🔽 decrease, and ✅ no change in bundle size.

@artemmufazalov artemmufazalov marked this pull request as ready for review March 17, 2025 15:18
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),
Copy link
Collaborator

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)) {
Copy link
Collaborator

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?

Copy link
Member Author

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

@artemmufazalov artemmufazalov added this pull request to the merge queue Mar 19, 2025
Merged via the queue into main with commit 7af1ed3 Mar 19, 2025
10 of 11 checks passed
@artemmufazalov artemmufazalov deleted the 1886-create-step branch March 19, 2025 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

do not display CreateTime if CreateStep is 0 or absent
2 participants