Skip to content
Snippets Groups Projects
Verified Commit 15b6f458 authored by Daniel Göbel's avatar Daniel Göbel
Browse files

Improve wording

parent a1f5d978
No related branches found
No related tags found
1 merge request!163Resolve "Support anyOf and newer drafts of JSON schema"
...@@ -67,7 +67,7 @@ const anyOfTooltip = computed<string | undefined>(() => { ...@@ -67,7 +67,7 @@ const anyOfTooltip = computed<string | undefined>(() => {
labelText = "<ul class='ps-3 ms-0 mb-0 text-start'>"; labelText = "<ul class='ps-3 ms-0 mb-0 text-start'>";
if (props.anyOfDependencies.group.length > 0) { if (props.anyOfDependencies.group.length > 0) {
labelText += labelText +=
"<li>When this is set, these are also required:<ul >" + "<li>When this is set, these parameters are also required:<ul >" +
props.anyOfDependencies.group props.anyOfDependencies.group
.map((a) => "<li>--" + a + "</li>") .map((a) => "<li>--" + a + "</li>")
.join("") + .join("") +
...@@ -76,7 +76,7 @@ const anyOfTooltip = computed<string | undefined>(() => { ...@@ -76,7 +76,7 @@ const anyOfTooltip = computed<string | undefined>(() => {
labelText += labelText +=
"<li>Set this or any of these parameters:<ul>" + "<li>Set this or any of these parameters:<ul>" +
props.anyOfDependencies.dependencies props.anyOfDependencies.dependencies
.map((a) => "<li>--" + a + "</li>") .map((a) => "<li>" + a.map((b) => "--" + b).join(",") + "</li>")
.join("") + .join("") +
"</ul></li></ul>"; "</ul></li></ul>";
} }
...@@ -87,7 +87,7 @@ const anyOfTooltip = computed<string | undefined>(() => { ...@@ -87,7 +87,7 @@ const anyOfTooltip = computed<string | undefined>(() => {
const dependentTooltip = computed<string | undefined>(() => { const dependentTooltip = computed<string | undefined>(() => {
if (props.dependencies != undefined) { if (props.dependencies != undefined) {
return ( return (
"Required when these are set: <ul class='ps-4 mb-0 text-start'>" + "Required when these parameters are set: <ul class='ps-4 mb-0 text-start'>" +
props.dependencies.map((a) => "<li>--" + a + "</li>").join("") + props.dependencies.map((a) => "<li>--" + a + "</li>").join("") +
"</ul></li>" "</ul></li>"
); );
...@@ -113,15 +113,15 @@ onMounted(() => { ...@@ -113,15 +113,15 @@ onMounted(() => {
<div class="d-flex pt-2 justify-content-between"> <div class="d-flex pt-2 justify-content-between">
<div class="flex-fill ps-2"> <div class="flex-fill ps-2">
<div class="row"> <div class="row">
<div class="fs-6"> <span class="fs-6 w-fit">
<font-awesome-icon v-if="icon" :icon="icon" class="me-2" /> <font-awesome-icon v-if="icon" :icon="icon" class="me-2" />
<code :id="props.parameterName" class="border rounded p-1" <code :id="props.parameterName" class="border rounded p-1"
>--{{ props.parameterName }}</code >--{{ props.parameterName }}</code
> >
</div> </span>
<span <span
v-if="anyOfTooltip != undefined" v-if="anyOfTooltip != undefined"
class="rounded p-1 bg-secondary ms-2 label w-fit" class="rounded py-0 px-1 bg-secondary ms-2 label w-fit fs-6"
data-bs-toggle="tooltip" data-bs-toggle="tooltip"
data-bs-placement="bottom" data-bs-placement="bottom"
:data-bs-title="anyOfTooltip" :data-bs-title="anyOfTooltip"
...@@ -131,13 +131,13 @@ onMounted(() => { ...@@ -131,13 +131,13 @@ onMounted(() => {
> >
<span <span
v-if="dependentTooltip != undefined" v-if="dependentTooltip != undefined"
class="rounded p-1 bg-secondary ms-2 label w-fit" class="rounded py-0 px-1 bg-secondary ms-2 label w-fit fs-6"
data-bs-toggle="tooltip" data-bs-toggle="tooltip"
data-bs-placement="bottom" data-bs-placement="bottom"
:data-bs-title="dependentTooltip" :data-bs-title="dependentTooltip"
data-bs-custom-class="parameter-form-tooltip" data-bs-custom-class="parameter-form-tooltip"
data-bs-html="true" data-bs-html="true"
>dependent</span >dependency</span
> >
</div> </div>
<div class="row align-items-start mt-2"> <div class="row align-items-start mt-2">
......
...@@ -83,7 +83,7 @@ const parameterAnyOfDependenciesPerParameter = computed< ...@@ -83,7 +83,7 @@ const parameterAnyOfDependenciesPerParameter = computed<
group: group:
b.find((a) => a.includes(paramName))?.filter((a) => a != paramName) ?? b.find((a) => a.includes(paramName))?.filter((a) => a != paramName) ??
[], [],
dependencies: b.filter((a) => !a.includes(paramName)).flat(), dependencies: b.filter((a) => !a.includes(paramName)),
}; };
} }
return r; return r;
......
...@@ -117,12 +117,12 @@ function parameterDependentRequired(parameterName: string): boolean { ...@@ -117,12 +117,12 @@ function parameterDependentRequired(parameterName: string): boolean {
function parameterAnyOfRequired(parameterName: string): boolean { function parameterAnyOfRequired(parameterName: string): boolean {
return ( return (
parameterAnyOfDependenciesPerParameter.value[parameterName] != undefined && parameterAnyOfDependenciesPerParameter.value[parameterName] != undefined &&
parameterAnyOfDependenciesPerParameter.value[ parameterAnyOfDependenciesPerParameter.value[parameterName].dependencies
parameterName .flat()
].dependencies.reduce( .reduce(
(acc, groupParam) => acc && model.value[groupParam] == undefined, (acc, groupParam) => acc && model.value[groupParam] == undefined,
true, true,
) && ) &&
(model.value[parameterName] == undefined || (model.value[parameterName] == undefined ||
parameterAnyOfDependenciesPerParameter.value[parameterName].group.reduce( parameterAnyOfDependenciesPerParameter.value[parameterName].group.reduce(
(acc, groupParam) => acc && model.value[groupParam] == undefined, (acc, groupParam) => acc && model.value[groupParam] == undefined,
...@@ -145,7 +145,7 @@ const parameterAnyOfDependenciesPerParameter = computed< ...@@ -145,7 +145,7 @@ const parameterAnyOfDependenciesPerParameter = computed<
group: group:
b.find((a) => a.includes(paramName))?.filter((a) => a != paramName) ?? b.find((a) => a.includes(paramName))?.filter((a) => a != paramName) ??
[], [],
dependencies: b.filter((a) => !a.includes(paramName)).flat(), dependencies: b.filter((a) => !a.includes(paramName)),
}; };
} }
return r; return r;
...@@ -158,7 +158,7 @@ const dependentTooltip = computed<Record<string, string>>(() => { ...@@ -158,7 +158,7 @@ const dependentTooltip = computed<Record<string, string>>(() => {
let labelText = ""; let labelText = "";
if (parameterDependenciesPerParameter.value[paramName] != undefined) { if (parameterDependenciesPerParameter.value[paramName] != undefined) {
labelText += labelText +=
"Required when these are set: <ul class='ps-4 mb-0 text-start'>" + "Required when these parameters are set: <ul class='ps-4 mb-0 text-start'>" +
parameterDependenciesPerParameter.value[paramName] parameterDependenciesPerParameter.value[paramName]
.map((a) => "<li>--" + a + "</li>") .map((a) => "<li>--" + a + "</li>")
.join("") + .join("") +
...@@ -191,7 +191,7 @@ const anyOfTooltip = computed<Record<string, string>>(() => { ...@@ -191,7 +191,7 @@ const anyOfTooltip = computed<Record<string, string>>(() => {
labelText += labelText +=
"<li>Set this or any of these parameters:<ul>" + "<li>Set this or any of these parameters:<ul>" +
parameterAnyOfDependenciesPerParameter.value[paramName].dependencies parameterAnyOfDependenciesPerParameter.value[paramName].dependencies
.map((a) => "<li>--" + a + "</li>") .map((a) => "<li>" + a.map((b) => "--" + b).join(",") + "</li>")
.join("") + .join("") +
"</ul></li></ul>"; "</ul></li></ul>";
} }
...@@ -282,7 +282,7 @@ onMounted(() => { ...@@ -282,7 +282,7 @@ onMounted(() => {
data-bs-custom-class="parameter-form-tooltip" data-bs-custom-class="parameter-form-tooltip"
data-bs-html="true" data-bs-html="true"
> >
Dependent dependency
</span> </span>
<div <div
class="input-group" class="input-group"
......
...@@ -20,5 +20,5 @@ export type TemporaryParams = { ...@@ -20,5 +20,5 @@ export type TemporaryParams = {
export interface ParameterAnyOfDependencies { export interface ParameterAnyOfDependencies {
group: string[]; // AND group in OR combination group: string[]; // AND group in OR combination
dependencies: string[]; // OR combination to fulfill dependencies: string[][]; // OR combination to fulfill
} }
...@@ -21,6 +21,7 @@ import type { ...@@ -21,6 +21,7 @@ import type {
import dayjs from "dayjs"; import dayjs from "dayjs";
import { useWorkflowExecutionStore } from "@/stores/workflowExecutions"; import { useWorkflowExecutionStore } from "@/stores/workflowExecutions";
import { useResourceStore } from "@/stores/resources"; import { useResourceStore } from "@/stores/resources";
import { latestVersion } from "@/utils/Workflow.ts";
const authStore = useUserStore(); const authStore = useUserStore();
const bucketStore = useBucketStore(); const bucketStore = useBucketStore();
...@@ -259,7 +260,18 @@ function accumulateWorkflowStatus( ...@@ -259,7 +260,18 @@ function accumulateWorkflowStatus(
v-for="workflow in processedWorkflows.slice(0, 3)" v-for="workflow in processedWorkflows.slice(0, 3)"
:key="workflow.workflow_id" :key="workflow.workflow_id"
> >
{{ workflow.name }} <br /> <router-link
:to="{
name: 'workflow-version',
params: {
workflowId: workflow.workflow_id,
versionId: latestVersion(workflow.versions)
?.workflow_version_id,
},
}"
>{{ workflow.name }}
</router-link>
<br />
<span class="text-secondary" style="font-size: 0.8rem"> <span class="text-secondary" style="font-size: 0.8rem">
Last update Last update
{{ {{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment