-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
addbab3
commit a90046c
Showing
8 changed files
with
208 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// SPDX-FileCopyrightText: NOI Techpark <digital@noi.bz.it> | ||
// | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
import { DatasetConfig } from '../../../domain/datasets/config/types'; | ||
import { domainWithOpenApiDocument } from '../../../domain/openApi'; | ||
import { venuev2Description } from './venuev2.description'; | ||
import { venuev2Operations } from './venuev2.operations'; | ||
import { venuev2Views } from './venuev2.views'; | ||
import { venuev2Route } from './venuev2.route'; | ||
|
||
export const venuev2Config: DatasetConfig = { | ||
source: 'embedded', | ||
baseUrl: domainWithOpenApiDocument.tourism.baseUrl, | ||
route: venuev2Route, | ||
description: venuev2Description, | ||
views: venuev2Views, | ||
operations: venuev2Operations, | ||
}; |
13 changes: 13 additions & 0 deletions
13
databrowser/src/config/tourism/venuev2/venuev2.description.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// SPDX-FileCopyrightText: NOI Techpark <digital@noi.bz.it> | ||
// | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
import { DatasetDescription } from '../../../domain/datasets/config/types'; | ||
|
||
export const venuev2Description: DatasetDescription = { | ||
title: 'Venue V2', | ||
subtitle: | ||
'This dataset contains information about events and their location.', | ||
description: | ||
'This dataset contains events location provided by LTS such as info about a location (e.g. number of seats, number of seats for disabled people, venue, etc.) or info to book an event location (e.g. prices, room configuration, etc.). Data are accessible in AlpineBits DestinationData format.', | ||
}; |
49 changes: 49 additions & 0 deletions
49
databrowser/src/config/tourism/venuev2/venuev2.listView.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// SPDX-FileCopyrightText: NOI Techpark <digital@noi.bz.it> | ||
// | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
import { CellComponent } from '../../../domain/cellComponents/types'; | ||
import { ListViewConfig } from '../../../domain/datasets/config/types'; | ||
import { | ||
imageTableCell, | ||
titleTableCell, | ||
sourceTableCell, | ||
languageTableCell, | ||
lastChangesTableCell, | ||
publishedOnTableCell, | ||
pushDataTableCell, | ||
} from '../../builder/tourism'; | ||
|
||
export const venuev2ListView: ListViewConfig = { | ||
elements: [ | ||
imageTableCell(), | ||
titleTableCell(), | ||
{ | ||
title: 'Category', | ||
component: CellComponent.StringCell, | ||
class: 'w-60', | ||
objectMapping: { text: 'VenueCategory.0.VenueCode' }, | ||
}, | ||
{ | ||
title: 'Location', | ||
component: CellComponent.StringCell, | ||
class: 'w-40', | ||
objectMapping: { | ||
text: 'LocationInfo.MunicipalityInfo.Name.{language}', | ||
}, | ||
}, | ||
languageTableCell(), | ||
lastChangesTableCell(), | ||
sourceTableCell(), | ||
{ | ||
title: 'Source state', | ||
component: CellComponent.StateCell, | ||
class: 'w-40', | ||
objectMapping: { | ||
state: 'Active', | ||
}, | ||
}, | ||
publishedOnTableCell(), | ||
pushDataTableCell(), | ||
], | ||
}; |
29 changes: 29 additions & 0 deletions
29
databrowser/src/config/tourism/venuev2/venuev2.operations.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// SPDX-FileCopyrightText: NOI Techpark <digital@noi.bz.it> | ||
// | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
import { Operations } from '../../../domain/datasets/config/types'; | ||
import { | ||
extendCreateRoles, | ||
extendDeleteRoles, | ||
extendUpdateRoles, | ||
ROLE_READ, | ||
} from '../roles'; | ||
|
||
export const venuev2Operations: Operations = { | ||
readAll: { | ||
rolesAllowed: ROLE_READ, | ||
}, | ||
read: { | ||
rolesAllowed: ROLE_READ, | ||
}, | ||
create: { | ||
rolesAllowed: extendCreateRoles(['VenueManager', 'VenueCreate']), | ||
}, | ||
update: { | ||
rolesAllowed: extendUpdateRoles(['VenueManager', 'VenueUpdate']), | ||
}, | ||
delete: { | ||
rolesAllowed: extendDeleteRoles(['VenueManager', 'VenueDelete']), | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// SPDX-FileCopyrightText: NOI Techpark <digital@noi.bz.it> | ||
// | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
import { DatasetRoute } from '../../../domain/datasets/config/types'; | ||
|
||
export const venuev2Route: DatasetRoute = { | ||
domain: 'tourism', | ||
pathSegments: ['v1', 'VenueV2'], | ||
}; |
73 changes: 73 additions & 0 deletions
73
databrowser/src/config/tourism/venuev2/venuev2.sharedView.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// SPDX-FileCopyrightText: NOI Techpark <digital@noi.bz.it> | ||
// | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
import { CellComponent } from '../../../domain/cellComponents/types'; | ||
import { | ||
DetailViewConfig, | ||
EditViewConfig, | ||
} from '../../../domain/datasets/config/types'; | ||
import { | ||
contactCategory, | ||
textInfoCategory, | ||
gpsDataCategory, | ||
idReadOnlyCell, | ||
imageGalleryCategory, | ||
logoWithMainImageCells, | ||
locationCategory, | ||
odhTagCategory, | ||
shortnameCell, | ||
dataStatesSubCategory, | ||
sourceSubCategoryWithDistinct, | ||
licenseInfoCategory, | ||
mappingCategory, | ||
} from '../../builder/tourism'; | ||
|
||
export const venuev2SharedView = (): DetailViewConfig | EditViewConfig => ({ | ||
elements: [ | ||
{ | ||
name: 'Main data', | ||
slug: 'main-data', | ||
subcategories: [ | ||
{ | ||
name: 'General data', | ||
properties: [shortnameCell(), ...logoWithMainImageCells()], | ||
}, | ||
{ | ||
name: 'IDs', | ||
properties: [idReadOnlyCell()], | ||
}, | ||
{ | ||
name: '', | ||
properties: [ | ||
{ | ||
title: 'Room Details', | ||
component: CellComponent.EditRoomVenueCell, | ||
arrayMapping: { | ||
pathToParent: 'RoomDetails', | ||
objectMapping: { | ||
Shortname: 'Shortname', | ||
Indoor: 'Indoor', | ||
SquareMeters: 'SquareMeters', | ||
Capacity: 'VenueSetup.0.Capacity', | ||
SetupType: 'VenueSetup.0.VenueCode', | ||
}, | ||
targetPropertyName: 'roomVenue', | ||
}, | ||
}, | ||
], | ||
}, | ||
dataStatesSubCategory(), | ||
sourceSubCategoryWithDistinct('venue'), | ||
], | ||
}, | ||
textInfoCategory(), | ||
contactCategory(), | ||
imageGalleryCategory(), | ||
locationCategory(), | ||
gpsDataCategory(), | ||
odhTagCategory('venue'), | ||
licenseInfoCategory(), | ||
mappingCategory(), | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// SPDX-FileCopyrightText: NOI Techpark <digital@noi.bz.it> | ||
// | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
import { venuev2ListView } from './venuev2.listView'; | ||
import { venuev2SharedView } from './venuev2.sharedView'; | ||
|
||
export const venuev2Views = { | ||
table: venuev2ListView, | ||
detail: venuev2SharedView(), | ||
edit: venuev2SharedView(), | ||
new: venuev2SharedView(), | ||
}; |