mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-25 09:03:12 +03:00
🐛 Fixed unselectable routes files in macOS Safari (#1472)
closes TryGhost/Ghost#11472 - adds an explicit `.yaml` to the `accepts` attribute of the routes file uploader to work around Safari only allowing `.yml` to be selected when given the yaml mime type
This commit is contained in:
parent
a30f0b2851
commit
06531daf85
@ -54,6 +54,8 @@ export default Controller.extend({
|
||||
yamlExtension: null,
|
||||
yamlMimeType: null,
|
||||
|
||||
yamlAccept: null,
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
this.importMimeType = IMPORT_MIME_TYPES;
|
||||
@ -61,6 +63,9 @@ export default Controller.extend({
|
||||
this.jsonMimeType = JSON_MIME_TYPE;
|
||||
this.yamlExtension = YAML_EXTENSION;
|
||||
this.yamlMimeType = YAML_MIME_TYPE;
|
||||
// (macOS) Safari only allows files with the `yml` extension to be selected with the specified MIME types
|
||||
// so explicitly allow the `yaml` extension.
|
||||
this.yamlAccept = [...this.yamlMimeType, ...Array.from(this.yamlExtension, extension => '.' + extension)];
|
||||
},
|
||||
|
||||
actions: {
|
||||
|
@ -206,7 +206,7 @@
|
||||
{{/if}}
|
||||
|
||||
<div style="display:none">
|
||||
<GhFileInput @multiple={{false}} @action={{uploader.setFiles}} @accept={{this.yamlMimeType}} data-test-file-input="routes" />
|
||||
<GhFileInput @multiple={{false}} @action={{uploader.setFiles}} @accept={{this.yamlAccept}} data-test-file-input="routes" />
|
||||
</div>
|
||||
</div>
|
||||
</GhUploader>
|
||||
|
Loading…
Reference in New Issue
Block a user