Skip to content

Commit

Permalink
Merge pull request #253 from SpeciesFileGroup/development
Browse files Browse the repository at this point in the history
Add pinpoint lib for keys
  • Loading branch information
jlpereira authored Jan 9, 2025
2 parents af3820e + 7001259 commit c5fb886
Show file tree
Hide file tree
Showing 7 changed files with 511 additions and 226 deletions.
466 changes: 254 additions & 212 deletions package-lock.json

Large diffs are not rendered by default.

29 changes: 15 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,37 @@
"lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src"
},
"dependencies": {
"@geoman-io/leaflet-geoman-free": "^2.17.0",
"@geoman-io/leaflet-geoman-free": "^2.18.1",
"@nuxt/devalue": "^2.0.2",
"@sfgrp/distinguish": "^0.4.0",
"@unhead/ssr": "^1.11.13",
"axios": "^1.7.8",
"@sfgrp/pinpoint": "^0.0.10",
"@unhead/ssr": "^1.11.15",
"axios": "^1.7.9",
"glob": "^11.0.0",
"js-yaml": "^4.1.0",
"leaflet": "^1.9.4",
"leaflet.markercluster": "^1.5.3",
"markdown-it-anchor": "^9.2.0",
"pinia": "^2.2.7",
"unhead": "^1.11.13",
"unplugin-vue-markdown": "^0.26.3",
"pinia": "^2.3.0",
"unhead": "^1.11.15",
"unplugin-vue-markdown": "^28.0.0",
"vue": "^3.5.13",
"vue-router": "^4.5.0"
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.15",
"@unhead/ssr": "^1.11.13",
"@tailwindcss/typography": "^0.5.16",
"@unhead/ssr": "^1.11.15",
"@vitejs/plugin-vue": "^5.2.1",
"autoprefixer": "^10.4.20",
"compression": "^1.7.5",
"eslint": "^9.15.0",
"eslint-plugin-vue": "^9.31.0",
"express": "^4.21.1",
"eslint": "^9.17.0",
"eslint-plugin-vue": "^9.32.0",
"express": "^4.21.2",
"minimist": "^1.2.8",
"postcss": "^8.4.49",
"sass": "^1.81.0",
"tailwindcss": "^3.4.15",
"vite": "^6.0.1",
"sass": "^1.83.1",
"tailwindcss": "^3.4.17",
"vite": "^6.0.7",
"vite-plugin-pages": "^0.32.4",
"vite-plugin-radar": "^0.9.6"
}
Expand Down
15 changes: 15 additions & 0 deletions src/components/Icon/IconArrowUp.global.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<template>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M4.5 10.5 12 3m0 0 7.5 7.5M12 3v18"
/>
</svg>
</template>
15 changes: 15 additions & 0 deletions src/components/Icon/IconInformation.global.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<template>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"
/>
</svg>
</template>
52 changes: 52 additions & 0 deletions src/modules/keys/components/MetadataModal.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<template>
<VButton
primary
class="!px-1 py-1 rounded-full"
title="Metadata"
@click="isModalVisible = true"
>
<IconInformation class="w-4 h-4" />
</VButton>
<VModal
v-if="isModalVisible"
@close="() => (isModalVisible = false)"
>
<template #header>
<h3 class="font-medium">Metadata</h3>
</template>
<div class="p-4 pt-0">
<VTable>
<VTableHeader>
<VTableHeaderRow>
<VTableHeaderCell>Data</VTableHeaderCell>
<VTableHeaderCell></VTableHeaderCell>
</VTableHeaderRow>
</VTableHeader>
<VTableBody>
<VTableBodyRow
v-for="[key, value] in Object.entries(metadata)"
:key="key"
>
<VTableBodyCell class="capitalize">
{{ key.replaceAll('_', ' ') }}
</VTableBodyCell>
<VTableBodyCell>{{ value }}</VTableBodyCell>
</VTableBodyRow>
</VTableBody>
</VTable>
</div>
</VModal>
</template>

<script setup>
import { ref } from 'vue'
defineProps({
metadata: {
type: Object,
required: true
}
})
const isModalVisible = ref(false)
</script>
9 changes: 9 additions & 0 deletions src/modules/keys/router/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import keyId from '../views/keyId.vue'

export default [
{
name: 'keys-id',
path: '/keys/:id',
component: keyId
}
]
151 changes: 151 additions & 0 deletions src/modules/keys/views/keyId.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
<template>
<div class="flex flex-col h-full container mx-auto">
<ClientOnly>
<VuePinpoint
ref="pinpoint"
v-bind="options"
>
<template #title="{ metadata }">
<div class="flex gap-2 justify-center items-center">
<h1>{{ metadata.title }}</h1>
<MetadataModal :metadata="metadata" />
</div>
</template>
<template #button-up-label>
<div class="flex gap-2 items-center">
<IconArrowUp class="h-3" /> Back <IconArrowUp class="h-3" />
</div>
</template>
<template #target="{ id, label }">
<RouterLink
:to="{ name: 'otus-id', params: { id } }"
v-html="label"
/>
</template>
</VuePinpoint>
</ClientOnly>
</div>
</template>

<script setup>
import { useRoute } from 'vue-router'
import { ref } from 'vue'
import { VuePinpoint } from '@sfgrp/pinpoint'
import '@sfgrp/pinpoint/dist/pinpoint.css'
import MetadataModal from '../components/MetadataModal.vue'
const route = useRoute()
const options = ref({
leadId: route.params.id,
baseUrl: __APP_ENV__.url,
projectToken: __APP_ENV__.project_token
})
</script>

<style>
.pinpoint-app {
@apply py-4 flex flex-col gap-4;
ul {
@apply ml-4;
}
}
.pinpoint-tree {
@apply pb-1;
li {
@apply text-secondary-color;
}
}
.pinpoint-previous-list-item {
@apply text-secondary-color;
}
.pinpoint-previous-couplets {
h2 {
@apply px-5;
@apply p-4 pl-5 pr-5 border-b font-medium border-base-muted flex justify-between;
}
}
.pinpoint-previous-list {
@apply py-4 px-1;
}
.pinpoint-couplet {
@apply flex flex-col gap-4;
}
.pinpoint-couplet-container {
@apply flex flex-col justify-center items-center;
}
.pinpoint-couplet-node {
h1 {
@apply px-5;
@apply p-4 pl-5 pr-5 border-b font-medium border-base-muted flex justify-between;
}
div {
display: none;
}
}
.pinpoint-node-container {
@apply px-5;
h3 {
@apply text-lg text-center my-4;
}
}
.pinpoint-button-go {
display: none;
}
.pinpoint-button-up {
@apply px-3 py-1 hover:bg-opacity-80 bg-primary-color text-primary-content text-sm items-center;
}
pinpoint-button-up::before {
content: 's';
}
.pinpoint-node-target {
@apply my-4;
}
.pinpoint-key-title {
@apply text-center text-xl;
}
.pinpoint-couplet-node,
.pinpoint-previous-couplets,
.pinpoint-node,
.pinpoint-node-container {
@apply border-base-muted bg-base-foreground print:shadow-none print:border-0 rounded;
box-shadow: rgba(30, 41, 59, 0.04) 0 2px 4px 0;
border: 1px solid rgba(98, 105, 118, 0.16);
transition: transform 0.3s ease-out, opacity 0.3s ease-out,
box-shadow 0.3s ease-out;
}
.pinpoint-node {
@apply px-4;
}
.pinpoint-couplet-node {
@apply w-1/2;
.pinpoint-node-target {
@apply mx-5;
}
}
.pinpoint-couplet-children-container {
@apply gap-4;
@apply grid-cols-1;
@apply md:grid-cols-[repeat(auto-fit,minmax(100px,1fr))];
}
</style>

0 comments on commit c5fb886

Please sign in to comment.