diff --git a/addons/core/translations/resources/en-us.yaml b/addons/core/translations/resources/en-us.yaml index d843a0f32..3833ad15a 100644 --- a/addons/core/translations/resources/en-us.yaml +++ b/addons/core/translations/resources/en-us.yaml @@ -234,6 +234,12 @@ session-recording: title: Channels by connection messages: no-channels: There are no channels for this connection + started-no-connections: + title: Session Recording In Progress + description: The Session has started but no connections have been made. + unknown-no-connections: + title: Session Recording Failure + description: This Session cannot be played back because no connections were established, and the Session has failed. channel: title: Channel title_index: Channel {index} diff --git a/ui/admin/app/controllers/scopes/scope/session-recordings/session-recording/channels-by-connection/index.js b/ui/admin/app/controllers/scopes/scope/session-recordings/session-recording/channels-by-connection/index.js new file mode 100644 index 000000000..8a779769b --- /dev/null +++ b/ui/admin/app/controllers/scopes/scope/session-recordings/session-recording/channels-by-connection/index.js @@ -0,0 +1,31 @@ +import Controller from '@ember/controller'; +import { + STATE_SESSION_RECORDING_STARTED, + STATE_SESSION_RECORDING_UNKNOWN, +} from 'api/models/session-recording'; + +export default class ScopesScopeSessionRecordingsSessionRecordingChannelsByConnectionIndexController extends Controller { + /** + * Returns true if the session recording has started + * but has not started any connections + * @type {boolean} + */ + get isSessionInprogressWithNoConnections() { + return ( + this.model?.sessionRecording?.connection_recordings?.length === 0 && + this.model?.sessionRecording?.state === STATE_SESSION_RECORDING_STARTED + ); + } + + /** + * Returns true if the session recording state is unknown + * and has no connections + * @type {boolean} + */ + get isSessionUnknownWithNoConnections() { + return ( + this.model?.sessionRecording?.connection_recordings?.length === 0 && + this.model?.sessionRecording?.state === STATE_SESSION_RECORDING_UNKNOWN + ); + } +} diff --git a/ui/admin/app/templates/scopes/scope/session-recordings/session-recording/channels-by-connection/index.hbs b/ui/admin/app/templates/scopes/scope/session-recordings/session-recording/channels-by-connection/index.hbs index f71adf356..6ec4cfc0d 100644 --- a/ui/admin/app/templates/scopes/scope/session-recordings/session-recording/channels-by-connection/index.hbs +++ b/ui/admin/app/templates/scopes/scope/session-recordings/session-recording/channels-by-connection/index.hbs @@ -11,119 +11,149 @@
- {{indexed-display-name
- 'resources.session-recording.connection.title_index'
- @model.sessionRecording.connection_recordings
- connection
+ {{#if this.isSessionInprogressWithNoConnections}}
+ {{connection.id}}
-
{{B.data.id}}
-