Skip to content

Commit

Permalink
refactor: πŸ’‘ change channel app state title & add alert msg (#2489)
Browse files Browse the repository at this point in the history
* refactor: πŸ’‘ change channel app state title & add alert msg

βœ… Closes: https://hashicorp.atlassian.net/browse/ICU-11148
  • Loading branch information
lisbet-alvarez authored Sep 13, 2024
1 parent 2515efe commit c4e58fb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
6 changes: 3 additions & 3 deletions addons/core/translations/resources/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { inject as service } from '@ember/service';
export default class ScopesScopeSessionRecordingsSessionRecordingChannelsByConnectionChannelIndexRoute extends Route {
// =services
@service can;
@service flashMessages;

// =methods
/**
Expand All @@ -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(),
});
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,17 @@
{{#if (can 'getAsciicast channel-recording' @model.channelRecording)}}
{{! Was not able to download asciicast }}
<A.Header
@title={{t
'resources.session-recording.channel.messages.missing.title'
}}
@title={{t 'resources.session-recording.channel.messages.error.title'}}
/>
<A.Body
@text={{t
'resources.session-recording.channel.messages.missing.description'
'resources.session-recording.channel.messages.error.description'
}}
/>
<A.Footer as |F|>
<F.LinkStandalone
@icon='learn-link'
@text={{t
'resources.session-recording.channel.messages.missing.link'
}}
@text={{t 'resources.session-recording.channel.messages.error.link'}}
@href={{doc-url 'session-recording.retrieve-lost-session-recordings'}}
/>
</A.Footer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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,
Expand Down

0 comments on commit c4e58fb

Please sign in to comment.