Skip to content

Commit

Permalink
code review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jsartisan committed Dec 6, 2024
1 parent 3d6c9df commit a757240
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
This is a temporary solution. According to the product requirements, we need to make AI chat widget interactive.
This code can be deleted when full-fledged inline editing feature is implemented.
*/
& [data-widget-name*="AIChat"] > * {
& :is([data-widget-name*="AIChat"], [data-widget-name*="Custom"]) > * {
pointer-events: all;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@ import React, { useContext, useEffect, useMemo, useRef, useState } from "react";
import styled from "styled-components";
import kebabCase from "lodash/kebabCase";

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
// @ts-expect-error Cannot find module due to raw-loader
import script from "!!raw-loader!./customWidgetscript.js";

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
// @ts-expect-error Cannot find module due to raw-loader
import appsmithConsole from "!!raw-loader!./appsmithConsole.js";

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
// @ts-expect-error Cannot find module due to raw-loader
import css from "!!raw-loader!./reset.css";
import clsx from "clsx";
import AnalyticsUtil from "ee/utils/AnalyticsUtil";
Expand All @@ -29,7 +26,7 @@ const Container = styled.div`

const { disableIframeWidgetSandbox } = getAppsmithConfigs();

function CustomComponent(props: CustomComponentProps) {
export function CustomComponent(props: CustomComponentProps) {
const { size } = props;
const iframe = useRef<HTMLIFrameElement>(null);
const theme = useContext(ThemeContext);
Expand Down Expand Up @@ -211,5 +208,3 @@ export interface CustomComponentProps {
widgetId: string;
size?: keyof typeof COMPONENT_SIZE;
}

export default CustomComponent;
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
BlueprintOperationTypes,
type FlattenedWidgetProps,
type WidgetDefaultProps,
} from "WidgetProvider/constants";
import { LayoutSystemTypes } from "layoutSystems/types";
import type { UpdatePropertyArgs } from "sagas/WidgetBlueprintSagas";
Expand All @@ -12,8 +13,6 @@ import { COMPONENT_SIZE, DEFAULT_MODEL } from "../constants";

export const defaultsConfig = {
widgetName: "Custom",
rows: 30,
columns: 23,
version: 1,
onResetClick: "{{showAlert('Successfully reset!!', '');}}",
events: ["onResetClick"],
Expand Down Expand Up @@ -61,4 +60,4 @@ export const defaultsConfig = {
},
],
},
};
} as unknown as WidgetDefaultProps;
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { DerivedPropertiesMap } from "WidgetProvider/factory";
import { EventType } from "constants/AppsmithActionConstants/ActionConstants";

import * as config from "../config";
import CustomComponent from "../component";
import { CustomComponent } from "../component";
import type { CustomWidgetProps } from "../types";
import { Elevations } from "../../constants";
import { ContainerComponent } from "../../Container";
Expand Down Expand Up @@ -54,9 +54,7 @@ export class WDSCustomWidget extends BaseWidget<
};
}

// TODO: Fix this the next time the file is edited
// eslint-disable-next-line @typescript-eslint/no-explicit-any
static getMetaPropertiesMap(): Record<string, any> {
static getMetaPropertiesMap() {
return {
model: undefined,
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useContext, useEffect, useRef, useState } from "react";
import FixedLayoutCustomComponent from "widgets/CustomWidget/component";
import AnvilLayoutCustomComponent from "modules/ui-builder/ui/wds/WDSCustomWidget/component";
import { CustomComponent as AnvilLayoutCustomComponent } from "modules/ui-builder/ui/wds/WDSCustomWidget/component";
import { CustomWidgetBuilderContext } from "../index";
import { toast } from "@appsmith/ads";
import Debugger from "./Debugger";
Expand Down

0 comments on commit a757240

Please sign in to comment.