Genel düzenlemeler
This commit is contained in:
parent
4b9ef52e84
commit
ca18bbc6a8
6 changed files with 33 additions and 11 deletions
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using Kurs.Languages.Languages;
|
||||
|
|
@ -10526,7 +10527,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
|
|||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "CountryCode",
|
||||
Width = 200,
|
||||
Width = 400,
|
||||
ListOrderNo = 2,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
|
|
@ -10801,7 +10802,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
|
|||
DataSourceType = UiLookupDataSourceTypeEnum.Query,
|
||||
DisplayExpr = "Name",
|
||||
ValueExpr = "Key",
|
||||
LookupQuery = $"SELECT \"{DbTablePrefix}Country\".\"Code\" AS \"Key\", \"{DbTablePrefix}Country\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}Country\" ORDER BY \"{DbTablePrefix}Country\".\"Name\""
|
||||
LookupQuery = $"SELECT \"{DbTablePrefix}Country\".\"Code\" AS \"Key\", \"{DbTablePrefix}Country\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}Country\" ORDER BY \"{DbTablePrefix}Country\".\"Name\"",
|
||||
CascadeEmptyFields = "CityCode"
|
||||
}),
|
||||
ValidationRuleJson = JsonSerializer.Serialize(new[]
|
||||
{
|
||||
|
|
@ -10834,7 +10836,10 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
|
|||
DataSourceType = UiLookupDataSourceTypeEnum.Query,
|
||||
DisplayExpr = "Name",
|
||||
ValueExpr = "Key",
|
||||
LookupQuery = $"SELECT \"{DbTablePrefix}City\".\"Code\" AS \"Key\", \"{DbTablePrefix}City\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}City\" ORDER BY \"{DbTablePrefix}City\".\"Name\""
|
||||
LookupQuery = $"SELECT \"{DbTablePrefix}City\".\"Code\" AS \"Key\", \"{DbTablePrefix}City\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}City\" WHERE \"PCity\".\"CountryCode\" = @param0 OR @param0 IS NULL ORDER BY \"{DbTablePrefix}City\".\"Name\"",
|
||||
CascadeRelationField = "CountryCode",
|
||||
CascadeFilterOperator="=",
|
||||
CascadeParentFields = "CountryCode"
|
||||
}),
|
||||
ValidationRuleJson = JsonSerializer.Serialize(new[]
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import { usePermission } from '../utils/hooks/usePermission'
|
|||
import { GridColumnData } from '../views/list/GridColumnData'
|
||||
import {
|
||||
ColumnFormatDto,
|
||||
EditingFormItemDto,
|
||||
GridDto,
|
||||
PlatformEditorTypes,
|
||||
UiCommandButtonPositionTypeEnum,
|
||||
|
|
|
|||
|
|
@ -178,7 +178,6 @@ function FormFieldTabJoinOptions({
|
|||
autoComplete="off"
|
||||
name="columnJoinTableDto.joinCondition2"
|
||||
placeholder={translate('::ListForms.ListFormFieldEdit.JoinOptionsJoinCondition2')}
|
||||
component={Input}
|
||||
>
|
||||
{({ field, form }: FieldProps<GridColumnJoinConditionEnum>) => (
|
||||
<Select
|
||||
|
|
|
|||
|
|
@ -26,6 +26,23 @@ const schema = object().shape({
|
|||
.required(),
|
||||
})
|
||||
|
||||
function getNormalizedInitialValues(initialValues: ColumnFormatEditDto) {
|
||||
return {
|
||||
...initialValues,
|
||||
lookupDto: {
|
||||
...initialValues.lookupDto,
|
||||
dataSourceType: initialValues.lookupDto?.dataSourceType ?? undefined,
|
||||
valueExpr: initialValues.lookupDto?.valueExpr ?? '',
|
||||
displayExpr: initialValues.lookupDto?.displayExpr ?? '',
|
||||
cascadeRelationField: initialValues.lookupDto?.cascadeRelationField ?? '',
|
||||
cascadeParentFields: initialValues.lookupDto?.cascadeParentFields ?? '',
|
||||
cascadeFilterOperator: initialValues.lookupDto?.cascadeFilterOperator ?? undefined,
|
||||
cascadeEmptyFields: initialValues.lookupDto?.cascadeEmptyFields ?? '',
|
||||
lookupQuery: initialValues.lookupDto?.lookupQuery ?? '',
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
function FormFieldTabLookup({
|
||||
listFormCode,
|
||||
initialValues,
|
||||
|
|
@ -40,10 +57,10 @@ function FormFieldTabLookup({
|
|||
<Container className="grid xl:grid-cols-2">
|
||||
<Formik
|
||||
enableReinitialize
|
||||
initialValues={initialValues}
|
||||
initialValues={getNormalizedInitialValues(initialValues)}
|
||||
validationSchema={schema}
|
||||
onSubmit={async (values, formikHelpers) => {
|
||||
await onSubmit(ListFormFieldEditTabs.LookupForm, values, formikHelpers)
|
||||
onSubmit={async (values) => {
|
||||
await onSubmit(ListFormFieldEditTabs.LookupForm, values)
|
||||
}}
|
||||
>
|
||||
{({ touched, errors, isSubmitting, values }) => (
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ function RolesPermission({
|
|||
|
||||
updatePermissions(providerName, name, { permissions: updatePermList })
|
||||
toast.push(<Notification title={'Permission updated'} type="success" />, {
|
||||
placement: 'top-center',
|
||||
placement: 'top-end',
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ function UsersPermission({
|
|||
|
||||
updatePermissions(providerName, id, { permissions: updatePermList })
|
||||
toast.push(<Notification title={'Permission updated'} type="success" />, {
|
||||
placement: 'top-center',
|
||||
placement: 'top-end',
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue