-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cf9b302
commit 0d7561d
Showing
8 changed files
with
223 additions
and
34 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
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 |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<script setup lang="ts"> | ||
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; | ||
import type { WorkflowInput } from "../Workflow/Editor/modules/inputs"; | ||
import ActivityPanel from "./ActivityPanel.vue"; | ||
const props = defineProps<{ | ||
inputs: WorkflowInput[]; | ||
}>(); | ||
const emit = defineEmits<{ | ||
(e: "insertModule", id: string, name: string, state: WorkflowInput["stateOverwrites"]): void; | ||
}>(); | ||
</script> | ||
|
||
<template> | ||
<ActivityPanel title="Inputs"> | ||
<div class="input-list"> | ||
<button | ||
v-for="(input, index) in props.inputs" | ||
:key="index" | ||
class="workflow-input-button" | ||
@click="emit('insertModule', input.id, input.title, input.stateOverwrites)"> | ||
<FontAwesomeIcon class="input-icon" fixed-width :icon="input.icon" /> | ||
<span class="input-title">{{ input.title }}</span> | ||
<span class="input-description">{{ input.description }}</span> | ||
</button> | ||
</div> | ||
</ActivityPanel> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
@import "theme/blue.scss"; | ||
.input-list { | ||
overflow-y: auto; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 0.5rem; | ||
} | ||
.workflow-input-button { | ||
border-radius: 0.5rem; | ||
border: 1px solid $gray-300; | ||
background: transparent; | ||
display: grid; | ||
grid-template-columns: auto 1fr; | ||
grid-template-areas: | ||
"i t" | ||
"d d"; | ||
text-align: left; | ||
gap: 0.25rem; | ||
align-items: center; | ||
&:hover, | ||
&:focus { | ||
background-color: $gray-100; | ||
border-color: $brand-primary; | ||
} | ||
&:active { | ||
background-color: $gray-200; | ||
border-color: $brand-primary; | ||
} | ||
.input-icon { | ||
grid-area: i; | ||
} | ||
.input-title { | ||
grid-area: t; | ||
font-weight: bold; | ||
} | ||
.input-description { | ||
grid-area: d; | ||
} | ||
} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import { faFile, faFolder } from "@fortawesome/free-regular-svg-icons"; | ||
import { faPencilAlt } from "@fortawesome/free-solid-svg-icons"; | ||
import { type IconDefinition } from "font-awesome-6"; | ||
|
||
export interface WorkflowInput { | ||
id: string; | ||
title: string; | ||
description: string; | ||
stateOverwrites?: { | ||
parameter_type?: "text" | "integer" | "boolean" | "color" | "float" | "directory_uri"; | ||
}; | ||
icon: IconDefinition; | ||
} | ||
|
||
export function getWorkflowInputs(): WorkflowInput[] { | ||
return [ | ||
{ | ||
id: "data_input", | ||
title: "Input Dataset", | ||
description: "Single dataset input", | ||
icon: faFile, | ||
}, | ||
{ | ||
id: "data_collection_input", | ||
title: "Input Dataset Collection", | ||
description: "Input for a collection of datasets", | ||
icon: faFolder, | ||
}, | ||
{ | ||
id: "parameter_input", | ||
title: "Text Input", | ||
description: "Text parameter used for workflow logic", | ||
icon: faPencilAlt, | ||
stateOverwrites: { | ||
parameter_type: "text", | ||
}, | ||
}, | ||
{ | ||
id: "parameter_input", | ||
title: "Integer Input", | ||
description: "Whole number parameter used for workflow logic", | ||
icon: faPencilAlt, | ||
stateOverwrites: { | ||
parameter_type: "integer", | ||
}, | ||
}, | ||
{ | ||
id: "parameter_input", | ||
title: "Float Input", | ||
description: "Imprecise decimal number parameter used for workflow logic", | ||
icon: faPencilAlt, | ||
stateOverwrites: { | ||
parameter_type: "float", | ||
}, | ||
}, | ||
{ | ||
id: "parameter_input", | ||
title: "Boolean Input", | ||
description: "True / False parameter used for workflow logic", | ||
icon: faPencilAlt, | ||
stateOverwrites: { | ||
parameter_type: "boolean", | ||
}, | ||
}, | ||
{ | ||
id: "parameter_input", | ||
title: "Color Input", | ||
description: "Color parameter used for workflow logic", | ||
icon: faPencilAlt, | ||
stateOverwrites: { | ||
parameter_type: "color", | ||
}, | ||
}, | ||
{ | ||
id: "parameter_input", | ||
title: "Directory Input", | ||
description: "Directory parameter used for workflow logic", | ||
icon: faPencilAlt, | ||
stateOverwrites: { | ||
parameter_type: "directory_uri", | ||
}, | ||
}, | ||
]; | ||
} |
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 |
---|---|---|
|
@@ -1456,6 +1456,11 @@ | |
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.2.1.tgz#411e02a820744d3f7e0d8d9df9d82b471beaa073" | ||
integrity sha512-Sz07mnQrTekFWLz5BMjOzHl/+NooTdW8F8kDQxjWwbpOJcnoSg4vUDng8d/WR1wOxM0O+CY9Zw0nR054riNYtQ== | ||
|
||
"@fortawesome/[email protected]": | ||
version "6.7.1" | ||
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.7.1.tgz#6201640f39fdcf8e41cd9d1a92b2da3a96817fa4" | ||
integrity sha512-gbDz3TwRrIPT3i0cDfujhshnXO9z03IT1UKRIVi/VEjpNHtSBIP2o5XSm+e816FzzCFEzAxPw09Z13n20PaQJQ== | ||
|
||
"@fortawesome/fontawesome-common-types@^0.2.36": | ||
version "0.2.36" | ||
resolved "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.36.tgz" | ||
|
@@ -6335,6 +6340,13 @@ follow-redirects@^1.0.0, follow-redirects@^1.15.6: | |
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" | ||
integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== | ||
|
||
"font-awesome-6@npm:@fortawesome/free-solid-svg-icons@6": | ||
version "6.7.1" | ||
resolved "https://registry.yarnpkg.com/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.7.1.tgz#c1f9a6c25562a12c283e87e284f9d82a5b0dbcc0" | ||
integrity sha512-BTKc0b0mgjWZ2UDKVgmwaE0qt0cZs6ITcDgjrti5f/ki7aF5zs+N91V6hitGo3TItCFtnKg6cUVGdTmBFICFRg== | ||
dependencies: | ||
"@fortawesome/fontawesome-common-types" "6.7.1" | ||
|
||
for-each@^0.3.3: | ||
version "0.3.3" | ||
resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" | ||
|
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