Skip to content
Snippets Groups Projects
Commit 8e1825ae authored by Angelina Filippova's avatar Angelina Filippova
Browse files

Fix parsing and wrapping tuple values in Args setting inside Pleroma.Upload.Filter.Mogrify

parent 659adbe6
No related branches found
No related tags found
1 merge request!151Add missing settings
Pipeline #29355 failed
......@@ -50,12 +50,7 @@ export const parseNonTuples = (key, value) => {
return updated
}
if (key === ':args') {
if (typeof value === 'string') {
return [value]
}
const index = value.findIndex(el => typeof el === 'object' && el.tuple.includes('implode'))
const updated = value.map((el, i) => i === index ? 'implode' : el)
return updated
return typeof value === 'string' ? [value] : value
}
return value
}
......@@ -259,13 +254,6 @@ const wrapValues = (settings, currentState) => {
} else if (setting === ':ip') {
const ip = value.split('.').map(s => parseInt(s, 10))
return { 'tuple': [setting, { 'tuple': ip }] }
} else if (setting === ':args') {
const index = value.findIndex(el => el === 'implode')
const updatedArray = value.slice()
if (index !== -1) {
updatedArray[index] = { 'tuple': ['implode', '1'] }
}
return { 'tuple': [setting, updatedArray] }
} else {
return { 'tuple': [setting, value] }
}
......
......@@ -20,9 +20,11 @@
allow-create
class="input"
@change="updateSetting($event, settingGroup.group, settingGroup.key, setting.key, setting.type)">
<el-option value="strip" label="strip"/>
<el-option value="auto-orient" label="auto-orient"/>
<el-option value="implode" label="implode"/>
<el-option value="strip"/>
<el-option value="auto-orient"/>
<!-- eslint-disable -->
<el-option value='{"implode", "1"}'/>
<!-- eslint-enable -->
</el-select>
</div>
</template>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment