From 774377db76cc8a123efd0892936af14cf04f820d Mon Sep 17 00:00:00 2001 From: dvonanderson Date: Tue, 28 Feb 2023 11:18:50 -0500 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20create=20session-record?= =?UTF-8?q?ing=20route?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Create `session-recording` route with empty landing page. Added translations to `resources.yaml` file. ✅ Closes: ICU-8270 --- addons/core/translations/resources/en-us.yaml | 5 ++- ui/admin/app/router.js | 8 ++++- .../routes/scopes/scope/session-recordings.js | 36 ++++++++++++++++++- 3 files changed, 46 insertions(+), 3 deletions(-) diff --git a/addons/core/translations/resources/en-us.yaml b/addons/core/translations/resources/en-us.yaml index f2f9818fa..8814160a6 100644 --- a/addons/core/translations/resources/en-us.yaml +++ b/addons/core/translations/resources/en-us.yaml @@ -208,9 +208,12 @@ org: new: New Org actions: delete: Delete Org -session-recording: +session-recordings: title: Session Recording title_plural: Session Recordings + recorded-sessions: + title: Recorded Session + title_plural: Recorded Sessions project: title: Project title_plural: Projects diff --git a/ui/admin/app/router.js b/ui/admin/app/router.js index 80d396bd6..52a5ca380 100644 --- a/ui/admin/app/router.js +++ b/ui/admin/app/router.js @@ -132,7 +132,13 @@ Router.map(function () { this.route('new'); this.route('worker', { path: ':worker_id' }, function () {}); }); - this.route('session-recordings', function () {}); + this.route('session-recordings', function () { + this.route( + 'session-recording', + { path: ':session_recording_id' }, + function () {} + ); + }); }); }); diff --git a/ui/admin/app/routes/scopes/scope/session-recordings.js b/ui/admin/app/routes/scopes/scope/session-recordings.js index f45ef2bd4..8713f2966 100644 --- a/ui/admin/app/routes/scopes/scope/session-recordings.js +++ b/ui/admin/app/routes/scopes/scope/session-recordings.js @@ -1,3 +1,37 @@ import Route from '@ember/routing/route'; +import { inject as service } from '@ember/service'; -export default class ScopesScopeSessionRecordingsRoute extends Route {} +export default class ScopesScopeSessionRecordingsRoute extends Route { + // =services + + @service store; + @service can; + @service session; + @service router; + + // =methods + + /** + * If arriving here unauthenticated, redirect to index for further processing. + */ + beforeModel() { + if (!this.session.isAuthenticated) this.router.transitionTo('index'); + } + + /** + * Load all session recordings. + * @return {SessionRecordingModel} + */ + model() { + // TODO: awaiting modeled data + // const scope = this.modelFor('scopes.scope'); + // const { id: scope_id } = scope; + // if (this.can.can('list session-recording', scope, { collection: 'session-recordings' })) { + // return this.store.query('session-recording', { scope_id }); + // } + + return 'i am session-recordings'; + } + + // =actions +}