stable

Clone or download

Read-only

Optimize relative-dates[-polyfills].js import in dashboards

part of: story #14828: display dates with both absolute and relative This commit aims to optimize the import of the tlp-relative-dates custmom element in dashboards. How? - Before this patch, the script was loaded no matter if the dashboards does not contain a widget using relative dates. Not good when the version with polyfills, dedicated to deprecated browsers such as IE11 and Edge Legacy, is a lot heavier. - Now, it is the widgets who do the load. As this script should be included once, we rely on the 'unique-name' mecanism of the dashboards' AssetIncluder. Which widgets? - For the moment, 4 widgets have been identified using relative dates: - HeartBeat - tracker table renderer - tracker cardwall renderer - my artifacts [Trackers v5] How to test: --> On dashboards, widgets using relative dates in tracker tooltips or in card fields must have their dates displayed. Change-Id: I83d4ac2520337cef052a8f4093583da7f979e758

Modified Files

Name
M plugins/cardwall/include/Cardwall_Renderer.class.php +4 −1 Go to diff View file
M plugins/tracker/include/Tracker/Report/Tracker_Report_Renderer_Table.class.php +4 −1 Go to diff View file
M plugins/tracker/include/Tracker/Widget/Tracker_Widget_MyArtifacts.class.php +8 −0 Go to diff View file
M src/common/Dashboard/AssetsIncluder.php +1 −13 Go to diff View file
M src/common/Project/Home.php +1 −3 Go to diff View file
M src/common/Widget/ProjectHeartbeat.php +3 −1 Go to diff View file
A src/common/date/RelativeDatesAssetsRetriever.php +40 −0 Go to diff View file
M src/www/my/index.php +1 −3 Go to diff View file
M tests/unit/common/Dashboard/AssetsIncluderTest.php +2 −12 Go to diff View file