-
Notifications
You must be signed in to change notification settings - Fork 894
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
[BUG] fixed wrapping of date #8247
Conversation
Signed-off-by: sumukhswamy <[email protected]>
ℹ️ Manual Changeset Creation ReminderPlease ensure manual commit for changeset file 8247.yml under folder changelogs/fragments to complete this PR. If you want to use the available OpenSearch Changeset Bot App to avoid manual creation of changeset file you can install it in your forked repository following this link. For more information about formatting of changeset files, please visit OpenSearch Auto Changeset and Release Notes Tool. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8247 +/- ##
=======================================
Coverage 64.14% 64.14%
=======================================
Files 3743 3743
Lines 88843 88844 +1
Branches 13855 13856 +1
=======================================
+ Hits 56987 56989 +2
+ Misses 31241 31240 -1
Partials 615 615
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
src/plugins/discover/public/application/components/default_discover_table/table_row.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: sumukhswamy <[email protected]>
@@ -111,7 +111,9 @@ const TableRowUI = ({ | |||
<td | |||
key={colName} | |||
data-test-subj="docTableField" | |||
className="osdDocTableCell eui-textBreakAll eui-textBreakWord" | |||
className={`osdDocTableCell ${ | |||
colName === '@timestamp' ? 'eui-textNoWrap' : 'eui-textBreakAll eui-textBreakWord' |
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.
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 dont quite understand this
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 dont quite understand this
As you hardcode the column name as @timestamp
, do we have other column name?
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.
have updated the condition for it add this for only timefield columns
@@ -111,7 +111,11 @@ const TableRowUI = ({ | |||
<td | |||
key={colName} | |||
data-test-subj="docTableField" | |||
className="osdDocTableCell eui-textBreakAll eui-textBreakWord" | |||
className={`osdDocTableCell ${ | |||
indexPattern.timeFieldName === colName |
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.
Out of curiosity, will there ever be a case where indexPattern.timeFieldName !== colName
?
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.
don't think so, there is already another condition which used the same to check if timefield = colname
https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/src/plugins/discover/public/application/components/default_discover_table/table_row.tsx#L129
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.
Out of curiosity, will there ever be a case where indexPattern.timeFieldName !== colName?
without diving too deep based on the snippet I'm guessing that this is for all the fields and it was applying the text break all to each colName. For example like if they select timestamp, useriD, statusCode, etc. are all col names. It just timefieldName sticks out because it's the first one we see. Other columns might have a child element that don't let it get wrapped as easily.
To be honest I think this rule could actually be applied to all fields of type date
. But that shouldn't block this PR.
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.
created an issue: #8441
* fixed wrapping of date Signed-off-by: sumukhswamy <[email protected]> * addressed comments Signed-off-by: sumukhswamy <[email protected]> * addressed comments for all time-fields Signed-off-by: sumukhswamy <[email protected]> --------- Signed-off-by: sumukhswamy <[email protected]> (cherry picked from commit 7d8d840) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* fixed wrapping of date * addressed comments * addressed comments for all time-fields --------- (cherry picked from commit 7d8d840) Signed-off-by: sumukhswamy <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…oject#8440) * fixed wrapping of date * addressed comments * addressed comments for all time-fields --------- (cherry picked from commit 7d8d840) Signed-off-by: sumukhswamy <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
Issues Resolved
Screenshot
Testing the changes
Changelog
Check List
yarn test:jest
yarn test:jest_integration