@@ -12,14 +12,13 @@ import not from 'ember-truth-helpers/helpers/not';
12
12
import t from ' ember-intl/helpers/t' ;
13
13
import FaIcon from ' ilios-common/components/fa-icon' ;
14
14
import { LinkTo } from ' @ember/routing' ;
15
- import { fn } from ' @ember/helper' ;
15
+ import { fn , hash } from ' @ember/helper' ;
16
16
import includes from ' ilios-common/helpers/includes' ;
17
17
import mapBy from ' ilios-common/helpers/map-by' ;
18
18
import SaveButton from ' ilios-common/components/save-button' ;
19
19
import perform from ' ember-concurrency/helpers/perform' ;
20
20
21
21
export default class PublishAllSessionsComponent extends Component {
22
- @service router;
23
22
@service store;
24
23
@service flashMessages;
25
24
@@ -200,22 +199,6 @@ export default class PublishAllSessionsComponent extends Component {
200
199
this .args .saved ();
201
200
});
202
201
203
- @action
204
- async transitionToCourse () {
205
- const queryParams = { courseObjectiveDetails: true , details: true };
206
- this .router .transitionTo (' course' , this .args .course , { queryParams });
207
- }
208
-
209
- @action
210
- async transitionToVisualizeObjectives () {
211
- this .router .transitionTo (' course-visualize-objectives' , this .args .course );
212
- }
213
-
214
- @action
215
- transitionToSession (session ) {
216
- const queryParams = { sessionObjectiveDetails: true };
217
- this .router .transitionTo (' session' , session, { queryParams });
218
- }
219
202
<template >
220
203
<div class =" publish-all-sessions" data-test-publish-all-sessions >
221
204
<section class =" publish-all-sessions-unpublishable" data-test-unpublishable >
@@ -288,14 +271,15 @@ export default class PublishAllSessionsComponent extends Component {
288
271
{{t " general.yes" }}
289
272
({{session.sessionObjectives.length }} )
290
273
{{#if session.showUnlinkIcon }}
291
- <button
292
- class =" link-button"
293
- type =" button"
294
- {{on " click" ( fn this . transitionToSession session ) }}
274
+ <LinkTo
275
+ @ route =" session"
276
+ @ model ={{session }}
277
+ @ query ={{hash sessionObjectiveDetails =true }}
278
+ aria-label ={{t " general.backToTitle" title =session.title }}
295
279
data-test-session-link
296
280
>
297
281
<FaIcon @ icon =" link-slash" />
298
- </button >
282
+ </LinkTo >
299
283
{{/if }}
300
284
</td >
301
285
{{else }}
@@ -390,14 +374,15 @@ export default class PublishAllSessionsComponent extends Component {
390
374
{{t " general.yes" }}
391
375
({{session.sessionObjectives.length }} )
392
376
{{#if session.showUnlinkIcon }}
393
- <button
394
- class =" link-button"
395
- type =" button"
396
- {{on " click" ( fn this . transitionToSession session ) }}
377
+ <LinkTo
378
+ @ route =" session"
379
+ @ model ={{session }}
380
+ @ query ={{hash sessionObjectiveDetails =true }}
381
+ aria-label ={{t " general.backToTitle" title =session.title }}
397
382
data-test-session-link
398
383
>
399
384
<FaIcon @ icon =" link-slash" />
400
- </button >
385
+ </LinkTo >
401
386
{{/if }}
402
387
</td >
403
388
{{else }}
@@ -527,14 +512,15 @@ export default class PublishAllSessionsComponent extends Component {
527
512
{{t " general.yes" }}
528
513
({{session.sessionObjectives.length }} )
529
514
{{#if session.showUnlinkIcon }}
530
- <button
531
- class =" link-button"
532
- type =" button"
533
- {{on " click" ( fn this . transitionToSession session ) }}
515
+ <LinkTo
516
+ @ route =" session"
517
+ @ model ={{session }}
518
+ @ query ={{hash sessionObjectiveDetails =true }}
519
+ aria-label ={{t " general.backToTitle" title =session.title }}
534
520
data-test-session-link
535
521
>
536
522
<FaIcon @ icon =" link-slash" />
537
- </button >
523
+ </LinkTo >
538
524
{{/if }}
539
525
</td >
540
526
{{else }}
@@ -564,22 +550,23 @@ export default class PublishAllSessionsComponent extends Component {
564
550
<span class =" unlinked-warning" data-test-unlinked-warning >
565
551
{{t " general.unlinkedObjectives" }}
566
552
</span >
567
- <button
568
- class =" link-button"
569
- type =" button"
570
- {{on " click" this . transitionToCourse}}
553
+ <LinkTo
554
+ @ route =" course"
555
+ @ model ={{@ course }}
556
+ @ query ={{hash details =true courseObjectiveDetails =true }}
557
+ title ={{t " general.backToTitle" title =@ course.title}}
571
558
data-test-course-link
572
559
>
573
560
<FaIcon @ icon =" link-slash" />
574
- </button >
575
- <button
576
- class = " link-button "
577
- type = " button "
578
- {{ on " click " this . transitionToVisualizeObjectives }}
561
+ </LinkTo >
562
+ <LinkTo
563
+ @ route = " course-visualize-objectives "
564
+ @ model = {{ @ course }}
565
+ title = {{ t " general.courseVisualizations " }}
579
566
data-test-visualize
580
567
>
581
568
<FaIcon @ icon =" chart-column" />
582
- </button >
569
+ </LinkTo >
583
570
{{/if }}
584
571
<p data-test-confirmation >
585
572
{{t
0 commit comments