Fix Container and form on import adding header and footer by default

This commit is contained in:
Nakul Nagargade 2025-07-01 12:32:07 +05:30
parent 73f2b09666
commit 8564bc1cfc

View file

@ -72,7 +72,11 @@ type NewRevampedComponent =
| 'VerticalDivider' | 'VerticalDivider'
| 'Link' | 'Link'
| 'DaterangePicker' | 'DaterangePicker'
| 'TextArea'; | 'TextArea'
| 'Container'
| 'Tabs'
| 'Form'
const DefaultDataSourceNames: DefaultDataSourceName[] = [ const DefaultDataSourceNames: DefaultDataSourceName[] = [
'restapidefault', 'restapidefault',
@ -94,6 +98,10 @@ const NewRevampedComponents: NewRevampedComponent[] = [
'Link', 'Link',
'DaterangePicker', 'DaterangePicker',
'TextArea', 'TextArea',
'Container',
'Tabs',
'Form'
]; ];
@Injectable() @Injectable()
@ -104,7 +112,7 @@ export class AppImportExportService {
protected appEnvironmentUtilService: AppEnvironmentUtilService, protected appEnvironmentUtilService: AppEnvironmentUtilService,
protected usersUtilService: UsersUtilService, protected usersUtilService: UsersUtilService,
protected componentsService: ComponentsService protected componentsService: ComponentsService
) {} ) { }
async export(user: User, id: string, searchParams: any = {}): Promise<{ appV2: App }> { async export(user: User, id: string, searchParams: any = {}): Promise<{ appV2: App }> {
// https://github.com/typeorm/typeorm/issues/3857 // https://github.com/typeorm/typeorm/issues/3857
@ -2156,6 +2164,15 @@ function migrateProperties(
delete properties.maxValue; delete properties.maxValue;
} }
} }
if (componentType === 'Container') {
properties.showHeader = properties?.showHeader || false;
}
if (componentType === 'Form') {
properties.showHeader = properties?.showHeader || false;
properties.showFooter = properties?.showFooter || false;
}
} }
return { properties, styles, general, generalStyles, validation }; return { properties, styles, general, generalStyles, validation };
} }