Workflow problemleri
This commit is contained in:
parent
2f1b9d4e77
commit
64084679e8
15 changed files with 132 additions and 46 deletions
|
|
@ -305,7 +305,7 @@ public class ListFormWizardAppService(
|
||||||
HeaderFilterJson = WizardConsts.DefaultHeaderFilterJson,
|
HeaderFilterJson = WizardConsts.DefaultHeaderFilterJson,
|
||||||
SearchPanelJson = WizardConsts.DefaultSearchPanelJson,
|
SearchPanelJson = WizardConsts.DefaultSearchPanelJson,
|
||||||
GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }),
|
GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }),
|
||||||
SelectionJson = WizardConsts.DefaultSelectionSingleJson,
|
SelectionJson = WizardConsts.DefaultSelectionSingleJson(input.Widgets.Count > 0 ? GridOptions.SelectionModeSingle : GridOptions.SelectionModeNone),
|
||||||
ColumnOptionJson = WizardConsts.DefaultColumnOptionJson(),
|
ColumnOptionJson = WizardConsts.DefaultColumnOptionJson(),
|
||||||
PermissionJson = WizardConsts.DefaultPermissionJson(code),
|
PermissionJson = WizardConsts.DefaultPermissionJson(code),
|
||||||
DeleteCommand = isDeleted ? WizardConsts.DefaultDeleteCommand(input.SelectCommand) : null,
|
DeleteCommand = isDeleted ? WizardConsts.DefaultDeleteCommand(input.SelectCommand) : null,
|
||||||
|
|
|
||||||
|
|
@ -18038,6 +18038,12 @@
|
||||||
"en": "Add Multi-Tenant Column",
|
"en": "Add Multi-Tenant Column",
|
||||||
"tr": "MultiTenant Sütunları Ekle"
|
"tr": "MultiTenant Sütunları Ekle"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "App.SqlQueryManager.AddWorkflowColumns",
|
||||||
|
"en": "Add Workflow Column",
|
||||||
|
"tr": "Workflow Sütunları Ekle"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"resourceName": "Platform",
|
"resourceName": "Platform",
|
||||||
"key": "App.SqlQueryManager.ClearAllColumns",
|
"key": "App.SqlQueryManager.ClearAllColumns",
|
||||||
|
|
|
||||||
|
|
@ -797,7 +797,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
|
||||||
PermissionJson = DefaultPermissionJson(PlatformConsts.IdentityPermissions.Users.Create, listFormName, PlatformConsts.IdentityPermissions.Users.Update, PlatformConsts.IdentityPermissions.Users.Delete, PlatformConsts.IdentityPermissions.Users.Export, PlatformConsts.IdentityPermissions.Users.Import, PlatformConsts.IdentityPermissions.Users.Note),
|
PermissionJson = DefaultPermissionJson(PlatformConsts.IdentityPermissions.Users.Create, listFormName, PlatformConsts.IdentityPermissions.Users.Update, PlatformConsts.IdentityPermissions.Users.Delete, PlatformConsts.IdentityPermissions.Users.Export, PlatformConsts.IdentityPermissions.Users.Import, PlatformConsts.IdentityPermissions.Users.Note),
|
||||||
DeleteCommand = $"UPDATE \"AbpUsers\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id",
|
DeleteCommand = $"UPDATE \"AbpUsers\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id",
|
||||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(),
|
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(),
|
||||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 730, true, true, true, true, false),
|
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 710, true, true, true, true, false),
|
||||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
|
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
|
||||||
new () { Order=1,ColCount=1,ColSpan=1,ItemType="group",Items=[
|
new () { Order=1,ColCount=1,ColSpan=1,ItemType="group",Items=[
|
||||||
new EditingFormItemDto { Order=1, DataField="Email", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order=1, DataField="Email", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||||
|
|
|
||||||
|
|
@ -352,7 +352,7 @@ public class WizardDataSeeder : IDataSeedContributor, ITransientDependency
|
||||||
HeaderFilterJson = WizardConsts.DefaultHeaderFilterJson,
|
HeaderFilterJson = WizardConsts.DefaultHeaderFilterJson,
|
||||||
SearchPanelJson = WizardConsts.DefaultSearchPanelJson,
|
SearchPanelJson = WizardConsts.DefaultSearchPanelJson,
|
||||||
GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }),
|
GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }),
|
||||||
SelectionJson = WizardConsts.DefaultSelectionSingleJson,
|
SelectionJson = WizardConsts.DefaultSelectionSingleJson(input.Widgets.Count > 0 ? GridOptions.SelectionModeSingle : GridOptions.SelectionModeNone),
|
||||||
ColumnOptionJson = WizardConsts.DefaultColumnOptionJson(),
|
ColumnOptionJson = WizardConsts.DefaultColumnOptionJson(),
|
||||||
PermissionJson = WizardConsts.DefaultPermissionJson(code),
|
PermissionJson = WizardConsts.DefaultPermissionJson(code),
|
||||||
DeleteCommand = isDeleted ? WizardConsts.DefaultDeleteCommand(input.SelectCommand) : null,
|
DeleteCommand = isDeleted ? WizardConsts.DefaultDeleteCommand(input.SelectCommand) : null,
|
||||||
|
|
|
||||||
|
|
@ -95,9 +95,9 @@ public static class WizardConsts
|
||||||
public static readonly string DefaultSearchPanelJson = JsonSerializer.Serialize(new { Visible = true });
|
public static readonly string DefaultSearchPanelJson = JsonSerializer.Serialize(new { Visible = true });
|
||||||
public static readonly string DefaultGroupPanelJson = JsonSerializer.Serialize(new { Visible = true });
|
public static readonly string DefaultGroupPanelJson = JsonSerializer.Serialize(new { Visible = true });
|
||||||
|
|
||||||
public static readonly string DefaultSelectionSingleJson = JsonSerializer.Serialize(new
|
public static string DefaultSelectionSingleJson(string Mode = "none") => JsonSerializer.Serialize(new
|
||||||
{
|
{
|
||||||
Mode = GridOptions.SelectionModeNone,
|
Mode = Mode,
|
||||||
AllowSelectAll = false
|
AllowSelectAll = false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -347,7 +347,8 @@ export function toCriteriaForm(item: WorkflowCriteriaDto): WorkflowCriteriaForm
|
||||||
}
|
}
|
||||||
|
|
||||||
export function normalizeCriteria(item: WorkflowCriteriaForm): SaveCriteriaInput {
|
export function normalizeCriteria(item: WorkflowCriteriaForm): SaveCriteriaInput {
|
||||||
const sharedPerson = item.approver || ''
|
const sharedPerson =
|
||||||
|
item.kind === 'Approval' || item.kind === 'Inform' ? item.approver || '' : ''
|
||||||
const compareOutcomes = (item.compareOutcomes || [])
|
const compareOutcomes = (item.compareOutcomes || [])
|
||||||
.slice(0, 4)
|
.slice(0, 4)
|
||||||
.filter((outcome) => outcome.label?.trim())
|
.filter((outcome) => outcome.label?.trim())
|
||||||
|
|
@ -504,7 +505,7 @@ export function criteriaSummary(item: WorkflowCriteriaDto) {
|
||||||
if (item.kind === 'Approval' || item.kind === 'Inform') {
|
if (item.kind === 'Approval' || item.kind === 'Inform') {
|
||||||
return `${item.title} ${item.approver ? `- ${item.approver}` : ''}`
|
return `${item.title} ${item.approver ? `- ${item.approver}` : ''}`
|
||||||
}
|
}
|
||||||
return `${item.title} ${item.approver ? `- ${item.approver}` : ''}`
|
return item.title
|
||||||
}
|
}
|
||||||
|
|
||||||
export function targetTitle(criteria: WorkflowCriteriaDto[], id?: string | null) {
|
export function targetTitle(criteria: WorkflowCriteriaDto[], id?: string | null) {
|
||||||
|
|
|
||||||
|
|
@ -296,10 +296,12 @@ export function FormTabWorkflow(
|
||||||
}
|
}
|
||||||
|
|
||||||
const schema = object().shape({
|
const schema = object().shape({
|
||||||
approvalUserFieldName: string().required(),
|
workflowDto: object().shape({
|
||||||
approvalStatusFieldName: string().required(),
|
approvalUserFieldName: string().required(),
|
||||||
approvalDateFieldName: string(),
|
approvalStatusFieldName: string().required(),
|
||||||
approvalDescriptionFieldName: string(),
|
approvalDateFieldName: string(),
|
||||||
|
approvalDescriptionFieldName: string(),
|
||||||
|
}),
|
||||||
})
|
})
|
||||||
|
|
||||||
const initialValues = useStoreState((s) => s.admin.lists.values)
|
const initialValues = useStoreState((s) => s.admin.lists.values)
|
||||||
|
|
@ -423,7 +425,7 @@ export function FormTabWorkflow(
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Button block variant="solid" loading={isSubmitting}>
|
<Button block variant="solid" type="submit" loading={isSubmitting}>
|
||||||
{isSubmitting ? translate('::SavingWithThreeDot') : translate('::Save')}
|
{isSubmitting ? translate('::SavingWithThreeDot') : translate('::Save')}
|
||||||
</Button>
|
</Button>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import { Button, Checkbox, FormItem, Input, Select } from '@/components/ui'
|
||||||
import { SelectCommandTypeEnum } from '@/proxy/form/models'
|
import { SelectCommandTypeEnum } from '@/proxy/form/models'
|
||||||
import type { DatabaseColumnDto, SqlObjectExplorerDto } from '@/proxy/sql-query-manager/models'
|
import type { DatabaseColumnDto, SqlObjectExplorerDto } from '@/proxy/sql-query-manager/models'
|
||||||
import { SelectBoxOption } from '@/types/shared'
|
import { SelectBoxOption } from '@/types/shared'
|
||||||
import { Field, FieldProps, FormikErrors, FormikTouched } from 'formik'
|
import { Field, FieldProps, FormikErrors, FormikTouched, useFormikContext } from 'formik'
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import CreatableSelect from 'react-select/creatable'
|
import CreatableSelect from 'react-select/creatable'
|
||||||
import { FaArrowLeft, FaArrowRight, FaPlus } from 'react-icons/fa'
|
import { FaArrowLeft, FaArrowRight, FaPlus } from 'react-icons/fa'
|
||||||
|
|
@ -68,6 +68,16 @@ const WizardStep2 = ({
|
||||||
onNext,
|
onNext,
|
||||||
}: WizardStep2Props) => {
|
}: WizardStep2Props) => {
|
||||||
const [showTableDesignerDialog, setShowTableDesignerDialog] = useState(false)
|
const [showTableDesignerDialog, setShowTableDesignerDialog] = useState(false)
|
||||||
|
const formik = useFormikContext<ListFormWizardDto>()
|
||||||
|
|
||||||
|
const handleTableDeployed = async (table: { schemaName: string; tableName: string }) => {
|
||||||
|
await onDbObjectsRefresh(values.dataSourceCode)
|
||||||
|
formik.setFieldValue('selectCommand', table.tableName)
|
||||||
|
formik.setFieldValue('selectCommandType', SelectCommandTypeEnum.Table)
|
||||||
|
formik.setFieldValue('keyFieldName', '')
|
||||||
|
formik.setFieldTouched('keyFieldName', false)
|
||||||
|
onLoadColumns(values.dataSourceCode, table.schemaName || 'dbo', table.tableName)
|
||||||
|
}
|
||||||
|
|
||||||
const step2Missing = [
|
const step2Missing = [
|
||||||
!values.listFormCode && translate('::App.Listform.ListformField.ListFormCode'),
|
!values.listFormCode && translate('::App.Listform.ListformField.ListFormCode'),
|
||||||
|
|
@ -825,7 +835,7 @@ const WizardStep2 = ({
|
||||||
onClose={() => setShowTableDesignerDialog(false)}
|
onClose={() => setShowTableDesignerDialog(false)}
|
||||||
dataSource={values.dataSourceCode}
|
dataSource={values.dataSourceCode}
|
||||||
initialTableData={null}
|
initialTableData={null}
|
||||||
onDeployed={() => onDbObjectsRefresh(values.dataSourceCode)}
|
onDeployed={handleTableDeployed}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import { useEffect, useMemo, useRef, useState } from 'react'
|
||||||
import type { FormEvent } from 'react'
|
import type { FormEvent } from 'react'
|
||||||
import { FaArrowLeft, FaArrowRight } from 'react-icons/fa'
|
import { FaArrowLeft, FaArrowRight } from 'react-icons/fa'
|
||||||
import { WorkflowDesigner } from '../workflow/WorkflowDesigner'
|
import { WorkflowDesigner } from '../workflow/WorkflowDesigner'
|
||||||
|
import { IdentityUserDto } from '@/proxy/admin/models'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
listFormCode: string
|
listFormCode: string
|
||||||
|
|
@ -77,7 +78,7 @@ function WizardStep6({
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getUsers(0, 1000).then((response) => {
|
getUsers(0, 1000).then((response) => {
|
||||||
setUserList(
|
setUserList(
|
||||||
(response.data?.items ?? []).map((user: any) => ({
|
(response.data?.items ?? []).map((user: IdentityUserDto) => ({
|
||||||
value: user.userName,
|
value: user.userName,
|
||||||
label: `${user.userName} (${user.name} ${user.surname})`,
|
label: `${user.userName} (${user.name} ${user.surname})`,
|
||||||
})),
|
})),
|
||||||
|
|
|
||||||
|
|
@ -476,9 +476,12 @@ const WizardStep7 = ({
|
||||||
{criteria.compareColumn} {criteria.compareOperator} {criteria.compareValue}
|
{criteria.compareColumn} {criteria.compareOperator} {criteria.compareValue}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="text-[11px] text-gray-500 dark:text-gray-400">
|
{(criteria.kind === 'Approval' || criteria.kind === 'Inform') &&
|
||||||
Approver: {criteria.approver}
|
criteria.approver && (
|
||||||
</div>
|
<div className="text-[11px] text-gray-500 dark:text-gray-400">
|
||||||
|
Approver: {criteria.approver}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -257,17 +257,19 @@ export function WorkflowCriteria({
|
||||||
onChange={(event) => setField('title', event.target.value)}
|
onChange={(event) => setField('title', event.target.value)}
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem
|
{(formValues.kind === 'Approval' || formValues.kind === 'Inform') && (
|
||||||
label={translate('::App.Listform.ListformField.Approver')}
|
<FormItem
|
||||||
asterisk={formValues.kind === 'Approval' || formValues.kind === 'Inform'}
|
label={translate('::App.Listform.ListformField.Approver')}
|
||||||
>
|
asterisk
|
||||||
<SelectField
|
>
|
||||||
required={formValues.kind === 'Approval' || formValues.kind === 'Inform'}
|
<SelectField
|
||||||
options={userList}
|
required
|
||||||
value={formValues.approver}
|
options={userList}
|
||||||
onChange={(value) => setField('approver', value)}
|
value={formValues.approver}
|
||||||
/>
|
onChange={(value) => setField('approver', value)}
|
||||||
</FormItem>
|
/>
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
|
||||||
{(formValues.kind === 'Start' || formValues.kind === 'Inform') && (
|
{(formValues.kind === 'Start' || formValues.kind === 'Inform') && (
|
||||||
<FormItem
|
<FormItem
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ type SqlDataType =
|
||||||
| 'decimal'
|
| 'decimal'
|
||||||
| 'float'
|
| 'float'
|
||||||
| 'bit'
|
| 'bit'
|
||||||
|
| 'datetime'
|
||||||
| 'datetime2'
|
| 'datetime2'
|
||||||
| 'date'
|
| 'date'
|
||||||
| 'uniqueidentifier'
|
| 'uniqueidentifier'
|
||||||
|
|
@ -68,7 +69,7 @@ interface TableDesignerDialogProps {
|
||||||
isOpen: boolean
|
isOpen: boolean
|
||||||
onClose: () => void
|
onClose: () => void
|
||||||
dataSource: string | null
|
dataSource: string | null
|
||||||
onDeployed?: () => void
|
onDeployed?: (table: { schemaName: string; tableName: string }) => void | Promise<void>
|
||||||
initialTableData?: { schemaName: string; tableName: string } | null
|
initialTableData?: { schemaName: string; tableName: string } | null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -98,6 +99,7 @@ const DATA_TYPES: { value: SqlDataType; label: string }[] = [
|
||||||
{ value: 'decimal', label: 'Decimal (decimal 18,4)' },
|
{ value: 'decimal', label: 'Decimal (decimal 18,4)' },
|
||||||
{ value: 'float', label: 'Float (float)' },
|
{ value: 'float', label: 'Float (float)' },
|
||||||
{ value: 'bit', label: 'Bool (bit)' },
|
{ value: 'bit', label: 'Bool (bit)' },
|
||||||
|
{ value: 'datetime', label: 'DateTime (datetime)' },
|
||||||
{ value: 'datetime2', label: 'DateTime (datetime2)' },
|
{ value: 'datetime2', label: 'DateTime (datetime2)' },
|
||||||
{ value: 'date', label: 'Date (date)' },
|
{ value: 'date', label: 'Date (date)' },
|
||||||
{ value: 'uniqueidentifier', label: 'Guid (uniqueidentifier)' },
|
{ value: 'uniqueidentifier', label: 'Guid (uniqueidentifier)' },
|
||||||
|
|
@ -226,6 +228,45 @@ const TENANT_COLUMN: ColumnDefinition = {
|
||||||
description: 'Tenant ID for multi-tenancy',
|
description: 'Tenant ID for multi-tenancy',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const WORKFLOW_COLUMNS: ColumnDefinition[] = [
|
||||||
|
{
|
||||||
|
id: '__ApprovalUserId',
|
||||||
|
columnName: 'ApprovalUserName',
|
||||||
|
dataType: 'nvarchar',
|
||||||
|
maxLength: '256',
|
||||||
|
isNullable: true,
|
||||||
|
defaultValue: '',
|
||||||
|
description: 'Workflow approval user name',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '__ApprovalStatus',
|
||||||
|
columnName: 'ApprovalStatus',
|
||||||
|
dataType: 'nvarchar',
|
||||||
|
maxLength: '50',
|
||||||
|
isNullable: true,
|
||||||
|
defaultValue: '',
|
||||||
|
description: 'Workflow approval status',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '__ApprovalDate',
|
||||||
|
columnName: 'ApprovalDate',
|
||||||
|
dataType: 'datetime',
|
||||||
|
maxLength: '',
|
||||||
|
isNullable: true,
|
||||||
|
defaultValue: '',
|
||||||
|
description: 'Workflow approval date',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '__ApprovalDescription',
|
||||||
|
columnName: 'ApprovalDescription',
|
||||||
|
dataType: 'nvarchar',
|
||||||
|
maxLength: '200',
|
||||||
|
isNullable: true,
|
||||||
|
defaultValue: '',
|
||||||
|
description: 'Workflow approval description',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
const CREATE_TABLE_SCRIPT_STORAGE_KEY = 'sqlQueryManager.lastCreateTableScript'
|
const CREATE_TABLE_SCRIPT_STORAGE_KEY = 'sqlQueryManager.lastCreateTableScript'
|
||||||
|
|
||||||
// ─── T-SQL Generator ──────────────────────────────────────────────────────────
|
// ─── T-SQL Generator ──────────────────────────────────────────────────────────
|
||||||
|
|
@ -405,6 +446,8 @@ function dbColToColumnDef(col: {
|
||||||
dataType = 'float'
|
dataType = 'float'
|
||||||
} else if (dt === 'bit') {
|
} else if (dt === 'bit') {
|
||||||
dataType = 'bit'
|
dataType = 'bit'
|
||||||
|
} else if (dt === 'datetime') {
|
||||||
|
dataType = 'datetime'
|
||||||
} else if (dt.startsWith('datetime') || dt === 'smalldatetime') {
|
} else if (dt.startsWith('datetime') || dt === 'smalldatetime') {
|
||||||
dataType = 'datetime2'
|
dataType = 'datetime2'
|
||||||
} else if (dt === 'date') {
|
} else if (dt === 'date') {
|
||||||
|
|
@ -476,6 +519,7 @@ function mapSqlTypeToDesigner(dataTypeRaw: string, lengthRaw: string): {
|
||||||
if (dt === 'decimal' || dt === 'numeric') return { dataType: 'decimal', maxLength: '' }
|
if (dt === 'decimal' || dt === 'numeric') return { dataType: 'decimal', maxLength: '' }
|
||||||
if (dt === 'float' || dt === 'real') return { dataType: 'float', maxLength: '' }
|
if (dt === 'float' || dt === 'real') return { dataType: 'float', maxLength: '' }
|
||||||
if (dt === 'bit') return { dataType: 'bit', maxLength: '' }
|
if (dt === 'bit') return { dataType: 'bit', maxLength: '' }
|
||||||
|
if (dt === 'datetime') return { dataType: 'datetime', maxLength: '' }
|
||||||
if (dt.startsWith('datetime') || dt === 'smalldatetime' || dt === 'time') {
|
if (dt.startsWith('datetime') || dt === 'smalldatetime' || dt === 'time') {
|
||||||
return { dataType: 'datetime2', maxLength: '' }
|
return { dataType: 'datetime2', maxLength: '' }
|
||||||
}
|
}
|
||||||
|
|
@ -1224,6 +1268,18 @@ const SqlTableDesignerDialog = ({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const addWorkflowColumns = () => {
|
||||||
|
const existingNames = new Set(columns.map((c) => c.columnName.trim().toLowerCase()))
|
||||||
|
const toAdd = WORKFLOW_COLUMNS.filter((c) => !existingNames.has(c.columnName.toLowerCase()))
|
||||||
|
|
||||||
|
if (toAdd.length > 0) {
|
||||||
|
setColumns((prev) => {
|
||||||
|
const nonEmpty = prev.filter((c) => c.columnName.trim() !== '')
|
||||||
|
return [...nonEmpty, ...toAdd.map((c) => ({ ...c })), createEmptyColumn()]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const importColumnsFromRememberedCreateTable = async () => {
|
const importColumnsFromRememberedCreateTable = async () => {
|
||||||
let script = ''
|
let script = ''
|
||||||
|
|
||||||
|
|
@ -1591,7 +1647,10 @@ const SqlTableDesignerDialog = ({
|
||||||
} catch {
|
} catch {
|
||||||
// Non-blocking: seed file save failure does not affect deploy success
|
// Non-blocking: seed file save failure does not affect deploy success
|
||||||
}
|
}
|
||||||
onDeployed?.()
|
await onDeployed?.({
|
||||||
|
schemaName: initialTableData?.schemaName || 'dbo',
|
||||||
|
tableName: deployedTable,
|
||||||
|
})
|
||||||
handleClose()
|
handleClose()
|
||||||
} else {
|
} else {
|
||||||
toast.push(
|
toast.push(
|
||||||
|
|
@ -1690,6 +1749,9 @@ const SqlTableDesignerDialog = ({
|
||||||
<Button size="xs" variant="solid" color="green-600" onClick={addMultiTenantColumns}>
|
<Button size="xs" variant="solid" color="green-600" onClick={addMultiTenantColumns}>
|
||||||
{translate('::App.SqlQueryManager.AddMultiTenantColumns')}
|
{translate('::App.SqlQueryManager.AddMultiTenantColumns')}
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button size="xs" variant="solid" color="indigo-600" onClick={addWorkflowColumns}>
|
||||||
|
{translate('::App.SqlQueryManager.AddWorkflowColumns')}
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
size="xs"
|
size="xs"
|
||||||
variant="solid"
|
variant="solid"
|
||||||
|
|
@ -2678,7 +2740,7 @@ const SqlTableDesignerDialog = ({
|
||||||
// ── Render ─────────────────────────────────────────────────────────────────
|
// ── Render ─────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog isOpen={isOpen} onClose={handleClose} onRequestClose={handleClose} width={900}>
|
<Dialog isOpen={isOpen} onClose={handleClose} onRequestClose={handleClose} width={1100}>
|
||||||
<Dialog.Body className="flex flex-col gap-2">
|
<Dialog.Body className="flex flex-col gap-2">
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<div className="flex items-center gap-3 border-b pb-3 flex-shrink-0">
|
<div className="flex items-center gap-3 border-b pb-3 flex-shrink-0">
|
||||||
|
|
|
||||||
|
|
@ -244,7 +244,7 @@ const Grid = (props: GridProps) => {
|
||||||
const { listFormCode, searchParams, isSubForm, level, gridDto: extGridDto } = props
|
const { listFormCode, searchParams, isSubForm, level, gridDto: extGridDto } = props
|
||||||
const { translate } = useLocalization()
|
const { translate } = useLocalization()
|
||||||
const { smaller } = useResponsive()
|
const { smaller } = useResponsive()
|
||||||
const config = useStoreState((state) => state.abpConfig.config)
|
const currentUser = useStoreState((state) => state.auth.user)
|
||||||
|
|
||||||
const gridRef = useRef<DataGridRef>()
|
const gridRef = useRef<DataGridRef>()
|
||||||
const refListFormCode = useRef('')
|
const refListFormCode = useRef('')
|
||||||
|
|
@ -374,10 +374,10 @@ const Grid = (props: GridProps) => {
|
||||||
grd,
|
grd,
|
||||||
gridDto?.gridOptions.workflowDto,
|
gridDto?.gridOptions.workflowDto,
|
||||||
selectedRowsData ?? grd.getSelectedRowsData(),
|
selectedRowsData ?? grd.getSelectedRowsData(),
|
||||||
config?.currentUser,
|
currentUser,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
[config?.currentUser, gridDto],
|
[currentUser, gridDto],
|
||||||
)
|
)
|
||||||
|
|
||||||
const refreshData = useCallback(() => {
|
const refreshData = useCallback(() => {
|
||||||
|
|
@ -997,7 +997,7 @@ const Grid = (props: GridProps) => {
|
||||||
|
|
||||||
// Kolonları oluştur - dil değiştiğinde güncelle
|
// Kolonları oluştur - dil değiştiğinde güncelle
|
||||||
const memoizedColumns = useMemo(() => {
|
const memoizedColumns = useMemo(() => {
|
||||||
if (!gridDto || !config) return undefined
|
if (!gridDto) return undefined
|
||||||
|
|
||||||
const cols = getBandedColumns()
|
const cols = getBandedColumns()
|
||||||
|
|
||||||
|
|
@ -1038,7 +1038,7 @@ const Grid = (props: GridProps) => {
|
||||||
})
|
})
|
||||||
|
|
||||||
return cols
|
return cols
|
||||||
}, [gridDto, config])
|
}, [gridDto])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setColumnData(memoizedColumns)
|
setColumnData(memoizedColumns)
|
||||||
|
|
|
||||||
|
|
@ -232,6 +232,7 @@ const Tree = (props: TreeProps) => {
|
||||||
const { listFormCode, searchParams, isSubForm, level, gridDto: extGridDto } = props
|
const { listFormCode, searchParams, isSubForm, level, gridDto: extGridDto } = props
|
||||||
const { translate } = useLocalization()
|
const { translate } = useLocalization()
|
||||||
const { smaller } = useResponsive()
|
const { smaller } = useResponsive()
|
||||||
|
const currentUser = useStoreState((state) => state.auth.user)
|
||||||
|
|
||||||
const gridRef = useRef<TreeListRef>()
|
const gridRef = useRef<TreeListRef>()
|
||||||
const refListFormCode = useRef('')
|
const refListFormCode = useRef('')
|
||||||
|
|
@ -251,7 +252,6 @@ const Tree = (props: TreeProps) => {
|
||||||
const [widgetGroupHeight, setWidgetGroupHeight] = useState(0)
|
const [widgetGroupHeight, setWidgetGroupHeight] = useState(0)
|
||||||
|
|
||||||
const [expandedRowKeys, setExpandedRowKeys] = useState<any[]>([])
|
const [expandedRowKeys, setExpandedRowKeys] = useState<any[]>([])
|
||||||
const config = useStoreState((state) => state.abpConfig.config)
|
|
||||||
|
|
||||||
type EditorOptionsWithButtons = {
|
type EditorOptionsWithButtons = {
|
||||||
buttons?: any[]
|
buttons?: any[]
|
||||||
|
|
@ -409,10 +409,10 @@ const Tree = (props: TreeProps) => {
|
||||||
tree,
|
tree,
|
||||||
gridDto?.gridOptions.workflowDto,
|
gridDto?.gridOptions.workflowDto,
|
||||||
selectedRowsData ?? tree.getSelectedRowsData(),
|
selectedRowsData ?? tree.getSelectedRowsData(),
|
||||||
config?.currentUser,
|
currentUser,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
[config?.currentUser, gridDto],
|
[currentUser, gridDto],
|
||||||
)
|
)
|
||||||
|
|
||||||
const refreshData = useCallback(() => {
|
const refreshData = useCallback(() => {
|
||||||
|
|
@ -900,7 +900,7 @@ const Tree = (props: TreeProps) => {
|
||||||
}, [gridDto])
|
}, [gridDto])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!gridDto || !config) return
|
if (!gridDto) return
|
||||||
|
|
||||||
const cols = getBandedColumns()
|
const cols = getBandedColumns()
|
||||||
setColumnData(cols)
|
setColumnData(cols)
|
||||||
|
|
@ -913,7 +913,7 @@ const Tree = (props: TreeProps) => {
|
||||||
cols,
|
cols,
|
||||||
)
|
)
|
||||||
setTreeListDataSource(dataSource)
|
setTreeListDataSource(dataSource)
|
||||||
}, [gridDto, searchParams, config])
|
}, [gridDto, searchParams])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const activeFilters = extraFilters.filter((f) => f.value)
|
const activeFilters = extraFilters.filter((f) => f.value)
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ const useToolbar = ({
|
||||||
const { translate } = useLocalization()
|
const { translate } = useLocalization()
|
||||||
const { checkPermission } = usePermission()
|
const { checkPermission } = usePermission()
|
||||||
const isPwaMode = usePWA()
|
const isPwaMode = usePWA()
|
||||||
const config = useStoreState((state) => state.abpConfig.config)
|
const currentUser = useStoreState((state) => state.auth.user)
|
||||||
|
|
||||||
const [toolbarData, setToolbarData] = useState<ToolbarItem[]>([])
|
const [toolbarData, setToolbarData] = useState<ToolbarItem[]>([])
|
||||||
const [toolbarModalData, setToolbarModalData] = useState<ToolbarModalData>()
|
const [toolbarModalData, setToolbarModalData] = useState<ToolbarModalData>()
|
||||||
|
|
@ -204,7 +204,7 @@ const useToolbar = ({
|
||||||
row,
|
row,
|
||||||
workflowOptions,
|
workflowOptions,
|
||||||
criteria.title,
|
criteria.title,
|
||||||
getCurrentUserWorkflowIdentities(config?.currentUser),
|
getCurrentUserWorkflowIdentities(currentUser),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -483,10 +483,9 @@ const useToolbar = ({
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!gridDto && !listFormCode) return
|
if (!gridDto && !listFormCode) return
|
||||||
if (!config) return
|
|
||||||
|
|
||||||
getToolbarData()
|
getToolbarData()
|
||||||
}, [gridDto, listFormCode, config])
|
}, [gridDto, listFormCode, currentUser])
|
||||||
|
|
||||||
return {
|
return {
|
||||||
toolbarData,
|
toolbarData,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue