Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental UI form separation #7777

Draft
wants to merge 51 commits into
base: devel
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
8a792ce
Add a separate switch component
VakarisZ Jul 5, 2023
1aeeb3e
Change switch form to use switch UI components
VakarisZ Jul 5, 2023
52cde37
Change roles form to use switch UI components
VakarisZ Jul 5, 2023
bc118d3
Change domains form to use switch UI components
VakarisZ Jul 5, 2023
0962355
Change realms form to use switch UI components
VakarisZ Jul 5, 2023
199f955
Delete unused exports in configuration sources
VakarisZ Jul 5, 2023
46e9d19
Change to switch UI component in authentication source forms
VakarisZ Jul 7, 2023
d41f261
Change to switch UI component in switch group forms
VakarisZ Jul 7, 2023
501f01e
Export BaseFormGroupSwitch as new component
VakarisZ Jul 10, 2023
6132b8e
Change connection profiles form to use switch UI component
VakarisZ Jul 10, 2023
483eeda
Change fingerbank forms to use switch UI component
VakarisZ Jul 10, 2023
434fa36
Change network behavior policy forms to use switch UI component
VakarisZ Jul 10, 2023
3423a83
Change scan engines forms to use switch UI component
VakarisZ Jul 10, 2023
43d8f19
Refactor switch component to be more flexible
VakarisZ Jul 12, 2023
f1c2c4d
Add label UI component
VakarisZ Jul 12, 2023
0564e66
Refactor BaseFormGroupActions.vue to use new switch component
VakarisZ Jul 12, 2023
65a198f
Handle focus internally in base input switch component
VakarisZ Jul 13, 2023
ba5031f
Fixup BaseFormGroupSwitch.vue
VakarisZ Jul 13, 2023
4dba334
Remove BaseInputSwitchLegacy.vue
VakarisZ Jul 13, 2023
db71821
Change security events forms to use switch UI component
VakarisZ Jul 13, 2023
b0ef879
Change firewalls forms to use switch UI component
VakarisZ Jul 13, 2023
22f1eaa
Change switch template form to use switch UI component
VakarisZ Jul 13, 2023
b5cb14a
Change syslog parsers form to use switch UI component
VakarisZ Jul 13, 2023
98ca66c
Change syslog forwarders form to use switch UI component
VakarisZ Jul 13, 2023
03d34dc
Change wrix locations form to use switch UI component
VakarisZ Jul 13, 2023
1a7b36a
Change PKI template form to use switch UI component
VakarisZ Jul 13, 2023
863b9e0
Change captive portal form to use switch UI component
VakarisZ Jul 13, 2023
845e153
Change filter engines form to use switch UI component
VakarisZ Jul 13, 2023
e17c6f3
Change billing tiers form to use switch UI component
VakarisZ Jul 13, 2023
4e7b297
Change PKI providers form to use switch UI component
VakarisZ Jul 13, 2023
6c0c1ba
Change network settings form to use switch UI component
VakarisZ Jul 17, 2023
ae8fc2e
Change interface settings form to use switch UI component
VakarisZ Jul 17, 2023
7cbb37e
Change provisioners form to use switch UI component
VakarisZ Jul 17, 2023
52e2380
Change self services form to use switch UI component
VakarisZ Jul 17, 2023
3e02a2a
Change remaining network forms to use switch UI component
VakarisZ Jul 17, 2023
73cab12
Change SNMP form to use switch UI component
VakarisZ Jul 17, 2023
c734ba2
Change floating devices form to use switch UI component
VakarisZ Jul 17, 2023
e3b97dd
Change main configuration forms to use switch UI component
VakarisZ Jul 18, 2023
52f18c1
Change database configuration to use switch UI component
VakarisZ Jul 18, 2023
e8a8418
Change cluster configuration form to use switch UI component
VakarisZ Jul 18, 2023
9185039
Change radius configuration form to use switch UI component
VakarisZ Jul 18, 2023
162826e
Change dns configuration form to use switch UI component
VakarisZ Jul 18, 2023
f66845b
Change admin login form to use switch UI component
VakarisZ Jul 18, 2023
ba2f255
Change ssl certificate form to use switch UI component
VakarisZ Jul 18, 2023
3ffdcf9
Add switch form group that doesn't use namespace
VakarisZ Jul 19, 2023
5dbff71
Use onChange switch component in ssl certificate form
VakarisZ Jul 19, 2023
73d812c
Change node edit form to use switch UI component
VakarisZ Jul 19, 2023
3111d08
Change user creation form to use switch UI component
VakarisZ Jul 19, 2023
f23611b
Change data flow view to use switch UI component
VakarisZ Jul 19, 2023
ce3d612
Change live logs view to use switch UI component
VakarisZ Jul 20, 2023
e771221
Experimental changes that attempt to separate UI and backend form data
VakarisZ Jul 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conf/I18N/api/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -5702,7 +5702,7 @@ msgid "Enable profile"
msgstr ""

#: html/pfappserver/root/src/views/Configuration/securityEvents/_components/TheForm.vue:9
msgid "Enable security event"
msgid "Enable this event"
msgstr ""

#: html/pfappserver/root/src/views/Configuration/advanced/_components/TheForm.vue:25
Expand Down
4 changes: 2 additions & 2 deletions conf/I18N/api/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -6296,8 +6296,8 @@ msgid "Enable profile"
msgstr "Activer le profil"

#: html/pfappserver/root/src/views/Configuration/securityEvents/_components/TheForm.vue:9
msgid "Enable security event"
msgstr "Activer l'événement de sécurité"
msgid "Enable this event"
msgstr "Activer cet événement"

#: html/pfappserver/root/src/views/Configuration/advanced/_components/TheForm.vue:25
msgid "Enable the Configurator and the Configurator API."
Expand Down
145 changes: 145 additions & 0 deletions html/pfappserver/root/src/components/new/BaseFormGroupSwitch.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
<template>
<base-form-group
class="form-group base-form-group-switch"
:column-label="columnLabel"
:content-cols="contentCols"
:content-cols-sm="contentColsSm"
:content-cols-md="contentColsMd"
:content-cols-lg="contentColsLg"
:content-cols-xl="contentColsXl"
:label-class="labelClass"
:label-cols="labelCols"
:label-cols-sm="labelColsSm"
:label-cols-md="labelColsMd"
:label-cols-lg="labelColsLg"
:label-cols-xl="labelColsXl"
:text="text"
:state="inputState"
:invalid-feedback="inputInvalidFeedback"
:valid-feedback="inputValidFeedback"
>
<base-input-switch :disabled="isLocked"
:size="size"
:onChange="onChange"
:value="inputValue"
@blur="onBlur"
/>
<template v-slot:prepend v-if="$slots.prepend">
<slot name="prepend"></slot>
</template>
<template v-slot:append v-if="$slots.append">
<slot name="append"></slot>
</template>
</base-form-group>
</template>
<script>
import {useFormGroupProps} from '@/composables/useFormGroup'
import {useInput, useInputProps} from '@/composables/useInput'
import {useInputMeta, useInputMetaProps} from '@/composables/useMeta'
import {useInputValidator, useInputValidatorProps} from '@/composables/useInputValidator'
import {
getFormNamespace,
setFormNamespace,
useInputValue,
useInputValueProps
} from '@/composables/useInputValue'
import BaseFormGroup from './BaseFormGroup'
import BaseInputSwitch from './BaseInputSwitch.vue'
import {computed, inject, unref} from '@vue/composition-api';

const components = {
BaseFormGroup,
BaseInputSwitch
}

export const props = {
enabledValue: {
type: [String, Number, Boolean],
default: true
},
disabledValue: {
type: [String, Number, Boolean],
default: false
},
size: {
type: String,
default: 'md',
validator: value => ['sm', 'md', 'lg'].includes(value)
},
isFocus: {
default: false,
type: Boolean
},
...useFormGroupProps,
...useInputProps,
...useInputMetaProps,
...useInputValidatorProps,
...useInputValueProps,
}

export const setup = (props, context) => {
const metaProps = useInputMeta(props, context)

const {
tabIndex,
text,
isLocked,
onBlur
} = useInput(metaProps, context)

const {
value,
onInput
} = useInputValue(metaProps, context)

const {
state,
invalidFeedback,
validFeedback
} = useInputValidator(metaProps, value)

const form = inject('form')
const onChange = (switchValue) => {
if (switchValue) {
setFormNamespace(props.namespace.split('.'), unref(form), props.enabledValue)
} else {
setFormNamespace(props.namespace.split('.'), unref(form), props.disabledValue)
}
}
const inputValue = computed(() =>
getFormNamespace(props.namespace.split('.'), unref(form)) === props.enabledValue
)

return {
// useInput
inputTabIndex: tabIndex,
inputText: text,
inputValue,
onChange,
isLocked,
onBlur,
onInput,

// useInputValidator
inputState: state,
inputInvalidFeedback: invalidFeedback,
inputValidFeedback: validFeedback
}
}

// @vue/component
export default {
name: 'base-form-group-switch',
inheritAttrs: false,
components,
props,
setup
}
</script>
<style lang="scss">
.base-form-group-switch {
.input-group {
padding-bottom: 0px !important;
}
}
</style>
Loading