-
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
979067d
commit d41f169
Showing
8 changed files
with
260 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 <[email protected]> | ||
// | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
import { domainWithOpenApiDocument } from '../../../domain/openApi'; | ||
import { DatasetConfig } from '../../../domain/datasets/config/types'; | ||
import { noinewsDescription } from './noinews.description'; | ||
import { noinewsOperations } from './noinews.operations'; | ||
import { noinewsRoute } from './noinews.route'; | ||
import { noinewsViews } from './noinews.views'; | ||
|
||
export const noinewsConfig: DatasetConfig = { | ||
source: 'embedded', | ||
baseUrl: domainWithOpenApiDocument.tourism.baseUrl, | ||
route: noinewsRoute, | ||
description: noinewsDescription, | ||
views: noinewsViews, | ||
operations: noinewsOperations, | ||
}; |
11 changes: 11 additions & 0 deletions
11
databrowser/src/config/tourism/noinews/noinews.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,11 @@ | ||
// SPDX-FileCopyrightText: NOI Techpark <[email protected]> | ||
// | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
import { DatasetDescription } from '../../../domain/datasets/config/types'; | ||
|
||
export const noinewsDescription: DatasetDescription = { | ||
title: 'Articles Noi News', | ||
subtitle: 'This dataset contains Noi news articles', | ||
description: 'This dataset contains Noi news articles.', | ||
}; |
46 changes: 46 additions & 0 deletions
46
databrowser/src/config/tourism/noinews/noinews.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,46 @@ | ||
// SPDX-FileCopyrightText: NOI Techpark <[email protected]> | ||
// | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
import { CellComponent } from '../../../domain/cellComponents/types'; | ||
import { ListViewConfig } from '../../../domain/datasets/config/types'; | ||
import { | ||
imageTableCell, | ||
languageTableCell, | ||
lastChangesTableCell, | ||
sourceTableCell, | ||
titleTableCell, | ||
publishedOnTableCell, | ||
pushDataTableCell, | ||
} from '../../builder/tourism'; | ||
|
||
export const noinewsListView: ListViewConfig = { | ||
elements: [ | ||
titleTableCell(), | ||
imageTableCell(), | ||
{ | ||
title: 'Type', | ||
component: CellComponent.StringCell, | ||
class: 'w-48', | ||
objectMapping: { | ||
text: 'Type', | ||
}, | ||
}, | ||
{ | ||
title: 'Tags', | ||
component: CellComponent.ArrayCell, | ||
class: 'w-40', | ||
objectMapping: { | ||
items: 'SmgTags', | ||
}, | ||
params: { | ||
separator: ', ', | ||
}, | ||
}, | ||
languageTableCell(), | ||
lastChangesTableCell(), | ||
sourceTableCell(), | ||
publishedOnTableCell(), | ||
pushDataTableCell(), | ||
], | ||
}; |
29 changes: 29 additions & 0 deletions
29
databrowser/src/config/tourism/noinews/noinews.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 <[email protected]> | ||
// | ||
// 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 noinewsOperations: Operations = { | ||
readAll: { | ||
rolesAllowed: ROLE_READ, | ||
}, | ||
read: { | ||
rolesAllowed: ROLE_READ, | ||
}, | ||
create: { | ||
rolesAllowed: extendCreateRoles(['ArticleManager', 'ArticleCreate']), | ||
}, | ||
update: { | ||
rolesAllowed: extendUpdateRoles(['ArticleManager', 'ArticleUpdate']), | ||
}, | ||
delete: { | ||
rolesAllowed: extendDeleteRoles(['ArticleManager', 'ArticleDelete']), | ||
}, | ||
}; |
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 <[email protected]> | ||
// | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
import { DatasetRoute } from '../../../domain/datasets/config/types'; | ||
|
||
export const noinewsRoute: DatasetRoute = { | ||
domain: 'tourism', | ||
pathSegments: ['v1', 'Article?articletype=newsfeednoi'], | ||
}; |
130 changes: 130 additions & 0 deletions
130
databrowser/src/config/tourism/noinews/noinews.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,130 @@ | ||
// SPDX-FileCopyrightText: NOI Techpark <[email protected]> | ||
// | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
import { CellComponent } from '../../../domain/cellComponents/types'; | ||
import { | ||
DetailViewConfig, | ||
EditViewConfig, | ||
} from '../../../domain/datasets/config/types'; | ||
import { | ||
contactCategory, | ||
dataStatesSubCategory, | ||
idReadOnlyCell, | ||
imageGalleryCategory, | ||
odhTagCategory, | ||
Check warning on line 15 in databrowser/src/config/tourism/noinews/noinews.sharedView.ts GitHub Actions / test
|
||
seasonCategory, | ||
Check warning on line 16 in databrowser/src/config/tourism/noinews/noinews.sharedView.ts GitHub Actions / test
|
||
shortnameCell, | ||
sourceSubCategoryWithDistinct, | ||
textInfoCategory, | ||
licenseInfoCategory, | ||
mappingCategory, | ||
tagCategory, | ||
} from '../../builder/tourism'; | ||
import { videoItemsCategory } from '../../builder/tourism/video'; | ||
import { DEFAULT_DATE_FORMAT, withOdhBaseUrl } from '../../utils'; | ||
|
||
export const noinewsSharedView = (): DetailViewConfig | EditViewConfig => ({ | ||
elements: [ | ||
{ | ||
name: 'Main data', | ||
slug: 'main-data', | ||
subcategories: [ | ||
{ | ||
name: 'General data', | ||
properties: [shortnameCell()], | ||
}, | ||
{ | ||
name: 'IDs', | ||
properties: [idReadOnlyCell()], | ||
}, | ||
dataStatesSubCategory(), | ||
sourceSubCategoryWithDistinct('article'), | ||
], | ||
}, | ||
textInfoCategory(), | ||
contactCategory(), | ||
imageGalleryCategory(), | ||
videoItemsCategory(), | ||
{ | ||
name: 'Additional Information', | ||
slug: 'additional-information', | ||
subcategories: [ | ||
{ | ||
name: '', | ||
properties: [ | ||
{ | ||
title: '', | ||
component: CellComponent.ArticleAdditionalInfoCell, | ||
objectMapping: { | ||
infos: 'AdditionalArticleInfos.{language}.Elements', | ||
}, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
{ | ||
name: 'Links', | ||
slug: 'links', | ||
subcategories: [ | ||
{ | ||
name: '', | ||
properties: [ | ||
{ | ||
title: '', | ||
component: CellComponent.ArticleLinkInfoCell, | ||
objectMapping: { | ||
links: 'ArticleLinkInfo.{language}.Elements', | ||
}, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
tagCategory('article'), | ||
{ | ||
name: 'Article Details', | ||
slug: 'article-details', | ||
subcategories: [ | ||
{ | ||
name: '', | ||
properties: [ | ||
{ | ||
title: 'Highlight', | ||
component: CellComponent.ToggleTriStateCell, | ||
objectMapping: { enabled: 'Highlight' }, | ||
}, | ||
{ | ||
title: '', | ||
component: CellComponent.ArticleTypeCell, | ||
objectMapping: { | ||
type: 'Type', | ||
subType: 'SubType', | ||
}, | ||
params: { | ||
lookupUrl: withOdhBaseUrl('/v1/ArticleTypes'), | ||
required: 'true', | ||
}, | ||
required: true, | ||
}, | ||
{ | ||
title: 'Article Date', | ||
component: CellComponent.DateCell, | ||
objectMapping: { date: 'ArticleDate' }, | ||
params: { format: DEFAULT_DATE_FORMAT }, | ||
}, | ||
{ | ||
title: 'Article Date To', | ||
component: CellComponent.DateCell, | ||
objectMapping: { date: 'ArticleDateTo' }, | ||
params: { format: DEFAULT_DATE_FORMAT }, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
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 <[email protected]> | ||
// | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
import { noinewsListView } from './noinews.listView'; | ||
import { noinewsSharedView } from './noinews.sharedView'; | ||
|
||
export const noinewsViews = { | ||
table: noinewsListView, | ||
detail: noinewsSharedView(), | ||
edit: noinewsSharedView(), | ||
new: noinewsSharedView(), | ||
}; |