- add versioning to frontend

- hode staistic badge
This commit is contained in:
Arno Kaimbacher 2023-07-05 18:05:52 +02:00
parent cfc81f2d90
commit 4f1ea85982
9 changed files with 2450 additions and 77 deletions

View file

@ -23,6 +23,9 @@ export default class DatasetDetailComponent extends Vue {
@Prop()
datasetId!: number;
// @Prop()
// identifier!: string;
searchTerm: string | Suggestion = "";
private subscriptions: Array<Subscription> = [];
@ -40,7 +43,11 @@ export default class DatasetDetailComponent extends Vue {
created(): void {
dayjs.extend(advancedFormat);
this.getDataset(this.datasetId);
if (typeof this.datasetId === "number") {
this.getDataset(this.datasetId);
} else {
this.getDatasetByIdentifier(this.datasetId);
}
}
beforeUnmount(): void {
@ -87,6 +94,19 @@ export default class DatasetDetailComponent extends Vue {
},
error: (error: string) => this.errorHandler(error),
});
this.subscriptions.push(newSub);
}
private getDatasetByIdentifier(id: string): void {
const newSub = DatasetService.getDatasetByDoi(id).subscribe({
next: (res: DbDataset) => {
this.dataset = res;
this.loaded = true;
},
error: (error: string) => this.errorHandler(error),
});
this.subscriptions.push(newSub);
}

View file

@ -158,7 +158,7 @@
<h2 class="label uppercase">Details</h2>
<!-- <data-metrics-badge doi="10.7272/q6g15xs4" display="regular"></data-metrics-badge> -->
<!-- <data-metrics-badge doi="10.24341/tethys.209" display="small" v-bind:data-input="post"></data-metrics-badge> -->
<data-metrics-badge v-bind:doi="dataset.identifier.value" display="small"></data-metrics-badge>
<!-- <data-metrics-badge v-bind:doi="dataset.identifier.value" display="small"></data-metrics-badge> -->
</div>
</div>
<div class="card">