-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix image modal, add demo and github actions
- Loading branch information
Showing
14 changed files
with
222 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Deploy to GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build public view | ||
run: npm run build | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: ./dist | ||
|
||
deploy: | ||
needs: build | ||
permissions: | ||
pages: write | ||
id-token: write | ||
|
||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
<template> | ||
<VuePinpoint | ||
:key-id="103" | ||
base-url="http://localhost:3000/api/v1" | ||
project-token="3oerVKf82_196cIECvHYNg" | ||
/> | ||
<VuePinpoint v-bind="config" /> | ||
<DemoPanelAPI @set="(data) => (config = { ...data })" /> | ||
</template> | ||
|
||
<script setup> | ||
import { ref } from 'vue' | ||
import VuePinpoint from './components/VuePinpoint.vue' | ||
import DemoPanelAPI from './components/Demo/DemoPanelAPI.vue' | ||
const config = ref({}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
import { Figure } from '@/types' | ||
import { Figure, APIConfig } from '@/types' | ||
|
||
export function makeFigure(figure: any): Figure { | ||
export function makeFigure( | ||
figure: any, | ||
{ baseUrl, projectToken }: APIConfig | ||
): Figure { | ||
return { | ||
caption: figure.caption, | ||
label: figure.label, | ||
position: figure.position, | ||
image: figure.medium | ||
image: figure.medium, | ||
original: `${baseUrl}/${figure.original_png?.substring( | ||
8 | ||
)}?project_token=${projectToken}` | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import { Lead } from '@/types' | ||
import { APIConfig, Lead } from '@/types' | ||
import { makeFigure } from './makeFigure' | ||
|
||
export function makeLead(item: any): Lead { | ||
export function makeLead(item: any, config: APIConfig): Lead { | ||
return { | ||
text: item.text, | ||
parentId: item.parent_id, | ||
targetId: item.target_id, | ||
targetType: item.target_type, | ||
position: item.position, | ||
figures: item.figures?.map(makeFigure) || [] | ||
figures: item.figures?.map((item) => makeFigure(item, config)) || [] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<template> | ||
<div class="demo-panel-api"> | ||
<div> | ||
<button | ||
type="button" | ||
@click="toggle" | ||
> | ||
{{ isVisible ? '-' : '+' }} | ||
</button> | ||
</div> | ||
<template v-if="isVisible"> | ||
<div> | ||
<label>API Url</label> | ||
<input | ||
type="text" | ||
v-model="config.baseUrl" | ||
/> | ||
</div> | ||
|
||
<div> | ||
<label>Project token</label> | ||
<input | ||
type="text" | ||
v-model="config.projectToken" | ||
/> | ||
</div> | ||
|
||
<div> | ||
<label>Lead ID</label> | ||
<input | ||
type="text" | ||
v-model="config.leadId" | ||
/> | ||
</div> | ||
|
||
<button | ||
type="button" | ||
@click="() => emit('set', config)" | ||
> | ||
Load | ||
</button> | ||
</template> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { ref } from 'vue' | ||
const emit = defineEmits(['set']) | ||
const config = ref({ | ||
/* leadId: 103, | ||
baseUrl: 'https://sfg.taxonworks.org/api/v1', | ||
projectToken: '3oerVKf82_196cIECvHYNg' */ | ||
}) | ||
const isVisible = ref(true) | ||
function toggle() { | ||
isVisible.value = !isVisible.value | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.demo-panel-api { | ||
display: flex; | ||
flex-direction: column; | ||
position: fixed; | ||
right: 0; | ||
top: 0; | ||
background-color: white; | ||
gap: 0.5rem; | ||
font-size: 14px; | ||
border-left: 1px solid black; | ||
border-bottom: 1px solid black; | ||
padding: 1.5rem 1.5rem; | ||
border-bottom-left-radius: 0.5rem; | ||
label { | ||
display: block; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ export type Figure = { | |
label: string | null | ||
position: number | ||
image: string | ||
original: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export type APIConfig = { | ||
baseUrl: string | ||
projectToken: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters