0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-13 21:42:53 +01:00

FIX: gracefully deal with lack of field label for dropdown and add settings explanation key value

Dieser Commit ist enthalten in:
Robert Barrow 2019-10-22 20:40:27 +01:00
Ursprung ce49a8ab94
Commit c9348469d7
2 geänderte Dateien mit 3 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -28,8 +28,8 @@ export default {
isFlagSelector() { isFlagSelector() {
const field = this.get('field'); const field = this.get('field');
//TODO improve the way this detects a flag dropdown (currently it relies on the string 'Nation', e.g. 'Nationality' or 'National Flag' appearing in label) //TODO improve the way this detects a flag dropdown (currently it relies on the string 'Nation', e.g. 'Nationality' or 'National Flag' appearing in label)
return (field.label.includes(Discourse.SiteSettings.wizard_national_flags_label_cue)) ? true : false; return (typeof field.label !== 'undefined') ? (field.label.includes(Discourse.SiteSettings.wizard_national_flags_label_cue)) ? true : false : false;
} }
}); });

Datei anzeigen

@ -23,3 +23,4 @@ en:
site_settings: site_settings:
wizard_redirect_exclude_paths: "Routes excluded from wizard redirects." wizard_redirect_exclude_paths: "Routes excluded from wizard redirects."
wizard_recognised_image_upload_formats: "File types which will result in upload displaying an image preview" wizard_recognised_image_upload_formats: "File types which will result in upload displaying an image preview"
wizard_national_flags_label_cue: "The characters that must appear in the dropdown field label for it to show a flag"