Merge pull request #81 from hashicorp/ICU-8270-create-session-recording-route
chore: 🤖 create session-recording route
This commit is contained in:
9 files changed
+88
-3
No files matched your search
@@ -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
|
||||
|
||||
@@ -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 () {}
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -1,3 +1,35 @@
|
||||
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 });
|
||||
// }
|
||||
}
|
||||
|
||||
// =actions
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeSessionRecordingsSessionRecordingRoute extends Route {
|
||||
// =services
|
||||
// =methods
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeSessionRecordingsSessionRecordingIndexRoute extends Route {}
|
||||
@@ -0,0 +1,3 @@
|
||||
{{page-title @model.displayName}}
|
||||
|
||||
{{outlet}}
|
||||
Whitespace-only changes.
@@ -0,0 +1,16 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'admin/tests/helpers';
|
||||
|
||||
module(
|
||||
'Unit | Route | scopes/scope/session-recordings/session-recording',
|
||||
function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it exists', function (assert) {
|
||||
let route = this.owner.lookup(
|
||||
'route:scopes/scope/session-recordings/session-recording'
|
||||
);
|
||||
assert.ok(route);
|
||||
});
|
||||
}
|
||||
);
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'admin/tests/helpers';
|
||||
|
||||
module(
|
||||
'Unit | Route | scopes/scope/session-recordings/session-recording/index',
|
||||
function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it exists', function (assert) {
|
||||
let route = this.owner.lookup(
|
||||
'route:scopes/scope/session-recordings/session-recording/index'
|
||||
);
|
||||
assert.ok(route);
|
||||
});
|
||||
}
|
||||
);
|
||||
Reference in new issue
Block a user