Skip to content

Commit

Permalink
Merge pull request #14102 from jmchilton/fix_workflow_invocations_only
Browse files Browse the repository at this point in the history
Fix showing invocations for a particular workflow.
  • Loading branch information
mvdbeek authored Jun 22, 2022
2 parents 59221e7 + fd29743 commit 29100ed
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<JobDetailsProvider
v-if="!isDatasetLoading && dataset.creating_job !== null"
v-slot="{ result: job, loading: isJobLoading }"
:jobid="dataset.creating_job"
:jobId="dataset.creating_job"
auto-refresh>
<div v-if="!isJobLoading">
<dataset-information class="detail" :hda_id="datasetId" />
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/DatasetInformation/DatasetError.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<JobDetailsProvider
v-if="!datasetLoading"
v-slot="{ result: jobDetails, loading }"
:jobid="dataset.creating_job"
:jobId="dataset.creating_job"
@error="onError">
<div v-if="!loading">
<div class="page-container edit-attr">
Expand All @@ -24,7 +24,7 @@
:tool-stderr="jobDetails.tool_stderr"
:job-stderr="jobDetails.job_stderr"
:job-messages="jobDetails.job_messages" />
<JobProblemProvider v-slot="{ result: jobProblems }" :jobid="dataset.creating_job" @error="onError">
<JobProblemProvider v-slot="{ result: jobProblems }" :jobId="dataset.creating_job" @error="onError">
<div v-if="jobProblems && (jobProblems.has_duplicate_inputs || jobProblems.has_empty_inputs)">
<h3 class="common_problems mt-3">Detected Common Potential Problems</h3>
<p v-if="jobProblems.has_empty_inputs" id="dataset-error-has-empty-inputs">
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/JobInformation/JobInformation.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<job-details-provider auto-refresh :jobid="job_id" @update:result="updateJob" />
<job-details-provider auto-refresh :jobId="job_id" @update:result="updateJob" />
<h3>Job Information</h3>
<table id="job-information" class="tabletip info_data_table">
<tbody>
Expand Down
8 changes: 4 additions & 4 deletions client/src/components/providers/JobProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { rethrowSimple } from "utils/simple-error";
import { stateIsTerminal } from "./utils";
import { cleanPaginationParameters } from "./utils";

async function jobDetails({ jobid }) {
const url = `${getAppRoot()}api/jobs/${jobid}?full=True`;
async function jobDetails({ jobId }) {
const url = `${getAppRoot()}api/jobs/${jobId}?full=True`;
try {
const { data } = await axios.get(url);
return data;
Expand All @@ -15,8 +15,8 @@ async function jobDetails({ jobid }) {
}
}

async function jobProblems({ jobid }) {
const url = `${getAppRoot()}api/jobs/${jobid}/common_problems`;
async function jobProblems({ jobId }) {
const url = `${getAppRoot()}api/jobs/${jobId}/common_problems`;
try {
const { data } = await axios.get(url);
return data;
Expand Down
4 changes: 3 additions & 1 deletion client/src/components/providers/SingleQueryProvider.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import hash from "object-hash";
import { LastQueue } from "utils/promise-queue";
import { HasAttributesMixin } from "./utils";

/**
* Builds a provider that gets its result from a single promise-based query function and
Expand All @@ -14,6 +15,7 @@ import { LastQueue } from "utils/promise-queue";
export const SingleQueryProvider = (lookup, stopRefresh = (result) => false) => {
const promiseCache = new Map();
return {
mixins: [HasAttributesMixin],
props: {
useCache: {
type: Boolean,
Expand Down Expand Up @@ -74,7 +76,7 @@ export const SingleQueryProvider = (lookup, stopRefresh = (result) => false) =>
promiseCache.set(this.cacheKey, lookupPromise);
}
} else {
lookupPromise = this.queue.enqueue(lookup, this.$attrs);
lookupPromise = this.queue.enqueue(lookup, this.attributes);
}
lookupPromise.then(
(result) => {
Expand Down
13 changes: 2 additions & 11 deletions client/src/components/providers/storeProviders.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import axios from "axios";
import { prependPath } from "utils/redirect";
import { mapActions, mapGetters } from "vuex";
import { mapCacheActions } from "vuex-cache";
import { HasAttributesMixin } from "./utils";

export const SimpleProviderMixin = {
props: {
Expand Down Expand Up @@ -135,6 +136,7 @@ export const JobProvider = {
*/
export const StoreProvider = (storeAction, storeGetter, storeCountGetter = undefined) => {
return {
mixins: [HasAttributesMixin],
watch: {
$attrs(newVal, oldVal) {
if (JSON.stringify(newVal) != JSON.stringify(oldVal)) {
Expand All @@ -153,9 +155,6 @@ export const StoreProvider = (storeAction, storeGetter, storeCountGetter = undef
},
computed: {
...mapGetters([storeGetter, storeCountGetter]),
attributes() {
return this.toCamelCase(this.$attrs);
},
result() {
return this[storeGetter](this.attributes);
},
Expand Down Expand Up @@ -184,14 +183,6 @@ export const StoreProvider = (storeAction, storeGetter, storeCountGetter = undef
this.loading = false;
}
},
toCamelCase(attributes) {
const result = {};
for (const key in attributes) {
const newKey = key.replace(/-./g, (x) => x[1].toUpperCase());
result[newKey] = attributes[key];
}
return result;
},
},
};
};
Expand Down
18 changes: 18 additions & 0 deletions client/src/components/providers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ export function stateIsTerminal(result) {
return !JOB_STATES_MODEL.NON_TERMINAL_STATES.includes(result.state);
}

export const HasAttributesMixin = {
computed: {
attributes() {
return this.toCamelCase(this.$attrs);
},
},
methods: {
toCamelCase(attributes) {
const result = {};
for (const key in attributes) {
const newKey = key.replace(/-./g, (x) => x[1].toUpperCase());
result[newKey] = attributes[key];
}
return result;
},
},
};

// Adapt bootstrap parameters to Galaxy API. Galaxy consumes snake case parameters
// and generally uses limit instead of perPage/per_page as a name for this concept.
export function cleanPaginationParameters(requestParams) {
Expand Down

0 comments on commit 29100ed

Please sign in to comment.