From 7b45df8612d2c25953cd60af0c98ce2da0ddafce Mon Sep 17 00:00:00 2001 From: Mark Pittaway Date: Wed, 8 May 2019 17:04:55 +1000 Subject: [PATCH] [SDESK-3998] Include updates for featuremedia stats --- .../directives/FeaturemediaUpdatesTable.js | 11 +- .../views/featuremedia-updates-table.html | 6 +- client/views/renditions-preview.html | 7 +- server/analytics/base_report/__init__.py | 30 +- .../featuremedia_updates_report.py | 25 + server/analytics/stats/__init__.py | 1 + .../analytics/stats/featuremedia_updates.py | 452 ++++++++++++------ .../analytics/stats/gen_archive_statistics.py | 34 +- .../analytics/stats/stats_report_service.py | 9 + .../featuremedia_update_stats.feature | 151 ++++++ 10 files changed, 548 insertions(+), 178 deletions(-) diff --git a/client/featuremedia_updates_report/directives/FeaturemediaUpdatesTable.js b/client/featuremedia_updates_report/directives/FeaturemediaUpdatesTable.js index 234502dfb..a745f4d56 100644 --- a/client/featuremedia_updates_report/directives/FeaturemediaUpdatesTable.js +++ b/client/featuremedia_updates_report/directives/FeaturemediaUpdatesTable.js @@ -96,6 +96,7 @@ export function FeaturemediaUpdatesTable( user: _.get(scope.users, _.get(update, 'user'), {}).display_name, operation: _.get(operations, _.get(update, 'operation')), update: _.get(update, 'update'), + clickable: _.get(update, 'operation') !== 'remove_featuremedia', })); scope.itemUpdates.push({ @@ -147,10 +148,12 @@ export function FeaturemediaUpdatesTable( * @description Opens the preview that will load the snapshot renditions and preview them */ scope.onUpdateClicked = (item, update) => { - scope.openPreview({ - item: item, - update: update, - }, 'renditions-preview'); + if (_.get(update, 'clickable')) { + scope.openPreview({ + item: item, + update: update, + }, 'renditions-preview'); + } }; init(); diff --git a/client/featuremedia_updates_report/views/featuremedia-updates-table.html b/client/featuremedia_updates_report/views/featuremedia-updates-table.html index 417c88c62..5c3834c1a 100644 --- a/client/featuremedia_updates_report/views/featuremedia-updates-table.html +++ b/client/featuremedia_updates_report/views/featuremedia-updates-table.html @@ -37,10 +37,12 @@ diff --git a/client/views/renditions-preview.html b/client/views/renditions-preview.html index d7beeff1a..749e360f9 100644 --- a/client/views/renditions-preview.html +++ b/client/views/renditions-preview.html @@ -1,4 +1,4 @@ -
+
@@ -17,7 +17,10 @@