File tree 3 files changed +19
-3
lines changed
3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 44
44
</td >
45
45
{{ else if (eq column "link")}}
46
46
<td >
47
- {{ #let (await (this.config.documentListLinkTo @document )) as |linkConfig |}}
47
+ {{ #let
48
+ (await (this.config.documentListLinkTo @document ))
49
+ as |linkConfig |
50
+ }}
48
51
{{ #if linkConfig.url }}
49
- <a href ={{ linkConfig.url }} >{{ linkConfig.label }} </a >
52
+ <a
53
+ href ={{ linkConfig.url }}
54
+ {{ on " click" (fn this.transitionTo linkConfig.url )}}
55
+ >{{ linkConfig.label }} </a >
50
56
{{ else }}
51
57
<LinkTo
52
58
@route ={{ linkConfig.route }}
Original file line number Diff line number Diff line change
1
+ import { action } from "@ember/object" ;
1
2
import { inject as service } from "@ember/service" ;
2
3
import Component from "@glimmer/component" ;
3
4
4
5
export default class DocumentListItemComponent extends Component {
5
6
@service ( "alexandria-config" ) config ;
7
+ @service router ;
6
8
7
9
get classes ( ) {
8
10
const classes = [ "document-list-item" ] ;
@@ -17,4 +19,11 @@ export default class DocumentListItemComponent extends Component {
17
19
18
20
return classes . join ( " " ) ;
19
21
}
22
+
23
+ @action
24
+ transitionTo ( url , event ) {
25
+ event . preventDefault ( ) ;
26
+
27
+ this . router . transitionTo ( url ) ;
28
+ }
20
29
}
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { trackedFunction } from "reactiveweb/function";
8
8
export default class DocumentViewComponent extends Component {
9
9
@service store ;
10
10
@service ( "alexandria-config" ) config ;
11
+ @service ( "alexandria-documents" ) documents ;
11
12
12
13
@tracked listView = true ;
13
14
@tracked search = "" ;
@@ -24,7 +25,7 @@ export default class DocumentViewComponent extends Component {
24
25
const files = await this . store . query (
25
26
"file" ,
26
27
{
27
- include : "document" ,
28
+ include : "document,renderings " ,
28
29
filter : this . args . filters || { } ,
29
30
page : { number : 1 } ,
30
31
} ,
You can’t perform that action at this time.
0 commit comments