File tree Expand file tree Collapse file tree 6 files changed +16
-18
lines changed Expand file tree Collapse file tree 6 files changed +16
-18
lines changed Original file line number Diff line number Diff line change @@ -4,17 +4,7 @@ import Component from '@glimmer/component';
4
4
export default class BreadcrumbComponent extends Component {
5
5
6
6
get nodes ( ) {
7
- let current ,
8
- _nodes = [ ] ;
9
-
10
- current = this . args . node ;
11
-
12
- while ( current && current . get ( 'id' ) ) {
13
- _nodes . push ( current ) ;
14
- current = current . get ( 'parent' ) ;
15
- }
16
-
17
- return _nodes . reverse ( ) ;
7
+ return this . args . node . breadcrumb ;
18
8
}
19
9
20
10
get query ( ) {
Original file line number Diff line number Diff line change 1
1
<li class =" breadcrumb-item" >
2
- {{ #if (is_equal @node.title " .inbox" )}}
2
+ {{ #if (is_equal @node .[ 0 ] " .inbox" )}}
3
3
{{ #if this.show_spinner }}
4
4
<Spinner @inProgress ={{ true }} class =" text-primary" />
5
5
{{ else }}
6
6
<Spinner @inProgress ={{ false }} class =" text-primary" />
7
7
{{ /if }}
8
8
<Breadcrumb::Inbox />
9
- {{ else if (is_equal @node.title ".home")}}
9
+ {{ else if (is_equal @node.[0] ".home")}}
10
10
{{ #if this.show_spinner }}
11
11
<Spinner @inProgress ={{ true }} class =" text-primary" />
12
12
{{ else }}
17
17
18
18
<button
19
19
class =" btn btn-link"
20
- {{ on " click" (perform @onNodeClicked @node.id @hint ' folder' )}}
21
- {{ tooltip title = @node.id placement =' bottom' delay =4000 }} >
22
- {{ #if (is_equal @node.title " .inbox" )}}
20
+ {{ on " click" (perform @onNodeClicked @node .[ 1 ] @hint ' folder' )}}
21
+ {{ tooltip title = @node .[ 1 ] placement =' bottom' delay =4000 }} >
22
+ {{ #if (is_equal @node .[ 0 ] " .inbox" )}}
23
23
Inbox
24
- {{ else if (is_equal @node.title ".home")}}
24
+ {{ else if (is_equal @node.[0] ".home")}}
25
25
Home
26
26
{{ else }}
27
- {{ @node.title }}
27
+ {{ @node. [ 0 ] }}
28
28
{{ /if }}
29
29
</button >
30
30
</li >
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ export default class DocumentModel extends NodeModel {
6
6
@attr image ;
7
7
@attr lang ;
8
8
@attr ocr ;
9
+ @attr breadcrumb ;
9
10
@attr ocr_status ;
10
11
// `versions` is an Array of DocumentVersion(s)
11
12
@attr versions ; // of type DocumentVersion
Original file line number Diff line number Diff line change
1
+ import { attr } from '@ember-data/model' ;
2
+
1
3
import NodeModel from './node' ;
2
4
3
5
4
6
export default class FolderModel extends NodeModel {
5
7
8
+ @attr breadcrumb ;
9
+
6
10
get nodeType ( ) {
7
11
return 'folder' ;
8
12
}
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ export default class NodeModel extends Model {
4
4
@attr title ;
5
5
@attr tags ;
6
6
@attr model ;
7
+ @attr breadcrumb ;
8
+
7
9
@belongsTo ( 'node' ,
8
10
{
9
11
async : true ,
Original file line number Diff line number Diff line change
1
+ Wrong breadcrumb path when openening document/folder
You can’t perform that action at this time.
0 commit comments