Skip to content

Commit 965bc59

Browse files
committed
Updated remaining ant design deprecations and removed some unused code
1 parent 9d446f8 commit 965bc59

40 files changed

+81
-130
lines changed

src/management-system-v2/app/(dashboard)/[environmentId]/(automation)/executions/[processId]/use-colors.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { RefObject, useCallback, useEffect, useRef, useState } from 'react';
1+
import { RefObject, useCallback, useEffect, useRef } from 'react';
22

33
import { ColorOptions, flowElementsStyling } from './instance-coloring';
44
import { InstanceInfo } from '@/lib/engines/deployment';

src/management-system-v2/app/(dashboard)/[environmentId]/(automation)/executions/[processId]/use-instance-variables.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import { useEffect, useMemo, useState } from 'react';
22
import { getProcessIds, getVariablesFromElementById } from '@proceed/bpmn-helper';
33
import { DeployedProcessInfo, InstanceInfo, VersionInfo } from '@/lib/engines/deployment';
4-
import {
5-
ProcessVariable,
6-
ProcessVariableSchema,
7-
textFormatMap,
8-
} from '@/lib/process-variable-schema';
4+
import { ProcessVariable, ProcessVariableSchema } from '@/lib/process-variable-schema';
95

106
export type Variable = {
117
name: string;

src/management-system-v2/app/(dashboard)/[environmentId]/(automation)/executions/page.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import { getUsersFavourites } from '@/lib/data/users';
66
import { getDeployedProcessesFromSavedEngines } from '@/lib/engines/saved-engines-helpers';
77
import { DeployedProcessInfo } from '@/lib/engines/deployment';
88
import { isUserErrorResponse } from '@/lib/user-error';
9-
import { Skeleton } from 'antd';
10-
import { Suspense } from 'react';
119
import { getDbEngines } from '@/lib/data/db/engines';
1210

1311
function getDeploymentNames<T extends { versions: DeployedProcessInfo['versions'] }>(

src/management-system-v2/app/(dashboard)/[environmentId]/iam/roles/role-page.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
'use client';
22

33
import { useState } from 'react';
4-
import {
5-
DeleteOutlined,
6-
InfoCircleOutlined,
7-
// UnorderedListOutlined,
8-
// AppstoreOutlined,
9-
PlusOutlined,
10-
} from '@ant-design/icons';
4+
import { DeleteOutlined, InfoCircleOutlined, PlusOutlined } from '@ant-design/icons';
115
import { Space, Button, Breakpoint, Grid, FloatButton, Tooltip, App, TableProps } from 'antd';
126
import { CloseOutlined } from '@ant-design/icons';
137
import HeaderActions from './header-actions';

src/management-system-v2/app/(dashboard)/[environmentId]/machine-config/[configId]/aas-config-content.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ const AasContent: React.FC<MachineDataViewProps> = ({
224224
`}</style>
225225

226226
<Space
227-
direction="vertical"
227+
orientation="vertical"
228228
style={{
229229
display: 'flex',
230230
width: '100%',

src/management-system-v2/app/(dashboard)/[environmentId]/machine-config/[configId]/aas-config-editor.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ import { useCollapseItems } from './aas-config-editor-collapse';
9797
import LanguageDropdown from './language-dropdown';
9898
import { Localization } from '@/lib/data/locale';
9999
import PreviewFeatureModal from '../preview-feature-modal';
100+
import { Without } from '@dnd-kit/utilities';
100101
const { Text } = Typography;
101102

102103
type MachineDataViewProps = {
@@ -218,8 +219,10 @@ const AasConfigEditor: React.FC<MachineDataViewProps> = ({
218219

219220
// TODO use FuzzySearch
220221
// currently only ignores capitalization
221-
const filterOption: SelectProps['filterOption'] = (input, option) =>
222-
((option?.label as string) ?? '').toLowerCase().includes(input.toLowerCase());
222+
const filterOption: Exclude<SelectProps['showSearch'], undefined | boolean>['filterOption'] = (
223+
input,
224+
option,
225+
) => ((option?.label as string) ?? '').toLowerCase().includes(input.toLowerCase());
223226

224227
const setUserPreferences = useUserPreferences.use.addPreferences();
225228
const openTreeItemsInConfigs = useUserPreferences.use['tech-data-open-tree-items']();
@@ -1422,9 +1425,8 @@ const AasConfigEditor: React.FC<MachineDataViewProps> = ({
14221425
<Select
14231426
popupMatchSelectWidth={false}
14241427
placeholder="Select Version"
1425-
showSearch
1428+
showSearch={{ filterOption }}
14261429
loading={loadingVersions}
1427-
filterOption={filterOption}
14281430
style={{ minWidth: '150px' }}
14291431
value={selectedVersionId || 'latest'}
14301432
onChange={handleVersionSelect}
@@ -1580,7 +1582,7 @@ const AasConfigEditor: React.FC<MachineDataViewProps> = ({
15801582
}
15811583
}}
15821584
trigger={['click']}
1583-
dropdownRender={() => (
1585+
popupRender={() => (
15841586
<div
15851587
style={{
15861588
background: '#fff',

src/management-system-v2/app/(dashboard)/[environmentId]/machine-config/[configId]/aas-create-parameter-modal.tsx

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -556,14 +556,14 @@ const ParameterInputs = ({
556556
>
557557
<Select
558558
size="small"
559-
showSearch
559+
showSearch={{
560+
filterSort: (optionA, optionB) =>
561+
(optionA?.label ?? '')
562+
.toLowerCase()
563+
.localeCompare((optionB?.label ?? '').toLowerCase()),
564+
optionFilterProp: 'label',
565+
}}
560566
placeholder="Search to Select"
561-
optionFilterProp="label"
562-
filterSort={(optionA, optionB) =>
563-
(optionA?.label ?? '')
564-
.toLowerCase()
565-
.localeCompare((optionB?.label ?? '').toLowerCase())
566-
}
567567
options={languageItemsSelect}
568568
value={currentDisplayLanguage}
569569
onChange={handleDisplayLanguageChange}
@@ -613,14 +613,14 @@ const ParameterInputs = ({
613613
>
614614
<Select
615615
size="small"
616-
showSearch
617616
placeholder="Search to Select"
618-
optionFilterProp="label"
619-
filterSort={(optionA, optionB) =>
620-
(optionA?.label ?? '')
621-
.toLowerCase()
622-
.localeCompare((optionB?.label ?? '').toLowerCase())
623-
}
617+
showSearch={{
618+
filterSort: (optionA, optionB) =>
619+
(optionA?.label ?? '')
620+
.toLowerCase()
621+
.localeCompare((optionB?.label ?? '').toLowerCase()),
622+
optionFilterProp: 'label',
623+
}}
624624
options={languageItemsSelect}
625625
value={currentDescriptionLanguage}
626626
onChange={handleDescriptionLanguageChange}
@@ -771,14 +771,11 @@ const ParameterInputs = ({
771771
}
772772
treeDefaultExpandAll={true}
773773
treeExpandAction="click"
774-
showSearch={true}
775-
treeNodeFilterProp="title"
776-
dropdownStyle={{ maxHeight: 600, overflow: 'auto' }}
774+
showSearch={{ treeNodeFilterProp: 'title' }}
775+
styles={{ popup: { root: { maxHeight: 600, overflow: 'auto' } } }}
777776
virtual={false}
778777
onChange={handleLinkedParametersChange}
779-
onDropdownVisibleChange={(open) => {
780-
setIsTreeSelectOpen(open);
781-
}}
778+
onOpenChange={(open) => setIsTreeSelectOpen(open)}
782779
onKeyDown={(e) => {
783780
if (e.key === 'Escape' && isTreeSelectOpen) {
784781
e.stopPropagation();

src/management-system-v2/app/(dashboard)/[environmentId]/machine-config/[configId]/aas-parameter-links.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,11 @@ const AasParamLinks: React.FC<CustomFieldProps> = ({
163163
return (
164164
<>
165165
<>
166-
<Divider style={{ margin: '0px 0px 10px 0px', fontSize: '0.8rem' }} orientation="left">
166+
<Divider
167+
style={{ margin: '0px 0px 10px 0px', fontSize: '0.8rem' }}
168+
orientation="horizontal"
169+
titlePlacement="left"
170+
>
167171
Linked Parameters
168172
</Divider>
169173
{editable && (

src/management-system-v2/app/(dashboard)/[environmentId]/machine-config/[configId]/aas-parameter-nests.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,11 @@ const AasParamNests: React.FC<MachineDataViewProps> = ({
184184

185185
return (
186186
<>
187-
<Divider style={{ margin: '10px 0px', fontSize: '0.8rem' }} orientation="left">
187+
<Divider
188+
style={{ margin: '10px 0px', fontSize: '0.8rem' }}
189+
orientation="horizontal"
190+
titlePlacement="left"
191+
>
188192
Nested Parameters
189193
</Divider>
190194
<Table<Parameter>

src/management-system-v2/app/(dashboard)/[environmentId]/machine-config/[configId]/language-dropdown.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ type LanguageDropdownProps = {
1111
const LanguageDropdown = ({ currentLanguage, onLanguageChange }: LanguageDropdownProps) => {
1212
return (
1313
<Select
14-
showSearch
14+
showSearch={{
15+
optionFilterProp: 'label',
16+
filterOption: (input, option) =>
17+
(option?.label ?? '').toLowerCase().includes(input.toLowerCase()),
18+
}}
1519
value={currentLanguage}
1620
onChange={onLanguageChange}
1721
options={languageItemsSelect}
1822
style={{ width: 195 }}
1923
placeholder="Select Language"
20-
optionFilterProp="label"
21-
filterOption={(input, option) =>
22-
(option?.label ?? '').toLowerCase().includes(input.toLowerCase())
23-
}
2424
labelRender={(props) => (
2525
<Space size={8} style={{ maxWidth: '150px', overflow: 'hidden' }}>
2626
<GlobalOutlined style={{ color: 'black' }} />

0 commit comments

Comments
 (0)