fix(discover): apply no-wrap styling to all date fields, not just the primary time field#12262
fix(discover): apply no-wrap styling to all date fields, not just the primary time field#12262amarkdotdev wants to merge 2 commits into
Conversation
661f362 to
be24c62
Compare
… primary time field The Discover table only applied eui-textNoWrap to the index pattern's primary timeFieldName. Other fields of type "date" (e.g. created_at, updated_at) would wrap, which looks inconsistent and makes date values harder to read. Check fieldInfo.type === 'date' instead of comparing against indexPattern.timeFieldName so that all date-typed fields receive the no-wrap styling consistently. Fixes opensearch-project#8441 Signed-off-by: Aaron Mark <64331623+amarkdotdev@users.noreply.github.com>
be24c62 to
6ad9a0b
Compare
❌ 2 Jest Test Failure(s)📄
|
|
Retriggered CI with an empty commit ( The previous Merge Gate failure looks unrelated to this change — it failed on Windows Jest integration tests in Could a maintainer take a look when you have a moment? Thanks! |
aebca1a to
6ad9a0b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #12262 +/- ##
===========================================
- Coverage 61.58% 0 -61.59%
===========================================
Files 4995 0 -4995
Lines 137542 0 -137542
Branches 23901 0 -23901
===========================================
- Hits 84707 0 -84707
+ Misses 46692 0 -46692
+ Partials 6143 0 -6143
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: Aaron Mark <64331623+amarkdotdev@users.noreply.github.com>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Description
The Discover table only applied
eui-textNoWrapto the index pattern's primarytimeFieldName. Other fields of typedate(e.g.created_at,updated_at) would wrap across lines, making them harder to read.Root cause
In
table_row.tsx, the no-wrap condition checkedindexPattern.timeFieldName === colNamewhich only matches the single primary timestamp. The original fix in #8247 addressed this for the primary field but did not extend to all date-typed fields.Fix
Replace
indexPattern.timeFieldName === colNamewithfieldInfo?.type === 'date'in both:className)TableCellcomponent'sisTimeFieldpropThis ensures all fields with type
dateget consistent no-wrap styling.Fixes #8441