Skip to content

Commit 8dc2af3

Browse files
committed
[Fix]: #2021 import nav app data issue
1 parent bd23748 commit 8dc2af3

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

client/packages/lowcoder/src/comps/comps/navComp/navComp.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,29 @@ function fixOldStyleData(oldData: any) {
136136
return oldData;
137137
}
138138

139+
function fixOldItemsData(oldData: any) {
140+
if (Array.isArray(oldData)) {
141+
return {
142+
optionType: "manual",
143+
manual: oldData,
144+
};
145+
}
146+
if (oldData && !oldData.optionType && Array.isArray(oldData.manual)) {
147+
return {
148+
optionType: "manual",
149+
manual: oldData.manual,
150+
};
151+
}
152+
return oldData;
153+
}
154+
139155
const childrenMap = {
140156
logoUrl: StringControl,
141157
logoEvent: withDefault(eventHandlerControl(logoEventHandlers), [{ name: "click" }]),
142158
horizontalAlignment: alignWithJustifyControl(),
143159
style: migrateOldData(styleControl(NavigationStyle, 'style'), fixOldStyleData),
144160
animationStyle: styleControl(AnimationStyle, 'animationStyle'),
145-
items: withDefault(createNavItemsControl(), {
161+
items: withDefault(migrateOldData(createNavItemsControl(), fixOldItemsData), {
146162
optionType: "manual",
147163
manual: [
148164
{
@@ -320,7 +336,6 @@ function createNavItemsControl() {
320336
{ label: trans("prop.map"), value: "map" },
321337
] as const;
322338

323-
// Variant used in Map mode
324339
const NavMapOption = new MultiCompBuilder(
325340
{
326341
label: StringControl,

client/packages/lowcoder/src/i18n/locales/en.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ export const en = {
2626
"text": "Text",
2727
"basic": "Basic",
2828
"label": "Label",
29+
"hidden": "Hidden",
30+
"disabled": "Disabled",
2931
"layout": "Layout",
3032
"color": "Color",
3133
"form": "Form",

0 commit comments

Comments
 (0)