Dodo-app: fix sync user info bug
disable form after running app installation
Change-Id: I28dec5f8a9ad1d586bc2d2cc56a6c1c66cf2fdbe
diff --git a/core/installer/welcome/static/dodo-app.js b/core/installer/welcome/static/dodo-app.js
new file mode 100644
index 0000000..ccb5252
--- /dev/null
+++ b/core/installer/welcome/static/dodo-app.js
@@ -0,0 +1,20 @@
+function triggerForm(status, buttonTxt) {
+ const form = document.getElementById("create-app");
+ const elements = form.querySelectorAll("input, select, textarea, button");
+ const button = document.getElementById("create-app-button");
+ button.textContent = buttonTxt;
+ button.setAttribute("aria-busy", status);
+ elements.forEach(element => {
+ element.disabled = status;
+ });
+}
+
+document.addEventListener("DOMContentLoaded", () => {
+ const form = document.getElementById("create-app");
+ form.addEventListener("submit", (event) => {
+ setTimeout(() => {
+ triggerForm(true, "creating app ...");
+ }, 0);
+ });
+ triggerForm(false, "create app");
+});
diff --git a/core/installer/welcome/static/dodo_app.css b/core/installer/welcome/static/dodo_app.css
index 320f940..b66da00 100644
--- a/core/installer/welcome/static/dodo_app.css
+++ b/core/installer/welcome/static/dodo_app.css
@@ -73,11 +73,31 @@
}
body.container {
- padding-top: 15px;
+ padding-top: 15px;
}
@media (min-width: 768px) {
- fieldset.grid {
- grid-template-columns: 1fr 1fr 1fr 200px;
- }
-};
+ fieldset.grid {
+ grid-template-columns: 1fr 1fr 1fr 200px;
+ }
+}
+
+[role="button"][aria-busy="true"],
+[type="button"][aria-busy="true"],
+[type="reset"][aria-busy="true"],
+[type="submit"][aria-busy="true"],
+a[aria-busy="true"],
+button[aria-busy="true"] {
+ pointer-events: auto;
+}
+
+input:disabled,
+select:disabled,
+textarea:disabled,
+button:disabled {
+ cursor: not-allowed;
+}
+
+.app-info-link {
+ width: fit-content;
+}