[PostReplacements] Allow setting additional_source & reason in url (#667)

This commit is contained in:
Donovan Daniels 2024-07-16 10:10:51 -05:00 committed by GitHub
parent 994494814b
commit 8a535ebb95
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,7 +22,7 @@
<div class="sect_red error_message" v-if="showErrors && errorMessage !== undefined">
{{ errorMessage }}
</div>
<button @click="submit" :disabled="(showErrors && preventUpload) || submitting">
{{ submitting ? "Uploading..." : "Upload" }}
</button>
@ -59,6 +59,14 @@ export default {
submittedReason: undefined,
};
},
mounted() {
const params = new URLSearchParams(window.location.search);
if (params.has("additional_source"))
this.sources = [params.get("additional_source")];
if (params.has("reason"))
this.reason = params.get("reason");
},
computed: {
preventUpload() {
return this.sourceWarning;