Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
slack_import: Disable submit button if file is invalid.
Aman Agrawalf45552fadd37
diff --git a/templates/zerver/slack_import.html b/templates/zerver/slack_import.htmlindex 0fc5b8468c3..0cd3d600fe9 100644--- a/templates/zerver/slack_import.html+++ b/templates/zerver/slack_import.html@@ -83,7 +83,7 @@<div class="not-editable-realm-field" id="slack-import-uploaded-file-name">{{ uploaded_import_file_name }}</div></div><div class="input-box">- <button type="submit" class="register-button">+ <button type="submit" class="register-button"{% if invalid_file_error_message %} disabled{% endif %}>{{ _("Start import") }}</button></div>diff --git a/web/src/portico/signup.ts b/web/src/portico/signup.tsindex 109f252c286..6410aaa2653 100644--- a/web/src/portico/signup.ts+++ b/web/src/portico/signup.ts@@ -457,6 +457,7 @@ $(() => {$("#slack-import-start-upload-wrapper").removeClass("hidden");$("#slack-import-uploaded-file-name").text(file.name!);$("#slack-import-file-upload-error").text("");+ $("#realm-creation-form-slack-import .register-button").prop("disabled", false);});// Reset uppy state to allow user replace existing uploaded file.uppy.on("complete", () => {diff --git a/web/styles/portico/portico_signin.css b/web/styles/portico/portico_signin.cssindex 2b7527da3d3..971ec59102c 100644--- a/web/styles/portico/portico_signin.css+++ b/web/styles/portico/portico_signin.css@@ -1568,3 +1568,10 @@ button#register_auth_button_gitlab {text-decoration: underline;}}++#realm-creation-form-slack-import .register-button {+ &[disabled] {+ opacity: 0.6;+ cursor: not-allowed;+ }+}