forked from ToolJet/ToolJet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature]: Added universal props for widgets with Tooltip (ToolJet#3096)
* Added universal props for widget * Fixed lint issues * Updated export name * Fixed lint errors * Updated genral variable name * Updated file name in doc
- Loading branch information
1 parent
88925fc
commit ed43ca8
Showing
12 changed files
with
88 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { widgets } from './widgetConfig'; | ||
|
||
const universalProps = { | ||
properties: {}, | ||
general: { | ||
tooltip: { type: 'code', displayName: 'Tooltip' }, | ||
}, | ||
others: {}, | ||
events: {}, | ||
styles: {}, | ||
definition: { | ||
others: {}, | ||
events: [], | ||
styles: {}, | ||
}, | ||
}; | ||
|
||
const combineProperties = (widget, universal, isArray = false) => { | ||
return { | ||
...widget, | ||
properties: { ...universal.properties, ...widget.properties }, | ||
general: { ...universal.general, ...widget.general }, | ||
others: { ...universal.others, ...widget.others }, | ||
events: isArray ? [...universal.events, ...widget.events] : { ...universal.events, ...widget.events }, | ||
styles: { ...universal.styles, ...widget.styles }, | ||
exposedVariables: { ...universal.exposedVariables, ...widget.exposedVariables }, | ||
}; | ||
}; | ||
|
||
export const componentTypes = widgets.map((widget) => { | ||
return { | ||
...combineProperties(widget, universalProps), | ||
definition: combineProperties(widget.definition, universalProps.definition, true), | ||
}; | ||
}); |
2 changes: 1 addition & 1 deletion
2
frontend/src/Editor/Components/components.js → .../src/Editor/WidgetManager/widgetConfig.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export const componentTypes = [ | ||
export const widgets = [ | ||
{ | ||
name: 'Table', | ||
displayName: 'Table', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters