Skip to content

Commit

Permalink
Added Transcript content in order so errors generated from Tool Form …
Browse files Browse the repository at this point in the history
…page's modal will be retained and passed through to the Error Report Email
  • Loading branch information
hujambo-dunia committed Apr 5, 2024
1 parent c2e3c90 commit 6152282
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 35 deletions.
57 changes: 32 additions & 25 deletions client/src/components/Common/SelfReportingError.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,6 @@
</div>
</div>
</div>
<JobProblemProvider v-slot="{ result: jobProblems }" :job-id="dataset.creating_job" @error="onError">
<div v-if="jobProblems && (jobProblems.has_duplicate_inputs || jobProblems.has_empty_inputs)">
<h4 class="common_problems mt-3 h-md">Detected Common Potential Problems</h4>
<p v-if="jobProblems.has_empty_inputs" id="dataset-error-has-empty-inputs">
The tool was started with one or more empty input datasets. This frequently results in tool errors
due to problematic input choices.
</p>
<p v-if="jobProblems.has_duplicate_inputs" id="dataset-error-has-duplicate-inputs">
The tool was started with one or more duplicate input datasets. This frequently results in tool
errors due to problematic input choices.
</p>
</div>
</JobProblemProvider>
<h4 class="mt-3 h-md">Troubleshooting</h4>
<p>
There are a number of helpful resources to self diagnose and correct problems.
Expand All @@ -60,23 +47,31 @@
v-model="message"
:area="true"
title="Please provide detailed information on the activities leading to this issue:" />
<b-button
id="dataset-error-submit"
variant="primary"
class="mt-3"
:disabled="disableSubmit"
@click="submit(dataset, currentUser?.email)">
<BLink
:aria-expanded="isExpanded ? 'true' : 'false'"
aria-controls="collapse-previous"
@click="isExpanded = !isExpanded">
({{ title }}) Error transcript:
</BLink>
<BCollapse id="collapse-previous" v-model="isExpanded">
<pre class="rounded code">{{ transcript }}</pre>
</BCollapse><br>
<BButton
id="dataset-error-submit"
variant="primary"
class="mt-3"
:disabled="disableSubmit"
@click="submit(dataset, currentUser?.email)">
<FontAwesomeIcon icon="bug" class="mr-1" />Report
</b-button>
</BButton>
</div>
</div>
</template>
<script>
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import { BAlert } from "bootstrap-vue";
import { BAlert, BButton, BCollapse, BLink } from "bootstrap-vue";
import FormElement from "components/Form/FormElement";
import { JobProblemProvider } from "components/providers/JobProvider";
import { mapState } from "pinia";
import { getGalaxyInstance } from "@/app";
Expand All @@ -89,8 +84,10 @@ export default {
components: {
FontAwesomeIcon,
FormElement,
JobProblemProvider,
BAlert,
BButton,
BCollapse,
BLink,
},
props: {
dataset: {
Expand All @@ -105,6 +102,10 @@ export default {
type: Array,
default: () => [],
},
transcript: {
type: String,
default: "",
},
},
setup() {
const { renderMarkdown } = useMarkdown({ openLinksInNewPage: true });
Expand All @@ -115,6 +116,7 @@ export default {
message: null,
errorMessage: null,
resultMessages: [],
isExpanded: false,
};
},
computed: {
Expand All @@ -128,13 +130,18 @@ export default {
const isEmailActive = !getGalaxyInstance().config.show_inactivity_warning;
return !this.currentUser?.email || !isEmailActive;
},
title() {
return this.isExpanded ? `-` : `+`;
},
},
methods: {
onError(err) {
this.errorMessage = err;
},
submit(dataset, email) {
sendErrorReport(dataset, this.message, email).then(
submit(dataset, userEmailJob) {
const email = userEmailJob || this.currentUserEmail;
const message = this.message;
sendErrorReport(dataset, message, email, this.transcript).then(
(resultMessages) => {
this.resultMessages = resultMessages;
},
Expand Down
41 changes: 31 additions & 10 deletions client/src/components/Tool/ToolForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@
<ToolEntryPoints v-for="job in entryPoints" :key="job.id" :job-id="job.id" />
</div>
<b-modal v-model="showError" size="sm" :title="errorTitle | l" scrollable ok-only>
<b-alert v-if="errorMessage" show variant="danger">
{{ errorMessage }}
</b-alert>
<b-alert show variant="warning">
The server could not complete this request. Please verify your parameter settings, retry submission and
contact the Galaxy Team if this error persists. A transcript of the submitted data is shown below.
</b-alert>
<small class="text-muted">
<pre>{{ errorContentPretty }}</pre>
</small>
{{ /* TODO integrate submit-prop into larger form */ }}
<SelfReportingError
:result-messages="[]"
:show-form="'true'"
:message="''"
:submit="submit"
:transcript="errorContentPretty"
:command-outputs="buildCommandOutputs(errorMessage)"
:notifications="buildNotifications(formConfig.id)" />
</b-modal>
<ToolRecommendation v-if="showRecommendation" :tool-id="formConfig.id" />
<ToolCard
Expand Down Expand Up @@ -126,6 +125,7 @@ import { getToolFormData, submitJob, updateToolFormData } from "./services";
import ToolCard from "./ToolCard";
import { allowCachedJobs } from "./utilities";
import SelfReportingError from "../Common/SelfReportingError.vue";
import FormSelect from "@/components/Form/Elements/FormSelect.vue";
export default {
Expand All @@ -139,6 +139,7 @@ export default {
ToolEntryPoints,
ToolRecommendation,
Heading,
SelfReportingError,
},
props: {
id: {
Expand Down Expand Up @@ -399,6 +400,26 @@ export default {
}
);
},
buildNotifications(toolId) {
return [
{
text: `An error occurred while running the tool <b id='dataset-error-tool-id' class='text-break '>${toolId}</b>.`,
variant: "danger",
},
{
text: `The server could not complete this request. Please verify your parameter settings, retry submission and contact the Galaxy team if this error persists. A transcript of the submitted data is shown below.`,
variant: "warning",
},
];
},
buildCommandOutputs(detail) {
return [
{
text: "Tool Message (?)",
detail: [detail],
},
];
},
},
};
</script>

0 comments on commit 6152282

Please sign in to comment.