Skip to content

Commit

Permalink
improving event v2 editview
Browse files Browse the repository at this point in the history
  • Loading branch information
RudiThoeni committed May 31, 2024
1 parent a90046c commit 1d26c68
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 16 deletions.
2 changes: 2 additions & 0 deletions databrowser/src/config/builder/tourism/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
38 changes: 38 additions & 0 deletions databrowser/src/config/builder/tourism/tag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// SPDX-FileCopyrightText: NOI Techpark <digital@noi.bz.it>
//
// 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)],
},
],
};
};
20 changes: 6 additions & 14 deletions databrowser/src/config/tourism/eventv2/eventv2.listView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
4 changes: 2 additions & 2 deletions databrowser/src/config/tourism/eventv2/eventv2.sharedView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
contactCategory,
dataStatesSubCategory,
imageGalleryCategory,
odhTagCategory,
tagCategory,
shortnameWithLogoAndMainImageSubCategory,
sourceSubCategoryWithDistinct,
textInfoCategory,
Expand Down Expand Up @@ -106,7 +106,7 @@ export const eventv2SharedView = (): DetailViewConfig | EditViewConfig => ({
],
},
contactCategory(),
odhTagCategory('event'),
tagCategory('event'),
licenseInfoCategory(),
mappingCategory(),
{
Expand Down

0 comments on commit 1d26c68

Please sign in to comment.