aboutsummaryrefslogtreecommitdiffstats
path: root/src/static/js/workflows/workflow.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/static/js/workflows/workflow.js')
-rw-r--r--src/static/js/workflows/workflow.js21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/static/js/workflows/workflow.js b/src/static/js/workflows/workflow.js
index f3f39e9..97bf8f4 100644
--- a/src/static/js/workflows/workflow.js
+++ b/src/static/js/workflows/workflow.js
@@ -29,7 +29,6 @@ class LibLaaSAPI {
/** POSTs to dashboard, which then auths and logs the requests, makes the request to LibLaaS, and passes the result back to here.
Treat this as a private function. Only use the async functions when outside of this class */
static makeRequest(method, endpoint, workflow_data) {
- console.log("Making request: %s, %s, %s", method, endpoint, workflow_data.toString())
const token = document.getElementsByName('csrfmiddlewaretoken')[0].value
return new Promise((resolve, reject) => {// -> HttpResponse
$.ajax(
@@ -130,7 +129,6 @@ class LibLaaSAPI {
static async makeTemplate(templateBlob) { // -> UUID or null
templateBlob.owner = user;
- console.log(JSON.stringify(templateBlob))
return await this.handleResponse(this.makeRequest(HTTP.POST, endpoint.MAKE_TEMPLATE, templateBlob));
}
@@ -230,12 +228,13 @@ class Workflow {
}
goTo(step_number) {
- while (step_number > this.step) {
- this.goNext();
- }
-
- while (step_number < this.step) {
- this.goPrev();
+ if (step_number < 0) return;
+ this.step = step_number
+ document.getElementById(this.sections[this.step]).scrollIntoView({behavior: 'smooth'});
+ if (this.step == this.sections.length - 1) {
+ document.getElementById('next').setAttribute('disabled', '');
+ } else if (this.step == 1) {
+ document.getElementById('prev').removeAttribute('disabled');
}
}
@@ -245,9 +244,11 @@ function apiError(info) {
showError("Unable to fetch " + info +". Please try again later or contact support.")
}
-function showError(message) {
+// global variable needed for a scrollintoview bug affecting chrome
+let alert_destination = -1;
+function showError(message, destination) {
+ alert_destination = destination;
const text = document.getElementById('alert_modal_message');
-
text.innerText = message;
$("#alert_modal").modal('show');
}