Skip to content

Commit

Permalink
Merge branch 'release_24.2' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Nov 26, 2024
2 parents ff7025d + bfa28df commit 40388b4
Show file tree
Hide file tree
Showing 27 changed files with 514 additions and 115 deletions.
2 changes: 1 addition & 1 deletion client/src/api/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4804,7 +4804,7 @@ export interface paths {
};
/**
* Get User Roles
* @description Return a collection of roles associated with this user. Only admins can see user roles.
* @description Return a list of roles associated with this user. Only admins can see user roles.
*/
get: operations["get_user_roles_api_users__user_id__roles_get"];
put?: never;
Expand Down
22 changes: 18 additions & 4 deletions client/src/components/Common/TextSummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ interface Props {
maxLength?: number;
/** The text to summarize */
description: string;
/** If `true`, doesn't let unexpanded text go beyond height of one line */
/** If `true`, doesn't let unexpanded text go beyond height of one line
* and ignores `maxLength` */
oneLineSummary?: boolean;
/** If `true`, doesn't show expand/collapse buttons */
noExpand?: boolean;
Expand All @@ -25,8 +26,17 @@ const props = withDefaults(defineProps<Props>(), {
});
const showDetails = ref(false);
const refOneLineSummary = ref<HTMLElement | null>(null);
const textTooLong = computed(() => props.description.length > props.maxLength);
const textTooLong = computed(() => {
if (!props.oneLineSummary) {
return props.description.length > props.maxLength;
} else if (refOneLineSummary.value) {
return refOneLineSummary.value.scrollWidth > refOneLineSummary.value.clientWidth;
} else {
return false;
}
});
const text = computed(() =>
textTooLong.value && !showDetails.value
? props.description.slice(0, Math.round(props.maxLength - props.maxLength / 2)) + "..."
Expand All @@ -35,8 +45,12 @@ const text = computed(() =>
</script>

<template>
<div>
<component :is="props.component" v-if="props.oneLineSummary" class="one-line-summary">
<div :class="{ 'd-flex': props.oneLineSummary && !noExpand }">
<component
:is="props.component"
v-if="props.oneLineSummary"
ref="refOneLineSummary"
:class="{ 'one-line-summary': !showDetails }">
{{ props.description }}
</component>
<span v-else>{{ text }}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
:run-disabled="hasValidationErrors || !canRunOnHistory"
:run-waiting="waitingForRequest"
@on-execute="onExecute">
<template v-slot:workflow-run-actions>
<template v-slot:workflow-title-actions>
<b-dropdown
v-if="showRuntimeSettings(currentUser)"
id="dropdown-form"
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/Workflow/Run/WorkflowRunSuccess.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ const wasNewHistoryTarget =

<template>
<div>
<div class="donemessagelarge">
<div v-if="props.invocations.length > 1" class="donemessagelarge">
Successfully invoked workflow <b>{{ props.workflowName }}</b>
<em v-if="props.invocations.length > 1"> - {{ props.invocations.length }} times</em>.
<em> - {{ props.invocations.length }} times</em>.
<span v-if="targetHistories.length > 1">
This workflow will generate results in multiple histories. You can observe progress in the
<router-link to="/histories/view_multiple">history multi-view</router-link>.
Expand Down
26 changes: 11 additions & 15 deletions client/src/components/Workflow/Run/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,34 +136,30 @@ export class WorkflowRunModel {
// or if an explicit reference is specified as data_ref and available
_.each(this.steps, (step) => {
if (step.step_type == "tool") {
var data_resolved = true;
let dataResolved = true;
visitInputs(step.inputs, (input, name, context) => {
var is_runtime_value = input.value && input.value.__class__ == "RuntimeValue";
var is_data_input = ["data", "data_collection"].indexOf(input.type) != -1;
var data_ref = context[input.data_ref];
const isRuntimeValue = input.value && input.value.__class__ == "RuntimeValue";
const isDataInput = ["data", "data_collection"].indexOf(input.type) != -1;
const dataRef = context[input.data_ref];
if (input.step_linked && !isDataStep(input.step_linked)) {
data_resolved = false;
dataResolved = false;
}
if (input.options && ((input.options.length == 0 && !data_resolved) || input.wp_linked)) {
if (input.options && ((input.options.length == 0 && !dataResolved) || input.wp_linked)) {
input.is_workflow = true;
}
if (data_ref) {
if (dataRef) {
input.is_workflow =
(data_ref.step_linked && !isDataStep(data_ref.step_linked)) || input.wp_linked;
(dataRef.step_linked && !isDataStep(dataRef.step_linked)) || input.wp_linked;
}
if (
!input.optional &&
(is_data_input ||
(input.value && input.value.__class__ == "RuntimeValue" && !input.step_linked))
) {
if ((isDataInput && !input.optional) || (!isDataInput && isRuntimeValue && !input.step_linked)) {
step.expanded = true;
hasOpenToolSteps = true;
}
if (is_runtime_value) {
if (isRuntimeValue) {
input.value = null;
}
input.flavor = "workflow";
if (!is_runtime_value && !is_data_input && input.type !== "hidden" && !input.wp_linked) {
if (!isRuntimeValue && !isDataInput && input.type !== "hidden" && !input.wp_linked) {
if (input.optional || (!isEmpty(input.value) && input.value !== "")) {
input.collapsible_value = input.value;
input.collapsible_preview = true;
Expand Down
8 changes: 6 additions & 2 deletions client/src/components/Workflow/WorkflowAnnotation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,19 @@ async function mountWorkflowAnnotation(version: "run_form" | "invocation", ownsW
}

describe("WorkflowAnnotation renders", () => {
it("(always) the run count and history, not indicators if owned not published", async () => {
it("the run count and history, not indicators if owned not published", async () => {
async function checkHasRunCount(version: "run_form" | "invocation") {
const { wrapper } = await mountWorkflowAnnotation(version);

const runCount = wrapper.find(SELECTORS.RUN_COUNT);
expect(runCount.text()).toContain("workflow runs:");
expect(runCount.text()).toContain(SAMPLE_RUN_COUNT.toString());

expect(wrapper.find(SELECTORS.SWITCH_TO_HISTORY_LINK).text()).toBe(TEST_HISTORY.name);
if (version === "run_form") {
expect(wrapper.find(SELECTORS.SWITCH_TO_HISTORY_LINK).exists()).toBe(false);
} else {
expect(wrapper.find(SELECTORS.SWITCH_TO_HISTORY_LINK).text()).toBe(TEST_HISTORY.name);
}

// Since this is the user's own workflow, the indicators link
// (to view all published workflows by the owner) should not be present
Expand Down
7 changes: 4 additions & 3 deletions client/src/components/Workflow/WorkflowAnnotation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ const workflowTags = computed(() => {
</span>
<UtcDate :date="timeElapsed" mode="elapsed" data-description="workflow annotation date" />
</i>
<span class="d-flex flex-gapx-1 align-items-center">
<FontAwesomeIcon :icon="faHdd" />Input History:
<span v-if="invocationUpdateTime" class="d-flex flex-gapx-1 align-items-center">
<FontAwesomeIcon :icon="faHdd" />History:
<SwitchToHistoryLink :history-id="props.historyId" />
<BBadge
v-if="props.newHistoryTarget && useHistoryStore().currentHistoryId !== props.historyId"
Expand All @@ -92,8 +92,9 @@ const workflowTags = computed(() => {
</div>
</div>
<div v-if="props.showDetails">
<TextSummary v-if="description" class="my-1" :description="description" />
<TextSummary v-if="description" class="my-1" :description="description" one-line-summary component="span" />
<StatelessTags v-if="workflowTags.length" :value="workflowTags" :disabled="true" />
<hr class="mb-0 mt-2" />
</div>
</div>
</template>
55 changes: 40 additions & 15 deletions client/src/components/Workflow/WorkflowNavigationTitle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ interface Props {
workflowId: string;
runDisabled?: boolean;
runWaiting?: boolean;
success?: boolean;
}
const props = withDefaults(defineProps<Props>(), {
Expand Down Expand Up @@ -84,20 +85,20 @@ const workflowImportTitle = computed(() => {

<template>
<div>
<div>
<BAlert v-if="importErrorMessage" variant="danger" dismissible show @dismissed="importErrorMessage = null">
{{ importErrorMessage }}
</BAlert>
<BAlert v-else-if="importedWorkflow" variant="info" dismissible show @dismissed="importedWorkflow = null">
<span>
Workflow <b>{{ importedWorkflow.name }}</b> imported successfully.
</span>
<RouterLink to="/workflows/list">Click here</RouterLink> to view the imported workflow in the workflows
list.
</BAlert>

<BAlert v-if="error" variant="danger" show>{{ error }}</BAlert>

<BAlert v-if="importErrorMessage" variant="danger" dismissible show @dismissed="importErrorMessage = null">
{{ importErrorMessage }}
</BAlert>
<BAlert v-else-if="importedWorkflow" variant="info" dismissible show @dismissed="importedWorkflow = null">
<span>
Workflow <b>{{ importedWorkflow.name }}</b> imported successfully.
</span>
<RouterLink to="/workflows/list">Click here</RouterLink> to view the imported workflow in the workflows
list.
</BAlert>

<BAlert v-if="error" variant="danger" show>{{ error }}</BAlert>

<div class="position-relative">
<div v-if="workflow" class="ui-portlet-section">
<div class="d-flex portlet-header align-items-center">
<div class="flex-grow-1" data-description="workflow heading">
Expand Down Expand Up @@ -136,7 +137,7 @@ const workflowImportTitle = computed(() => {
:action="onImport">
</AsyncButton>

<slot name="workflow-run-actions" />
<slot name="workflow-title-actions" />

<ButtonSpinner
v-if="!props.invocation"
Expand All @@ -163,6 +164,30 @@ const workflowImportTitle = computed(() => {
</BButtonGroup>
</div>
</div>
<div v-if="props.success" class="donemessagelarge">
Successfully invoked workflow
<b>{{ getWorkflowName() }}</b>
</div>
</div>
</div>
</template>

<style scoped lang="scss">
@keyframes fadeOut {
0% {
opacity: 1;
}
100% {
opacity: 0;
display: none;
pointer-events: none;
}
}
.donemessagelarge {
top: 0;
position: absolute;
width: 100%;
animation: fadeOut 3s forwards;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const selectors = {
invocationSummary: ".invocation-overview",
bAlertStub: "balert-stub",
spanElement: "span",
invocationReportTab: "btab-stub[title='Report']",
invocationReportTab: '[titleitemclass="invocation-report-tab"]',
fullPageHeading: "anonymous-stub[h1='true']",
};

Expand Down
Loading

0 comments on commit 40388b4

Please sign in to comment.