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",
|
||||
"tr": "Tablo Yapısını Kaydet"
|
||||
},
|
||||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "ListForms.ListForm.GridStateSaved",
|
||||
"en": "Grid State Saved",
|
||||
"tr": "Tablo Yapısı Kaydedildi"
|
||||
},
|
||||
{
|
||||
"resourceName": "Platform",
|
||||
"key": "ListForms.ListForm.ResetGridState",
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@ function FormTabEdit(props: FormEditProps & { listFormCode: string }) {
|
|||
{({ touched, errors, values, isSubmitting }) => (
|
||||
<Form>
|
||||
<FormContainer size="sm">
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-3">
|
||||
<Card className="my-2" header="General">
|
||||
<FormItem
|
||||
label={translate('::ListForms.ListFormEdit.EditingAllowAdding')}
|
||||
invalid={
|
||||
|
|
@ -57,7 +59,8 @@ function FormTabEdit(props: FormEditProps & { listFormCode: string }) {
|
|||
<FormItem
|
||||
label={translate('::ListForms.ListFormEdit.EditingAllowEditing')}
|
||||
invalid={
|
||||
errors.editingOptionDto?.allowEditing && touched.editingOptionDto?.allowEditing
|
||||
errors.editingOptionDto?.allowEditing &&
|
||||
touched.editingOptionDto?.allowEditing
|
||||
}
|
||||
errorMessage={errors.editingOptionDto?.allowEditing}
|
||||
>
|
||||
|
|
@ -68,6 +71,23 @@ function FormTabEdit(props: FormEditProps & { listFormCode: string }) {
|
|||
/>
|
||||
</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={
|
||||
|
|
@ -85,7 +105,8 @@ function FormTabEdit(props: FormEditProps & { listFormCode: string }) {
|
|||
<FormItem
|
||||
label={translate('::ListForms.ListFormEdit.EditingAllowDeleting')}
|
||||
invalid={
|
||||
errors.editingOptionDto?.allowDeleting && touched.editingOptionDto?.allowDeleting
|
||||
errors.editingOptionDto?.allowDeleting &&
|
||||
touched.editingOptionDto?.allowDeleting
|
||||
}
|
||||
errorMessage={errors.editingOptionDto?.allowDeleting}
|
||||
>
|
||||
|
|
@ -112,7 +133,8 @@ function FormTabEdit(props: FormEditProps & { listFormCode: string }) {
|
|||
<FormItem
|
||||
label={translate('::ListForms.ListFormEdit.EditingConfirmDelete')}
|
||||
invalid={
|
||||
errors.editingOptionDto?.confirmDelete && touched.editingOptionDto?.confirmDelete
|
||||
errors.editingOptionDto?.confirmDelete &&
|
||||
touched.editingOptionDto?.confirmDelete
|
||||
}
|
||||
errorMessage={errors.editingOptionDto?.confirmDelete}
|
||||
>
|
||||
|
|
@ -124,7 +146,9 @@ function FormTabEdit(props: FormEditProps & { listFormCode: string }) {
|
|||
</FormItem>
|
||||
<FormItem
|
||||
label={translate('::ListForms.ListFormEdit.EditingUseIcons')}
|
||||
invalid={errors.editingOptionDto?.useIcons && touched.editingOptionDto?.useIcons}
|
||||
invalid={
|
||||
errors.editingOptionDto?.useIcons && touched.editingOptionDto?.useIcons
|
||||
}
|
||||
errorMessage={errors.editingOptionDto?.useIcons}
|
||||
>
|
||||
<Field
|
||||
|
|
@ -133,6 +157,7 @@ function FormTabEdit(props: FormEditProps & { listFormCode: string }) {
|
|||
component={Checkbox}
|
||||
/>
|
||||
</FormItem>
|
||||
|
||||
<FormItem
|
||||
label={translate('::ListForms.ListFormEdit.EditingSelectTextOnEditStart')}
|
||||
invalid={
|
||||
|
|
@ -143,10 +168,13 @@ function FormTabEdit(props: FormEditProps & { listFormCode: string }) {
|
|||
>
|
||||
<Field
|
||||
name="editingOptionDto.selectTextOnEditStart"
|
||||
placeholder={translate('::ListForms.ListFormEdit.EditingSelectTextOnEditStart')}
|
||||
placeholder={translate(
|
||||
'::ListForms.ListFormEdit.EditingSelectTextOnEditStart',
|
||||
)}
|
||||
component={Checkbox}
|
||||
/>
|
||||
</FormItem>
|
||||
|
||||
<FormItem
|
||||
label={translate('::SidePanel.Mode')}
|
||||
invalid={errors.editingOptionDto?.mode && touched.editingOptionDto?.mode}
|
||||
|
|
@ -172,6 +200,7 @@ function FormTabEdit(props: FormEditProps & { listFormCode: string }) {
|
|||
)}
|
||||
</Field>
|
||||
</FormItem>
|
||||
|
||||
<FormItem
|
||||
label={translate('::ListForms.ListFormEdit.EditingRefreshMode')}
|
||||
invalid={
|
||||
|
|
@ -271,6 +300,8 @@ function FormTabEdit(props: FormEditProps & { listFormCode: string }) {
|
|||
component={Input}
|
||||
/>
|
||||
</FormItem>
|
||||
</Card>
|
||||
<Card className="my-2" header="Popup">
|
||||
{values.editingOptionDto.mode === 'popup' && (
|
||||
<>
|
||||
<FormItem
|
||||
|
|
@ -375,28 +406,16 @@ function FormTabEdit(props: FormEditProps & { listFormCode: string }) {
|
|||
>
|
||||
<Field
|
||||
name="editingOptionDto.popup.hideOnOutsideClick"
|
||||
placeholder={translate('::ListForms.ListFormEdit.EditingHideOnOutsideClick')}
|
||||
placeholder={translate(
|
||||
'::ListForms.ListFormEdit.EditingHideOnOutsideClick',
|
||||
)}
|
||||
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>
|
||||
</Card>
|
||||
</div>
|
||||
<Button block variant="solid" loading={isSubmitting}>
|
||||
{isSubmitting ? translate('::SavingWithThreeDot') : translate('::Save')}
|
||||
</Button>
|
||||
|
|
|
|||
|
|
@ -338,6 +338,20 @@ const useListFormColumns = ({
|
|||
|
||||
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) {
|
||||
const item = {
|
||||
name: 'detail',
|
||||
|
|
@ -360,20 +374,6 @@ const useListFormColumns = ({
|
|||
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) => {
|
||||
if (action.buttonPosition !== UiCommandButtonPositionTypeEnum.CommandColumn) 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({
|
||||
widget: 'dxButton',
|
||||
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
|
||||
if (grdOpt.groupPanelDto?.visible) {
|
||||
items.push({
|
||||
|
|
|
|||
Loading…
Reference in a new issue