Skip to content

Commit

Permalink
Expose collections in store -- these are much better for a toplevel s…
Browse files Browse the repository at this point in the history
…elector
  • Loading branch information
dannon committed Dec 19, 2024
1 parent e70ae68 commit bf6481b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions website/models/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface Workflow {
diagrams: string;
trsID: string;
categories: string[];
collections: string[];
}

// Define the interface for an author
Expand Down
7 changes: 1 addition & 6 deletions website/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import { defineNuxtConfig } from "nuxt/config";

export default defineNuxtConfig({
modules: [
"@nuxt/ui",
"@nuxt/content",
"@pinia/nuxt",
'nuxt-icon'
],
modules: ["@nuxt/ui", "@nuxt/content", "@pinia/nuxt", "nuxt-icon"],
colorMode: {
preference: "light",
},
Expand Down
2 changes: 2 additions & 0 deletions website/stores/workflows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const useWorkflowStore = defineStore("workflow", () => {
return allWorkflows.value.find((w) => w.trsID === trsID) as Workflow;
};
const allCategories = computed(() => Array.from(new Set(allWorkflows.value.flatMap((w) => w.categories))));
const allCollections = computed(() => Array.from(new Set(allWorkflows.value.flatMap((w) => w.collections))));
const allTags = computed(() => Array.from(new Set(allWorkflows.value.flatMap((w) => w.definition.tags))));

const setWorkflow = () => {
Expand All @@ -23,6 +24,7 @@ export const useWorkflowStore = defineStore("workflow", () => {
return {
workflow,
allCategories,
allCollections,
allTags,
allWorkflows,
getWorkflowByTrsId,
Expand Down

0 comments on commit bf6481b

Please sign in to comment.