mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
configpanel: remove args props and handling for now
This commit is contained in:
parent
368f890ff1
commit
af2b50d2c0
2 changed files with 13 additions and 17 deletions
|
@ -24,7 +24,7 @@
|
||||||
<component
|
<component
|
||||||
v-if="field.visible" :is="field.is" v-bind="field.props"
|
v-if="field.visible" :is="field.is" v-bind="field.props"
|
||||||
v-model="forms[panel.id][fname]" :validation="validation[fname]" :key="fname"
|
v-model="forms[panel.id][fname]" :validation="validation[fname]" :key="fname"
|
||||||
@action.stop="onAction(section.id, fname, field.props.args)"
|
@action.stop="onAction(section.id, fname, section.fields)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</component>
|
</component>
|
||||||
|
@ -61,24 +61,20 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
onApply () {
|
onApply () {
|
||||||
const panelId = this.panel.id
|
const panelId = this.panel.id
|
||||||
const nonActionKeys = this.panel.sections.filter(section => {
|
|
||||||
return !section.isActionSection
|
|
||||||
}).reduce((keys, { fields }) => {
|
|
||||||
return keys.concat(Object.keys(fields))
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
this.$emit('submit', {
|
|
||||||
id: this.panel.id,
|
|
||||||
form: filterObject(this.forms[panelId], ([key]) => nonActionKeys.includes(key))
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
onAction (sectionId, actionId, actionArgs) {
|
|
||||||
const panelId = this.panel.id
|
|
||||||
|
|
||||||
this.$emit('submit', {
|
this.$emit('submit', {
|
||||||
id: panelId,
|
id: panelId,
|
||||||
form: filterObject(this.forms[panelId], ([key]) => actionArgs.includes(key)),
|
form: this.forms[panelId]
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
onAction (sectionId, actionId, actionFields) {
|
||||||
|
const panelId = this.panel.id
|
||||||
|
const actionFieldsKeys = Object.keys(actionFields)
|
||||||
|
|
||||||
|
this.$emit('submit', {
|
||||||
|
id: panelId,
|
||||||
|
form: filterObject(this.forms[panelId], ([key]) => actionFieldsKeys.includes(key)),
|
||||||
action: [panelId, sectionId, actionId].join('.'),
|
action: [panelId, sectionId, actionId].join('.'),
|
||||||
name: actionId
|
name: actionId
|
||||||
})
|
})
|
||||||
|
|
|
@ -233,7 +233,7 @@ export function formatYunoHostArgument (arg) {
|
||||||
{
|
{
|
||||||
types: ['button'],
|
types: ['button'],
|
||||||
name: 'ButtonItem',
|
name: 'ButtonItem',
|
||||||
props: ['type:style', 'label:ask', 'icon', 'enabled', 'args'],
|
props: ['type:style', 'label:ask', 'icon', 'enabled'],
|
||||||
renderSelf: true
|
renderSelf: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Reference in a new issue