mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
refactor: mv ReadOnlyField -> FormFieldReadonly + AdressInputSelect -> AdressItem
This commit is contained in:
parent
7123ba6cdc
commit
7c6092e6dc
6 changed files with 9 additions and 11 deletions
4
app/components.d.ts
vendored
4
app/components.d.ts
vendored
|
@ -8,7 +8,7 @@ export {}
|
|||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
AbstractForm: typeof import('./src/components/globals/AbstractForm.vue')['default']
|
||||
AdressInputSelect: typeof import('./src/components/AdressInputSelect.vue')['default']
|
||||
AdressItem: typeof import('./src/components/globals/formItems/AdressItem.vue')['default']
|
||||
BAlert: typeof import('bootstrap-vue-next')['BAlert']
|
||||
BBadge: typeof import('bootstrap-vue-next')['BBadge']
|
||||
BBreadcrumb: typeof import('bootstrap-vue-next')['BBreadcrumb']
|
||||
|
@ -80,6 +80,7 @@ declare module 'vue' {
|
|||
ExplainWhat: typeof import('./src/components/globals/ExplainWhat.vue')['default']
|
||||
FileItem: typeof import('./src/components/globals/formItems/FileItem.vue')['default']
|
||||
FormField: typeof import('./src/components/globals/FormField.vue')['default']
|
||||
FormFieldReadonly: typeof import('./src/components/globals/FormFieldReadonly.vue')['default']
|
||||
InputItem: typeof import('./src/components/globals/formItems/InputItem.vue')['default']
|
||||
LazyRenderer: typeof import('./src/components/LazyRenderer.vue')['default']
|
||||
ListGroupSkeleton: typeof import('./src/components/globals/skeletons/ListGroupSkeleton.vue')['default']
|
||||
|
@ -87,7 +88,6 @@ declare module 'vue' {
|
|||
MessageListGroup: typeof import('./src/components/MessageListGroup.vue')['default']
|
||||
QueryHeader: typeof import('./src/components/QueryHeader.vue')['default']
|
||||
ReadOnlyAlertItem: typeof import('./src/components/globals/formItems/ReadOnlyAlertItem.vue')['default']
|
||||
ReadOnlyField: typeof import('./src/components/globals/ReadOnlyField.vue')['default']
|
||||
RecursiveListGroup: typeof import('./src/components/RecursiveListGroup.vue')['default']
|
||||
RoutableTabs: typeof import('./src/components/RoutableTabs.vue')['default']
|
||||
RouterLink: typeof import('vue-router')['RouterLink']
|
||||
|
|
|
@ -10,7 +10,7 @@ import {
|
|||
} from '@/helpers/commons'
|
||||
|
||||
const NO_VALUE_FIELDS = [
|
||||
'ReadOnlyField',
|
||||
'FormFieldReadonly',
|
||||
'ReadOnlyAlertItem',
|
||||
'MarkdownItem',
|
||||
'DisplayTextItem',
|
||||
|
@ -56,7 +56,7 @@ export function sizeToM(sizeStr) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a formatted address element to be used by AdressInputSelect component.
|
||||
* Returns a formatted address element to be used by AdressItem component.
|
||||
*
|
||||
* @param {String} address - A string representing an adress (subdomain or email)
|
||||
* @return {Object} - `{ localPart, separator, domain }`.
|
||||
|
@ -124,7 +124,7 @@ export function formatYunoHostArgument(arg) {
|
|||
let validation = {}
|
||||
arg.ask = formatI18nField(arg.ask)
|
||||
const field = {
|
||||
is: arg.readonly ? 'ReadOnlyField' : 'FormField',
|
||||
is: arg.readonly ? 'FormFieldReadonly' : 'FormField',
|
||||
visible: arg.visible,
|
||||
props: {
|
||||
label: arg.ask,
|
||||
|
|
|
@ -3,7 +3,6 @@ import { useVuelidate } from '@vuelidate/core'
|
|||
import { computed, reactive, ref } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
import AdressInputSelect from '@/components/AdressInputSelect.vue'
|
||||
import {
|
||||
domain,
|
||||
dynDomain,
|
||||
|
@ -207,7 +206,7 @@ async function onSubmit() {
|
|||
class="mt-3"
|
||||
>
|
||||
<template #default="{ self }">
|
||||
<AdressInputSelect v-bind="self" v-model="form.dynDomain" />
|
||||
<AdressItem v-bind="self" v-model="form.dynDomain" />
|
||||
</template>
|
||||
</FormField>
|
||||
|
||||
|
@ -252,7 +251,7 @@ async function onSubmit() {
|
|||
class="mt-3"
|
||||
>
|
||||
<template #default="{ self }">
|
||||
<AdressInputSelect v-bind="self" v-model="form.localDomain" />
|
||||
<AdressItem v-bind="self" v-model="form.localDomain" />
|
||||
</template>
|
||||
</FormField>
|
||||
</BCollapse>
|
||||
|
|
|
@ -5,7 +5,6 @@ import { useI18n } from 'vue-i18n'
|
|||
import { useRouter } from 'vue-router'
|
||||
|
||||
import api from '@/api'
|
||||
import AdressInputSelect from '@/components/AdressInputSelect.vue'
|
||||
import type ViewBase from '@/components/globals/ViewBase.vue'
|
||||
import { arrayDiff } from '@/helpers/commons'
|
||||
import {
|
||||
|
@ -255,7 +254,7 @@ function removeEmailField(type: 'aliases' | 'forward', index: number) {
|
|||
<!-- USER EMAIL -->
|
||||
<FormField v-bind="fields.mail" :validation="v$.form.mail">
|
||||
<template #default="{ self }">
|
||||
<AdressInputSelect v-bind="self" v-model="form.mail" />
|
||||
<AdressItem v-bind="self" v-model="form.mail" />
|
||||
</template>
|
||||
</FormField>
|
||||
|
||||
|
@ -282,7 +281,7 @@ function removeEmailField(type: 'aliases' | 'forward', index: number) {
|
|||
:validation-index="i"
|
||||
>
|
||||
<template #default="{ self }">
|
||||
<AdressInputSelect v-bind="self" v-model="form.mail_aliases[i]" />
|
||||
<AdressItem v-bind="self" v-model="form.mail_aliases[i]" />
|
||||
</template>
|
||||
</FormField>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue