From 9be559637c0807a5dd98e0ac31836e6e585a1895 Mon Sep 17 00:00:00 2001 From: Haider Ali Date: Fri, 24 Jul 2020 18:15:16 +0530 Subject: [PATCH 1/5] Remove my-sessions from view session route --- app/controllers/events/view/sessions/list.js | 4 ++-- app/router.js | 4 +++- .../ui-table/cell/events/view/sessions/cell-session-title.hbs | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/controllers/events/view/sessions/list.js b/app/controllers/events/view/sessions/list.js index fbd6d67b5b9..98bbb87964a 100644 --- a/app/controllers/events/view/sessions/list.js +++ b/app/controllers/events/view/sessions/list.js @@ -139,8 +139,8 @@ export default class extends Controller.extend(EmberTableControllerMixin) { } @action - viewSession(id) { - this.transitionToRoute('my-sessions.view', id); + viewSession(session_id, event_id) { + this.transitionToRoute('my-sessions.view', event_id, session_id); } @action diff --git a/app/router.js b/app/router.js index 51a242a4059..4245be33582 100644 --- a/app/router.js +++ b/app/router.js @@ -128,7 +128,9 @@ Router.map(function() { }); this.route('my-sessions', function() { this.route('list', { path: '/:session_status' }); - this.route('view', { path: '/s/:session_id' }); + }); + this.route('my-sessions', { path: '/e' }, function() { + this.route('view', { path: '/:event_id/sessions/:session_id' }); }); this.route('notifications', function() { this.route('all', { path: '/:notification_state' }); diff --git a/app/templates/components/ui-table/cell/events/view/sessions/cell-session-title.hbs b/app/templates/components/ui-table/cell/events/view/sessions/cell-session-title.hbs index e1793f41dca..bdc546845db 100644 --- a/app/templates/components/ui-table/cell/events/view/sessions/cell-session-title.hbs +++ b/app/templates/components/ui-table/cell/events/view/sessions/cell-session-title.hbs @@ -1,7 +1,7 @@ {{this.record}}
- + {{#if (not this.extraRecords.isLocked)}} From fe4a45686487e49a4419b3261c577f51c9b5eeb6 Mon Sep 17 00:00:00 2001 From: Haider Ali Date: Sat, 25 Jul 2020 13:25:23 +0530 Subject: [PATCH 2/5] Change route to public.sessions.view directories --- app/controllers/events/view/sessions/list.js | 2 +- app/controllers/{my-sessions => public/sessions}/view.js | 0 app/router.js | 4 +--- app/routes/{my-sessions => public/sessions}/view.js | 0 app/templates/{my-sessions => public/sessions}/view.hbs | 0 5 files changed, 2 insertions(+), 4 deletions(-) rename app/controllers/{my-sessions => public/sessions}/view.js (100%) rename app/routes/{my-sessions => public/sessions}/view.js (100%) rename app/templates/{my-sessions => public/sessions}/view.hbs (100%) diff --git a/app/controllers/events/view/sessions/list.js b/app/controllers/events/view/sessions/list.js index 98bbb87964a..ec8e1cd44b1 100644 --- a/app/controllers/events/view/sessions/list.js +++ b/app/controllers/events/view/sessions/list.js @@ -140,7 +140,7 @@ export default class extends Controller.extend(EmberTableControllerMixin) { @action viewSession(session_id, event_id) { - this.transitionToRoute('my-sessions.view', event_id, session_id); + this.transitionToRoute('public.sessions.view', event_id, session_id); } @action diff --git a/app/controllers/my-sessions/view.js b/app/controllers/public/sessions/view.js similarity index 100% rename from app/controllers/my-sessions/view.js rename to app/controllers/public/sessions/view.js diff --git a/app/router.js b/app/router.js index 4245be33582..c5aed792157 100644 --- a/app/router.js +++ b/app/router.js @@ -42,6 +42,7 @@ Router.map(function() { this.route('public', { path: '/e/:event_id' }, function() { this.route('sessions', function() { this.route('list', { path: '/s/:session_status' }); + this.route('view', { path: '/:session_id' }); }); this.route('cfs', { path: '/cfs/:speaker_call_hash' }, function() { this.route('new-speaker'); @@ -129,9 +130,6 @@ Router.map(function() { this.route('my-sessions', function() { this.route('list', { path: '/:session_status' }); }); - this.route('my-sessions', { path: '/e' }, function() { - this.route('view', { path: '/:event_id/sessions/:session_id' }); - }); this.route('notifications', function() { this.route('all', { path: '/:notification_state' }); }); diff --git a/app/routes/my-sessions/view.js b/app/routes/public/sessions/view.js similarity index 100% rename from app/routes/my-sessions/view.js rename to app/routes/public/sessions/view.js diff --git a/app/templates/my-sessions/view.hbs b/app/templates/public/sessions/view.hbs similarity index 100% rename from app/templates/my-sessions/view.hbs rename to app/templates/public/sessions/view.hbs From bb43d45d7bb16868ed252f10fe2c361c4d86d6d4 Mon Sep 17 00:00:00 2001 From: Haider Ali Date: Sat, 25 Jul 2020 17:17:41 +0530 Subject: [PATCH 3/5] Change route for public.sessions.list --- app/router.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/router.js b/app/router.js index 0e874663a7e..45d4d594041 100644 --- a/app/router.js +++ b/app/router.js @@ -41,7 +41,7 @@ Router.map(function() { this.route('oauth', { path: '/oauth/callback' }); this.route('public', { path: '/e/:event_id' }, function() { this.route('sessions', function() { - this.route('list', { path: '/s/:session_status' }); + this.route('list', { path: '/:session_status' }); this.route('view', { path: '/:session_id' }); }); this.route('cfs', { path: '/cfs/:speaker_call_hash' }, function() { From 71afd7fccc961083554cc34764afb180063822ea Mon Sep 17 00:00:00 2001 From: Haider Ali Date: Mon, 27 Jul 2020 13:47:54 +0530 Subject: [PATCH 4/5] Change route for session-card --- app/templates/components/session-card.hbs | 4 ++-- tests/integration/components/session-card-test.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/templates/components/session-card.hbs b/app/templates/components/session-card.hbs index 8ed631848d8..eda2d9b79d9 100644 --- a/app/templates/components/session-card.hbs +++ b/app/templates/components/session-card.hbs @@ -1,13 +1,13 @@
{{#unless this.device.isMobile}} {{/unless}}
- +
{{this.session.title}}
diff --git a/tests/integration/components/session-card-test.js b/tests/integration/components/session-card-test.js index 441f2803aa8..bc6a52b0282 100644 --- a/tests/integration/components/session-card-test.js +++ b/tests/integration/components/session-card-test.js @@ -7,7 +7,7 @@ import { render } from '@ember/test-helpers'; module('Integration | Component | session card', function(hooks) { setupIntegrationTest(hooks); - const session = EmberObject.create({ id: 123, title: 'Super cool JS', state: 'rejected', event: 'OS Tech', startsAt: new Date(), endsAt: new Date() }); + const session = EmberObject.create({ id: 123, title: 'Super cool JS', state: 'rejected', event: {name: 'OS Tech', id: 123}, startsAt: new Date(), endsAt: new Date() }); test('it renders', async function(assert) { this.set('session', session); From a6a6cf977e5f45279421d6045a6dfea455afe7cd Mon Sep 17 00:00:00 2001 From: Haider Ali Date: Mon, 27 Jul 2020 14:43:27 +0530 Subject: [PATCH 5/5] fix linting issue --- tests/integration/components/session-card-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/components/session-card-test.js b/tests/integration/components/session-card-test.js index bc6a52b0282..d8901fe68cc 100644 --- a/tests/integration/components/session-card-test.js +++ b/tests/integration/components/session-card-test.js @@ -7,7 +7,7 @@ import { render } from '@ember/test-helpers'; module('Integration | Component | session card', function(hooks) { setupIntegrationTest(hooks); - const session = EmberObject.create({ id: 123, title: 'Super cool JS', state: 'rejected', event: {name: 'OS Tech', id: 123}, startsAt: new Date(), endsAt: new Date() }); + const session = EmberObject.create({ id: 123, title: 'Super cool JS', state: 'rejected', event: { name: 'OS Tech', id: 123 }, startsAt: new Date(), endsAt: new Date() }); test('it renders', async function(assert) { this.set('session', session);