Skip to content

Commit

Permalink
Merge pull request #632 from noi-techpark/development
Browse files Browse the repository at this point in the history
development
  • Loading branch information
RudiThoeni authored Oct 17, 2024
2 parents 969ab5c + ccf4dcd commit fb9a956
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 23 deletions.
8 changes: 7 additions & 1 deletion databrowser/src/config/builder/tourism/echargingdata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const echargingdataCategory = (
visible: options.visible,
subcategories: [
{
name: 'Primary Data (synced from mobility api)',
name: 'Primary Data (synced from timeseries api)',
properties: [
{
title: 'State',
Expand Down Expand Up @@ -75,13 +75,19 @@ export const echargingdataCategory = (
objectMapping: {
text: 'AdditionalProperties.EchargingDataProperties.AccessTypeInfo',
},
params: {
readonly: 'true',
},
},
{
title: 'Payment information',
component: CellComponent.StringCell,
objectMapping: {
text: 'AdditionalProperties.EchargingDataProperties.PaymentInfo',
},
params: {
readonly: 'true',
},
},
{
title: 'Charging plugs types',
Expand Down
2 changes: 1 addition & 1 deletion databrowser/src/config/builder/tourism/odh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const odhActiveTableCell = (): PropertyConfig => ({
});

export const odhTagCell = (mainentity?: string): PropertyConfig => {
const filterParam = mainentity == null ? '' : `?mainentity=${mainentity}`;
const filterParam = mainentity == null ? '' : `?validforentity=${mainentity}`;
const url = withOdhBaseUrl('/v1/ODHTag') + filterParam;

return {
Expand Down
11 changes: 0 additions & 11 deletions databrowser/src/config/tourism/article/article.listView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,6 @@ export const articleListView: ListViewConfig = {
text: 'SubType',
},
},
{
title: 'Tags',
component: CellComponent.ArrayCell,
class: 'w-40',
objectMapping: {
items: 'SmgTags',
},
params: {
separator: ', ',
},
},
languageTableCell(),
lastChangesTableCell(),
sourceTableCell(),
Expand Down
28 changes: 19 additions & 9 deletions databrowser/src/config/tourism/article/article.sharedView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,28 @@ export const articleSharedView = (): DetailViewConfig | EditViewConfig => ({
{
name: '',
properties: [
// {
// title: 'Assigned ODH Tags (Deprecated)',
// component: CellComponent.TagReferenceCell,
// arrayMapping: {
// targetPropertyName: 'items',
// pathToParent: 'SmgTags',
// },
// params: {
// url: withOdhBaseUrl('/v1/ODHTag?mainentity=article'),
// keySelector: 'Id',
// labelSelector: 'TagName.{language}',
// editable: 'false',
// },
// },
{
title: 'Assigned ODH Tags (Deprecated)',
component: CellComponent.TagReferenceCell,
arrayMapping: {
targetPropertyName: 'items',
pathToParent: 'SmgTags',
title: 'Tags (Deprecated)',
component: CellComponent.ArrayCell,
objectMapping: {
items: 'SmgTags',
},
params: {
url: withOdhBaseUrl('/v1/ODHTag?mainentity=article'),
keySelector: 'Id',
labelSelector: 'TagName.{language}',
editable: 'false',
separator: ', ',
},
},
{
Expand Down
4 changes: 3 additions & 1 deletion databrowser/src/domain/datasets/ui/header/DatasetHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ import { useDatasetViewStore } from '../../view/store/datasetViewStore';
import { useSessionStorage } from '@vueuse/core';
import { computeRouteDomain } from '../../location/routeDomain';
import { computeRoutePath } from '../../location/routePath';
import { getApiDomain } from '../../../../domain/datasets/utils';
const { view, isTableView } = storeToRefs(useDatasetViewStore());
Expand Down Expand Up @@ -226,7 +227,8 @@ const handleDatasetChange = (value: string) => {
const getDomainOfDataset = (dataset: TourismMetaData) => {
// TODO: fix this as referenced in OverviewLinkTable
return dataset.baseUrl.includes('tourism') ? 'tourism' : 'mobility';
//return dataset.baseUrl.includes('tourism') ? 'tourism' : 'mobility';
return getApiDomain(dataset) ?? 'mobility';
};
const currentDataset = ref<SelectValue>('');
Expand Down
8 changes: 8 additions & 0 deletions databrowser/src/domain/datasets/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ export const getTableLocationFromDataset = (dataset: TourismMetaData) => {
return computeTableLocation(domain, pathSegments, apiFilter);
};

export const getApiDomain = (dataset: TourismMetaData) => {
if (dataset == null || dataset.baseUrl == null) {
return;
}

return translateApiTypeToDomain(dataset);
};

const translateApiTypeToDomain = (dataset: TourismMetaData) => {
if (dataset.apiType) {
// Add here all apiTypes
Expand Down

0 comments on commit fb9a956

Please sign in to comment.