Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RDF-download buttons to entity page #68 #85

Merged
merged 11 commits into from
Sep 7, 2023
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 1.15.1-pr-85.0 (2023-09-07)

**Note:** Version bump only for package root





## 1.15.0 (2023-09-07)

**Note:** Version bump only for package root
Expand All @@ -11,6 +19,14 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline



## 1.14.3-pr-85.0 (2023-09-07)

**Note:** Version bump only for package root





## 1.14.3-pr-87.0 (2023-09-04)

**Note:** Version bump only for package root
Expand All @@ -27,6 +43,14 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline



## 1.14.3-pr-85.0 (2023-09-07)

**Note:** Version bump only for package root





## 1.14.2 (2023-08-23)

**Note:** Version bump only for package root
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.15.0",
"version": "1.15.1-pr-85.0",
"command": {
"version": {
"message": "chore(release): %s",
Expand Down
24 changes: 24 additions & 0 deletions packages/design-system-angular/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 1.15.1-pr-85.0 (2023-09-07)

**Note:** Version bump only for package @geovistory/design-system-angular





## 1.15.0 (2023-09-07)

**Note:** Version bump only for package @geovistory/design-system-angular
Expand All @@ -11,6 +19,14 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline



## 1.14.3-pr-85.0 (2023-09-07)

**Note:** Version bump only for package @geovistory/design-system-angular





## 1.14.3-pr-87.0 (2023-09-04)

**Note:** Version bump only for package @geovistory/design-system-angular
Expand All @@ -27,6 +43,14 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline



## 1.14.3-pr-85.0 (2023-09-07)

**Note:** Version bump only for package @geovistory/design-system-angular





## 1.14.2 (2023-08-23)

**Note:** Version bump only for package @geovistory/design-system-angular
Expand Down
8 changes: 4 additions & 4 deletions packages/design-system-angular/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/design-system-angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@geovistory/design-system-angular",
"version": "1.15.0",
"version": "1.15.1-pr-85.0",
"description": "geovistory.org's design system: web components",
"repository": {
"type": "git",
Expand Down Expand Up @@ -32,7 +32,7 @@
"@angular/platform-browser": "~13.3.0",
"@angular/platform-browser-dynamic": "~13.3.0",
"@angular/router": "~13.3.0",
"@geovistory/design-system-web": "1.15.0",
"@geovistory/design-system-web": "1.15.1-pr-85.0",
"@rollup/plugin-typescript": "^11.1.2",
"rxjs": "~7.5.0",
"tslib": "^2.3.0",
Expand Down
24 changes: 24 additions & 0 deletions packages/design-system-react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 1.15.1-pr-85.0 (2023-09-07)

**Note:** Version bump only for package @geovistory/design-system-react





## 1.15.0 (2023-09-07)

**Note:** Version bump only for package @geovistory/design-system-react
Expand All @@ -11,6 +19,14 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline



## 1.14.3-pr-85.0 (2023-09-07)

**Note:** Version bump only for package @geovistory/design-system-react





## 1.14.3-pr-87.0 (2023-09-04)

**Note:** Version bump only for package @geovistory/design-system-react
Expand All @@ -27,6 +43,14 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline



## 1.14.3-pr-85.0 (2023-09-07)

**Note:** Version bump only for package @geovistory/design-system-react





## 1.14.2 (2023-08-23)

**Note:** Version bump only for package @geovistory/design-system-react
Expand Down
8 changes: 4 additions & 4 deletions packages/design-system-react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/design-system-react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@geovistory/design-system-react",
"sideEffects": false,
"version": "1.15.0",
"version": "1.15.1-pr-85.0",
"description": "geovistory.org's design system: React components",
"repository": {
"type": "git",
Expand Down Expand Up @@ -44,7 +44,7 @@
"typescript": "^4.8.3"
},
"dependencies": {
"@geovistory/design-system-web": "1.15.0",
"@geovistory/design-system-web": "1.15.1-pr-85.0",
"@ionic/core": "6.0.14",
"@rollup/plugin-typescript": "^11.1.2"
},
Expand Down
12 changes: 12 additions & 0 deletions packages/design-system-web/.storybook/preview-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
position: relative;
}

body.sb-show-main.sb-main-padded {
padding: 0;
}

#storybook-root,
#storybook-docs {
overflow: auto;
position: relative;
height: 100%;
padding: 1rem;
}

.geov-custom-toc {
position: sticky;
top: 0px;
Expand Down
24 changes: 24 additions & 0 deletions packages/design-system-web/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 1.15.1-pr-85.0 (2023-09-07)

**Note:** Version bump only for package @geovistory/design-system-web





## 1.15.0 (2023-09-07)

**Note:** Version bump only for package @geovistory/design-system-web
Expand All @@ -11,6 +19,14 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline



## 1.14.3-pr-85.0 (2023-09-07)

**Note:** Version bump only for package @geovistory/design-system-web





## 1.14.3-pr-87.0 (2023-09-04)

**Note:** Version bump only for package @geovistory/design-system-web
Expand All @@ -27,6 +43,14 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline



## 1.14.3-pr-85.0 (2023-09-07)

**Note:** Version bump only for package @geovistory/design-system-web





## 1.14.2 (2023-08-23)

**Note:** Version bump only for package @geovistory/design-system-web
Expand Down
4 changes: 2 additions & 2 deletions packages/design-system-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/design-system-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@geovistory/design-system-web",
"version": "1.15.0",
"version": "1.15.1-pr-85.0",
"description": "geovistory.org's design system: web components",
"main": "dist/index.cjs.js",
"module": "dist/index.js",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { Color } from '@ionic/core';
import { Component, h, Host, Prop } from '@stencil/core';
import { State } from '@stencil/core/internal';
import { Component, h, Host, Prop, State } from '@stencil/core';
import { downloadOutline } from 'ionicons/icons';

/**
Expand All @@ -27,6 +26,11 @@ export class GeovEntityDownloadRdf {
* ID number of entity, e.g. 'i315800'
*/
@Prop() entityId: string;
/**
* projectId
* ID number of project, e.g. '123123'
*/
@Prop() projectId: number | undefined;
perrauda marked this conversation as resolved.
Show resolved Hide resolved
/**
* color
* color of the button
Expand Down Expand Up @@ -73,18 +77,22 @@ export class GeovEntityDownloadRdf {
modal: HTMLIonModalElement;

open() {
this.modal.isOpen = true;
this.modal.present();
}
dismiss() {
this.modal.dismiss();
this.modal.isOpen = false;
}

async fetchRDF(format: string[]) {
const headers = new Headers({
Accept: format[0], //format[0] = Type
});
let args = this.entityId;
if (this.projectId != undefined) {
perrauda marked this conversation as resolved.
Show resolved Hide resolved
args += '?p=' + this.projectId;
}
const url = 'https://www.geovistory.org/resource/';
const response = await fetch(url + this.entityId, {
const response = await fetch(url + args, {
method: 'GET',
headers: headers,
mode: 'cors',
Expand All @@ -97,6 +105,7 @@ export class GeovEntityDownloadRdf {
a.click();
this.dismiss();
}

renderClickableItem() {
return Object.entries(this.listFormat).map(([a, b]) => (
<ion-item button={true} detail={false} onClick={() => this.fetchRDF(b)} download="Download">
Expand All @@ -105,13 +114,14 @@ export class GeovEntityDownloadRdf {
</ion-item>
));
}

render() {
return (
<Host>
<ion-button id="open-custom-dialog" expand={this.expand} fill={this.fill} color={this.color} onClick={() => (this.modal.isOpen = true)}>
<ion-button expand={this.expand} fill={this.fill} color={this.color} onClick={() => this.open()}>
{this.buttonLabel} {this.buttonIcon ? <ion-icon name={this.buttonIcon}></ion-icon> : <ion-icon icon={downloadOutline}></ion-icon>}
</ion-button>
<ion-modal id="example-modal" trigger="open-custom-dialog" ref={element => (this.modal = element)} onWillDismiss={() => this.dismiss()}>
<ion-modal ref={element => (this.modal = element)} onWillDismiss={() => this.dismiss()} isOpen={false}>
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
Expand Down
Loading