@@ -16,8 +16,11 @@ import './content-editor-tab.element.js';
16
16
17
17
@customElement ( 'umb-content-workspace-view-edit' )
18
18
export class UmbContentWorkspaceViewEditElement extends UmbLitElement implements UmbWorkspaceViewElement {
19
- //@state ()
20
- //private _hasRootProperties = false;
19
+ /*
20
+ // root properties is a possible feature with Bellissima, but as it is new its not fully implemented yet [NL]
21
+ @state ()
22
+ private _hasRootProperties = false;
23
+ */
21
24
22
25
@state ( )
23
26
private _hasRootGroups = false ;
@@ -78,6 +81,16 @@ export class UmbContentWorkspaceViewEditElement extends UmbLitElement implements
78
81
if ( ! this . _tabs || ! this . #structureManager) return ;
79
82
const routes : UmbRoute [ ] = [ ] ;
80
83
84
+ if ( this . _hasRootGroups ) {
85
+ routes . push ( {
86
+ path : `root` ,
87
+ component : ( ) => import ( './content-editor-tab.element.js' ) ,
88
+ setup : ( component ) => {
89
+ ( component as UmbContentWorkspaceViewEditTabElement ) . containerId = null ;
90
+ } ,
91
+ } ) ;
92
+ }
93
+
81
94
if ( this . _tabs . length > 0 ) {
82
95
this . _tabs ?. forEach ( ( tab ) => {
83
96
const tabName = tab . name ?? '' ;
@@ -91,23 +104,11 @@ export class UmbContentWorkspaceViewEditElement extends UmbLitElement implements
91
104
} ) ;
92
105
}
93
106
94
- if ( this . _hasRootGroups ) {
107
+ if ( routes . length !== 0 ) {
95
108
routes . push ( {
96
109
path : '' ,
97
- component : ( ) => import ( './content-editor-tab.element.js' ) ,
98
- setup : ( component ) => {
99
- ( component as UmbContentWorkspaceViewEditTabElement ) . containerId = null ;
100
- } ,
110
+ redirectTo : routes [ 0 ] . path ,
101
111
} ) ;
102
- }
103
-
104
- if ( routes . length !== 0 ) {
105
- if ( ! this . _hasRootGroups ) {
106
- routes . push ( {
107
- path : '' ,
108
- redirectTo : routes [ 0 ] ?. path ,
109
- } ) ;
110
- }
111
112
112
113
routes . push ( {
113
114
path : `**` ,
@@ -127,21 +128,20 @@ export class UmbContentWorkspaceViewEditElement extends UmbLitElement implements
127
128
${ this . _hasRootGroups && this . _tabs . length > 0
128
129
? html `
129
130
<uui- tab
130
- label= "Content"
131
- .active = ${ this . _routerPath + '/' === this . _activePath }
132
- href= ${ this . _routerPath + '/' }
133
- > Content </ uui- tab
134
- >
131
+ .label = ${ this . localize . term ( 'general_generic' ) }
132
+ .active = ${ this . _routerPath + '/root' === this . _activePath }
133
+ .href = ${ this . _routerPath + '/root' } > </ uui- tab>
135
134
`
136
135
: '' }
137
136
${ repeat (
138
137
this . _tabs ,
139
138
( tab ) => tab . name ,
140
139
( tab ) => {
141
140
const path = this . _routerPath + '/tab/' + encodeFolderName ( tab . name || '' ) ;
142
- return html `<uui- tab label= ${ tab . name ?? 'Unnamed' } .active = ${ path === this . _activePath } href= ${ path }
143
- > ${ this . localize . string ( tab . name ) } </ uui- tab
144
- > ` ;
141
+ return html `<uui- tab
142
+ .label = ${ this . localize . string ( tab . name ?? '#general_unnamed' ) }
143
+ .active = ${ path === this . _activePath }
144
+ .href = ${ path } > </ uui- tab> ` ;
145
145
} ,
146
146
) }
147
147
</ uui- tab- group> `
0 commit comments