diff --git a/databrowser/src/config/builder/tourism/index.ts b/databrowser/src/config/builder/tourism/index.ts index 332ce907..be02ef8b 100644 --- a/databrowser/src/config/builder/tourism/index.ts +++ b/databrowser/src/config/builder/tourism/index.ts @@ -23,6 +23,8 @@ export * from './region'; export * from './season'; export * from './shortname'; export * from './source'; +export * from './source'; +export * from './tag'; export * from './textInfo'; export * from './title'; export * from './webcam'; diff --git a/databrowser/src/config/builder/tourism/tag.ts b/databrowser/src/config/builder/tourism/tag.ts new file mode 100644 index 00000000..32d6f2d5 --- /dev/null +++ b/databrowser/src/config/builder/tourism/tag.ts @@ -0,0 +1,38 @@ +// SPDX-FileCopyrightText: NOI Techpark +// +// SPDX-License-Identifier: AGPL-3.0-or-later + +import { CellComponent } from '../../../domain/cellComponents/types'; +import { + DetailElements, + PropertyConfig, +} from '../../../domain/datasets/config/types'; +import { withOdhBaseUrl } from '../../utils'; + +export const tagCell = (mainentity?: string): PropertyConfig => { + const filterParam = mainentity == null ? '' : `?mainentity=${mainentity}`; + const url = withOdhBaseUrl('/v1/Tag') + filterParam; + + return { + title: 'Assigned Tags', + component: CellComponent.TagReferenceCell, + arrayMapping: { + targetPropertyName: 'items', + pathToParent: 'TagIds', + }, + params: { url, keySelector: 'Id', labelSelector: 'TagName.{language}' }, + }; +}; + +export const tagCategory = (mainentity?: string): DetailElements => { + return { + name: 'Tags', + slug: 'Tags', + subcategories: [ + { + name: '', + properties: [tagCell(mainentity)], + }, + ], + }; +}; diff --git a/databrowser/src/config/tourism/eventv2/eventv2.listView.ts b/databrowser/src/config/tourism/eventv2/eventv2.listView.ts index bbf6d436..d2ab304a 100644 --- a/databrowser/src/config/tourism/eventv2/eventv2.listView.ts +++ b/databrowser/src/config/tourism/eventv2/eventv2.listView.ts @@ -21,32 +21,24 @@ export const eventv2ListView: ListViewConfig = { titleTableCell(), { title: 'Date start', - component: CellComponent.EditedDateCell, + component: CellComponent.DateCell, class: 'w-48', params: { format: DEFAULT_DATE_TIME_FORMAT }, - objectMapping: { date: 'DateBegin' }, + objectMapping: { date: 'Begin' }, }, { title: 'Date end', - component: CellComponent.EditedDateCell, + component: CellComponent.DateCell, class: 'w-48', params: { format: DEFAULT_DATE_TIME_FORMAT }, - objectMapping: { date: 'DateEnd' }, + objectMapping: { date: 'End' }, }, { - title: 'Event Organizer', + title: 'Venue', component: CellComponent.StringCell, class: 'w-48', objectMapping: { - text: 'OrganizerInfos.{language}.CompanyName', - }, - }, - { - title: 'Location', - component: CellComponent.StringCell, - class: 'w-48', - objectMapping: { - text: 'LocationInfo.DistrictInfo.Name.en', + text: 'VenueId', }, }, languageTableCell(), diff --git a/databrowser/src/config/tourism/eventv2/eventv2.sharedView.ts b/databrowser/src/config/tourism/eventv2/eventv2.sharedView.ts index d2ac6a1c..dab7cd0b 100644 --- a/databrowser/src/config/tourism/eventv2/eventv2.sharedView.ts +++ b/databrowser/src/config/tourism/eventv2/eventv2.sharedView.ts @@ -12,7 +12,7 @@ import { contactCategory, dataStatesSubCategory, imageGalleryCategory, - odhTagCategory, + tagCategory, shortnameWithLogoAndMainImageSubCategory, sourceSubCategoryWithDistinct, textInfoCategory, @@ -106,7 +106,7 @@ export const eventv2SharedView = (): DetailViewConfig | EditViewConfig => ({ ], }, contactCategory(), - odhTagCategory('event'), + tagCategory('event'), licenseInfoCategory(), mappingCategory(), {