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

Implement a bunch of new custom data types #60

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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