OpenSearch-Dashboards icon indicating copy to clipboard operation
OpenSearch-Dashboards copied to clipboard

Add updated_at column to objects' tables

Open RoyiSitbon opened this issue 3 years ago • 9 comments

Signed-off-by: sitbubu [email protected]

Is your feature request related to a problem? Please describe. We want to see more informative data inside the saved objects' tables, one important column that answers our needs will be the “updated at” option. After adding this option we will gain an additional advantage, i.e sort our objects by date.

Describe the solution you'd like to We wish to add an additional “updated at” column to our management, visualizations, and dashboards tables. e.g. for the management table, we will define: Screen Shot 2022-02-06 at 20 04 38

and then we will be able to see an additional column, like so: Untitled

The same solution will be implemented under the visualizations and dashboards tables, besides the fact that we will need to set our updated_at property inside the attributes prop since it uses us as the rendered object info for these tables.

Linked issue: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/1217

RoyiSitbon avatar Feb 07 '22 08:02 RoyiSitbon

There is an advanced setting in stack management that determines the date format of how dates should be pretty printed. We should be using that to format the date/time display.

kgcreative avatar Feb 07 '22 18:02 kgcreative

Thanks for the changes! I believe this field uses the ISO 8601 string format YYYY-MM-DDTHH:mm:ss.sssZ, so we should keep that consistent. And I know we can't change the field name, but when we render it I think it would look better to use a noun instead of including the at proposition (i.e. Updated Time instead of Updated at).

thanks, changed as requested

RoyiSitbon avatar Feb 14 '22 10:02 RoyiSitbon

Thanks for the changes! I believe this field uses the ISO 8601 string format YYYY-MM-DDTHH:mm:ss.sssZ, so we should keep that consistent. And I know we can't change the field name, but when we render it I think it would look better to use a noun instead of including the at proposition (i.e. Updated Time instead of Updated at).

Hey, all changes have been made inside this pr. Thanks

RoyiSitbon avatar Mar 01 '22 06:03 RoyiSitbon

Hi @RoyiSitbon, do you need any additional questions answered for this PR?

tmarkley avatar May 09 '22 16:05 tmarkley

Hi @RoyiSitbon, do you need any additional questions answered for this PR?

Hey @tmarkley, thanks for checking. I replied above.

RoyiSitbon avatar May 13 '22 06:05 RoyiSitbon

Codecov Report

Merging #1218 (7580cec) into main (b5d529a) will increase coverage by 0.02%. The diff coverage is 60.00%.

@@            Coverage Diff             @@
##             main    #1218      +/-   ##
==========================================
+ Coverage   66.55%   66.57%   +0.02%     
==========================================
  Files        3170     3170              
  Lines       60321    60326       +5     
  Branches     9181     9182       +1     
==========================================
+ Hits        40144    40162      +18     
+ Misses      17984    17969      -15     
- Partials     2193     2195       +2     
Impacted Files Coverage Δ
...agement_section/objects_table/components/table.tsx 65.51% <0.00%> (-1.15%) :arrow_down:
...ment_section/objects_table/saved_objects_table.tsx 73.48% <ø> (ø)
...rd/public/application/listing/dashboard_listing.js 78.57% <50.00%> (-4.77%) :arrow_down:
...c/core/public/saved_objects/simple_saved_object.ts 56.25% <100.00%> (+2.91%) :arrow_up:
...objects/public/saved_object/saved_object_loader.ts 53.84% <100.00%> (+53.84%) :arrow_up:
...ared/static/forms/hook_form_lib/hooks/use_field.ts 66.66% <0.00%> (+0.96%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov-commenter avatar May 13 '22 15:05 codecov-commenter

Hello @RoyiSitbon,

Will pull this down! Quick question will this require a migration on existing documents?

kavilla avatar Jul 14 '22 07:07 kavilla

Hello @RoyiSitbon,

Will pull this down! Quick question will this require a migration on existing documents?

Hey @kavilla , yes pls. not requires a migration, unless we will want to ascertain the existence of these metaFields. Nothing will go wrong even without migration attach(also validated using tests as expected).

Thanks a lot

RoyiSitbon avatar Aug 02 '22 11:08 RoyiSitbon

Hello @RoyiSitbon, Will pull this down! Quick question will this require a migration on existing documents?

Hey @kavilla , yes pls. not requires a migration, unless we will want to ascertain the existence of these metaFields. Nothing will go wrong even without migration attach(also validated using tests as expected).

Thanks a lot

Great then I think we can target to get this in to 2.3! Thank you so much @RoyiSitbon

kavilla avatar Aug 09 '22 19:08 kavilla

I've validated this locally and the change looks good! Glad that you exposed the updated_at a global level so that every saved object type can utilize it. Sorry that this got sidetracked.

🙏

RoyiSitbon avatar Sep 18 '22 04:09 RoyiSitbon

Nice!

seanneumann avatar Sep 27 '22 19:09 seanneumann