Skip to content

Commit

Permalink
optimizations articles, echarging visualizations
Browse files Browse the repository at this point in the history
  • Loading branch information
RudiThoeni committed Oct 17, 2024
1 parent f359d07 commit ccfd6f3
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 22 deletions.
2 changes: 1 addition & 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
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 ccfd6f3

Please sign in to comment.