Skip to content

Commit

Permalink
Merge pull request #74 from ag-computational-bio/feature/persist-brow…
Browse files Browse the repository at this point in the history
…sing-data

Feature/persist browsing data
  • Loading branch information
lukasjelonek authored Dec 21, 2023
2 parents 1514c4a + 39997ea commit c8827fb
Show file tree
Hide file tree
Showing 4 changed files with 284 additions and 147 deletions.
10 changes: 5 additions & 5 deletions src/components/QueryFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@
</template>

<script setup lang="ts">
import type { FilterTuple } from "@/views/BrowseView.vue";
import type { Range } from "@/views/BrowseView.vue";
import { computed, type PropType } from "vue";
const props = defineProps({
label: { type: String, required: true },
modelValue: { type: Object as PropType<FilterTuple>, required: true },
modelValue: { type: Object as PropType<Range>, required: true },
});
const emits = defineEmits<{
(e: "update:modelValue", value: FilterTuple): void;
(e: "update:modelValue", value: Range): void;
}>();
const from = computed({
get: () => props.modelValue.from,
set: (x) => {
x = Number(x);
if(!isNaN(x)) {
if (!isNaN(x)) {
emits("update:modelValue", { ...props.modelValue, from: x });
}
},
Expand All @@ -34,7 +34,7 @@ const to = computed({
get: () => props.modelValue.to,
set: (x) => {
x = Number(x);
if(!isNaN(x)) {
if (!isNaN(x)) {
emits("update:modelValue", { ...props.modelValue, to: x });
}
},
Expand Down
3 changes: 3 additions & 0 deletions src/model/Search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ export type SearchInfoLeaf = {
field: string;
ops: string[];
type: "text" | "number";
min: number;
max: number;
};

export type SearchInfoNested = {
field: string;
fields: SearchInfoField[];
Expand Down
127 changes: 61 additions & 66 deletions src/router/index.ts
Original file line number Diff line number Diff line change
@@ -1,66 +1,61 @@
import { createRouter, createWebHistory } from "vue-router";

const router = createRouter({
linkActiveClass: "active",
linkExactActiveClass: "exact-active",
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
path: "/",
name: "home",
component: () => import("../views/HomeView.vue"),
},
{
path: "/about",
name: "about",
// route level code-splitting
// this generates a separate chunk (About.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import("../views/AboutView.vue"),
},
{
path: "/search",
name: "search",
component: () => import("../views/search/SearchView.vue"),
props: (route) => ({
offset: route.query.offset,
limit: route.query.limit,
query: route.query.query,
}),
},
{
path: "/imprint",
name: "imprint",
component: () => import("../views/ImprintView.vue"),
},
{
path: "/result/:id",
name: "result",
component: () => import("../views/show-results/ResultView.vue"),
props: true,
},
{
path: "/result/:id/:tab",
name: "result-tab",
component: () => import("../views/show-results/ResultView.vue"),
props: true,
},
{
path: "/browse",
name: "browse",
component: () => import("../views/BrowseView.vue"),
},
{
path: "/composition",
name: "composition",
component: () => import("../views/DatasetCompositionView.vue"),
},
{
path: "/statistics",
name: "statistics",
component: () => import("../views/statistics/StatisticsView.vue"),
},
],
});

export default router;
import { createRouter, createWebHistory } from "vue-router";

const router = createRouter({
linkActiveClass: "active",
linkExactActiveClass: "exact-active",
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
path: "/",
name: "home",
component: () => import("../views/HomeView.vue"),
},
{
path: "/about",
name: "about",
// route level code-splitting
// this generates a separate chunk (About.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import("../views/AboutView.vue"),
},
{
path: "/search",
name: "search",
component: () => import("../views/search/SearchView.vue"),
},
{
path: "/imprint",
name: "imprint",
component: () => import("../views/ImprintView.vue"),
},
{
path: "/result/:id",
name: "result",
component: () => import("../views/show-results/ResultView.vue"),
props: true,
},
{
path: "/result/:id/:tab",
name: "result-tab",
component: () => import("../views/show-results/ResultView.vue"),
props: true,
},
{
path: "/browse",
name: "browse",
component: () => import("../views/BrowseView.vue"),
},
{
path: "/composition",
name: "composition",
component: () => import("../views/DatasetCompositionView.vue"),
},
{
path: "/statistics",
name: "statistics",
component: () => import("../views/statistics/StatisticsView.vue"),
},
],
});

export default router;
Loading

0 comments on commit c8827fb

Please sign in to comment.