Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move disabled, visibility, tooltip and box shadow to properties in Checkbox and Button #9665

Merged
merged 143 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
1d70fba
init textinput revamp
stepinfwd Oct 25, 2023
7c868c1
updated styles panel
stepinfwd Oct 27, 2023
20cd024
bugfix
stepinfwd Oct 27, 2023
9d201c8
updates
stepinfwd Oct 29, 2023
ce1678f
fix :: accordion
stepinfwd Oct 29, 2023
91d404c
fix :: styling
stepinfwd Oct 29, 2023
9b84a40
add box shadow , additional property,tooltip
stepinfwd Oct 30, 2023
caa6118
fix conditional render for styles
stepinfwd Oct 30, 2023
bca15b1
Merge branch 'feature/text-input' of https://github.com/ToolJet/ToolJ…
stepinfwd Oct 31, 2023
b244413
feat :: fixed order of each property and styles
stepinfwd Oct 31, 2023
7f7aa1c
feat :: styling input
stepinfwd Oct 31, 2023
25f6639
bugfix
stepinfwd Oct 31, 2023
2bd51a5
feat :: add option to add icon
stepinfwd Nov 3, 2023
d23fcc0
add option to add icon
stepinfwd Nov 3, 2023
71c4c97
adding option to toggle visibility
stepinfwd Nov 7, 2023
395b852
updated password input with new design
stepinfwd Nov 8, 2023
c9ae42c
chnaging component location
stepinfwd Nov 8, 2023
2ff0e69
Merge branch 'appbuilder-1.4' into feature/text-input
stepinfwd Nov 8, 2023
419825c
Merge branch 'feature/text-input' into feature/password-input-updated
stepinfwd Nov 8, 2023
a98262a
bugfix
stepinfwd Nov 9, 2023
1a0c0a1
style fixes
stepinfwd Nov 9, 2023
6d1fc58
Merge branch 'feature/text-input' into feature/password-input-updated
stepinfwd Nov 9, 2023
40b0fa6
fix :: added loader
stepinfwd Nov 9, 2023
0602fe1
updated :: few detailing
stepinfwd Nov 15, 2023
9768957
few bugfixes
stepinfwd Nov 15, 2023
9109d5a
fix :: for form widget label
stepinfwd Nov 15, 2023
6857d1b
fixes
stepinfwd Nov 26, 2023
d6e0f29
added option to add icon color
stepinfwd Nov 27, 2023
3c50909
including label field for password input
stepinfwd Nov 28, 2023
c0eac10
Merge branch 'feature/text-input' into feature/password-input-updated
stepinfwd Nov 28, 2023
017540e
fix for label
stepinfwd Nov 28, 2023
2cdb359
fix
stepinfwd Nov 28, 2023
78ec9b3
test fix backward compatibility for height
stepinfwd Nov 28, 2023
0c1ed22
updates
stepinfwd Nov 29, 2023
e0c2b9c
revert
stepinfwd Nov 29, 2023
79482c3
adding key for distinguishing older and newer widgets
stepinfwd Nov 29, 2023
cc19d89
testing
stepinfwd Nov 29, 2023
4f3e47d
test
stepinfwd Nov 29, 2023
3611e30
test
stepinfwd Nov 29, 2023
202068a
Merge branch 'appbuilder-1.4' into feature/text-input
stepinfwd Nov 30, 2023
0a338e8
update
stepinfwd Nov 30, 2023
84d59b5
update
stepinfwd Nov 30, 2023
d0626ab
migration testing
stepinfwd Nov 30, 2023
a956910
limit vertical resizing in textinput
stepinfwd Nov 30, 2023
efb629f
testing
stepinfwd Nov 30, 2023
a4fe256
throw test
stepinfwd Nov 30, 2023
ee17bcf
test
stepinfwd Nov 30, 2023
cbd4156
adding check for label length
stepinfwd Nov 30, 2023
a95083c
fixing edge cases
stepinfwd Dec 3, 2023
955c21c
Merge branch 'feature/text-input' into feature/password-input-updated
stepinfwd Dec 3, 2023
4efab1b
removing resize
stepinfwd Dec 3, 2023
1b0b49e
backward compatibility height
stepinfwd Dec 4, 2023
44c4155
backward compatibility
stepinfwd Dec 4, 2023
98d2350
number input review fixes
stepinfwd Dec 8, 2023
245f1f1
added exposed items
stepinfwd Dec 8, 2023
b59eea3
fixing csa
stepinfwd Dec 10, 2023
5b3b553
ui fixes
stepinfwd Dec 12, 2023
1c85650
Merge branch 'feature/number-input-1.4' into feature/text-input
stepinfwd Dec 12, 2023
2527b80
fix height compatibility
stepinfwd Dec 12, 2023
e3f28ce
Merge branch 'feature/password-input-updated' into feature/text-input
stepinfwd Dec 12, 2023
00e43a7
feat :: csa for all inputs and exposed variables
stepinfwd Dec 12, 2023
b86b964
backward compatibility fixes and validation fixes
stepinfwd Dec 13, 2023
de7f6f3
fixes :: textinput positioning of loader and icon
stepinfwd Dec 13, 2023
bf1fb33
fix :: password input
stepinfwd Dec 14, 2023
a4fe031
cleanup and fixes
stepinfwd Dec 16, 2023
ab7b836
fixes
stepinfwd Dec 17, 2023
df55036
cleanup
stepinfwd Dec 17, 2023
4e5a39d
Merge branch 'appbuilder-1.5' into feature/text-input
stepinfwd Dec 17, 2023
a7bf7cf
fixes
stepinfwd Dec 18, 2023
2fd85f7
review fixes
stepinfwd Dec 20, 2023
1349592
review fixes
stepinfwd Dec 20, 2023
d99c714
typo fix
stepinfwd Dec 20, 2023
28437b1
fix padding
stepinfwd Dec 21, 2023
f93bf36
review fixes styles component panel
stepinfwd Dec 22, 2023
fb75750
fix naming
stepinfwd Dec 22, 2023
8caba8f
fix padding
stepinfwd Dec 22, 2023
b5fdac3
feat :: toggle switch revamp
stepinfwd Jan 2, 2024
99f909a
init checkbox
stepinfwd Jan 3, 2024
e5eb446
fixes
stepinfwd Jan 7, 2024
3fd69fb
fixes
stepinfwd Jan 7, 2024
107fed3
switch fixes
stepinfwd Jan 7, 2024
cb19e88
validation fix
stepinfwd Jan 8, 2024
f1a7752
Merge branch 'appbuilder-1.5' into feature/text-input
stepinfwd Jan 8, 2024
40ec5c8
Merge branch 'feature/text-input' into feature/checkbox-revamp
stepinfwd Jan 8, 2024
44b175a
fixes
stepinfwd Jan 8, 2024
0a05406
cleanup
stepinfwd Jan 8, 2024
8fc0d3a
height fix
stepinfwd Jan 10, 2024
b2599f7
fix height toggle
stepinfwd Jan 10, 2024
8bdfd24
updates
stepinfwd Jan 10, 2024
f56cd94
fix :: icons position
stepinfwd Jan 10, 2024
1d37279
updates
stepinfwd Jan 10, 2024
68be3e9
cleanup
stepinfwd Jan 11, 2024
bb97751
updates events , csa
stepinfwd Jan 11, 2024
ffb5d53
cleanup
stepinfwd Jan 12, 2024
0ee164e
backward compatibility
stepinfwd Jan 12, 2024
90a6a09
clean
stepinfwd Jan 12, 2024
63d16b7
Merge branch 'feature/text-input' into feature/checkbox-revamp
stepinfwd Jan 12, 2024
d68b155
backward compatibility fix
stepinfwd Jan 13, 2024
98bea23
label fixed to one line
stepinfwd Jan 13, 2024
f1879f1
Merge branch 'appbuilder-1.5' into feature/text-input
stepinfwd Jan 13, 2024
9131731
feat :: change validation from properties
stepinfwd Jan 13, 2024
e989ef0
ui fixes
stepinfwd Jan 14, 2024
df167c0
icon name
stepinfwd Jan 14, 2024
ee0dbfa
removed 'px' text from tooltip
stepinfwd Jan 18, 2024
2b46f40
added onchange event for checkbox
stepinfwd Jan 18, 2024
246196c
fixes placeholder
stepinfwd Jan 18, 2024
f2d60f3
few updates :: removing label in form
stepinfwd Jan 18, 2024
3b389e9
ui in form
stepinfwd Jan 19, 2024
ea7da77
fire onchange
stepinfwd Jan 19, 2024
ca4163d
update :: number input validation behaviour
stepinfwd Jan 19, 2024
7c0fe6b
Merge branch 'appbuilder-1.5' into feature/text-input
stepinfwd Jan 19, 2024
3f76e43
testing fixes
stepinfwd Jan 21, 2024
9a4366a
added side handlers
stepinfwd Jan 21, 2024
312e0d6
removing unwanted fx
stepinfwd Jan 21, 2024
a16dfe6
disabling fx for padding field
stepinfwd Jan 21, 2024
5ef13be
ordering change
stepinfwd Jan 22, 2024
f187314
fix
stepinfwd Jan 22, 2024
96f8dfc
label issue + restricted side handler
stepinfwd Jan 22, 2024
0c23931
fix :: box shadow bug
stepinfwd Jan 22, 2024
5417263
fix
stepinfwd Jan 24, 2024
acb3aaf
on change event doesnt propagate exposed vars correctly
stepinfwd Jan 24, 2024
a580957
adding debounce for slider value change
stepinfwd Jan 25, 2024
01a3283
fix :: for modal ooen bug during onfocus event
stepinfwd Jan 25, 2024
a9a329f
test slider
stepinfwd Jan 25, 2024
7e618ca
fix :: bugs regarding state update in checbox , slider , slider bug
stepinfwd Jan 29, 2024
7153b14
update slider with radix slider
stepinfwd Jan 29, 2024
f040e80
bugfix
stepinfwd Jan 29, 2024
f0e0277
Merge branch 'feature/text-input' into feature/checkbox-revamp
stepinfwd Jan 30, 2024
4f8e4ec
update tooltip
stepinfwd Jan 30, 2024
d8d5e18
fix toggle switch
stepinfwd Jan 30, 2024
7ec722d
Merge branch 'appbuilder-1.6' into feature/checkbox-revamp
stepinfwd Mar 11, 2024
e57552b
fixes : inspector
stepinfwd Mar 12, 2024
5917055
fix : checkbox label
stepinfwd Mar 12, 2024
667d955
Merge branch 'appbuilder-1.6' into feature/checkbox-revamp
stepinfwd Mar 13, 2024
6ca2d4c
Merge branch 'appbuilder-1.7' into feature/checkbox-revamp
stepinfwd May 7, 2024
d586eae
Move disabled, visibility, tooltip and box shadow to properties
nakulnagargade May 9, 2024
3b0f8f0
Merge branch 'feature/checkbox-revamp' into migration-checkbox-toggle
nakulnagargade May 9, 2024
7818699
Remove toggleswitch and button
nakulnagargade May 9, 2024
b7d46c3
Add down rollbackUpdates
nakulnagargade May 10, 2024
7943949
fix : filter order of toggle (#9879)
stepinfwd May 27, 2024
c9935d0
Merge branch 'appbuilder-1.7' into migration-checkbox-toggle
nakulnagargade May 29, 2024
405d8de
fix merge issue
nakulnagargade May 29, 2024
a0ce04d
fix
nakulnagargade May 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions frontend/src/Editor/WidgetManager.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,29 @@ export const WidgetManager = function WidgetManager({ componentTypes, zoomLevel,

function filterComponents(value) {
if (value !== '') {
const fuse = new Fuse(componentTypes, { keys: ['displayName'], shouldSort: true, threshold: 0.4 });
const fuse = new Fuse(componentTypes, {
keys: ['displayName'],
shouldSort: true,
threshold: 0.4,
});
const results = fuse.search(value);

// Find the indices of ToggleSwitchLegacy and ToggleSwitch
const legacyIndex = componentTypes.findIndex((component) => component?.name === 'ToggleSwitchLegacy');
const toggleIndex = componentTypes.findIndex((component) => component?.name === 'ToggleSwitch');

// Swap the indices (if both are found)
if (legacyIndex !== -1 && toggleIndex !== -1) {
[componentTypes[legacyIndex], componentTypes[toggleIndex]] = [
componentTypes[toggleIndex],
componentTypes[legacyIndex],
];
}
setFilteredComponents(results.map((result) => result.item));
} else {
setFilteredComponents(componentTypes);
}
}

function renderComponentCard(component, index) {
return <DraggableBox key={index} index={index} component={component} zoomLevel={zoomLevel} />;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
import { Component } from 'src/entities/component.entity';
import { processDataInBatches } from 'src/helpers/utils.helper';
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
);
}
}
}
12 changes: 10 additions & 2 deletions server/src/services/app_import_export.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type DefaultDataSourceName =
| 'tooljetdbdefault'
| 'workflowsdefault';

type NewRevampedComponent = 'Text' | 'TextInput' | 'PasswordInput' | 'NumberInput' | 'Table';
type NewRevampedComponent = 'Text' | 'TextInput' | 'PasswordInput' | 'NumberInput' | 'Table' | 'Button' | 'Checkbox';

const DefaultDataSourceNames: DefaultDataSourceName[] = [
'restapidefault',
Expand All @@ -61,7 +61,15 @@ const DefaultDataSourceNames: DefaultDataSourceName[] = [
'workflowsdefault',
];
const DefaultDataSourceKinds: DefaultDataSourceKind[] = ['restapi', 'runjs', 'runpy', 'tooljetdb', 'workflows'];
const NewRevampedComponents: NewRevampedComponent[] = ['Text', 'TextInput', 'PasswordInput', 'NumberInput', 'Table'];
const NewRevampedComponents: NewRevampedComponent[] = [
'Text',
'TextInput',
'PasswordInput',
'NumberInput',
'Table',
'Checkbox',
'Button',
];

@Injectable()
export class AppImportExportService {
Expand Down
Loading