2025-02-25 06:52:50 +00:00
|
|
|
import { Component } from '@entities/component.entity';
|
|
|
|
|
import { processDataInBatches } from '@helpers/migration.helper';
|
Release: Appbuilder 1.7 (#9875)
* Remove date-fns depedency from table datepicker
* Revert Remove date-fns depedency from table datepicker
* Fix Built with Tooljet" watermark and app mode switcher appear briefly before the correct login page loads. (#9545)
* fix: headers and action button UI on table (#9626)
* fix: delete all children and nested children on component delete (#9182)
* fix: delete all children and nested children on component delete
* refactor: removed duplicate logics
* refactor: reuse functions and remove duplicate functions
* fix: update parentid of kanban modal child on version creation
* fix: add kanban modal children to delete list
* Fix duplicate text appearing at the bottom from the previous page in PDF widget (#9567)
* chore: fixed vulnerability issues on FE (#9561)
Co-authored-by: Johnson Cherian <johnsonc.dev@gmail.com>
* chore: Removed unused packages in FE (#9161)
* Removed unused packages
* Remove date-fns dependency drom table date picker (#9585)
---------
Co-authored-by: Johnson Cherian <johnsonc.dev@gmail.com>
Co-authored-by: Nakul Nagargade <133095394+nakulnagargade@users.noreply.github.com>
* Fix Pagination and order of rows malfunction if default selected Id is not on page 1 (#9651)
* Fix Pagination and order of rows malfunction if default selected Id is not on page 1
* remove console logs
* Add support to add Manual date entry in Datepicker table column (#9631)
* Removed unused packages
* Add Manual date entry in Datepicker table column
* Remove date-fns dependency drom table date picker (#9585)
* fix date input issue
* Remove consoles
---------
Co-authored-by: Kavin Venkatachalam <kavin.saratha@gmail.com>
Co-authored-by: Johnson Cherian <johnsonc.dev@gmail.com>
* Feature: pages sidebar collapsable and pin functionality in preview/release mode (#9650)
* add: pin and collapsable functionality to pages sidebar
* fix: review changes
* fix: canvas auto update width on sidebar toggle
* fix icon size
* Add support to wrap table's column header (#9565)
* Add support to wrap table's column header
* Resolve code comments
* commit
* fix: resize page width on window resize (#9164)
* feat: Button component revamp (#8361)
* init textinput revamp
* updated styles panel
* bugfix
* updates
* fix :: accordion
* fix :: styling
* add box shadow , additional property,tooltip
* fix conditional render for styles
* feat :: fixed order of each property and styles
* feat :: styling input
* bugfix
* feat :: add option to add icon
* add option to add icon
* adding option to toggle visibility
* updated password input with new design
* chnaging component location
* bugfix
* style fixes
* fix :: added loader
* updated :: few detailing
* few bugfixes
* fix :: for form widget label
* fixes
* added option to add icon color
* including label field for password input
* fix for label
* fix
* test fix backward compatibility for height
* updates
* revert
* adding key for distinguishing older and newer widgets
* testing
* test
* test
* update
* update
* migration testing
* limit vertical resizing in textinput
* testing
* throw test
* test
* adding check for label length
* fixing edge cases
* removing resize
* backward compatibility height
* backward compatibility
* number input review fixes
* added exposed items
* fixing csa
* ui fixes
* fix height compatibility
* feat :: csa for all inputs and exposed variables
* backward compatibility fixes and validation fixes
* fixes :: textinput positioning of loader and icon
* fix :: password input
* cleanup and fixes
* fixes
* cleanup
* fixes
* review fixes
* review fixes
* button component revamped
* fix :: csa
* typo fix
* typo
* fix :: styling
* exposed variables
* fix padding
* review fixes styles component panel
* fix naming
* fix padding
* default size
* fix :: icons position
* updates
* cleanup
* updates events , csa
* cleanup
* remove border
* backward compatibility
* clean
* feat :: change validation from properties
* ui fixes
* icon name
* disabled state
* removed 'px' text from tooltip
* fixes placeholder
* few updates :: removing label in form
* ui in form
* update :: number input validation behaviour
* testing fixes
* added side handlers
* removing unwanted fx
* disabling fx for padding field
* ordering change
* fix
* label issue + restricted side handler
* fix :: box shadow bug
* on change event doesnt propagate exposed vars correctly
* adding debounce for slider value change
* fix :: for modal ooen bug during onfocus event
* test slider
* fix :: bugs regarding state update in checbox , slider , slider bug
* update slider with radix slider
* bugfix
* merge fixes
* fix
* updates
* removing unwanted migrations
* fix: box shadow
* fix : import export issues
* fix : colouring
* cleanup
* fixes
* fix : design review comments
* add border color
* fix : review changes
* fix
* change display name to solid
* fix label
* fix : loader issue
* fix : button icon position
* fix : qa bugs
* feat: Checkbox + Toggle revamp (#8519)
* init textinput revamp
* updated styles panel
* bugfix
* updates
* fix :: accordion
* fix :: styling
* add box shadow , additional property,tooltip
* fix conditional render for styles
* feat :: fixed order of each property and styles
* feat :: styling input
* bugfix
* feat :: add option to add icon
* add option to add icon
* adding option to toggle visibility
* updated password input with new design
* chnaging component location
* bugfix
* style fixes
* fix :: added loader
* updated :: few detailing
* few bugfixes
* fix :: for form widget label
* fixes
* added option to add icon color
* including label field for password input
* fix for label
* fix
* test fix backward compatibility for height
* updates
* revert
* adding key for distinguishing older and newer widgets
* testing
* test
* test
* update
* update
* migration testing
* limit vertical resizing in textinput
* testing
* throw test
* test
* adding check for label length
* fixing edge cases
* removing resize
* backward compatibility height
* backward compatibility
* number input review fixes
* added exposed items
* fixing csa
* ui fixes
* fix height compatibility
* feat :: csa for all inputs and exposed variables
* backward compatibility fixes and validation fixes
* fixes :: textinput positioning of loader and icon
* fix :: password input
* cleanup and fixes
* fixes
* cleanup
* fixes
* review fixes
* review fixes
* typo fix
* fix padding
* review fixes styles component panel
* fix naming
* fix padding
* feat :: toggle switch revamp
* init checkbox
* fixes
* fixes
* switch fixes
* validation fix
* fixes
* cleanup
* height fix
* fix height toggle
* updates
* fix :: icons position
* updates
* cleanup
* updates events , csa
* cleanup
* backward compatibility
* clean
* backward compatibility fix
* label fixed to one line
* feat :: change validation from properties
* ui fixes
* icon name
* removed 'px' text from tooltip
* added onchange event for checkbox
* fixes placeholder
* few updates :: removing label in form
* ui in form
* fire onchange
* update :: number input validation behaviour
* testing fixes
* added side handlers
* removing unwanted fx
* disabling fx for padding field
* ordering change
* fix
* label issue + restricted side handler
* fix :: box shadow bug
* fix
* on change event doesnt propagate exposed vars correctly
* adding debounce for slider value change
* fix :: for modal ooen bug during onfocus event
* test slider
* fix :: bugs regarding state update in checbox , slider , slider bug
* update slider with radix slider
* bugfix
* update tooltip
* fix toggle switch
* fixes : inspector
* fix : checkbox label
* feat : checkbox completed
* update checkbox review changes
* feat : toggle component
* feat : added new toggle component
* fix : colors
* updated review changes
* update name for old and new version
* update
* case change
* update
* update icon
* removed padding from checkbox and toggle
* fix naming
* product review and bugfixes : changes
* fix : checkbox setvalue action
* Update setvalue action in toggle
* fixed: section for legacy and new components
* fix : checkbox tick mark not showing on resizing
* fix : icon in inspector
* fix : box shadow
* fix : ismandatory definition
* configs update
---------
Co-authored-by: Johnson Cherian <johnsonc.dev@gmail.com>
* fix : toggle switch import and switch component issues (#9874)
* fix : filter order of toggle (#9879)
* fix: appbuilder 1.7 integration testing bug fixes (#9880)
* fix: add only ids in deleted components map for component delete functionality
* Fix TableRowHeightInput in codehinter (#9881)
* fix: disable drag on calender popup and unblock other input interactions
* Bugfixes componentes 1.7 (#9892)
* fix : filter order of toggle (#9879)
* fix : Button alignment when label is empty
* fix : box shadow added
* fix : direction and default box shadow
* fix : disable csa not working for checkbox
* fix : button padding
* added toggle for box shadow check
* fixes : integration 1.7 (#9901)
* fix : exposed vars not getting exposed on page change
* fix : validation error font
* fix : dynamic color for button
* fix : loading placement during CSA
* Move disabled, visibility, tooltip and box shadow to properties in Checkbox and Button (#9665)
* init textinput revamp
* updated styles panel
* bugfix
* updates
* fix :: accordion
* fix :: styling
* add box shadow , additional property,tooltip
* fix conditional render for styles
* feat :: fixed order of each property and styles
* feat :: styling input
* bugfix
* feat :: add option to add icon
* add option to add icon
* adding option to toggle visibility
* updated password input with new design
* chnaging component location
* bugfix
* style fixes
* fix :: added loader
* updated :: few detailing
* few bugfixes
* fix :: for form widget label
* fixes
* added option to add icon color
* including label field for password input
* fix for label
* fix
* test fix backward compatibility for height
* updates
* revert
* adding key for distinguishing older and newer widgets
* testing
* test
* test
* update
* update
* migration testing
* limit vertical resizing in textinput
* testing
* throw test
* test
* adding check for label length
* fixing edge cases
* removing resize
* backward compatibility height
* backward compatibility
* number input review fixes
* added exposed items
* fixing csa
* ui fixes
* fix height compatibility
* feat :: csa for all inputs and exposed variables
* backward compatibility fixes and validation fixes
* fixes :: textinput positioning of loader and icon
* fix :: password input
* cleanup and fixes
* fixes
* cleanup
* fixes
* review fixes
* review fixes
* typo fix
* fix padding
* review fixes styles component panel
* fix naming
* fix padding
* feat :: toggle switch revamp
* init checkbox
* fixes
* fixes
* switch fixes
* validation fix
* fixes
* cleanup
* height fix
* fix height toggle
* updates
* fix :: icons position
* updates
* cleanup
* updates events , csa
* cleanup
* backward compatibility
* clean
* backward compatibility fix
* label fixed to one line
* feat :: change validation from properties
* ui fixes
* icon name
* removed 'px' text from tooltip
* added onchange event for checkbox
* fixes placeholder
* few updates :: removing label in form
* ui in form
* fire onchange
* update :: number input validation behaviour
* testing fixes
* added side handlers
* removing unwanted fx
* disabling fx for padding field
* ordering change
* fix
* label issue + restricted side handler
* fix :: box shadow bug
* fix
* on change event doesnt propagate exposed vars correctly
* adding debounce for slider value change
* fix :: for modal ooen bug during onfocus event
* test slider
* fix :: bugs regarding state update in checbox , slider , slider bug
* update slider with radix slider
* bugfix
* update tooltip
* fix toggle switch
* fixes : inspector
* fix : checkbox label
* Move disabled, visibility, tooltip and box shadow to properties
* Remove toggleswitch and button
* Add down rollbackUpdates
* fix : filter order of toggle (#9879)
* fix merge issue
* fix
---------
Co-authored-by: stepinfwd <stepinfwd@gmail.com>
* fix: use onMouseOver and onMouseLeave together to fix hover event
* fix : Validation message to be shown only when use toggles on and off , code refactor (#9905)
* Fix naming logic for copying (#9909)
---------
Co-authored-by: Nakul Nagargade <133095394+nakulnagargade@users.noreply.github.com>
Co-authored-by: Kiran Ashok <stepinfwd@gmail.com>
* fix: update animateTransform for cross browser compatibility (#9917)
* fix: color transitions on sidebar pages in dark mode (#9920)
* Fix table all column editable (#9921)
* fix: add only ids in deleted components map for component delete functionality
* Fix TableRowHeightInput in codehinter (#9881)
* fix: disable drag on calender popup and unblock other input interactions
* Fix allColumns editable in Table
* Fix clientServer nor working in Table
* In widget config, update the total records as 10
---------
Co-authored-by: Johnson Cherian <johnsonc.dev@gmail.com>
* chore: bump minor version
---------
Co-authored-by: Nakul Nagargade <nakul@tooljet.com>
Co-authored-by: Nakul Nagargade <133095394+nakulnagargade@users.noreply.github.com>
Co-authored-by: vjaris42 <vjy239@gmail.com>
Co-authored-by: Kavin Venkatachalam <50441969+kavinvenkatachalam@users.noreply.github.com>
Co-authored-by: Kavin Venkatachalam <kavin.saratha@gmail.com>
Co-authored-by: Kiran Ashok <stepinfwd@gmail.com>
2024-05-30 12:42:10 +00:00
|
|
|
import { EntityManager, MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
|
|
|
|
|
|
const componentTypes = ['Checkbox', 'Button'];
|
|
|
|
|
const batchSize = 100;
|
|
|
|
|
|
|
|
|
|
export class MoveCheckboxButtonDisabledToProperties1715248128046 implements MigrationInterface {
|
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
|
|
|
const entityManager = queryRunner.manager;
|
|
|
|
|
for (const componentType of componentTypes) {
|
|
|
|
|
await processDataInBatches(
|
|
|
|
|
entityManager,
|
|
|
|
|
async (entityManager: EntityManager) => {
|
|
|
|
|
return await entityManager.find(Component, {
|
|
|
|
|
where: { type: componentType },
|
|
|
|
|
order: { createdAt: 'ASC' },
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
async (entityManager: EntityManager, components: Component[]) => {
|
|
|
|
|
await this.processUpdates(entityManager, components);
|
|
|
|
|
},
|
|
|
|
|
batchSize
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private async processUpdates(entityManager, components) {
|
|
|
|
|
for (const component of components) {
|
|
|
|
|
const properties = component.properties;
|
|
|
|
|
const styles = component.styles;
|
|
|
|
|
const general = component.general;
|
|
|
|
|
const generalStyles = component.generalStyles;
|
|
|
|
|
|
|
|
|
|
if (styles.visibility) {
|
|
|
|
|
properties.visibility = styles.visibility;
|
|
|
|
|
delete styles.visibility;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (styles.disabledState) {
|
|
|
|
|
properties.disabledState = styles.disabledState;
|
|
|
|
|
delete styles.disabledState;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (general?.tooltip) {
|
|
|
|
|
properties.tooltip = general?.tooltip;
|
|
|
|
|
delete general?.tooltip;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (generalStyles?.boxShadow) {
|
|
|
|
|
styles.boxShadow = generalStyles?.boxShadow;
|
|
|
|
|
delete generalStyles?.boxShadow;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await entityManager.update(Component, component.id, {
|
|
|
|
|
properties,
|
|
|
|
|
styles,
|
|
|
|
|
general,
|
|
|
|
|
generalStyles,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private async rollbackUpdates(entityManager, components) {
|
|
|
|
|
for (const component of components) {
|
|
|
|
|
const properties = component.properties;
|
|
|
|
|
const styles = component.styles;
|
|
|
|
|
const general = component.general;
|
|
|
|
|
const generalStyles = component.generalStyles;
|
|
|
|
|
|
|
|
|
|
if (properties.visibility !== undefined) {
|
|
|
|
|
styles.visibility = properties.visibility;
|
|
|
|
|
delete properties.visibility;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (properties.disabledState !== undefined) {
|
|
|
|
|
styles.disabledState = properties.disabledState;
|
|
|
|
|
delete properties.disabledState;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (properties.tooltip !== undefined) {
|
|
|
|
|
general.tooltip = properties.tooltip;
|
|
|
|
|
delete properties.tooltip;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (styles.boxShadow !== undefined) {
|
|
|
|
|
generalStyles.boxShadow = styles.boxShadow;
|
|
|
|
|
delete styles.boxShadow;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await entityManager.update(Component, component.id, {
|
|
|
|
|
properties,
|
|
|
|
|
styles,
|
|
|
|
|
general,
|
|
|
|
|
generalStyles,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
|
|
|
const entityManager = queryRunner.manager;
|
|
|
|
|
for (const componentType of componentTypes) {
|
|
|
|
|
await processDataInBatches(
|
|
|
|
|
entityManager,
|
|
|
|
|
async (entityManager: EntityManager) => {
|
|
|
|
|
return await entityManager.find(Component, {
|
|
|
|
|
where: { type: componentType },
|
|
|
|
|
order: { createdAt: 'ASC' },
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
async (entityManager: EntityManager, components: Component[]) => {
|
|
|
|
|
await this.rollbackUpdates(entityManager, components);
|
|
|
|
|
},
|
|
|
|
|
batchSize
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|