File tree Expand file tree Collapse file tree 5 files changed +33
-5
lines changed Expand file tree Collapse file tree 5 files changed +33
-5
lines changed Original file line number Diff line number Diff line change 1
1
import type { UmbDictionaryCollectionModel } from '../../types.js' ;
2
+ import { UMB_EDIT_DICTIONARY_WORKSPACE_PATH_PATTERN } from '../../../paths.js' ;
2
3
import type { UmbDefaultCollectionContext } from '@umbraco-cms/backoffice/collection' ;
3
4
import { UMB_COLLECTION_CONTEXT } from '@umbraco-cms/backoffice/collection' ;
4
5
import type { UmbTableColumn , UmbTableConfig , UmbTableItem } from '@umbraco-cms/backoffice/components' ;
@@ -74,17 +75,17 @@ export class UmbDictionaryTableCollectionViewElement extends UmbLitElement {
74
75
75
76
#createTableItems( dictionaries : Array < UmbDictionaryCollectionModel > , languages : Array < UmbLanguageDetailModel > ) {
76
77
this . _tableItems = dictionaries . map ( ( dictionary ) => {
78
+ const editPath = UMB_EDIT_DICTIONARY_WORKSPACE_PATH_PATTERN . generateAbsolute ( {
79
+ unique : dictionary . unique ,
80
+ } ) ;
81
+
77
82
return {
78
83
id : dictionary . unique ,
79
84
icon : 'icon-book-alt-2' ,
80
85
data : [
81
86
{
82
87
columnAlias : 'name' ,
83
- value : html `<a
84
- style= "font-weight:bold"
85
- href = "section/dictionary/workspace/dictionary/edit/${ dictionary . unique } " >
86
- ${ dictionary . name } </ a
87
- > ` ,
88
+ value : html `<a style= "font-weight:bold" href = ${ editPath } > ${ dictionary . name } </ a> ` ,
88
89
} ,
89
90
...languages . map ( ( language ) => {
90
91
return {
Original file line number Diff line number Diff line change @@ -3,3 +3,4 @@ export * from './tree/index.js';
3
3
export * from './modals/dictionary-picker-modal.token.js' ;
4
4
export * from './entity.js' ;
5
5
export * from './components/index.js' ;
6
+ export * from './paths.js' ;
Original file line number Diff line number Diff line change
1
+ import { UMB_DICTIONARY_ENTITY_TYPE } from './entity.js' ;
2
+ import { UmbPathPattern } from '@umbraco-cms/backoffice/router' ;
3
+ import { UMB_TRANSLATION_SECTION_PATHNAME } from '@umbraco-cms/backoffice/translation' ;
4
+ import { UMB_WORKSPACE_PATH_PATTERN } from '@umbraco-cms/backoffice/workspace' ;
5
+ import type { UmbEntityModel , UmbEntityUnique } from '@umbraco-cms/backoffice/entity' ;
6
+
7
+ export const UMB_DICTIONARY_WORKSPACE_PATH = UMB_WORKSPACE_PATH_PATTERN . generateAbsolute ( {
8
+ sectionName : UMB_TRANSLATION_SECTION_PATHNAME ,
9
+ entityType : UMB_DICTIONARY_ENTITY_TYPE ,
10
+ } ) ;
11
+
12
+ export const UMB_CREATE_DICTIONARY_WORKSPACE_PATH_PATTERN = new UmbPathPattern < {
13
+ parentEntityType : UmbEntityModel [ 'entityType' ] ;
14
+ parentUnique : UmbEntityUnique ;
15
+ } > ( 'create/parent/:parentEntityType/:parentUnique' , UMB_DICTIONARY_WORKSPACE_PATH ) ;
16
+
17
+ export const UMB_EDIT_DICTIONARY_WORKSPACE_PATH_PATTERN = new UmbPathPattern < {
18
+ unique : UmbEntityUnique ;
19
+ } > ( 'edit/:unique' , UMB_DICTIONARY_WORKSPACE_PATH ) ;
Original file line number Diff line number Diff line change 1
1
export * from './constants.js' ;
2
+ export * from './paths.js' ;
Original file line number Diff line number Diff line change
1
+ import { UMB_SECTION_PATH_PATTERN } from '@umbraco-cms/backoffice/section' ;
2
+
3
+ export const UMB_TRANSLATION_SECTION_PATHNAME = 'translation' ;
4
+ export const UMB_TRANSLATION_SECTION_PATH = UMB_SECTION_PATH_PATTERN . generateAbsolute ( {
5
+ sectionName : UMB_TRANSLATION_SECTION_PATHNAME ,
6
+ } ) ;
You can’t perform that action at this time.
0 commit comments