FormTabEdit
This commit is contained in:
parent
d10c430d19
commit
01ad6ffa60
4 changed files with 376 additions and 351 deletions
|
|
@ -3198,6 +3198,12 @@
|
||||||
"en": "Save Grid State",
|
"en": "Save Grid State",
|
||||||
"tr": "Tablo Yapısını Kaydet"
|
"tr": "Tablo Yapısını Kaydet"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "ListForms.ListForm.GridStateSaved",
|
||||||
|
"en": "Grid State Saved",
|
||||||
|
"tr": "Tablo Yapısı Kaydedildi"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"resourceName": "Platform",
|
"resourceName": "Platform",
|
||||||
"key": "ListForms.ListForm.ResetGridState",
|
"key": "ListForms.ListForm.ResetGridState",
|
||||||
|
|
|
||||||
|
|
@ -41,362 +41,381 @@ function FormTabEdit(props: FormEditProps & { listFormCode: string }) {
|
||||||
{({ touched, errors, values, isSubmitting }) => (
|
{({ touched, errors, values, isSubmitting }) => (
|
||||||
<Form>
|
<Form>
|
||||||
<FormContainer size="sm">
|
<FormContainer size="sm">
|
||||||
<FormItem
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-3">
|
||||||
label={translate('::ListForms.ListFormEdit.EditingAllowAdding')}
|
<Card className="my-2" header="General">
|
||||||
invalid={
|
|
||||||
errors.editingOptionDto?.allowAdding && touched.editingOptionDto?.allowAdding
|
|
||||||
}
|
|
||||||
errorMessage={errors.editingOptionDto?.allowAdding}
|
|
||||||
>
|
|
||||||
<Field
|
|
||||||
name="editingOptionDto.allowAdding"
|
|
||||||
placeholder={translate('::ListForms.ListFormEdit.EditingAllowAdding')}
|
|
||||||
component={Checkbox}
|
|
||||||
/>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem
|
|
||||||
label={translate('::ListForms.ListFormEdit.EditingAllowEditing')}
|
|
||||||
invalid={
|
|
||||||
errors.editingOptionDto?.allowEditing && touched.editingOptionDto?.allowEditing
|
|
||||||
}
|
|
||||||
errorMessage={errors.editingOptionDto?.allowEditing}
|
|
||||||
>
|
|
||||||
<Field
|
|
||||||
name="editingOptionDto.allowEditing"
|
|
||||||
placeholder={translate('::ListForms.ListFormEdit.EditingAllowEditing')}
|
|
||||||
component={Checkbox}
|
|
||||||
/>
|
|
||||||
</FormItem>
|
|
||||||
|
|
||||||
<FormItem
|
|
||||||
label={translate('::ListForms.ListFormEdit.EditingAllowDetail')}
|
|
||||||
invalid={
|
|
||||||
errors.editingOptionDto?.allowDetail && touched.editingOptionDto?.allowDetail
|
|
||||||
}
|
|
||||||
errorMessage={errors.editingOptionDto?.allowDetail}
|
|
||||||
>
|
|
||||||
<Field
|
|
||||||
name="editingOptionDto.allowDetail"
|
|
||||||
placeholder={translate('::ListForms.ListFormEdit.EditingAllowDetail')}
|
|
||||||
component={Checkbox}
|
|
||||||
/>
|
|
||||||
</FormItem>
|
|
||||||
|
|
||||||
<FormItem
|
|
||||||
label={translate('::ListForms.ListFormEdit.EditingAllowDeleting')}
|
|
||||||
invalid={
|
|
||||||
errors.editingOptionDto?.allowDeleting && touched.editingOptionDto?.allowDeleting
|
|
||||||
}
|
|
||||||
errorMessage={errors.editingOptionDto?.allowDeleting}
|
|
||||||
>
|
|
||||||
<Field
|
|
||||||
name="editingOptionDto.allowDeleting"
|
|
||||||
placeholder={translate('::ListForms.ListFormEdit.EditingAllowDeleting')}
|
|
||||||
component={Checkbox}
|
|
||||||
/>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem
|
|
||||||
label={translate('::ListForms.ListFormEdit.EditingAllowDeleteAll')}
|
|
||||||
invalid={
|
|
||||||
errors.editingOptionDto?.allowAllDeleting &&
|
|
||||||
touched.editingOptionDto?.allowAllDeleting
|
|
||||||
}
|
|
||||||
errorMessage={errors.editingOptionDto?.allowAllDeleting}
|
|
||||||
>
|
|
||||||
<Field
|
|
||||||
name="editingOptionDto.allowAllDeleting"
|
|
||||||
placeholder={translate('::ListForms.ListFormEdit.EditingAllowDeleteAll')}
|
|
||||||
component={Checkbox}
|
|
||||||
/>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem
|
|
||||||
label={translate('::ListForms.ListFormEdit.EditingConfirmDelete')}
|
|
||||||
invalid={
|
|
||||||
errors.editingOptionDto?.confirmDelete && touched.editingOptionDto?.confirmDelete
|
|
||||||
}
|
|
||||||
errorMessage={errors.editingOptionDto?.confirmDelete}
|
|
||||||
>
|
|
||||||
<Field
|
|
||||||
name="editingOptionDto.confirmDelete"
|
|
||||||
placeholder={translate('::ListForms.ListFormEdit.EditingConfirmDelete')}
|
|
||||||
component={Checkbox}
|
|
||||||
/>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem
|
|
||||||
label={translate('::ListForms.ListFormEdit.EditingUseIcons')}
|
|
||||||
invalid={errors.editingOptionDto?.useIcons && touched.editingOptionDto?.useIcons}
|
|
||||||
errorMessage={errors.editingOptionDto?.useIcons}
|
|
||||||
>
|
|
||||||
<Field
|
|
||||||
name="editingOptionDto.useIcons"
|
|
||||||
placeholder={translate('::ListForms.ListFormEdit.EditingUseIcons')}
|
|
||||||
component={Checkbox}
|
|
||||||
/>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem
|
|
||||||
label={translate('::ListForms.ListFormEdit.EditingSelectTextOnEditStart')}
|
|
||||||
invalid={
|
|
||||||
errors.editingOptionDto?.selectTextOnEditStart &&
|
|
||||||
touched.editingOptionDto?.selectTextOnEditStart
|
|
||||||
}
|
|
||||||
errorMessage={errors.editingOptionDto?.selectTextOnEditStart}
|
|
||||||
>
|
|
||||||
<Field
|
|
||||||
name="editingOptionDto.selectTextOnEditStart"
|
|
||||||
placeholder={translate('::ListForms.ListFormEdit.EditingSelectTextOnEditStart')}
|
|
||||||
component={Checkbox}
|
|
||||||
/>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem
|
|
||||||
label={translate('::SidePanel.Mode')}
|
|
||||||
invalid={errors.editingOptionDto?.mode && touched.editingOptionDto?.mode}
|
|
||||||
errorMessage={errors.editingOptionDto?.mode}
|
|
||||||
>
|
|
||||||
<Field
|
|
||||||
type="text"
|
|
||||||
autoComplete="off"
|
|
||||||
name="editingOptionDto.mode"
|
|
||||||
placeholder={translate('::SidePanel.Mode')}
|
|
||||||
>
|
|
||||||
{({ field, form }: FieldProps<GridsEditMode>) => (
|
|
||||||
<Select
|
|
||||||
field={field}
|
|
||||||
form={form}
|
|
||||||
isClearable={true}
|
|
||||||
options={editingOptionModeOptions}
|
|
||||||
value={editingOptionModeOptions?.filter(
|
|
||||||
(option) => option.value === values.editingOptionDto.mode,
|
|
||||||
)}
|
|
||||||
onChange={(option) => form.setFieldValue(field.name, option?.value)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Field>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem
|
|
||||||
label={translate('::ListForms.ListFormEdit.EditingRefreshMode')}
|
|
||||||
invalid={
|
|
||||||
errors.editingOptionDto?.refreshMode && touched.editingOptionDto?.refreshMode
|
|
||||||
}
|
|
||||||
errorMessage={errors.editingOptionDto?.refreshMode}
|
|
||||||
>
|
|
||||||
<Field
|
|
||||||
type="text"
|
|
||||||
autoComplete="off"
|
|
||||||
name="editingOptionDto.refreshMode"
|
|
||||||
placeholder={translate('::ListForms.ListFormEdit.EditingRefreshMode')}
|
|
||||||
>
|
|
||||||
{({ field, form }: FieldProps<GridsEditRefreshMode>) => (
|
|
||||||
<Select
|
|
||||||
field={field}
|
|
||||||
form={form}
|
|
||||||
isClearable={true}
|
|
||||||
options={editingOptionRefreshModeOptions}
|
|
||||||
value={editingOptionRefreshModeOptions?.filter(
|
|
||||||
(option) => option.value === values.editingOptionDto.refreshMode,
|
|
||||||
)}
|
|
||||||
onChange={(option) => form.setFieldValue(field.name, option?.value)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Field>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem
|
|
||||||
label={translate('::ListForms.ListFormEdit.EditingNewRowPosition')}
|
|
||||||
invalid={
|
|
||||||
errors.editingOptionDto?.newRowPosition &&
|
|
||||||
touched.editingOptionDto?.newRowPosition
|
|
||||||
}
|
|
||||||
errorMessage={errors.editingOptionDto?.newRowPosition}
|
|
||||||
>
|
|
||||||
<Field
|
|
||||||
type="text"
|
|
||||||
autoComplete="off"
|
|
||||||
name="editingOptionDto.newRowPosition"
|
|
||||||
placeholder={translate('::ListForms.ListFormEdit.EditingNewRowPosition')}
|
|
||||||
>
|
|
||||||
{({ field, form }: FieldProps<NewRowPosition>) => (
|
|
||||||
<Select
|
|
||||||
field={field}
|
|
||||||
form={form}
|
|
||||||
isClearable={true}
|
|
||||||
options={editingOptionNewRowPositionOptions}
|
|
||||||
value={editingOptionNewRowPositionOptions?.filter(
|
|
||||||
(option) => option.value === values.editingOptionDto.newRowPosition,
|
|
||||||
)}
|
|
||||||
onChange={(option) => form.setFieldValue(field.name, option?.value)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Field>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem
|
|
||||||
label={translate('::ListForms.ListFormEdit.EditingStartEditAction')}
|
|
||||||
invalid={
|
|
||||||
errors.editingOptionDto?.startEditAction &&
|
|
||||||
touched.editingOptionDto?.startEditAction
|
|
||||||
}
|
|
||||||
errorMessage={errors.editingOptionDto?.startEditAction}
|
|
||||||
>
|
|
||||||
<Field
|
|
||||||
type="text"
|
|
||||||
autoComplete="off"
|
|
||||||
name="editingOptionDto.startEditAction"
|
|
||||||
placeholder={translate('::ListForms.ListFormEdit.EditingStartEditAction')}
|
|
||||||
>
|
|
||||||
{({ field, form }: FieldProps<StartEditAction>) => (
|
|
||||||
<Select
|
|
||||||
field={field}
|
|
||||||
form={form}
|
|
||||||
isClearable={true}
|
|
||||||
options={editingOptionStartEditActionOptions}
|
|
||||||
value={editingOptionStartEditActionOptions?.filter(
|
|
||||||
(option) => option.value === values.editingOptionDto.startEditAction,
|
|
||||||
)}
|
|
||||||
onChange={(option) => form.setFieldValue(field.name, option?.value)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Field>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem
|
|
||||||
label={translate('::ListForms.ListFormEdit.EditingEditColumnName')}
|
|
||||||
invalid={
|
|
||||||
errors.editingOptionDto?.editColumnName &&
|
|
||||||
touched.editingOptionDto?.editColumnName
|
|
||||||
}
|
|
||||||
errorMessage={errors.editingOptionDto?.editColumnName}
|
|
||||||
>
|
|
||||||
<Field
|
|
||||||
type="text"
|
|
||||||
autoComplete="off"
|
|
||||||
name="editingOptionDto.editColumnName"
|
|
||||||
placeholder={translate('::ListForms.ListFormEdit.EditingEditColumnName')}
|
|
||||||
component={Input}
|
|
||||||
/>
|
|
||||||
</FormItem>
|
|
||||||
{values.editingOptionDto.mode === 'popup' && (
|
|
||||||
<>
|
|
||||||
<FormItem
|
<FormItem
|
||||||
label={translate('::ListForms.ListFormEdit.EditingShowTitle')}
|
label={translate('::ListForms.ListFormEdit.EditingAllowAdding')}
|
||||||
invalid={
|
invalid={
|
||||||
errors.editingOptionDto?.popup?.showTitle &&
|
errors.editingOptionDto?.allowAdding && touched.editingOptionDto?.allowAdding
|
||||||
touched.editingOptionDto?.popup?.showTitle
|
|
||||||
}
|
}
|
||||||
errorMessage={errors.editingOptionDto?.popup?.showTitle}
|
errorMessage={errors.editingOptionDto?.allowAdding}
|
||||||
>
|
>
|
||||||
<Field
|
<Field
|
||||||
name="editingOptionDto.popup.showTitle"
|
name="editingOptionDto.allowAdding"
|
||||||
placeholder={translate('::ListForms.ListFormEdit.EditingShowTitle')}
|
placeholder={translate('::ListForms.ListFormEdit.EditingAllowAdding')}
|
||||||
component={Checkbox}
|
component={Checkbox}
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem
|
<FormItem
|
||||||
label={translate('::ListForms.ListFormEdit.DetailsTitle')}
|
label={translate('::ListForms.ListFormEdit.EditingAllowEditing')}
|
||||||
invalid={
|
invalid={
|
||||||
errors.editingOptionDto?.popup?.title &&
|
errors.editingOptionDto?.allowEditing &&
|
||||||
touched.editingOptionDto?.popup?.title
|
touched.editingOptionDto?.allowEditing
|
||||||
}
|
}
|
||||||
errorMessage={errors.editingOptionDto?.popup?.title}
|
errorMessage={errors.editingOptionDto?.allowEditing}
|
||||||
|
>
|
||||||
|
<Field
|
||||||
|
name="editingOptionDto.allowEditing"
|
||||||
|
placeholder={translate('::ListForms.ListFormEdit.EditingAllowEditing')}
|
||||||
|
component={Checkbox}
|
||||||
|
/>
|
||||||
|
</FormItem>
|
||||||
|
|
||||||
|
<FormItem
|
||||||
|
label={translate('::ListForms.ListFormEdit.SendOnlyChangedFormValuesUpdate')}
|
||||||
|
invalid={
|
||||||
|
errors.editingOptionDto?.sendOnlyChangedFormValuesUpdate &&
|
||||||
|
touched.editingOptionDto?.sendOnlyChangedFormValuesUpdate
|
||||||
|
}
|
||||||
|
errorMessage={errors.editingOptionDto?.sendOnlyChangedFormValuesUpdate}
|
||||||
|
>
|
||||||
|
<Field
|
||||||
|
name="editingOptionDto.sendOnlyChangedFormValuesUpdate"
|
||||||
|
placeholder={translate(
|
||||||
|
'::ListForms.ListFormEdit.SendOnlyChangedFormValuesUpdate',
|
||||||
|
)}
|
||||||
|
component={Checkbox}
|
||||||
|
/>
|
||||||
|
</FormItem>
|
||||||
|
|
||||||
|
<FormItem
|
||||||
|
label={translate('::ListForms.ListFormEdit.EditingAllowDetail')}
|
||||||
|
invalid={
|
||||||
|
errors.editingOptionDto?.allowDetail && touched.editingOptionDto?.allowDetail
|
||||||
|
}
|
||||||
|
errorMessage={errors.editingOptionDto?.allowDetail}
|
||||||
|
>
|
||||||
|
<Field
|
||||||
|
name="editingOptionDto.allowDetail"
|
||||||
|
placeholder={translate('::ListForms.ListFormEdit.EditingAllowDetail')}
|
||||||
|
component={Checkbox}
|
||||||
|
/>
|
||||||
|
</FormItem>
|
||||||
|
|
||||||
|
<FormItem
|
||||||
|
label={translate('::ListForms.ListFormEdit.EditingAllowDeleting')}
|
||||||
|
invalid={
|
||||||
|
errors.editingOptionDto?.allowDeleting &&
|
||||||
|
touched.editingOptionDto?.allowDeleting
|
||||||
|
}
|
||||||
|
errorMessage={errors.editingOptionDto?.allowDeleting}
|
||||||
|
>
|
||||||
|
<Field
|
||||||
|
name="editingOptionDto.allowDeleting"
|
||||||
|
placeholder={translate('::ListForms.ListFormEdit.EditingAllowDeleting')}
|
||||||
|
component={Checkbox}
|
||||||
|
/>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem
|
||||||
|
label={translate('::ListForms.ListFormEdit.EditingAllowDeleteAll')}
|
||||||
|
invalid={
|
||||||
|
errors.editingOptionDto?.allowAllDeleting &&
|
||||||
|
touched.editingOptionDto?.allowAllDeleting
|
||||||
|
}
|
||||||
|
errorMessage={errors.editingOptionDto?.allowAllDeleting}
|
||||||
|
>
|
||||||
|
<Field
|
||||||
|
name="editingOptionDto.allowAllDeleting"
|
||||||
|
placeholder={translate('::ListForms.ListFormEdit.EditingAllowDeleteAll')}
|
||||||
|
component={Checkbox}
|
||||||
|
/>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem
|
||||||
|
label={translate('::ListForms.ListFormEdit.EditingConfirmDelete')}
|
||||||
|
invalid={
|
||||||
|
errors.editingOptionDto?.confirmDelete &&
|
||||||
|
touched.editingOptionDto?.confirmDelete
|
||||||
|
}
|
||||||
|
errorMessage={errors.editingOptionDto?.confirmDelete}
|
||||||
|
>
|
||||||
|
<Field
|
||||||
|
name="editingOptionDto.confirmDelete"
|
||||||
|
placeholder={translate('::ListForms.ListFormEdit.EditingConfirmDelete')}
|
||||||
|
component={Checkbox}
|
||||||
|
/>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem
|
||||||
|
label={translate('::ListForms.ListFormEdit.EditingUseIcons')}
|
||||||
|
invalid={
|
||||||
|
errors.editingOptionDto?.useIcons && touched.editingOptionDto?.useIcons
|
||||||
|
}
|
||||||
|
errorMessage={errors.editingOptionDto?.useIcons}
|
||||||
|
>
|
||||||
|
<Field
|
||||||
|
name="editingOptionDto.useIcons"
|
||||||
|
placeholder={translate('::ListForms.ListFormEdit.EditingUseIcons')}
|
||||||
|
component={Checkbox}
|
||||||
|
/>
|
||||||
|
</FormItem>
|
||||||
|
|
||||||
|
<FormItem
|
||||||
|
label={translate('::ListForms.ListFormEdit.EditingSelectTextOnEditStart')}
|
||||||
|
invalid={
|
||||||
|
errors.editingOptionDto?.selectTextOnEditStart &&
|
||||||
|
touched.editingOptionDto?.selectTextOnEditStart
|
||||||
|
}
|
||||||
|
errorMessage={errors.editingOptionDto?.selectTextOnEditStart}
|
||||||
|
>
|
||||||
|
<Field
|
||||||
|
name="editingOptionDto.selectTextOnEditStart"
|
||||||
|
placeholder={translate(
|
||||||
|
'::ListForms.ListFormEdit.EditingSelectTextOnEditStart',
|
||||||
|
)}
|
||||||
|
component={Checkbox}
|
||||||
|
/>
|
||||||
|
</FormItem>
|
||||||
|
|
||||||
|
<FormItem
|
||||||
|
label={translate('::SidePanel.Mode')}
|
||||||
|
invalid={errors.editingOptionDto?.mode && touched.editingOptionDto?.mode}
|
||||||
|
errorMessage={errors.editingOptionDto?.mode}
|
||||||
>
|
>
|
||||||
<Field
|
<Field
|
||||||
type="text"
|
type="text"
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
name="editingOptionDto.popup.title"
|
name="editingOptionDto.mode"
|
||||||
placeholder={translate('::ListForms.ListFormEdit.DetailsTitle')}
|
placeholder={translate('::SidePanel.Mode')}
|
||||||
component={Input}
|
>
|
||||||
/>
|
{({ field, form }: FieldProps<GridsEditMode>) => (
|
||||||
|
<Select
|
||||||
|
field={field}
|
||||||
|
form={form}
|
||||||
|
isClearable={true}
|
||||||
|
options={editingOptionModeOptions}
|
||||||
|
value={editingOptionModeOptions?.filter(
|
||||||
|
(option) => option.value === values.editingOptionDto.mode,
|
||||||
|
)}
|
||||||
|
onChange={(option) => form.setFieldValue(field.name, option?.value)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Field>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
<FormItem
|
<FormItem
|
||||||
label={translate('::ListForms.ListFormEdit.DetailsWidth')}
|
label={translate('::ListForms.ListFormEdit.EditingRefreshMode')}
|
||||||
invalid={
|
invalid={
|
||||||
errors.editingOptionDto?.popup?.width &&
|
errors.editingOptionDto?.refreshMode && touched.editingOptionDto?.refreshMode
|
||||||
touched.editingOptionDto?.popup?.width
|
|
||||||
}
|
}
|
||||||
errorMessage={errors.editingOptionDto?.popup?.width}
|
errorMessage={errors.editingOptionDto?.refreshMode}
|
||||||
>
|
>
|
||||||
<Field
|
<Field
|
||||||
className="w-20"
|
type="text"
|
||||||
type="number"
|
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
name="editingOptionDto.popup.width"
|
name="editingOptionDto.refreshMode"
|
||||||
placeholder={translate('::ListForms.ListFormEdit.DetailsWidth')}
|
placeholder={translate('::ListForms.ListFormEdit.EditingRefreshMode')}
|
||||||
component={Input}
|
>
|
||||||
/>
|
{({ field, form }: FieldProps<GridsEditRefreshMode>) => (
|
||||||
|
<Select
|
||||||
|
field={field}
|
||||||
|
form={form}
|
||||||
|
isClearable={true}
|
||||||
|
options={editingOptionRefreshModeOptions}
|
||||||
|
value={editingOptionRefreshModeOptions?.filter(
|
||||||
|
(option) => option.value === values.editingOptionDto.refreshMode,
|
||||||
|
)}
|
||||||
|
onChange={(option) => form.setFieldValue(field.name, option?.value)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Field>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem
|
<FormItem
|
||||||
label={translate('::ListForms.ListFormEdit.DetailsHeight')}
|
label={translate('::ListForms.ListFormEdit.EditingNewRowPosition')}
|
||||||
invalid={
|
invalid={
|
||||||
errors.editingOptionDto?.popup?.height &&
|
errors.editingOptionDto?.newRowPosition &&
|
||||||
touched.editingOptionDto?.popup?.height
|
touched.editingOptionDto?.newRowPosition
|
||||||
}
|
}
|
||||||
errorMessage={errors.editingOptionDto?.popup?.height}
|
errorMessage={errors.editingOptionDto?.newRowPosition}
|
||||||
>
|
>
|
||||||
<Field
|
<Field
|
||||||
className="w-20"
|
type="text"
|
||||||
type="number"
|
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
name="editingOptionDto.popup.height"
|
name="editingOptionDto.newRowPosition"
|
||||||
placeholder={translate('::ListForms.ListFormEdit.DetailsHeight')}
|
placeholder={translate('::ListForms.ListFormEdit.EditingNewRowPosition')}
|
||||||
|
>
|
||||||
|
{({ field, form }: FieldProps<NewRowPosition>) => (
|
||||||
|
<Select
|
||||||
|
field={field}
|
||||||
|
form={form}
|
||||||
|
isClearable={true}
|
||||||
|
options={editingOptionNewRowPositionOptions}
|
||||||
|
value={editingOptionNewRowPositionOptions?.filter(
|
||||||
|
(option) => option.value === values.editingOptionDto.newRowPosition,
|
||||||
|
)}
|
||||||
|
onChange={(option) => form.setFieldValue(field.name, option?.value)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Field>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem
|
||||||
|
label={translate('::ListForms.ListFormEdit.EditingStartEditAction')}
|
||||||
|
invalid={
|
||||||
|
errors.editingOptionDto?.startEditAction &&
|
||||||
|
touched.editingOptionDto?.startEditAction
|
||||||
|
}
|
||||||
|
errorMessage={errors.editingOptionDto?.startEditAction}
|
||||||
|
>
|
||||||
|
<Field
|
||||||
|
type="text"
|
||||||
|
autoComplete="off"
|
||||||
|
name="editingOptionDto.startEditAction"
|
||||||
|
placeholder={translate('::ListForms.ListFormEdit.EditingStartEditAction')}
|
||||||
|
>
|
||||||
|
{({ field, form }: FieldProps<StartEditAction>) => (
|
||||||
|
<Select
|
||||||
|
field={field}
|
||||||
|
form={form}
|
||||||
|
isClearable={true}
|
||||||
|
options={editingOptionStartEditActionOptions}
|
||||||
|
value={editingOptionStartEditActionOptions?.filter(
|
||||||
|
(option) => option.value === values.editingOptionDto.startEditAction,
|
||||||
|
)}
|
||||||
|
onChange={(option) => form.setFieldValue(field.name, option?.value)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Field>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem
|
||||||
|
label={translate('::ListForms.ListFormEdit.EditingEditColumnName')}
|
||||||
|
invalid={
|
||||||
|
errors.editingOptionDto?.editColumnName &&
|
||||||
|
touched.editingOptionDto?.editColumnName
|
||||||
|
}
|
||||||
|
errorMessage={errors.editingOptionDto?.editColumnName}
|
||||||
|
>
|
||||||
|
<Field
|
||||||
|
type="text"
|
||||||
|
autoComplete="off"
|
||||||
|
name="editingOptionDto.editColumnName"
|
||||||
|
placeholder={translate('::ListForms.ListFormEdit.EditingEditColumnName')}
|
||||||
component={Input}
|
component={Input}
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem
|
</Card>
|
||||||
label={translate('::ListForms.ListFormEdit.EditingFullScreen')}
|
<Card className="my-2" header="Popup">
|
||||||
invalid={
|
{values.editingOptionDto.mode === 'popup' && (
|
||||||
errors.editingOptionDto?.popup?.fullScreen &&
|
<>
|
||||||
touched.editingOptionDto?.popup?.fullScreen
|
<FormItem
|
||||||
}
|
label={translate('::ListForms.ListFormEdit.EditingShowTitle')}
|
||||||
errorMessage={errors.editingOptionDto?.popup?.fullScreen}
|
invalid={
|
||||||
>
|
errors.editingOptionDto?.popup?.showTitle &&
|
||||||
<Field
|
touched.editingOptionDto?.popup?.showTitle
|
||||||
name="editingOptionDto.popup.fullScreen"
|
}
|
||||||
placeholder={translate('::ListForms.ListFormEdit.EditingFullScreen')}
|
errorMessage={errors.editingOptionDto?.popup?.showTitle}
|
||||||
component={Checkbox}
|
>
|
||||||
/>
|
<Field
|
||||||
</FormItem>
|
name="editingOptionDto.popup.showTitle"
|
||||||
<FormItem
|
placeholder={translate('::ListForms.ListFormEdit.EditingShowTitle')}
|
||||||
label={translate('::ListForms.ListFormEdit.ResizeEnabled')}
|
component={Checkbox}
|
||||||
invalid={
|
/>
|
||||||
errors.editingOptionDto?.popup?.resizeEnabled &&
|
</FormItem>
|
||||||
touched.editingOptionDto?.popup?.resizeEnabled
|
<FormItem
|
||||||
}
|
label={translate('::ListForms.ListFormEdit.DetailsTitle')}
|
||||||
errorMessage={errors.editingOptionDto?.popup?.resizeEnabled}
|
invalid={
|
||||||
>
|
errors.editingOptionDto?.popup?.title &&
|
||||||
<Field
|
touched.editingOptionDto?.popup?.title
|
||||||
name="editingOptionDto.popup.resizeEnabled"
|
}
|
||||||
placeholder={translate('::ListForms.ListFormEdit.ResizeEnabled')}
|
errorMessage={errors.editingOptionDto?.popup?.title}
|
||||||
component={Checkbox}
|
>
|
||||||
/>
|
<Field
|
||||||
</FormItem>
|
type="text"
|
||||||
<FormItem
|
autoComplete="off"
|
||||||
label={translate('::ListForms.ListFormEdit.EditingHideOnOutsideClick')}
|
name="editingOptionDto.popup.title"
|
||||||
invalid={
|
placeholder={translate('::ListForms.ListFormEdit.DetailsTitle')}
|
||||||
errors.editingOptionDto?.popup?.hideOnOutsideClick &&
|
component={Input}
|
||||||
touched.editingOptionDto?.popup?.hideOnOutsideClick
|
/>
|
||||||
}
|
</FormItem>
|
||||||
errorMessage={errors.editingOptionDto?.popup?.hideOnOutsideClick}
|
<FormItem
|
||||||
>
|
label={translate('::ListForms.ListFormEdit.DetailsWidth')}
|
||||||
<Field
|
invalid={
|
||||||
name="editingOptionDto.popup.hideOnOutsideClick"
|
errors.editingOptionDto?.popup?.width &&
|
||||||
placeholder={translate('::ListForms.ListFormEdit.EditingHideOnOutsideClick')}
|
touched.editingOptionDto?.popup?.width
|
||||||
component={Checkbox}
|
}
|
||||||
/>
|
errorMessage={errors.editingOptionDto?.popup?.width}
|
||||||
</FormItem>
|
>
|
||||||
</>
|
<Field
|
||||||
)}
|
className="w-20"
|
||||||
<FormItem
|
type="number"
|
||||||
label={translate('::ListForms.ListFormEdit.SendOnlyChangedFormValuesUpdate')}
|
autoComplete="off"
|
||||||
invalid={
|
name="editingOptionDto.popup.width"
|
||||||
errors.editingOptionDto?.sendOnlyChangedFormValuesUpdate &&
|
placeholder={translate('::ListForms.ListFormEdit.DetailsWidth')}
|
||||||
touched.editingOptionDto?.sendOnlyChangedFormValuesUpdate
|
component={Input}
|
||||||
}
|
/>
|
||||||
errorMessage={errors.editingOptionDto?.sendOnlyChangedFormValuesUpdate}
|
</FormItem>
|
||||||
>
|
<FormItem
|
||||||
<Field
|
label={translate('::ListForms.ListFormEdit.DetailsHeight')}
|
||||||
name="editingOptionDto.sendOnlyChangedFormValuesUpdate"
|
invalid={
|
||||||
placeholder={translate(
|
errors.editingOptionDto?.popup?.height &&
|
||||||
'::ListForms.ListFormEdit.SendOnlyChangedFormValuesUpdate',
|
touched.editingOptionDto?.popup?.height
|
||||||
|
}
|
||||||
|
errorMessage={errors.editingOptionDto?.popup?.height}
|
||||||
|
>
|
||||||
|
<Field
|
||||||
|
className="w-20"
|
||||||
|
type="number"
|
||||||
|
autoComplete="off"
|
||||||
|
name="editingOptionDto.popup.height"
|
||||||
|
placeholder={translate('::ListForms.ListFormEdit.DetailsHeight')}
|
||||||
|
component={Input}
|
||||||
|
/>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem
|
||||||
|
label={translate('::ListForms.ListFormEdit.EditingFullScreen')}
|
||||||
|
invalid={
|
||||||
|
errors.editingOptionDto?.popup?.fullScreen &&
|
||||||
|
touched.editingOptionDto?.popup?.fullScreen
|
||||||
|
}
|
||||||
|
errorMessage={errors.editingOptionDto?.popup?.fullScreen}
|
||||||
|
>
|
||||||
|
<Field
|
||||||
|
name="editingOptionDto.popup.fullScreen"
|
||||||
|
placeholder={translate('::ListForms.ListFormEdit.EditingFullScreen')}
|
||||||
|
component={Checkbox}
|
||||||
|
/>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem
|
||||||
|
label={translate('::ListForms.ListFormEdit.ResizeEnabled')}
|
||||||
|
invalid={
|
||||||
|
errors.editingOptionDto?.popup?.resizeEnabled &&
|
||||||
|
touched.editingOptionDto?.popup?.resizeEnabled
|
||||||
|
}
|
||||||
|
errorMessage={errors.editingOptionDto?.popup?.resizeEnabled}
|
||||||
|
>
|
||||||
|
<Field
|
||||||
|
name="editingOptionDto.popup.resizeEnabled"
|
||||||
|
placeholder={translate('::ListForms.ListFormEdit.ResizeEnabled')}
|
||||||
|
component={Checkbox}
|
||||||
|
/>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem
|
||||||
|
label={translate('::ListForms.ListFormEdit.EditingHideOnOutsideClick')}
|
||||||
|
invalid={
|
||||||
|
errors.editingOptionDto?.popup?.hideOnOutsideClick &&
|
||||||
|
touched.editingOptionDto?.popup?.hideOnOutsideClick
|
||||||
|
}
|
||||||
|
errorMessage={errors.editingOptionDto?.popup?.hideOnOutsideClick}
|
||||||
|
>
|
||||||
|
<Field
|
||||||
|
name="editingOptionDto.popup.hideOnOutsideClick"
|
||||||
|
placeholder={translate(
|
||||||
|
'::ListForms.ListFormEdit.EditingHideOnOutsideClick',
|
||||||
|
)}
|
||||||
|
component={Checkbox}
|
||||||
|
/>
|
||||||
|
</FormItem>
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
component={Checkbox}
|
</Card>
|
||||||
/>
|
</div>
|
||||||
</FormItem>
|
|
||||||
<Button block variant="solid" loading={isSubmitting}>
|
<Button block variant="solid" loading={isSubmitting}>
|
||||||
{isSubmitting ? translate('::SavingWithThreeDot') : translate('::Save')}
|
{isSubmitting ? translate('::SavingWithThreeDot') : translate('::Save')}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
||||||
|
|
@ -338,6 +338,20 @@ const useListFormColumns = ({
|
||||||
|
|
||||||
const buttons: any[] = []
|
const buttons: any[] = []
|
||||||
|
|
||||||
|
if (hasUpdate) {
|
||||||
|
buttons.push({
|
||||||
|
name: 'edit',
|
||||||
|
text: translate('::App.Platform.Edit'),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasDelete) {
|
||||||
|
buttons.push({
|
||||||
|
name: 'delete',
|
||||||
|
text: translate('::App.Platform.Delete'),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
if (hasDetail) {
|
if (hasDetail) {
|
||||||
const item = {
|
const item = {
|
||||||
name: 'detail',
|
name: 'detail',
|
||||||
|
|
@ -360,20 +374,6 @@ const useListFormColumns = ({
|
||||||
buttons.push(item)
|
buttons.push(item)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasUpdate) {
|
|
||||||
buttons.push({
|
|
||||||
name: 'edit',
|
|
||||||
text: translate('::App.Platform.Edit'),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hasDelete) {
|
|
||||||
buttons.push({
|
|
||||||
name: 'delete',
|
|
||||||
text: translate('::App.Platform.Delete'),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
gridDto.gridOptions.commandColumnDto.forEach((action) => {
|
gridDto.gridOptions.commandColumnDto.forEach((action) => {
|
||||||
if (action.buttonPosition !== UiCommandButtonPositionTypeEnum.CommandColumn) return
|
if (action.buttonPosition !== UiCommandButtonPositionTypeEnum.CommandColumn) return
|
||||||
if (!checkPermission(action.authName)) return
|
if (!checkPermission(action.authName)) return
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,20 @@ const useToolbar = ({
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add InsertNewRecord button
|
||||||
|
if (grdOpt.editingOptionDto?.allowAdding && checkPermission(grdOpt.permissionDto?.c)) {
|
||||||
|
items.push({
|
||||||
|
locateInMenu: 'auto',
|
||||||
|
showText: 'always',
|
||||||
|
name: 'addRowButton',
|
||||||
|
location: 'after',
|
||||||
|
options: {
|
||||||
|
text: translate('::ListForms.ListForm.AddNewRecord'),
|
||||||
|
hint: translate('::ListForms.ListForm.AddNewRecord'),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
items.push({
|
items.push({
|
||||||
widget: 'dxButton',
|
widget: 'dxButton',
|
||||||
name: 'refreshButton',
|
name: 'refreshButton',
|
||||||
|
|
@ -120,20 +134,6 @@ const useToolbar = ({
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add InsertNewRecord button
|
|
||||||
if (grdOpt.editingOptionDto?.allowAdding && checkPermission(grdOpt.permissionDto?.c)) {
|
|
||||||
items.push({
|
|
||||||
locateInMenu: 'auto',
|
|
||||||
showText: 'always',
|
|
||||||
name: 'addRowButton',
|
|
||||||
location: 'after',
|
|
||||||
options: {
|
|
||||||
text: translate('::ListForms.ListForm.AddNewRecord'),
|
|
||||||
hint: translate('::ListForms.ListForm.AddNewRecord'),
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add group panel
|
// Add group panel
|
||||||
if (grdOpt.groupPanelDto?.visible) {
|
if (grdOpt.groupPanelDto?.visible) {
|
||||||
items.push({
|
items.push({
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue