diff --git a/src/assets/app.scss b/src/assets/app.scss index fd7bf80..005502b 100644 --- a/src/assets/app.scss +++ b/src/assets/app.scss @@ -86,3 +86,10 @@ h3 { .p-overlaypanel .p-overlaypanel-content { padding: 0; } + +.p-dropdown:not(.p-disabled):hover { + border-color: var(--primary-color); +} +.p-multiselect:not(.p-disabled):hover { + border-color: var(--primary-color); +} \ No newline at end of file diff --git a/src/components/Projects.vue b/src/components/Projects.vue index d6434c9..c71a2d1 100644 --- a/src/components/Projects.vue +++ b/src/components/Projects.vue @@ -23,17 +23,17 @@ diff --git a/src/components/Workflows.vue b/src/components/Workflows.vue index 8596a2b..ee20a74 100644 --- a/src/components/Workflows.vue +++ b/src/components/Workflows.vue @@ -12,6 +12,7 @@ import filtersStore from "@/store/filters-store" import workflowsStore from "@/store/workflows-store" import type { ReleaseInfo } from "@/types" +import projectsStore from "@/store/projects-store" const { t } = useI18n() @@ -53,6 +54,7 @@ workflowsStore.latestRuns = await api.getLatestRuns() workflowsStore.gt = await api.getGroundTruth() workflowsStore.workflows = await api.getWorkflows() + projectsStore.setRepos(await api.getProjects()) workflowsStore.runs.forEach(run => { const gtId = mapGtId(run.metadata.gt_workspace.id) diff --git a/src/components/base/MultiSelect.vue b/src/components/base/MultiSelect.vue index f9efbf8..8e97c14 100644 --- a/src/components/base/MultiSelect.vue +++ b/src/components/base/MultiSelect.vue @@ -38,6 +38,9 @@ const dropdownLabel = computed(() => { {{ t('select_all') }} + diff --git a/src/components/projects/Project.vue b/src/components/projects/Project.vue index c993642..10dee38 100644 --- a/src/components/projects/Project.vue +++ b/src/components/projects/Project.vue @@ -1,6 +1,6 @@ @@ -154,7 +162,12 @@ function toggleParameterOverlay(step: WorkflowStep, event: Event) { @hide="isOpVisible = false" >
-

{{ selectedStep?.id }}

+ + + + {{ selectedStep?.id }} + +

{{ selectedStep?.id }}

diff --git a/src/components/workflows/timeline/TimelineSorting.vue b/src/components/workflows/timeline/TimelineSorting.vue index 77bb6af..29bf6e1 100644 --- a/src/components/workflows/timeline/TimelineSorting.vue +++ b/src/components/workflows/timeline/TimelineSorting.vue @@ -4,7 +4,6 @@ import { computed, ref, watch } from "vue" import Dropdown from "primevue/dropdown" import { GTTimelineSortingOptions, sortByOption } from "@/helpers/sorting" import { useI18n } from "vue-i18n" -import { DropdownPassThroughStyles } from "@/helpers/pt" const { t } = useI18n() @@ -41,15 +40,14 @@ function updateSortedList(event: any) { \ No newline at end of file diff --git a/src/helpers/api.ts b/src/helpers/api.ts index f44b999..9821708 100644 --- a/src/helpers/api.ts +++ b/src/helpers/api.ts @@ -1,12 +1,12 @@ -import type { EvalDefinitions, EvaluationRun, GroundTruth, Workflow } from "@/types" +import type { EvalDefinitions, EvaluationRun, GroundTruth, Project, Release, Workflow } from "@/types" const baseUrlOld = 'https://raw.githubusercontent.com/OCR-D/quiver-back-end/main/data' const baseUrl = 'https://quiver-dev.sub.uni-goettingen.de/api' -async function getProjects() { +async function getProjects(): Promise { return await request(baseUrlOld + '/repos.json') } -async function getOcrdAllReleases() { +async function getOcrdAllReleases(): Promise { return await request(baseUrlOld + '/ocrd_all_releases.json') } diff --git a/src/helpers/pt.ts b/src/helpers/pt.ts index 0b1f1fc..f10ad80 100644 --- a/src/helpers/pt.ts +++ b/src/helpers/pt.ts @@ -7,79 +7,10 @@ const TRANSITIONS = { } } -const DropdownPassThroughStyles = { - root: ({ props }) => ({ - class: [ - 'cursor-pointer inline-flex relative select-none', - 'bg-white border border-gray-300 transition-colors duration-200 ease-in-out rounded-md', - 'dark:bg-gray-900 dark:border-primary-900/40 dark:hover:border-primary-300', - 'w-full md:w-56', - 'hover:border-primary focus:outline-none focus:outline-offset-0 focus:shadow-[0_0_0_0.2rem_rgba(191,219,254,1)] dark:focus:shadow-[0_0_0_0.2rem_rgba(147,197,253,0.5)]', - { 'opacity-60 select-none pointer-events-none cursor-default': props.disabled } - ] - }), - input: ({ props }) => ({ - class: [ - 'cursor-pointer block flex flex-auto overflow-hidden text-ellipsis whitespace-nowrap relative', - 'bg-transparent border-0 text-gray-800', - 'dark:text-white/80', - 'p-3 transition duration-200 bg-transparent rounded appearance-none font-sans text-base', - 'focus:outline-none focus:shadow-none', - { 'pr-7': props.showClear } - ] - }), - trigger: { - class: ['flex items-center justify-center shrink-0', 'bg-transparent text-gray-500 w-12 rounded-tr-lg rounded-br-lg'] - }, - wrapper: { - class: ['max-h-[200px] overflow-auto', 'bg-white text-gray-700 border-0 rounded-md shadow-lg', 'dark:bg-gray-900 dark:text-white/80'] - }, - list: { - class: 'py-3 list-none m-0' - }, - item: ({ context }) => ({ - class: [ - 'cursor-pointer font-normal overflow-hidden relative whitespace-nowrap', - 'm-0 p-3 border-0 transition-shadow duration-200 rounded-none', - { - 'text-gray-700 hover:text-gray-700 hover:bg-gray-200 dark:text-white/80 dark:hover:bg-gray-800': !context.focused && !context.selected, - 'bg-gray-300 text-gray-700 dark:text-white/80 dark:bg-gray-800/90 hover:text-gray-700 hover:bg-gray-200 dark:text-white/80 dark:hover:bg-gray-800': context.focused && !context.selected, - 'bg-primary-100 text-primary dark:bg-primary-400 dark:text-white/80': context.focused && context.selected, - 'bg-primary-50 text-primary dark:bg-primary-300 dark:text-white/80': !context.focused && context.selected - } - ] - }), - itemgroup: { - class: ['m-0 p-3 text-gray-800 bg-white font-bold', 'dark:bg-gray-900 dark:text-white/80', 'cursor-auto'] - }, - header: { - class: ['p-3 border-b border-gray-300 text-gray-700 bg-gray-100 mt-0 rounded-tl-lg rounded-tr-lg', 'dark:bg-gray-800 dark:text-white/80 dark:border-primary-900/40'] - }, - filtercontainer: { - class: 'relative' - }, - filterinput: { - class: [ - 'pr-7 -mr-7', - 'w-full', - 'font-sans text-base text-gray-700 bg-white py-3 px-3 border border-gray-300 transition duration-200 rounded-lg appearance-none', - 'dark:bg-gray-900 dark:border-primary-900/40 dark:hover:border-primary-300 dark:text-white/80', - 'hover:border-primary focus:outline-none focus:outline-offset-0 focus:shadow-[0_0_0_0.2rem_rgba(191,219,254,1)] dark:focus:shadow-[0_0_0_0.2rem_rgba(147,197,253,0.5)]' - ] - }, - filtericon: { - class: '-mt-2 absolute top-1/2' - }, - clearicon: { - class: 'text-gray-500 right-12 -mt-2 absolute top-1/2' - }, -} - const OverlayPanelDropdownStyles = { root: 'bg-white border border-gray-300 rounded-md' } export { - DropdownPassThroughStyles, OverlayPanelDropdownStyles } diff --git a/src/helpers/store.ts b/src/helpers/store.ts deleted file mode 100644 index 69e0f08..0000000 --- a/src/helpers/store.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { reactive } from 'vue' -import type { GroundTruth, Workflow } from "@/types" - -interface State { - gtList: GroundTruth[], - workflows: Workflow[], - setGTList: (gt: GroundTruth[]) => void, - setWorkflows: (workflows: Workflow[]) => void, -} - -export const store = reactive({ - repos: [], - releases: [], - evaluations: [], - metricDefinitions: {}, - gtList: [], - workflows: [], - setGTList(gtList) { - this.gtList = gtList - }, - setWorkflows(workflows) { - this.workflows = workflows - }, - setRepos(repos) { - this.repos = repos - }, - setReleases(releases) { - this.releases = releases - }, - setEvaluations(evaluations) { - this.evaluations = evaluations - }, - setMetricDefinitions(defs) { - this.metricDefinitions = defs - }, - getRepoById(id) { - return this.repos.find(repo => { - return repo.id === id - }) - } -}) diff --git a/src/locales/de.json b/src/locales/de.json index acc44b4..b83c26c 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -99,5 +99,6 @@ "select_a_label": "Kennzeichnung auswählen", "select_a_script_type": "Skript-Typ auswählen", "no_labelling": "Keine Kennzeichnung", + "select_ground_truth": "Ground Truth auswählen", "no_results_found": "No results found." } diff --git a/src/locales/en.json b/src/locales/en.json index d632c48..5c7ff89 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -94,5 +94,6 @@ "select_a_label": "Select a label", "select_a_script_type": "Select a script-type", "no_labelling": "No labelling", + "select_ground_truth": "Select Ground Truth", "no_results_found": "No results found." } diff --git a/src/store/projects-store.ts b/src/store/projects-store.ts new file mode 100644 index 0000000..86b323d --- /dev/null +++ b/src/store/projects-store.ts @@ -0,0 +1,25 @@ +import { reactive } from 'vue' +import type { Project, Release } from '@/types' + + +export default reactive<{ + repos: Project[], + releases: Release[], + setRepos: (repos: Project[]) => void + setReleases: (releases: Release[]) => void + getRepoById: (id: string) => Project | null +}>({ + repos: [], + releases: [], + setRepos(repos: Project[]) { + this.repos = repos + }, + setReleases(releases: Release[]) { + this.releases = releases + }, + getRepoById(id) { + return this.repos.find(repo => { + return repo.id === id + }) ?? null + } +}) diff --git a/src/types/index.d.ts b/src/types/index.d.ts index 67a625e..b83743d 100644 --- a/src/types/index.d.ts +++ b/src/types/index.d.ts @@ -136,6 +136,11 @@ export interface FilterOption { label: string } +export interface Release { + projects: string[], + tag: string +} + export interface ReleaseInfo { id: number, published_at: string, @@ -166,3 +171,46 @@ export interface GroupedTableDataSubject { value: number | number[] | null }[] } + +export interface Project { + additional_info: { + links: { + Dockerfile?: string + "README.md"?: string + "ocrd-tool.json"?: string + "setup.py"?: string + } + } + compliant_cli: boolean + dependencies: { + [package: string]: string + } + dependency_conflicts?: { + [package: string]: { + [package: string]: string + } + } + id: string + latest_version: string + ocrd_tool?: { + git_url: string + tools: { + [ocrd_tool: string]: { + categrories: string[] + description: string + executable: string + input_file_grp: string[] + output_file_grp: string[] + parameters: any + steps: string[] + } + } + version: string + } + ocrd_tool_json_valid: boolean + official: boolean + org_plus_name: string + project_type: string + unreleased_changes: number + url: string +} \ No newline at end of file