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); + } }