From 24fdd926f157dbf288b99adeb4a7299d806665d0 Mon Sep 17 00:00:00 2001 From: Dharini Jeeva Date: Tue, 23 Jan 2024 12:13:50 -0800 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20toggle=20translation=20?= =?UTF-8?q?based=20on=20state=20(#2106)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/core/translations/resources/en-us.yaml | 1 + .../routes/scopes/scope/session-recordings.js | 14 -------------- .../channels-by-connection.js | 19 +++++++++++++++++++ 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/addons/core/translations/resources/en-us.yaml b/addons/core/translations/resources/en-us.yaml index ff2a7b912..01bf16cfe 100644 --- a/addons/core/translations/resources/en-us.yaml +++ b/addons/core/translations/resources/en-us.yaml @@ -954,6 +954,7 @@ policy: messages: detach: Successfully detached reapply: Successfully reapplied + later: Policy will be reapplied after the recording has completed none: title: No storage policies yet description: A Storage Policy defines how long Session Recordings must be kept and when they should be deleted. We recommend checking your data retention policies for compliance requirements. diff --git a/ui/admin/app/routes/scopes/scope/session-recordings.js b/ui/admin/app/routes/scopes/scope/session-recordings.js index 90fb45e94..7d81c6d93 100644 --- a/ui/admin/app/routes/scopes/scope/session-recordings.js +++ b/ui/admin/app/routes/scopes/scope/session-recordings.js @@ -5,8 +5,6 @@ import Route from '@ember/routing/route'; import { inject as service } from '@ember/service'; -import { action } from '@ember/object'; -import { notifySuccess, notifyError } from 'core/decorators/notify'; import orderBy from 'lodash/orderBy'; export default class ScopesScopeSessionRecordingsRoute extends Route { @@ -70,16 +68,4 @@ export default class ScopesScopeSessionRecordingsRoute extends Route { }; } } - - /** - * Reapplies storage policy dates to session recording - * @param {SessionRecordingModel} - */ - @action - @notifyError(({ message }) => message, { catch: true }) - @notifySuccess('resources.policy.messages.reapply') - async reapplyStoragepolicy(sessionRecording) { - await sessionRecording.reapplyStoragePolicy(); - super.refresh(...arguments); - } } diff --git a/ui/admin/app/routes/scopes/scope/session-recordings/session-recording/channels-by-connection.js b/ui/admin/app/routes/scopes/scope/session-recordings/session-recording/channels-by-connection.js index b17263a81..64a92231d 100644 --- a/ui/admin/app/routes/scopes/scope/session-recordings/session-recording/channels-by-connection.js +++ b/ui/admin/app/routes/scopes/scope/session-recordings/session-recording/channels-by-connection.js @@ -5,6 +5,9 @@ import Route from '@ember/routing/route'; import { inject as service } from '@ember/service'; +import { action } from '@ember/object'; +import { notifySuccess, notifyError } from 'core/decorators/notify'; +import { STATE_SESSION_RECORDING_AVAILABLE } from 'api/models/session-recording'; export default class ScopesScopeSessionRecordingsSessionRecordingChannelsByConnectionRoute extends Route { // =services @@ -48,4 +51,20 @@ export default class ScopesScopeSessionRecordingsSessionRecordingChannelsByConne storageBucket, }; } + + /** + * Reapplies storage policy dates to session recording + * @param {SessionRecordingModel} + */ + @action + @notifyError(({ message }) => message, { catch: true }) + @notifySuccess(({ state }) => + state === STATE_SESSION_RECORDING_AVAILABLE + ? 'resources.policy.messages.reapply' + : 'resources.policy.messages.later', + ) + async reapplyStoragepolicy(sessionRecording) { + await sessionRecording.reapplyStoragePolicy(); + super.refresh(...arguments); + } }