Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove my-sessions from organizer view session route #4629

Merged
merged 8 commits into from
Jul 27, 2020
4 changes: 2 additions & 2 deletions app/controllers/events/view/sessions/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
}

@action
viewSession(id) {
this.transitionToRoute('my-sessions.view', id);
viewSession(session_id, event_id) {
this.transitionToRoute('public.sessions.view', event_id, session_id);
}

@action
Expand Down
4 changes: 2 additions & 2 deletions app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ 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() {
this.route('new-speaker');
Expand Down Expand Up @@ -128,7 +129,6 @@ Router.map(function() {
});
this.route('my-sessions', function() {
this.route('list', { path: '/:session_status' });
this.route('view', { path: '/s/:session_id' });
});
this.route('notifications', function() {
this.route('all', { path: '/:notification_state' });
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions app/templates/components/session-card.hbs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<div class="event wide ui grid row">
{{#unless this.device.isMobile}}
<div class="ui card three wide computer six wide tablet column">
<a class="image" href="{{href-to 'my-sessions.view' this.session.id}}">
<a class="image" href="{{href-to 'public.sessions.view' this.session.event.id this.session.id}}">
<Widgets::SafeImage @src={{if this.session.event.thumbnailImageUrl this.session.event.thumbnailImageUrl "assets/images/landing.jpg"}} />
</a>
</div>
{{/unless}}
<div class="ui card thirteen wide computer ten wide tablet sixteen wide mobile column">
<a class="main content" href="{{href-to 'my-sessions.view' this.session.id}}">
<a class="main content" href="{{href-to 'public.sessions.view' this.session.event.id this.session.id}}">
<div class="header">
<span>{{this.session.title}}</span>
<div class="right floated author">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{this.record}}
<div class="hidden ui divider"></div>
<div class="ui horizontal compact basic buttons">
<UiPopup @content={{t "View Session"}} @class="ui icon button" @click={{action this.props.actions.viewSession this.extraRecords.id}} @position="left center">
<UiPopup @content={{t "View Session"}} @class="ui icon button" @click={{action this.props.actions.viewSession this.extraRecords.id this.extraRecords.event.id}} @position="left center">
<i class="unhide icon"></i>
</UiPopup>
{{#if (not this.extraRecords.isLocked)}}
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/components/session-card-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down