slack_import: Disable submit button if file is invalid.

This commit is contained in:
Aman Agrawal
2025-08-21 16:46:30 +05:30
committed by Tim Abbott
parent 04fa43e1df
commit f45552fadd
3 changed files with 9 additions and 1 deletions

View File

@@ -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>

View File

@@ -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", () => {

View File

@@ -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;
}
}