Skip to content

Commit 38e59da

Browse files
authored
Merge pull request #87 from CloudCannon/encode_url
Add encode_url
2 parents 44707b4 + 9f6cfbe commit 38e59da

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
gid: type._inputs.*.options.encode_url
2+
url: /configuration-file/types/_inputs/*/options/encode_url/
3+
title: ''
4+
description: This key defines whether the value is URL encoded on change.
5+
examples:
6+
- description: >-
7+
In this example, we have configured a *File Input* to encode URLs to
8+
prepare for filenames that may contain spaces.
9+
language: yaml
10+
code: |-
11+
_inputs:
12+
file_path:
13+
type: file
14+
options:
15+
encode_url: true
16+
annotations: []
17+
source: /cloudcannon.config.yml
18+
show_in_navigation: false

src/input-base.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,9 @@ export const FileInputOptionsSchema = z
298298
description:
299299
'Prevents file uploads inside the "Select existing file/image" file browser modal window.',
300300
}),
301+
encode_url: z.boolean().default(false).optional().meta({
302+
id: 'type._inputs.*.options.encode_url',
303+
}),
301304
})
302305
.meta({
303306
description: 'Options that are specific to File Inputs.',

0 commit comments

Comments
 (0)