chore: Create a new datasource for WDS table (#33928)
Fixes #33388 /ok-to-test tags="@tag.IDE, @tag.Widget, @tag.Table"<!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/9349570140> > Commit: 06384344db582e56d6b873d7bbf41d1e6bb6b634 > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9349570140&attempt=1" target="_blank">Click here!</a> <!-- end of auto-generated comment: Cypress test results --> --------- Co-authored-by: Pawan Kumar <pawankumar@Pawans-MacBook-Pro-2.local>
This commit is contained in:
parent
b70e3013b6
commit
a7dd0921e9
|
|
@ -241,6 +241,7 @@ export type EditorProps = EditorStyleProps &
|
|||
ignoreSlashCommand?: boolean;
|
||||
ignoreBinding?: boolean;
|
||||
ignoreAutoComplete?: boolean;
|
||||
maxHeight?: string | number;
|
||||
|
||||
// Custom gutter
|
||||
customGutter?: CodeEditorGutter;
|
||||
|
|
@ -1571,6 +1572,7 @@ class CodeEditor extends Component<Props, State> {
|
|||
height,
|
||||
hideEvaluatedValue,
|
||||
hoverInteraction,
|
||||
maxHeight,
|
||||
showLightningMenu,
|
||||
size,
|
||||
theme,
|
||||
|
|
@ -1703,6 +1705,7 @@ class CodeEditor extends Component<Props, State> {
|
|||
isNotHover={this.state.isFocused || this.state.isOpened}
|
||||
isRawView={this.props.isRawView}
|
||||
isReadOnly={this.props.isReadOnly}
|
||||
maxHeight={maxHeight}
|
||||
mode={this.props.mode}
|
||||
onMouseMove={this.handleLintTooltip}
|
||||
onMouseOver={this.handleMouseMove}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ export const EditorWrapper = styled.div<{
|
|||
removeHoverAndFocusStyle?: boolean;
|
||||
AIEnabled?: boolean;
|
||||
mode: string;
|
||||
maxHeight?: string | number;
|
||||
}>`
|
||||
// Bottom border was getting clipped
|
||||
.CodeMirror.cm-s-duotone-light.CodeMirror-wrap {
|
||||
|
|
@ -68,6 +69,7 @@ export const EditorWrapper = styled.div<{
|
|||
`
|
||||
: `position: relative;`}
|
||||
min-height: 36px;
|
||||
max-height: ${(props) => props.maxHeight || "auto"};
|
||||
height: ${(props) => props.height || "auto"};
|
||||
background-color: ${(props) =>
|
||||
props.disabled ? "var(--ads-v2-color-bg-muted)" : "var(--ads-v2-color-bg)"};
|
||||
|
|
|
|||
|
|
@ -11,10 +11,12 @@ import {
|
|||
import LazyCodeEditor from "components/editorComponents/LazyCodeEditor";
|
||||
import { bindingHintHelper } from "components/editorComponents/CodeEditor/hintHelpers";
|
||||
import { slashCommandHintHelper } from "components/editorComponents/CodeEditor/commandsHelper";
|
||||
import type { EditorProps } from "components/editorComponents/CodeEditor";
|
||||
|
||||
class CodeEditorControl extends BaseControl<ControlProps> {
|
||||
render() {
|
||||
const {
|
||||
controlConfig,
|
||||
dataTreePath,
|
||||
evaluatedValue,
|
||||
expected,
|
||||
|
|
@ -33,6 +35,7 @@ class CodeEditorControl extends BaseControl<ControlProps> {
|
|||
additionalDynamicData={this.props.additionalAutoComplete}
|
||||
hinting={[bindingHintHelper, slashCommandHintHelper]}
|
||||
input={{ value: propertyValue, onChange: this.onChange }}
|
||||
maxHeight={controlConfig?.maxHeight as EditorProps["maxHeight"]}
|
||||
mode={EditorModes.TEXT_WITH_BINDING}
|
||||
positionCursorInsideBinding
|
||||
size={EditorSize.EXTENDED}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,13 @@
|
|||
import { InlineEditingSaveOptions } from "../constants";
|
||||
import type { WidgetDefaultProps } from "WidgetProvider/constants";
|
||||
import {
|
||||
BlueprintOperationTypes,
|
||||
type WidgetDefaultProps,
|
||||
} from "WidgetProvider/constants";
|
||||
import { ResponsiveBehavior } from "layoutSystems/common/utils/constants";
|
||||
import { DEFAULT_DATA } from "../constants/data";
|
||||
import type { WidgetProps } from "widgets/BaseWidget";
|
||||
import type { DynamicPath } from "utils/DynamicBindingUtils";
|
||||
import get from "lodash/get";
|
||||
|
||||
export const defaultsConfig = {
|
||||
responsiveBehavior: ResponsiveBehavior.Fill,
|
||||
|
|
@ -19,7 +26,7 @@ export const defaultsConfig = {
|
|||
dynamicPropertyPathList: [],
|
||||
dynamicBindingPathList: [],
|
||||
primaryColumns: {},
|
||||
tableData: "",
|
||||
tableData: DEFAULT_DATA,
|
||||
columnWidthMap: {},
|
||||
columnOrder: [],
|
||||
enableClientSideSearch: true,
|
||||
|
|
@ -35,4 +42,30 @@ export const defaultsConfig = {
|
|||
buttonLabel: "Action",
|
||||
buttonColor: "accent",
|
||||
buttonVariant: "filled",
|
||||
blueprint: {
|
||||
operations: [
|
||||
{
|
||||
type: BlueprintOperationTypes.MODIFY_PROPS,
|
||||
fn: (widget: WidgetProps & { children?: WidgetProps[] }) => {
|
||||
const dynamicPropertyPathList: DynamicPath[] = [
|
||||
...get(widget, "dynamicPropertyPathList", []),
|
||||
];
|
||||
|
||||
dynamicPropertyPathList.push({
|
||||
key: "tableData",
|
||||
});
|
||||
|
||||
const updatePropertyMap = [
|
||||
{
|
||||
widgetId: widget.widgetId,
|
||||
propertyName: "dynamicPropertyPathList",
|
||||
propertyValue: dynamicPropertyPathList,
|
||||
},
|
||||
];
|
||||
|
||||
return updatePropertyMap;
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
} as unknown as WidgetDefaultProps;
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ export const contentConfig = [
|
|||
controlType: "ONE_CLICK_BINDING_CONTROL",
|
||||
controlConfig: {
|
||||
searchableColumn: true,
|
||||
maxHeight: "300px",
|
||||
},
|
||||
placeholderText: '[{ "name": "John" }]',
|
||||
inputType: "ARRAY",
|
||||
|
|
|
|||
130
app/client/src/widgets/wds/WDSTableWidget/constants/data.ts
Normal file
130
app/client/src/widgets/wds/WDSTableWidget/constants/data.ts
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
export const DEFAULT_DATA = [
|
||||
{
|
||||
Name: "John Doe",
|
||||
Company: "TechCorp",
|
||||
Title: "Software Engineer",
|
||||
"Phone number": "(555) 123-4567",
|
||||
Email: "john.doe@techcorp.com",
|
||||
"Registration date": "2023-01-15",
|
||||
},
|
||||
{
|
||||
Name: "Jane Smith",
|
||||
Company: "Innovate Ltd",
|
||||
Title: "Project Manager",
|
||||
"Phone number": "(555) 234-5678",
|
||||
Email: "jane.smith@innovatelt.com",
|
||||
"Registration date": "2023-02-20",
|
||||
},
|
||||
{
|
||||
Name: "Alice Johnson",
|
||||
Company: "Web Solutions",
|
||||
Title: "UX Designer",
|
||||
"Phone number": "(555) 345-6789",
|
||||
Email: "alice.johnson@websolutions.com",
|
||||
"Registration date": "2023-03-10",
|
||||
},
|
||||
{
|
||||
Name: "Bob Brown",
|
||||
Company: "BuildIt",
|
||||
Title: "Construction Manager",
|
||||
"Phone number": "(555) 456-7890",
|
||||
Email: "bob.brown@buildit.com",
|
||||
"Registration date": "2023-04-05",
|
||||
},
|
||||
{
|
||||
Name: "Charlie Davis",
|
||||
Company: "FinTech Inc",
|
||||
Title: "Financial Analyst",
|
||||
"Phone number": "(555) 567-8901",
|
||||
Email: "charlie.davis@fintechinc.com",
|
||||
"Registration date": "2023-05-12",
|
||||
},
|
||||
{
|
||||
Name: "Dana Lee",
|
||||
Company: "HealthFirst",
|
||||
Title: "Nurse Practitioner",
|
||||
"Phone number": "(555) 678-9012",
|
||||
Email: "dana.lee@healthfirst.com",
|
||||
"Registration date": "2023-06-01",
|
||||
},
|
||||
{
|
||||
Name: "Evan Martinez",
|
||||
Company: "AutoPro",
|
||||
Title: "Mechanical Engineer",
|
||||
"Phone number": "(555) 789-0123",
|
||||
Email: "evan.martinez@autopro.com",
|
||||
"Registration date": "2023-07-19",
|
||||
},
|
||||
{
|
||||
Name: "Fiona Green",
|
||||
Company: "EduFuture",
|
||||
Title: "Curriculum Developer",
|
||||
"Phone number": "(555) 890-1234",
|
||||
Email: "fiona.green@edufuture.com",
|
||||
"Registration date": "2023-08-23",
|
||||
},
|
||||
{
|
||||
Name: "George Harris",
|
||||
Company: "MarketMasters",
|
||||
Title: "Marketing Director",
|
||||
"Phone number": "(555) 901-2345",
|
||||
Email: "george.harris@marketmasters.com",
|
||||
"Registration date": "2023-09-07",
|
||||
},
|
||||
{
|
||||
Name: "Hannah Wright",
|
||||
Company: "LegalEagle",
|
||||
Title: "Attorney",
|
||||
"Phone number": "(555) 012-3456",
|
||||
Email: "hannah.wright@legaleagle.com",
|
||||
"Registration date": "2023-10-15",
|
||||
},
|
||||
{
|
||||
Name: "Ian Walker",
|
||||
Company: "HomeGoods",
|
||||
Title: "Retail Manager",
|
||||
"Phone number": "(555) 123-4567",
|
||||
Email: "ian.walker@homegoods.com",
|
||||
"Registration date": "2023-11-22",
|
||||
},
|
||||
{
|
||||
Name: "Julia King",
|
||||
Company: "TravelWise",
|
||||
Title: "Travel Agent",
|
||||
"Phone number": "(555) 234-5678",
|
||||
Email: "julia.king@travelwise.com",
|
||||
"Registration date": "2023-12-30",
|
||||
},
|
||||
{
|
||||
Name: "Kevin Scott",
|
||||
Company: "CleanEnergy",
|
||||
Title: "Environmental Scientist",
|
||||
"Phone number": "(555) 345-6789",
|
||||
Email: "kevin.scott@cleanenergy.com",
|
||||
"Registration date": "2024-01-08",
|
||||
},
|
||||
{
|
||||
Name: "Laura Baker",
|
||||
Company: "MediaMinds",
|
||||
Title: "Content Strategist",
|
||||
"Phone number": "(555) 456-7890",
|
||||
Email: "laura.baker@mediaminds.com",
|
||||
"Registration date": "2024-02-18",
|
||||
},
|
||||
{
|
||||
Name: "Michael Young",
|
||||
Company: "CyberSecure",
|
||||
Title: "Cybersecurity Specialist",
|
||||
"Phone number": "(555) 567-8901",
|
||||
Email: "michael.young@cybersecure.com",
|
||||
"Registration date": "2024-03-29",
|
||||
},
|
||||
{
|
||||
Name: "Nina Patel",
|
||||
Company: "AgriTech",
|
||||
Title: "Agricultural Engineer",
|
||||
"Phone number": "(555) 678-9012",
|
||||
Email: "nina.patel@agritech.com",
|
||||
"Registration date": "2024-04-10",
|
||||
},
|
||||
];
|
||||
Loading…
Reference in New Issue
Block a user