From c4e58fb780405eba2ee5f2e8f71268bcc0e24c40 Mon Sep 17 00:00:00 2001 From: Lisbet Alvarez <107949262+lisbet-alvarez@users.noreply.github.com> Date: Fri, 13 Sep 2024 13:24:45 -0700 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20change=20channel=20a?= =?UTF-8?q?pp=20state=20title=20&=20add=20alert=20msg=20(#2489)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: 💡 change channel app state title & add alert msg ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-11148 --- addons/core/translations/resources/en-us.yaml | 6 +++--- .../channels-by-connection/channel/index.js | 9 ++++++++- .../channels-by-connection/channel/index.hbs | 10 +++------- .../channels-by-connection/channel-test.js | 7 ++++--- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/addons/core/translations/resources/en-us.yaml b/addons/core/translations/resources/en-us.yaml index 22204d623..87c296629 100644 --- a/addons/core/translations/resources/en-us.yaml +++ b/addons/core/translations/resources/en-us.yaml @@ -384,9 +384,9 @@ session-recording: messages: none: title: Channel Playback - missing: - title: We can't play back this channel because the file is missing - description: This likely means the connected storage bucket is misconfigured or the file was deleted. + error: + title: Playback error + description: This may mean the connected storage bucket is misconfigured, the file was deleted, or integrity validation failed. link: Retrieving lost session recordings not-supported: title: Playback is not supported for this channel diff --git a/ui/admin/app/routes/scopes/scope/session-recordings/session-recording/channels-by-connection/channel/index.js b/ui/admin/app/routes/scopes/scope/session-recordings/session-recording/channels-by-connection/channel/index.js index fd3deeb4d..a4b45883f 100644 --- a/ui/admin/app/routes/scopes/scope/session-recordings/session-recording/channels-by-connection/channel/index.js +++ b/ui/admin/app/routes/scopes/scope/session-recordings/session-recording/channels-by-connection/channel/index.js @@ -9,6 +9,7 @@ import { inject as service } from '@ember/service'; export default class ScopesScopeSessionRecordingsSessionRecordingChannelsByConnectionChannelIndexRoute extends Route { // =services @service can; + @service flashMessages; // =methods /** @@ -24,7 +25,13 @@ export default class ScopesScopeSessionRecordingsSessionRecordingChannelsByConne try { asciicast = await channelRecording.getAsciicast(); } catch (e) { - // no op + // Alert user of error occurred during download. + const error = e.errors[0]; + this.flashMessages.danger(error.detail, { + notificationType: 'error', + sticky: true, + dismiss: (flash) => flash.destroyMessage(), + }); } } diff --git a/ui/admin/app/templates/scopes/scope/session-recordings/session-recording/channels-by-connection/channel/index.hbs b/ui/admin/app/templates/scopes/scope/session-recordings/session-recording/channels-by-connection/channel/index.hbs index 1754bebba..ec165ee8e 100644 --- a/ui/admin/app/templates/scopes/scope/session-recordings/session-recording/channels-by-connection/channel/index.hbs +++ b/ui/admin/app/templates/scopes/scope/session-recordings/session-recording/channels-by-connection/channel/index.hbs @@ -14,21 +14,17 @@ {{#if (can 'getAsciicast channel-recording' @model.channelRecording)}} {{! Was not able to download asciicast }} diff --git a/ui/admin/tests/acceptance/session-recordings/session-recording/channels-by-connection/channel-test.js b/ui/admin/tests/acceptance/session-recordings/session-recording/channels-by-connection/channel-test.js index 069231c33..248150caa 100644 --- a/ui/admin/tests/acceptance/session-recordings/session-recording/channels-by-connection/channel-test.js +++ b/ui/admin/tests/acceptance/session-recordings/session-recording/channels-by-connection/channel-test.js @@ -132,9 +132,10 @@ module( // if there was an error player will not render assert.dom('.session-recording-player').doesNotExist(); + assert.dom('.hds-application-state__title').hasText('Playback error'); assert - .dom('.hds-application-state__title') - .hasText("We can't play back this channel because the file is missing"); + .dom('.rose-notification-body') + .includesText('rpc error: code = Unknown'); }); test('user can navigate back to session recording screen', async function (assert) { @@ -146,7 +147,7 @@ module( assert.strictEqual(currentURL(), urls.sessionRecording); }); - test('users can navigate to channel recording and incorrect url autocorrects', async function (assert) { + test('users can navigate to channel recording and incorrect url auto corrects', async function (assert) { featuresService.enable('ssh-session-recording'); const sessionRecording = this.server.create('session-recording', { scope: instances.scopes.global,