Skip to content

Commit

Permalink
Merge pull request #60 from ssciwr/new-custom-types
Browse files Browse the repository at this point in the history
Implement a bunch of new custom data types
  • Loading branch information
dokempf authored Oct 7, 2024
2 parents 8b6c5eb + 60ccd78 commit 4fd5114
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/components/fields/CustomDataTypeGND.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<script>
import { fieldData } from "../../lib/easydbHelpers";
import { A } from "flowbite-svelte";
import { ArrowUpRightFromSquareOutline } from "flowbite-svelte-icons";
export let data;
export let table;
export let field;
const fdata = fieldData(data, table, field);
</script>

<span class="easydb-custom-gnd">
{fdata.conceptName}
<A href={fdata.conceptURI}>
<ArrowUpRightFromSquareOutline class="w-4 h-4"/>
</A>
</span>
7 changes: 7 additions & 0 deletions src/components/fields/CustomDataTypeGeoref.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script>
import { easydbInstanceStore, systemidStore } from "../../lib/stores";
import { A } from "flowbite-svelte";
</script>

MapBox visualization is not implemented in this viewer. Look at it in the <A href="{$easydbInstanceStore}/#/details/{$systemidStore.at(-1)}">EasyDB instance</A> instead.
20 changes: 20 additions & 0 deletions src/components/fields/CustomDataTypeGetty.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<script>
import { fieldData } from "../../lib/easydbHelpers";
import { A } from "flowbite-svelte";
import { ArrowUpRightFromSquareOutline } from "flowbite-svelte-icons";
export let data;
export let table;
export let field;
const fdata = fieldData(data, table, field);
</script>

<span class="easydb-custom-getty">
{fdata.conceptName}
<A href={fdata.conceptURI}>
<ArrowUpRightFromSquareOutline class="w-4 h-4"/>
</A>
</span>

16 changes: 16 additions & 0 deletions src/components/fields/CustomDataTypeLocation.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<script>
import { fieldData } from "../../lib/easydbHelpers";
import { MapPinAltSolid } from "flowbite-svelte-icons";
export let data;
export let table;
export let field;
const fdata = fieldData(data, table, field);
</script>

<div class="easydb-custom-location flex items-center">
<MapPinAltSolid class="w-12 h-12"/>
{fdata.mapPosition.position.lat}, {fdata.mapPosition.position.lng}
</div>
8 changes: 8 additions & 0 deletions src/components/logic/FieldDispatch.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
import Boolean from "../fields/Boolean.svelte";
import CustomDataTypeGazetteer from "../fields/CustomDataTypeGazetteer.svelte";
import CustomDataTypeGeonames from "../fields/CustomDataTypeGeonames.svelte";
import CustomDataTypeGeoref from "../fields/CustomDataTypeGeoref.svelte";
import CustomDataTypeGetty from "../fields/CustomDataTypeGetty.svelte";
import CustomDataTypeGND from "../fields/CustomDataTypeGND.svelte";
import CustomDataTypeLink from "../fields/CustomDataTypeLink.svelte";
import CustomDataTypeLocation from "../fields/CustomDataTypeLocation.svelte";
import CustomDataTypeUbhdgnd from "../fields/CustomDataTypeUBHDGND.svelte";
import Date from "../fields/Date.svelte";
import Daterange from "../fields/Daterange.svelte";
Expand All @@ -32,7 +36,11 @@
"boolean": Boolean,
"custom:base.custom-data-type-gazetteer.gazetteer": CustomDataTypeGazetteer,
"custom:base.custom-data-type-geonames.geonames": CustomDataTypeGeonames,
"custom:base.custom-data-type-georef.georef": CustomDataTypeGeoref,
"custom:base.custom-data-type-getty.getty": CustomDataTypeGetty,
"custom:base.custom-data-type-gnd.gnd": CustomDataTypeGND,
"custom:base.custom-data-type-link.link": CustomDataTypeLink,
"custom:base.custom-data-type-location.location": CustomDataTypeLocation,
"custom:base.custom-data-type-ubhdgnd.ubhdgnd": CustomDataTypeUbhdgnd,
"date": Date,
"daterange": Daterange,
Expand Down

0 comments on commit 4fd5114

Please sign in to comment.