chore: update eslint and dependencies then fix revealed errors (#27908)

## Description
Update eslint and dependencies then fix revealed errors
This commit is contained in:
Valera Melnikov 2023-10-11 10:14:38 +03:00 committed by GitHub
parent d8501f82ad
commit f5a0e41f60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
119 changed files with 1454 additions and 940 deletions

View File

@ -366,13 +366,13 @@ describe("JS Function Execution", function () {
: i === functionsLength - 1
? `
${functionName}: ${
isMarkedAsync ? "async" : ""
} ()=>"${functionName}",
isMarkedAsync ? "async" : ""
} ()=>"${functionName}",
}`
: `
${functionName}: ${
isMarkedAsync ? "async" : ""
} ()=> "${functionName}",`;
isMarkedAsync ? "async" : ""
} ()=> "${functionName}",`;
}
return JS_OBJECT_BODY;
};

View File

@ -1043,8 +1043,8 @@ export class AggregateHelper extends ReusableHelper {
public ActionContextMenuWithInPane({
action = "Delete",
subAction = "",
entityType = EntityItems.JSObject,
subAction = "",
toastToValidate = "",
}: DeleteParams) {
cy.get(this.locator._contextMenuInPane).click();

View File

@ -28,6 +28,7 @@ interface EntityActionParams {
| "Refresh"
| "Set as home page";
subAction?: string;
//@ts-expect-error: type mismatch
entityType?: EntityItems;
toAssertAction?: boolean;
toastToValidate?: string;
@ -232,10 +233,10 @@ export class EntityExplorer {
}
public ActionContextMenuByEntityName({
entityNameinLeftSidebar,
action = "Delete",
subAction = "",
entityNameinLeftSidebar,
entityType = EntityItems.Query,
subAction = "",
toAssertAction,
toastToValidate = "",
}: EntityActionParams) {

View File

@ -189,7 +189,7 @@ export class Table {
_divFirstChild = "div:first-child abbr";
_listPreviousPage = ".rc-pagination-prev";
_listNavigation = (move: string) =>
"//button[@area-label='" + move + " page']";
"//button[@aria-label='" + move + " page']";
_listNextPage = ".rc-pagination-next";
_listActivePage = (version: "v1" | "v2") =>
`.t--widget-listwidget${

View File

@ -282,10 +282,11 @@
"@types/tinycolor2": "^1.4.2",
"@types/to-json-schema": "^0.2.1",
"@types/toposort": "^2.0.3",
"@types/uuid": "^9.0.5",
"@types/webfontloader": "1.6.33",
"@types/zipcelx": "^1.5.0",
"@typescript-eslint/eslint-plugin": "^5.54.1",
"@typescript-eslint/parser": "^5.54.1",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"babel-plugin-lodash": "^3.3.4",
"babel-plugin-module-resolver": "^4.1.0",
"chalk": "^4.1.1",
@ -306,17 +307,17 @@
"cypress-xpath": "^1.6.0",
"diff": "^5.0.0",
"dotenv": "^8.1.0",
"eslint": "^8.42.0",
"eslint-config-prettier": "^8.6.0",
"eslint-import-resolver-babel-module": "^5.3.1",
"eslint-plugin-cypress": "^2.11.2",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.30.0",
"eslint-plugin-react-hooks": "^2.3.0",
"eslint-plugin-sort-destructure-keys": "^1.3.5",
"eslint-plugin-storybook": "^0.6.11",
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-babel-module": "^5.3.2",
"eslint-plugin-cypress": "^2.15.1",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jest": "^27.4.2",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-sort-destructure-keys": "^1.5.0",
"eslint-plugin-storybook": "^0.6.15",
"esm": "^3.2.25",
"factory.ts": "^0.5.1",
"husky": "^8.0.0",
@ -325,7 +326,7 @@
"jest-environment-jsdom": "^27.4.1",
"jest-styled-components": "^7.0.8",
"json5": "^2.2.3",
"lint-staged": "^13.2.0",
"lint-staged": "^14.0.1",
"msw": "^0.28.0",
"pg": "^8.11.3",
"plop": "^3.1.1",
@ -338,7 +339,7 @@
"postcss-nesting": "^12.0.1",
"postcss-url": "^10.1.3",
"postinstall-postinstall": "^2.1.0",
"prettier": "^2.8.6",
"prettier": "^3.0.3",
"prop-types": "^15.8.1",
"raw-loader": "^4.0.2",
"react-is": "^16.12.0",

View File

@ -36,8 +36,8 @@ const _Checkbox = (props: CheckboxProps, ref: CheckboxRef) => {
icon: Icon = CheckIcon,
isDisabled: isDisabledProp = false,
isIndeterminate = false,
validationState,
labelPosition = "right",
validationState,
} = props;
const state = useToggleState(props);
const inputRef = useRef<HTMLInputElement>(null);

View File

@ -24,19 +24,19 @@ export type FieldRef = Ref<HTMLDivElement>;
const _Field = (props: FieldProps, ref: FieldRef) => {
const {
children,
contextualHelp,
description,
descriptionProps,
elementType,
errorMessage,
errorMessageProps = {},
fieldType = "field",
isDisabled = false,
label,
labelProps,
validationState,
wrapperClassName,
description,
descriptionProps,
wrapperProps = {},
contextualHelp,
fieldType = "field",
} = props;
const hasHelpText =
Boolean(description) ||

View File

@ -35,14 +35,14 @@ export interface TooltipOptions {
export function useTooltip({
closeDelay = 0,
initialOpen = false,
interaction = "hover",
offset: offsetProp = DEFAULT_TOOLTIP_OFFSET,
onOpenChange: setControlledOpen,
open: controlledOpen,
openDelay = 0,
placement = "top",
interaction = "hover",
offset: offsetProp = DEFAULT_TOOLTIP_OFFSET,
shift: shiftProp = DEFAULT_TOOLTIP_SHIFT,
padding: paddingProp = DEFAULT_TOOLTIP_PADDING,
placement = "top",
shift: shiftProp = DEFAULT_TOOLTIP_SHIFT,
}: TooltipOptions = {}) {
const [uncontrolledOpen, setUncontrolledOpen] = React.useState(initialOpen);

View File

@ -1,4 +1,4 @@
//THIS FILE IS CREATED AUTOMATICALLY. PLEASE DON'T EDIT IT.
/* THIS FILE IS CREATED AUTOMATICALLY. PLEASE DON'T EDIT IT. */
:root {
--root-unit: clamp(4px, calc(0.06vw + 3.77px), 5px);
--spacing-0: 0;
@ -159,7 +159,7 @@
--color-fg-on-warning: rgb(21.953% 9.0775% 0%);
--color-bd: rgb(72.54% 73.727% 82.602%);
--color-bd-accent: rgb(33.333% 23.922% 91.373%);
--color-bd-focus: rgb(78.161% 34.431% 0%);
--color-bd-focus: rgb(33.333% 23.922% 91.373%);
--color-bd-neutral: rgb(37.869% 38.922% 47.553%);
--color-bd-neutral-hover: rgb(49.162% 50.308% 59.345%);
--color-bd-positive: rgb(6.7435% 63.436% 18.481%);

View File

@ -193,7 +193,7 @@
"type": "color"
},
"bd-focus": {
"value": "rgb(78.161% 34.431% 0%)",
"value": "rgb(33.333% 23.922% 91.373%)",
"type": "color"
},
"bd-neutral": {

View File

@ -18,7 +18,7 @@ const allTokens = new TokensAccessor({
}).getAllTokens();
const ATTENTION_MESSAGE =
"//THIS FILE IS CREATED AUTOMATICALLY. PLEASE DON'T EDIT IT.";
"/* THIS FILE IS CREATED AUTOMATICALLY. PLEASE DON'T EDIT IT. */";
const cssStyles = `:root {--root-unit: ${getFluidRootUnit(fluid)}; ${cssRule(
allTokens,
)}}`;

View File

@ -346,7 +346,8 @@ export const DropdownWrapper = styled.div<{
border: 1px solid var(--ads-dropdown-default-menu-border-color);
overflow: hidden;
overflow-y: auto;
box-shadow: 0px 12px 16px -4px rgba(0, 0, 0, 0.1),
box-shadow:
0px 12px 16px -4px rgba(0, 0, 0, 0.1),
0px 4px 6px -2px rgba(0, 0, 0, 0.05);
display: ${(props) => (props.isOpen ? "inline-block" : "none")};
.dropdown-search {
@ -1121,9 +1122,8 @@ export default function Dropdown(props: DropdownProps) {
const handleKeydown = useCallback(
(e: React.KeyboardEvent) => {
const elementList = document.getElementById(
"ds--dropdown-options",
)?.children;
const elementList = document.getElementById("ds--dropdown-options")
?.children;
if (!elementList || elementList?.length === 0) {
setHighlight(-1);
}

View File

@ -108,7 +108,9 @@
*-----------------------------------------------------------------------------
*/
&[data-focused] {
box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-bd-focus);
box-shadow:
0 0 0 2px var(--color-bg),
0 0 0 4px var(--color-bd-focus);
}
/**

View File

@ -50,7 +50,9 @@
*-----------------------------------------------------------------------------
*/
&[data-focused] [data-icon] {
box-shadow: var(--checkbox-box-shadow), 0 0 0 2px var(--color-bg),
box-shadow:
var(--checkbox-box-shadow),
0 0 0 2px var(--color-bg),
0 0 0 4px var(--color-bd-focus);
}

View File

@ -48,7 +48,9 @@
*-----------------------------------------------------------------------------
*/
&[data-focused] [data-icon] {
box-shadow: var(--radio-box-shadow), 0 0 0 2px var(--color-bg),
box-shadow:
var(--radio-box-shadow),
0 0 0 2px var(--color-bg),
0 0 0 4px var(--color-bd-focus);
}

View File

@ -56,6 +56,8 @@
*-----------------------------------------------------------------------------
*/
&[data-focused] [data-icon] {
box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-bd-focus);
box-shadow:
0 0 0 2px var(--color-bg),
0 0 0 4px var(--color-bd-focus);
}
}

View File

@ -59,7 +59,9 @@
&[data-focused],
&:focus-visible {
box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-bd-focus);
box-shadow:
0 0 0 2px var(--color-bg),
0 0 0 4px var(--color-bd-focus);
}
&[data-disabled] {

View File

@ -15,6 +15,7 @@ enum COMMAND_TYPES {
"FIND" = "FETCH_MANY",
"INSERT" = "INSERT_ONE",
"UPDATE" = "UPDATE_ONE",
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
"COUNT" = "FETCH_MANY",
}
const COMMON_INITIAL_VALUE_KEYS = [
@ -237,10 +238,13 @@ export default abstract class GSheets extends BaseQueryGenerator {
];
const scrubedOutInitialValues = allowedInitialValueKeys
.filter((key) => initialValues[key as keyof GSheetsFormData])
.reduce((acc, key) => {
acc[key] = initialValues[key as keyof GSheetsFormData];
return acc;
}, {} as Record<string, object>);
.reduce(
(acc, key) => {
acc[key] = initialValues[key as keyof GSheetsFormData];
return acc;
},
{} as Record<string, object>,
);
const { formData, ...rest } = builtValues;

View File

@ -191,10 +191,13 @@ export default abstract class MongoDB extends BaseQueryGenerator {
const scrubedOutInitalValues = [...ALLOWED_INITAL_VALUE_KEYS, commandKey]
.filter((key) => initialValues[key as keyof MongoDBFormData])
.reduce((acc, key) => {
acc[key] = initialValues[key as keyof MongoDBFormData];
return acc;
}, {} as Record<string, object>);
.reduce(
(acc, key) => {
acc[key] = initialValues[key as keyof MongoDBFormData];
return acc;
},
{} as Record<string, object>,
);
const { formData, ...rest } = builtValues;

View File

@ -183,8 +183,8 @@ export const fetchGitStatusSuccess = (payload: GitStatusData) => ({
});
export const fetchGitRemoteStatusInit = ({
onSuccessCallback = noop,
onErrorCallback = noop,
onSuccessCallback = noop,
} = {}) => ({
type: ReduxActionTypes.FETCH_GIT_REMOTE_STATUS_INIT,
onSuccessCallback,

View File

@ -65,7 +65,8 @@ const CarouselContainer = styled.div`
&.active {
height: max-content;
box-shadow: 0 2px 4px -2px rgba(0, 0, 0, 0.06),
box-shadow:
0 2px 4px -2px rgba(0, 0, 0, 0.06),
0 4px 8px -2px rgba(0, 0, 0, 0.1);
background-color: var(--ads-v2-color-bg);

View File

@ -13,8 +13,10 @@ import { getAssetUrl } from "@appsmith/utils/airgapHelpers";
export const UpgradeToBEPageWrapper = styled.div`
width: 100%;
height: 100%;
background: linear-gradient(90deg, #fff 20px, transparent 1%) center,
linear-gradient(#fff 20px, transparent 1%) center, #d2ddec;
background:
linear-gradient(90deg, #fff 20px, transparent 1%) center,
linear-gradient(#fff 20px, transparent 1%) center,
#d2ddec;
background-size: 22px 22px;
position: relative;

View File

@ -260,10 +260,13 @@ export function* fetchAppAndPagesSaga(
const isValidResponse: boolean = yield call(validateResponse, response);
if (isValidResponse) {
const prevPagesState: Page[] = yield select(getPageList);
const pagePermissionsMap = prevPagesState.reduce((acc, page) => {
acc[page.pageId] = page.userPermissions ?? [];
return acc;
}, {} as Record<string, string[]>);
const pagePermissionsMap = prevPagesState.reduce(
(acc, page) => {
acc[page.pageId] = page.userPermissions ?? [];
return acc;
},
{} as Record<string, string[]>,
);
yield put({
type: ReduxActionTypes.FETCH_APPLICATION_SUCCESS,
payload: { ...response.data.application, pages: response.data.pages },
@ -921,9 +924,8 @@ export function* initializeDatasourceWithDefaultValues(datasource: Datasource) {
datasource.datasourceStorages[currentEnvironment],
);
payload.isConfigured = false; // imported datasource as not configured yet
const response: ApiResponse = yield DatasourcesApi.updateDatasourceStorage(
payload,
);
const response: ApiResponse =
yield DatasourcesApi.updateDatasourceStorage(payload);
const isValidResponse: boolean = yield validateResponse(response);
if (isValidResponse) {
yield put({

View File

@ -273,9 +273,8 @@ export function* createWorkspaceSaga(
);
const isValidResponse: boolean = yield validateResponse(response);
if (!isValidResponse) {
const errorMessage: string | undefined = yield getResponseErrorMessage(
response,
);
const errorMessage: string | undefined =
yield getResponseErrorMessage(response);
yield call(reject, { _error: errorMessage });
} else {
yield put({

View File

@ -44,12 +44,10 @@ export function* getUserAndAppDetails() {
getCurrentApplication,
);
const user: ReturnType<typeof getCurrentUser> = yield select(getCurrentUser);
const instanceId: ReturnType<typeof getInstanceId> = yield select(
getInstanceId,
);
const pageId: ReturnType<typeof getCurrentPageId> = yield select(
getCurrentPageId,
);
const instanceId: ReturnType<typeof getInstanceId> =
yield select(getInstanceId);
const pageId: ReturnType<typeof getCurrentPageId> =
yield select(getCurrentPageId);
const userAndAppDetails: UserAndAppDetails = {
pageId,
appId: currentApp?.id || "",

View File

@ -228,9 +228,8 @@ export function* forgotPasswordSaga(
);
const isValidResponse: boolean = yield validateResponse(response);
if (!isValidResponse) {
const errorMessage: string | undefined = yield getResponseErrorMessage(
response,
);
const errorMessage: string | undefined =
yield getResponseErrorMessage(response);
yield call(reject, { _error: errorMessage });
} else {
yield put({
@ -260,9 +259,8 @@ export function* resetPasswordSaga(
const response: ApiResponse = yield callAPI(UserApi.resetPassword, request);
const isValidResponse: boolean = yield validateResponse(response);
if (!isValidResponse) {
const errorMessage: string | undefined = yield getResponseErrorMessage(
response,
);
const errorMessage: string | undefined =
yield getResponseErrorMessage(response);
yield call(reject, { _error: errorMessage });
} else {
yield put({
@ -294,9 +292,8 @@ export function* invitedUserSignupSaga(
);
const isValidResponse: boolean = yield validateResponse(response);
if (!isValidResponse) {
const errorMessage: string | undefined = yield getResponseErrorMessage(
response,
);
const errorMessage: string | undefined =
yield getResponseErrorMessage(response);
yield call(reject, { _error: errorMessage });
} else {
yield put(invitedUserSignupSuccess());

View File

@ -860,10 +860,13 @@ export const getPageActions = (pageId = "") => {
export const selectDatasourceIdToNameMap = createSelector(
getDatasources,
(datasources) => {
return datasources.reduce((acc, datasource) => {
acc[datasource.id] = datasource.name;
return acc;
}, {} as Record<string, string>);
return datasources.reduce(
(acc, datasource) => {
acc[datasource.id] = datasource.name;
return acc;
},
{} as Record<string, string>,
);
},
);
@ -1185,9 +1188,8 @@ export const getDatasourceScopeValue = (
const options = formConfig[0]?.children?.find(
(child: any) => child?.configProperty === configProperty,
)?.options;
const label = options?.find(
(option: any) => option.value === scopeValue,
)?.label;
const label = options?.find((option: any) => option.value === scopeValue)
?.label;
return label;
};

View File

@ -59,18 +59,21 @@ export const MULTIPLEXING_MODE_CONFIGS: MultiplexingModeConfigs = {
},
...Object.values(sqlModesConfig)
.filter((config) => config.isMultiplex)
.reduce((prev, current) => {
prev[current.mode] = {
outerMode: current.mime,
innerModes: [
{
open: BINDING_OPEN,
close: BINDING_CLOSE,
},
],
};
return prev;
}, {} as Record<TEditorSqlModes, MultiplexingModeConfig | undefined>),
.reduce(
(prev, current) => {
prev[current.mode] = {
outerMode: current.mime,
innerModes: [
{
open: BINDING_OPEN,
close: BINDING_CLOSE,
},
],
};
return prev;
},
{} as Record<TEditorSqlModes, MultiplexingModeConfig | undefined>,
),
"text/plain": undefined,
"application/json": undefined,
javascript: undefined,

View File

@ -152,12 +152,15 @@ function extractFromObj<T, K extends keyof T>(
keys: K[],
): [Pick<T, K>, T[K][]] {
const deps = [] as T[K][];
const newObj = keys.reduce((newObj, curr) => {
newObj[curr] = obj[curr];
deps.push(obj[curr]);
const newObj = keys.reduce(
(newObj, curr) => {
newObj[curr] = obj[curr];
deps.push(obj[curr]);
return newObj;
}, {} as Pick<T, K>);
return newObj;
},
{} as Pick<T, K>,
);
return [newObj, deps];
}

View File

@ -68,7 +68,9 @@ import {
const StyledContainer = styled.div<{ category: SearchCategory; query: string }>`
max-height: 530px;
transition: height 0.1s ease, width 0.1s ease;
transition:
height 0.1s ease,
width 0.1s ease;
height: ${(props) =>
isMenu(props.category) ||
isActionOperation(props.category) ||

View File

@ -4,7 +4,9 @@ import { Colors } from "constants/Colors";
export default styled.div`
background-color: ${Colors.GREY_1};
border-radius: ${(props) => props.theme.radii[0]}px;
box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2), 0px 2px 10px rgba(0, 0, 0, 0.1);
box-shadow:
0px 0px 2px rgba(0, 0, 0, 0.2),
0px 2px 10px rgba(0, 0, 0, 0.1);
color: ${(props) => props.theme.colors.textOnDarkBG};
text-transform: capitalize;
`;

View File

@ -121,22 +121,22 @@ function WidgetQueryGeneratorForm(props: Props) {
const [pristine, setPristine] = useState(true);
const {
aliases,
alertMessage,
showEditFieldsModal = false,
actionButtonCtaText = createMessage(CONNECT_BUTTON_TEXT),
alertMessage,
aliases,
datasourceDropdownVariant,
errorMsg,
excludePrimaryColumnFromQueryGeneration,
expectedType,
isConnectableToWidget,
onUpdate,
otherFields = [],
propertyPath,
propertyValue,
sampleData,
searchableColumn,
showEditFieldsModal = false,
widgetId,
otherFields = [],
isConnectableToWidget,
datasourceDropdownVariant,
} = props;
const isSourceOpen = useSelector(getIsOneClickBindingOptionsVisibility);

View File

@ -147,7 +147,8 @@ const StyledTooltip = styled.span<{ width?: number }>`
text-align: left;
background-color: var(--ads-v2-color-bg-emphasis-max);
border-radius: var(--ads-v2-border-radius);
box-shadow: 0 2px 4px -2px rgba(0, 0, 0, 0.06),
box-shadow:
0 2px 4px -2px rgba(0, 0, 0, 0.06),
0 4px 8px -2px rgba(0, 0, 0, 0.1);
color: var(--ads-v2-color-fg-on-emphasis-max);
font-family: var(--ads-v2-font-family);

View File

@ -122,12 +122,12 @@ type BoundingRectTargets = Record<string, RefRectParams>;
const WalkthroughRenderer = ({
details,
offset,
targetId,
dismissOnOverlayClick,
eventParams = {},
multipleHighlights,
offset,
overlayColor,
dismissOnOverlayClick,
targetId,
}: FeatureParams) => {
const [boundingRects, setBoundingRects] =
useState<BoundingRectTargets | null>(null);

View File

@ -100,9 +100,8 @@ class DropDownControl extends BaseControl<DropDownControlProps> {
? this.props.evaluatedValue
: this.props.propertyValue;
selected = options.find(
(option) => option.value === computedValue,
)?.value;
selected = options.find((option) => option.value === computedValue)
?.value;
if (this.props.alwaysShowSelected && !selected) {
selected = computedValue;

View File

@ -113,7 +113,7 @@ class FieldConfigurationControl extends BaseControl<ControlProps, State> {
addNewField = () => {
if (this.isArrayItem()) return;
const { propertyValue = {}, propertyName, widgetProperties } = this.props;
const { propertyName, propertyValue = {}, widgetProperties } = this.props;
const { childStylesheet, widgetName } =
widgetProperties as JSONFormWidgetProps;
const schema: Schema = propertyValue;
@ -193,7 +193,7 @@ class FieldConfigurationControl extends BaseControl<ControlProps, State> {
};
render() {
const { propertyValue = {}, panelConfig } = this.props;
const { panelConfig, propertyValue = {} } = this.props;
const schema: Schema = propertyValue;
const schemaItems = Object.values(schema);

View File

@ -129,10 +129,13 @@ export class URLBuilder {
appParams.applicationVersion || this.appParams.applicationVersion;
}
if (pageParams) {
const params = pageParams.reduce((acc, page) => {
acc[page.pageId] = page;
return acc;
}, {} as Record<string, PageURLParams>);
const params = pageParams.reduce(
(acc, page) => {
acc[page.pageId] = page;
return acc;
},
{} as Record<string, PageURLParams>,
);
Object.assign(this.pageParams, params);
}
}
@ -196,12 +199,12 @@ export class URLBuilder {
*/
build(builderParams: URLBuilderParams, mode: APP_MODE = APP_MODE.EDIT) {
const {
branch,
hash = "",
pageId,
params = {},
persistExistingParams = false,
suffix,
pageId,
branch,
} = builderParams;
if (!pageId) {

View File

@ -42,7 +42,7 @@ type ResizableHandleProps = {
function ResizableHandle(props: ResizableHandleProps) {
const bind = useDrag(
({ first, last, dragging, movement: [mx, my], memo }) => {
({ dragging, first, last, memo, movement: [mx, my] }) => {
if (!props.allowResize) {
return;
}

View File

@ -168,9 +168,9 @@ type ResizableHandleProps = {
export function ResizableHandle(props: ResizableHandleProps) {
const bind = useDrag((state) => {
const {
dragging,
first,
last,
dragging,
memo,
movement: [mx, my],
} = state;

View File

@ -206,10 +206,8 @@ function WidgetsMultiSelectBox(props: {
left: (e.clientX - bounds.left) / props.snapColumnSpace,
};
const top = minBy(selectedWidgets, (rect) => rect.topRow)?.topRow;
const left = minBy(
selectedWidgets,
(rect) => rect.leftColumn,
)?.leftColumn;
const left = minBy(selectedWidgets, (rect) => rect.leftColumn)
?.leftColumn;
setDraggingState({
isDragging: true,
dragGroupActualParent: parentId || "",

View File

@ -102,11 +102,11 @@ export const ColorInput = (props: ColorInputProps) => {
useState<brandColorsKeys>("primary");
const {
className,
filter = () => true,
logEvent,
onChange,
tooltips,
value,
filter = () => true,
logEvent,
} = props;
const colorInputRef = useRef<HTMLInputElement>(null);

View File

@ -78,14 +78,13 @@ export const getSectionId = (
// "boxShadow" and "resetButtonStyles.boxShadow"
// The intendened match is "resetButtonStyles.boxShadow".
// So we aggregrate matches and find the best match which is the longest string
const bestMatchedSection = matchedSections.reduce(function (
sectiona,
sectionb,
) {
return sectiona.propertyName.length > sectionb.propertyName.length
? sectiona
: sectionb;
});
const bestMatchedSection = matchedSections.reduce(
function (sectiona, sectionb) {
return sectiona.propertyName.length > sectionb.propertyName.length
? sectiona
: sectionb;
},
);
return bestMatchedSection.id;
};

View File

@ -97,8 +97,9 @@ export const ACTION_PLUGIN_MAP: Array<ActionGroupConfig | undefined> = [
];
export const getActionConfig = (type: PluginType) =>
ACTION_PLUGIN_MAP.find((configByType: ActionGroupConfig | undefined) =>
configByType?.types.includes(type),
ACTION_PLUGIN_MAP.find(
(configByType: ActionGroupConfig | undefined) =>
configByType?.types.includes(type),
);
export const useNewActionName = () => {

View File

@ -188,10 +188,10 @@ export function MoreJSCollectionsMenu(props: EntityContextMenuProps) {
/>
</MenuTrigger>
<MenuContent avoidCollisions>
{options.map((option) => {
{options.map((option, index) => {
if (option.children) {
return (
<MenuSub>
<MenuSub key={index}>
<MenuSubTrigger startIcon={option.icon}>
{option.label}
</MenuSubTrigger>

View File

@ -46,10 +46,13 @@ import { useFeatureFlag } from "utils/hooks/useFeatureFlag";
import { FEATURE_FLAG } from "@appsmith/entities/FeatureFlag";
import { getHasCreateActionPermission } from "@appsmith/utils/BusinessFeatures/permissionPageHelpers";
const docsURLMap = recommendedLibraries.reduce((acc, lib) => {
acc[lib.url] = lib.docsURL;
return acc;
}, {} as Record<string, string>);
const docsURLMap = recommendedLibraries.reduce(
(acc, lib) => {
acc[lib.url] = lib.docsURL;
return acc;
},
{} as Record<string, string>,
);
const Library = styled.li`
list-style: none;

View File

@ -123,15 +123,17 @@ export const useAppWideAndOtherDatasource = () => {
const otherDatasourceInWorkspace = useOtherDatasourcesInWorkspace();
const appWideDS = useMemo(
() =>
[...datasourcesUsedInApplication].sort((ds1, ds2) =>
ds1.name?.toLowerCase()?.localeCompare(ds2.name?.toLowerCase()),
[...datasourcesUsedInApplication].sort(
(ds1, ds2) =>
ds1.name?.toLowerCase()?.localeCompare(ds2.name?.toLowerCase()),
),
[datasourcesUsedInApplication],
);
const otherDS = useMemo(
() =>
[...otherDatasourceInWorkspace].sort((ds1, ds2) =>
ds1.name?.toLowerCase()?.localeCompare(ds2.name?.toLowerCase()),
[...otherDatasourceInWorkspace].sort(
(ds1, ds2) =>
ds1.name?.toLowerCase()?.localeCompare(ds2.name?.toLowerCase()),
),
[otherDatasourceInWorkspace],
);
@ -249,8 +251,9 @@ export const usePageIds = (searchKeyword?: string) => {
};
export const useEntityUpdateState = (entityId: string) => {
return useSelector((state: AppState) =>
get(state, "ui.explorer.entity.updatingEntity")?.includes(entityId),
return useSelector(
(state: AppState) =>
get(state, "ui.explorer.entity.updatingEntity")?.includes(entityId),
);
};

View File

@ -104,14 +104,14 @@ export default (props: PopperProps) => {
const {
boundaryParent = "viewport",
isDraggable = false,
cypressSelectorDragHandle,
disablePopperEvents = false,
isDraggable = false,
onPositionChange = onPositionChangeFn,
position,
renderDragBlock,
onPositionChange = onPositionChangeFn,
themeMode = props.themeMode || ThemeMode.LIGHT,
renderDragBlockPositions,
cypressSelectorDragHandle,
themeMode = props.themeMode || ThemeMode.LIGHT,
} = props;
// Memoizing to avoid rerender of draggable icon.

View File

@ -147,11 +147,11 @@ interface AddDeployKeyProps {
}
function AddDeployKey({
connectLoading = false,
errorData,
isImport = false,
onChange = noop,
value = {},
isImport = false,
errorData,
connectLoading = false,
}: AddDeployKeyProps) {
const isModalOpen = useSelector(getIsGitSyncModalOpen);
const [fetched, setFetched] = useState(false);

View File

@ -66,9 +66,9 @@ interface ChooseGitProviderProps {
}
function ChooseGitProvider({
isImport = false,
onChange = noop,
value = {},
isImport = false,
}: ChooseGitProviderProps) {
const workspace = useSelector(getCurrentAppWorkspace);
const isMobile = useIsMobileDevice();

View File

@ -44,9 +44,9 @@ interface GenerateSSHProps {
}
function GenerateSSH({
errorData,
onChange = noop,
value = {},
errorData,
}: GenerateSSHProps) {
const [isTouched, setIsTouched] = useState(false);
const isInvalid =

View File

@ -77,9 +77,9 @@ interface StepsProps {
}
function Steps({
steps = [],
activeKey,
onActiveKeyChange = noop,
steps = [],
}: StepsProps) {
const activeIndex = steps.findIndex((s) => s.key === activeKey);

View File

@ -21,11 +21,11 @@ interface CopyButtonProps {
}
export function CopyButton({
value,
delay = 2000,
isDisabled = false,
onCopy = noop,
tooltipMessage,
isDisabled = false,
value,
}: CopyButtonProps) {
const timerRef = useRef<number>();
const [showCopied, setShowCopied] = useState(false);

View File

@ -27,9 +27,12 @@ export default function GitSyncStatusbar(props: StatusbarProps) {
}
} else {
if (percentage < 90) {
const interval = setInterval(() => {
setPercentage((percentage) => percentage + 10);
}, (period * 1000) / 9);
const interval = setInterval(
() => {
setPercentage((percentage) => percentage + 10);
},
(period * 1000) / 9,
);
return () => clearInterval(interval);
}
}

View File

@ -23,7 +23,7 @@ export const useSSHKeyPair = () => {
const [failedGeneratingSSHKey, setFailedGeneratingSSHKey] = useState(false);
const fetchSSHKeyPair = useCallback(
({ onSuccessCallback = noop, onErrorCallback = noop } = {}) => {
({ onErrorCallback = noop, onSuccessCallback = noop } = {}) => {
setIsFetchingSSHKeyPair(true);
dispatch(
getSSHKeyPair({
@ -44,7 +44,7 @@ export const useSSHKeyPair = () => {
const generateSSHKey = useCallback(
(
keyType = "ECDSA",
{ onSuccessCallback = noop, onErrorCallback = noop } = {},
{ onErrorCallback = noop, onSuccessCallback = noop } = {},
) => {
// if (currentApplication?.id) {
setIsGeneratingSSHKey(true);

View File

@ -52,7 +52,8 @@ export const IframeWrapper = styled.div`
iframe {
border-radius: 0px 0px 16px 16px;
box-shadow: 0px 20px 24px -4px rgba(16, 24, 40, 0.1),
box-shadow:
0px 20px 24px -4px rgba(16, 24, 40, 0.1),
0px 8px 8px -4px rgba(16, 24, 40, 0.04);
width: 100%;
height: 734px;

View File

@ -33,7 +33,8 @@ const CheckmarkWrapper = styled.div<{ $height: string; $width: string }>`
stroke-miterlimit: 10;
margin: 10% auto;
box-shadow: inset 0px 0px 0px #7ac142;
animation: fill 0.4s ease-in-out 0.4s forwards,
animation:
fill 0.4s ease-in-out 0.4s forwards,
scale 0.3s ease-in-out 0.9s both;
}

View File

@ -47,9 +47,9 @@ export default function AuthMessage(props: AuthMessageProps) {
calloutType = "error",
datasource,
description,
isInViewMode = false,
pageId,
style = {},
isInViewMode = false,
} = props;
const dispatch = useDispatch();
const pluginType = useSelector((state: AppState) =>

View File

@ -134,20 +134,20 @@ function DatasourceAuth({
],
formData,
getSanitizedFormData,
isFormDirty,
isInsideReconnectModal,
isInvalid,
pageId: pageIdProp = "",
pluginType,
pluginName,
pluginPackageName,
isSaving,
isTesting,
viewMode,
onCancel,
pageId: pageIdProp = "",
pluginName,
pluginPackageName,
pluginType,
scopeValue,
shouldDisplayAuthMessage = true,
triggerSave,
isFormDirty,
scopeValue,
isInsideReconnectModal,
onCancel,
viewMode,
}: Props) {
const shouldRender = !viewMode || isInsideReconnectModal;
const authType =

View File

@ -27,7 +27,7 @@ export const lintOptions = (globalData: Record<string, boolean>) =>
// global values
globals: globalData,
loopfunc: true,
} as LintOptions);
}) as LintOptions;
export const JS_OBJECT_START_STATEMENT = "export default";
export const INVALID_JSOBJECT_START_STATEMENT = `JSObject must start with '${JS_OBJECT_START_STATEMENT}'`;
export const INVALID_JSOBJECT_START_STATEMENT_ERROR_CODE =

View File

@ -318,9 +318,12 @@ class LintService {
}
function convertArrayToObject(arr: string[]) {
return arr.reduce((acc, item) => {
return { ...acc, [item]: true } as const;
}, {} as Record<string, true>);
return arr.reduce(
(acc, item) => {
return { ...acc, [item]: true } as const;
},
{} as Record<string, true>,
);
}
function filterDataPaths(paths: string[], entityTree: EntityTree) {

View File

@ -59,10 +59,13 @@ export const pageListReducer = createReducer(initialState, {
Array<{ pageId: string; dsl: DSL; userPermissions: string[] }>
>,
) => {
const pagePermissionsMap = action.payload.reduce((acc, page) => {
acc[page.pageId] = page.userPermissions;
return acc;
}, {} as Record<string, string[]>);
const pagePermissionsMap = action.payload.reduce(
(acc, page) => {
acc[page.pageId] = page.userPermissions;
return acc;
},
{} as Record<string, string[]>,
);
return {
...state,

View File

@ -12,7 +12,10 @@ import type {
} from "workers/Evaluation/fns/geolocationFns";
class GeoLocationError extends Error {
constructor(message: string, private responseData?: any) {
constructor(
message: string,
private responseData?: any,
) {
super(message);
}
}

View File

@ -301,9 +301,8 @@ export function* fetchActionsSaga(
{ mode: "EDITOR", appId: applicationId },
);
try {
const response: ApiResponse<Action[]> = yield ActionAPI.fetchActions(
applicationId,
);
const response: ApiResponse<Action[]> =
yield ActionAPI.fetchActions(applicationId);
const isValidResponse: boolean = yield validateResponse(response);
if (isValidResponse) {
yield put({
@ -727,9 +726,8 @@ export function* refactorActionName(
newName: newName,
});
const isRefactorSuccessful: boolean = yield validateResponse(
refactorResponse,
);
const isRefactorSuccessful: boolean =
yield validateResponse(refactorResponse);
const currentPageId: string = yield select(getCurrentPageId);

View File

@ -666,7 +666,7 @@ function* handleCreateNewApiActionSaga(
}>,
) {
const workspaceId: string = yield select(getCurrentWorkspaceId);
const { pageId, apiType = PluginPackageName.REST_API } = action.payload;
const { apiType = PluginPackageName.REST_API, pageId } = action.payload;
const pluginId: string = yield select(getPluginIdOfPackageName, apiType);
// Default Config is Rest Api Plugin Config
let defaultConfig = DEFAULT_CREATE_API_CONFIG;

View File

@ -74,9 +74,8 @@ export function* initAppTheming() {
export function* fetchAppThemes(action: ReduxAction<FetchAppThemesAction>) {
try {
const { applicationId } = action.payload;
const response: ApiResponse<AppTheme> = yield ThemingApi.fetchThemes(
applicationId,
);
const response: ApiResponse<AppTheme> =
yield ThemingApi.fetchThemes(applicationId);
yield put({
type: ReduxActionTypes.FETCH_APP_THEMES_SUCCESS,
@ -294,9 +293,8 @@ function* closeisBetaCardShown() {
*/
function* resetTheme() {
try {
const canvasWidgets: CanvasWidgetsReduxState = yield select(
getCanvasWidgets,
);
const canvasWidgets: CanvasWidgetsReduxState =
yield select(getCanvasWidgets);
const propertiesToUpdate: UpdateWidgetPropertyPayload[] =
getPropertiesToUpdateForReset(canvasWidgets);
@ -313,9 +311,8 @@ function* setDefaultSelectedThemeOnError() {
const applicationId: string = yield select(getCurrentApplicationId);
try {
// Fetch all system themes
const response: ApiResponse<AppTheme[]> = yield ThemingApi.fetchThemes(
applicationId,
);
const response: ApiResponse<AppTheme[]> =
yield ThemingApi.fetchThemes(applicationId);
// Gets default theme
const theme = find(response.data, { name: "Default" });

View File

@ -149,9 +149,8 @@ export function* updateLayoutSystemTypeSaga(
actionPayload: ReduxAction<LayoutSystemTypes>,
) {
try {
const currLayoutSystemType: LayoutSystemTypes = yield select(
getLayoutSystemType,
);
const currLayoutSystemType: LayoutSystemTypes =
yield select(getLayoutSystemType);
const payloadLayoutSystemType = actionPayload.payload;
if (currLayoutSystemType === payloadLayoutSystemType) return;
@ -194,9 +193,8 @@ export function* recalculateAutoLayoutColumnsAndSave(
widgets?: CanvasWidgetsReduxState,
) {
const layoutSystemType: LayoutSystemTypes = yield select(getLayoutSystemType);
const mainCanvasProps: MainCanvasReduxState = yield select(
getMainCanvasProps,
);
const mainCanvasProps: MainCanvasReduxState =
yield select(getMainCanvasProps);
yield put(
updateLayoutForMobileBreakpointAction(

View File

@ -72,9 +72,8 @@ export function* getCanvasSizeAfterWidgetMove(
let mainCanvasMinHeight;
let canvasParentMinHeight = canvasWidget.minHeight;
if (canvasWidgetId === MAIN_CONTAINER_WIDGET_ID) {
const mainCanvasProps: MainCanvasReduxState = yield select(
getMainCanvasProps,
);
const mainCanvasProps: MainCanvasReduxState =
yield select(getMainCanvasProps);
mainCanvasMinHeight = mainCanvasProps?.height;
} else if (canvasWidget.parentId) {
const parent: FlattenedWidgetProps = yield select(
@ -335,9 +334,8 @@ function* moveWidgetsSaga(
);
}
const layoutSystemType: LayoutSystemTypes = yield select(
getLayoutSystemType,
);
const layoutSystemType: LayoutSystemTypes =
yield select(getLayoutSystemType);
let updatedWidgets: CanvasWidgetsReduxState = { ...allWidgets };
if (layoutSystemType === LayoutSystemTypes.AUTO) {
/**

View File

@ -453,9 +453,8 @@ function* logDebuggerErrorAnalyticsSaga(
function* addDebuggerErrorLogsSaga(action: ReduxAction<Log[]>) {
const errorLogs = action.payload;
const currentDebuggerErrors: Record<string, Log> = yield select(
getDebuggerErrors,
);
const currentDebuggerErrors: Record<string, Log> =
yield select(getDebuggerErrors);
const appMode: ReturnType<typeof getAppMode> = yield select(getAppMode);
yield put(debuggerLogInit(errorLogs));
const validErrorLogs = errorLogs.filter((log) => log.source && log.id);
@ -585,9 +584,8 @@ function* deleteDebuggerErrorLogsSaga(
action: ReduxAction<{ id: string; analytics: Log["analytics"] }[]>,
) {
const { payload } = action;
const currentDebuggerErrors: Record<string, Log> = yield select(
getDebuggerErrors,
);
const currentDebuggerErrors: Record<string, Log> =
yield select(getDebuggerErrors);
const appMode: ReturnType<typeof getAppMode> = yield select(getAppMode);
const existingErrorPayloads = payload.filter((item) =>
currentDebuggerErrors.hasOwnProperty(item.id),

View File

@ -130,16 +130,16 @@ export function* updateDataTreeHandler(
errors,
evalMetaUpdates = [],
evaluationOrder,
reValidatedPaths,
isCreateFirstTree = false,
isNewWidgetAdded,
jsUpdates,
jsVarsCreatedEvent,
logs,
removedPaths,
reValidatedPaths,
staleMetaIds,
undefinedEvalValuesMap,
unEvalUpdates,
jsVarsCreatedEvent,
updates,
} = evalTreeResponse;
@ -243,12 +243,10 @@ export function* evaluateTreeSaga(
> = yield select(getAllActionValidationConfig);
const unevalTree = unEvalAndConfigTree.unEvalTree;
const widgets: ReturnType<typeof getWidgets> = yield select(getWidgets);
const metaWidgets: ReturnType<typeof getMetaWidgets> = yield select(
getMetaWidgets,
);
const theme: ReturnType<typeof getSelectedAppTheme> = yield select(
getSelectedAppTheme,
);
const metaWidgets: ReturnType<typeof getMetaWidgets> =
yield select(getMetaWidgets);
const theme: ReturnType<typeof getSelectedAppTheme> =
yield select(getSelectedAppTheme);
const toPrintConfigTree = unEvalAndConfigTree.configTree;
log.debug({ unevalTree, configTree: toPrintConfigTree });
PerformanceTracker.startAsyncTracking(
@ -600,9 +598,8 @@ function* evaluationChangeListenerSaga(): any {
evalQueueBuffer(),
);
while (true) {
const action: EvaluationReduxAction<unknown | unknown[]> = yield take(
evtActionChannel,
);
const action: EvaluationReduxAction<unknown | unknown[]> =
yield take(evtActionChannel);
yield call(evalAndLintingHandler, true, action, {
shouldReplay: get(action, "payload.shouldReplay"),

View File

@ -270,9 +270,8 @@ function* formEvaluationChangeListenerSaga() {
type: ReduxActionTypes.FORM_EVALUATION_EMPTY_BUFFER,
});
}
const action: ReduxAction<FormEvalActionPayload> = yield take(
formEvalChannel,
);
const action: ReduxAction<FormEvalActionPayload> =
yield take(formEvalChannel);
yield call(setFormEvaluationSagaAsync, action);
}
}

View File

@ -1072,9 +1072,8 @@ function* watchGitRequests() {
);
while (true) {
const { type, ...args }: ReduxAction<unknown> = yield take(
gitActionChannel,
);
const { type, ...args }: ReduxAction<unknown> =
yield take(gitActionChannel);
yield call(gitRequestActions[type], { type, ...args });
}
}

View File

@ -361,9 +361,8 @@ export function* refactorJSObjectName(
newName: newName,
});
const isRefactorSuccessful: boolean = yield validateResponse(
refactorResponse,
);
const isRefactorSuccessful: boolean =
yield validateResponse(refactorResponse);
const currentPageId: string | undefined = yield select(getCurrentPageId);

View File

@ -404,9 +404,8 @@ function* startInstallationRequestChannel() {
ReduxActionTypes.INSTALL_LIBRARY_INIT,
]);
while (true) {
const action: ReduxAction<Partial<TJSLibrary>> = yield take(
queueInstallChannel,
);
const action: ReduxAction<Partial<TJSLibrary>> =
yield take(queueInstallChannel);
yield put({
type: ReduxActionTypes.INSTALL_LIBRARY_START,
payload: action.payload.url,

View File

@ -568,9 +568,8 @@ function* handleRefactorJSActionNameSaga(
const refactorResponse: ApiResponse =
yield JSActionAPI.updateJSCollectionActionRefactor(requestData);
const isRefactorSuccessful: boolean = yield validateResponse(
refactorResponse,
);
const isRefactorSuccessful: boolean =
yield validateResponse(refactorResponse);
const currentPageId: string | undefined = yield select(getCurrentPageId);

View File

@ -109,9 +109,8 @@ export function* createModalSaga(action: ReduxAction<{ modalName: string }>) {
export function* showModalByNameSaga(
action: ReduxAction<{ modalName: string }>,
) {
const widgets: { [widgetId: string]: FlattenedWidgetProps } = yield select(
getWidgets,
);
const widgets: { [widgetId: string]: FlattenedWidgetProps } =
yield select(getWidgets);
const modal: FlattenedWidgetProps | undefined = Object.values(widgets).find(
(widget: FlattenedWidgetProps) =>
widget.widgetName === action.payload.modalName,

View File

@ -186,9 +186,8 @@ function* setCurrentStepSaga(action: ReduxAction<number>) {
function* setUpTourAppSaga() {
yield put(setPreviewModeAction(false));
// Delete the container widget
const widgets: { [widgetId: string]: FlattenedWidgetProps } = yield select(
getWidgets,
);
const widgets: { [widgetId: string]: FlattenedWidgetProps } =
yield select(getWidgets);
const containerWidget = Object.values(widgets).find(
(widget) => widget.type === "CONTAINER_WIDGET",
);
@ -281,9 +280,8 @@ function* addOnboardingWidget(action: ReduxAction<Partial<WidgetProps>>) {
// Wait for widget names to be updated
// Updating widget names here as widget blueprints don't take widget names
yield take(ReduxActionTypes.SAVE_PAGE_SUCCESS);
const widgets: { [widgetId: string]: FlattenedWidgetProps } = yield select(
getWidgets,
);
const widgets: { [widgetId: string]: FlattenedWidgetProps } =
yield select(getWidgets);
const nameInput = Object.values(widgets).find(
(widget) => widget.widgetName === "Input1",
@ -331,9 +329,8 @@ function* addOnboardingWidget(action: ReduxAction<Partial<WidgetProps>>) {
// Update button widget text
function* updateWidgetTextSaga() {
const widgets: { [widgetId: string]: FlattenedWidgetProps } = yield select(
getWidgets,
);
const widgets: { [widgetId: string]: FlattenedWidgetProps } =
yield select(getWidgets);
const buttonWidget = Object.values(widgets).find(
(widget) => widget.type === "BUTTON_WIDGET",
);
@ -373,9 +370,8 @@ function* endGuidedTourSaga(action: ReduxAction<boolean>) {
function* selectWidgetSaga(
action: ReduxAction<{ widgetName: string; propertyName?: string }>,
) {
const widgets: { [widgetId: string]: FlattenedWidgetProps } = yield select(
getWidgets,
);
const widgets: { [widgetId: string]: FlattenedWidgetProps } =
yield select(getWidgets);
const widget = Object.values(widgets).find((widget) => {
return widget.widgetName === action.payload.widgetName;
});

View File

@ -171,10 +171,13 @@ export function* fetchPageListSaga(
const response: FetchPageListResponse = yield call(apiCall, applicationId);
const isValidResponse: boolean = yield validateResponse(response);
const prevPagesState: Page[] = yield select(getPageList);
const pagePermissionsMap = prevPagesState.reduce((acc, page) => {
acc[page.pageId] = page.userPermissions ?? [];
return acc;
}, {} as Record<string, string[]>);
const pagePermissionsMap = prevPagesState.reduce(
(acc, page) => {
acc[page.pageId] = page.userPermissions ?? [];
return acc;
},
{} as Record<string, string[]>,
);
if (isValidResponse) {
const workspaceId = response.data.workspaceId;
const pages: Page[] = response.data.pages.map((page) => ({
@ -292,9 +295,8 @@ export function* handleFetchedPage({
isFirstLoad?: boolean;
}) {
const isAutoLayout: boolean = yield select(getIsAutoLayout);
const mainCanvasProps: MainCanvasReduxState = yield select(
getMainCanvasProps,
);
const mainCanvasProps: MainCanvasReduxState =
yield select(getMainCanvasProps);
const isValidResponse: boolean = yield validateResponse(fetchPageResponse);
const willPageBeMigrated = checkIfMigrationIsNeeded(fetchPageResponse);
const lastUpdatedTime = getLastUpdateTime(fetchPageResponse);
@ -705,9 +707,8 @@ export function* createNewPageFromEntity(
) {
try {
const isAutoLayout: boolean = yield select(getIsAutoLayout);
const mainCanvasProps: MainCanvasReduxState = yield select(
getMainCanvasProps,
);
const mainCanvasProps: MainCanvasReduxState =
yield select(getMainCanvasProps);
// Default layout is extracted by adding dynamically computed properties like min-height.
const defaultPageLayouts = [
{
@ -748,9 +749,8 @@ export function* createPageSaga(
try {
const guidedTourEnabled: boolean = yield select(inGuidedTour);
const isAutoLayout: boolean = yield select(getIsAutoLayout);
const mainCanvasProps: MainCanvasReduxState = yield select(
getMainCanvasProps,
);
const mainCanvasProps: MainCanvasReduxState =
yield select(getMainCanvasProps);
// Prevent user from creating a new page during the guided tour
if (guidedTourEnabled) {
@ -1130,9 +1130,8 @@ export function* setDataUrl() {
export function* fetchPageDSLSaga(pageId: string) {
try {
const isAutoLayout: boolean = yield select(getIsAutoLayout);
const mainCanvasProps: MainCanvasReduxState = yield select(
getMainCanvasProps,
);
const mainCanvasProps: MainCanvasReduxState =
yield select(getMainCanvasProps);
const fetchPageResponse: FetchPageResponse = yield call(PageApi.fetchPage, {
id: pageId,
});

View File

@ -222,9 +222,8 @@ export function* evalErrorHandler(
removedPaths?: Array<{ entityId: string; fullpath: string }>,
) {
if (dataTree && evaluationOrder && configTree && reValidatedPaths) {
const currentDebuggerErrors: Record<string, Log> = yield select(
getDebuggerErrors,
);
const currentDebuggerErrors: Record<string, Log> =
yield select(getDebuggerErrors);
const evalAndValidationOrder = new Set([
...reValidatedPaths,

View File

@ -124,9 +124,8 @@ export function* fetchProvidersWithCategorySaga(
) {
try {
const request: FetchProviderWithCategoryRequest = action.payload;
const response: Providers = yield ProvidersApi.fetchProvidersWithCategory(
request,
);
const response: Providers =
yield ProvidersApi.fetchProvidersWithCategory(request);
const isValidResponse: boolean = yield validateResponse(response);

View File

@ -342,9 +342,8 @@ function* handleQueryCreatedSaga(actionPayload: ReduxAction<QueryAction>) {
actionPayload.payload;
const pageId: string = yield select(getCurrentPageId);
if (pluginType !== PluginType.DB && pluginType !== PluginType.REMOTE) return;
const pluginTemplates: Record<string, unknown> = yield select(
getPluginTemplates,
);
const pluginTemplates: Record<string, unknown> =
yield select(getPluginTemplates);
const queryTemplate = pluginTemplates[pluginId];
// Do not show template view if the query has body(code) or if there are no templates or if the plugin is MongoDB
const showTemplate = !(

View File

@ -84,9 +84,8 @@ function* restoreApplicationFromSnapshotSaga() {
applicationId,
});
const currentLayoutSystemType: LayoutSystemTypes = yield select(
getLayoutSystemType,
);
const currentLayoutSystemType: LayoutSystemTypes =
yield select(getLayoutSystemType);
const isValidResponse: boolean = yield validateResponse(
response,
@ -170,9 +169,8 @@ export function* deleteApplicationSnapshotSaga() {
//Saga to update snapshot details by fetching info from backend
function* updateSnapshotDetailsSaga() {
try {
const snapShotDetails: { updatedTime: Date } | undefined = yield call(
fetchSnapshotSaga,
);
const snapShotDetails: { updatedTime: Date } | undefined =
yield call(fetchSnapshotSaga);
yield put(
updateSnapshotDetails(
snapShotDetails && snapShotDetails.updatedTime

View File

@ -122,9 +122,8 @@ function* deleteTabChildSaga(
function* deleteSagaInit(deleteAction: ReduxAction<WidgetDelete>) {
const { widgetId } = deleteAction.payload;
const selectedWidget: FlattenedWidgetProps | undefined = yield select(
getSelectedWidget,
);
const selectedWidget: FlattenedWidgetProps | undefined =
yield select(getSelectedWidget);
const selectedWidgets: string[] = yield select(getSelectedWidgets);
const guidedTourEnabled: boolean = yield select(inGuidedTour);
const isExploring: boolean = yield select(isExploringSelector);
@ -209,9 +208,8 @@ function* deleteSaga(deleteAction: ReduxAction<WidgetDelete>) {
const { disallowUndo, isShortcut } = deleteAction.payload;
if (!widgetId) {
const selectedWidget: FlattenedWidgetProps | undefined = yield select(
getSelectedWidget,
);
const selectedWidget: FlattenedWidgetProps | undefined =
yield select(getSelectedWidget);
if (!selectedWidget) return;
// if widget is not deletable, don't do anything

View File

@ -209,9 +209,8 @@ export function* resizeSaga(resizeAction: ReduxAction<WidgetResize>) {
widgetId,
} = resizeAction.payload;
const layoutSystemType: LayoutSystemTypes = yield select(
getLayoutSystemType,
);
const layoutSystemType: LayoutSystemTypes =
yield select(getLayoutSystemType);
const mainCanvasWidth: number = yield select(getCanvasWidth);
widget = {
...widget,
@ -689,7 +688,7 @@ export function* getPropertiesUpdatedWidget(
) {
const { dynamicUpdates, updates, widgetId } = updatesObj;
const { modify = {}, remove = [], postUpdateAction, triggerPaths } = updates;
const { modify = {}, postUpdateAction, remove = [], triggerPaths } = updates;
const stateWidget: WidgetProps = yield select(getWidget, widgetId);
@ -990,9 +989,8 @@ function* createSelectedWidgetsCopy(
* @returns
*/
function* copyWidgetSaga(action: ReduxAction<{ isShortcut: boolean }>) {
const allWidgets: { [widgetId: string]: FlattenedWidgetProps } = yield select(
getWidgets,
);
const allWidgets: { [widgetId: string]: FlattenedWidgetProps } =
yield select(getWidgets);
const selectedWidgets: string[] = yield select(getSelectedWidgets);
if (!selectedWidgets) {
toast.show(createMessage(ERROR_WIDGET_COPY_NO_WIDGET_SELECTED), {
@ -1834,9 +1832,8 @@ function* pasteWidgetSaga(
!flexLayers ||
flexLayers.length <= 0)
) {
const metaProps: Record<string, any> = yield select(
getWidgetsMeta,
);
const metaProps: Record<string, any> =
yield select(getWidgetsMeta);
if (widget.widgetId === widgetIdMap[copiedWidget.widgetId])
widgets = pasteWidgetInFlexLayers(
widgets,
@ -1955,9 +1952,8 @@ function* pasteWidgetSaga(
}
function* cutWidgetSaga() {
const allWidgets: { [widgetId: string]: FlattenedWidgetProps } = yield select(
getWidgets,
);
const allWidgets: { [widgetId: string]: FlattenedWidgetProps } =
yield select(getWidgets);
const selectedWidgets: string[] = yield select(getSelectedWidgets);
if (!selectedWidgets) {
toast.show(createMessage(ERROR_WIDGET_CUT_NO_WIDGET_SELECTED), {

View File

@ -671,13 +671,11 @@ export const getSelectedWidgetWhenPasting = function* () {
const { widgets: copiedWidgetGroups }: { widgets: CopiedWidgetGroup[] } =
yield getCopiedWidgets();
let selectedWidget: FlattenedWidgetProps | undefined = yield select(
getSelectedWidget,
);
let selectedWidget: FlattenedWidgetProps | undefined =
yield select(getSelectedWidget);
const focusedWidget: FlattenedWidgetProps | undefined = yield select(
getFocusedWidget,
);
const focusedWidget: FlattenedWidgetProps | undefined =
yield select(getFocusedWidget);
selectedWidget = getSelectedWidgetIfPastingIntoListWidget(
canvasWidgets,
@ -1490,9 +1488,8 @@ export function getNextWidgetName(
* @returns
*/
export function* createWidgetCopy(widget: FlattenedWidgetProps) {
const allWidgets: { [widgetId: string]: FlattenedWidgetProps } = yield select(
getWidgets,
);
const allWidgets: { [widgetId: string]: FlattenedWidgetProps } =
yield select(getWidgets);
const widgetsToStore = getAllWidgetsInTree(widget.widgetId, allWidgets);
return {
widgetId: widget.widgetId,

View File

@ -56,10 +56,10 @@ import { APP_MODE } from "entities/App";
function* selectWidgetSaga(action: ReduxAction<WidgetSelectionRequestPayload>) {
try {
const {
payload = [],
selectionRequestType,
invokedBy,
pageId,
payload = [],
selectionRequestType,
} = action.payload;
if (payload.some(isInvalidSelectionRequest)) {

View File

@ -243,9 +243,8 @@ export function* updateWidgetAutoHeightSaga(
// Get the canvas level map from the store
// This map tells us the nesting of each canvas widget in the DSL.
// MainContainer's level is 0.
const canvasLevelMap: CanvasLevelsReduxState = yield select(
getCanvasLevelMap,
);
const canvasLevelMap: CanvasLevelsReduxState =
yield select(getCanvasLevelMap);
// 1. Get all siblings together.
// Get all updates for that level.

View File

@ -184,11 +184,14 @@ export const getCurrentPageDescription = createSelector(
);
export const selectPageSlugToIdMap = createSelector(getPageList, (pages) =>
pages.reduce((acc, page: Page) => {
// Comeback
acc[page.pageId] = page.slug || "";
return acc;
}, {} as Record<string, string>),
pages.reduce(
(acc, page: Page) => {
// Comeback
acc[page.pageId] = page.slug || "";
return acc;
},
{} as Record<string, string>,
),
);
export const getCurrentApplication = (state: AppState) =>

View File

@ -12,8 +12,10 @@ export const lightTheme = { ...theme, colors: { ...theme.colors, ...light } };
const darkTheme = { ...theme, colors: { ...theme.colors, ...dark } };
// Only for usage with ThemeProvider
export const getThemeDetails = (state: AppState, themeMode: ThemeMode): Theme =>
themeMode === ThemeMode.LIGHT ? lightTheme : darkTheme;
export const getThemeDetails = (
state: AppState,
themeMode: ThemeMode,
): Theme => (themeMode === ThemeMode.LIGHT ? lightTheme : darkTheme);
export const getTheme = (themeMode: ThemeMode) => {
const colors = themeMode === ThemeMode.LIGHT ? light : dark;

View File

@ -109,11 +109,11 @@ export const useWidgetDragResize = () => {
),
setDraggingState: useCallback(
({
isDragging,
dragGroupActualParent = "",
draggingGroupCenter = {},
startPoints,
draggedOn,
draggingGroupCenter = {},
dragGroupActualParent = "",
isDragging,
startPoints,
}: {
isDragging: boolean;
dragGroupActualParent?: string;

View File

@ -716,15 +716,15 @@ export const initAppKbState = async (
const appKbState = {
checksum,
pageSlugs: pageSlugs.reduce((acc, pageSlug) => {
acc[pageSlug] = {
hasReacted: false,
};
return acc;
}, {} as Record<string, { hasReacted: boolean }>) as Record<
string,
{ hasReacted: boolean }
>,
pageSlugs: pageSlugs.reduce(
(acc, pageSlug) => {
acc[pageSlug] = {
hasReacted: false,
};
return acc;
},
{} as Record<string, { hasReacted: boolean }>,
) as Record<string, { hasReacted: boolean }>,
};
aiKBApplicationMap[appId] = appKbState;

View File

@ -7,16 +7,15 @@ const StyledContainer = styled.div<ContainerProps>`
height: 100%;
position: relative;
${({ maxWidth, minHeight, minWidth }) =>
css`
& [data-button] {
display: flex;
width: auto;
${minWidth ? `min-width: ${minWidth}px;` : ""}
${minHeight ? `min-height: ${minHeight}px;` : ""}
${({ maxWidth, minHeight, minWidth }) => css`
& [data-button] {
display: flex;
width: auto;
${minWidth ? `min-width: ${minWidth}px;` : ""}
${minHeight ? `min-height: ${minHeight}px;` : ""}
${maxWidth ? `max-width: ${maxWidth}px;` : ""}
}
`}
}
`}
.grecaptcha-badge {
visibility: hidden;

View File

@ -19,12 +19,12 @@ export function RecaptchaV2(props: RecaptchaV2Props) {
props.handleRecaptchaV2Loading && props.handleRecaptchaV2Loading(isloading);
};
const {
isLoading,
isDisabled,
recaptchaKey,
onRecaptchaSubmitSuccess,
onRecaptchaSubmitError = noop,
isLoading,
onPress: onClickProp,
onRecaptchaSubmitError = noop,
onRecaptchaSubmitSuccess,
recaptchaKey,
} = props;
const onClick = () => {
if (isDisabled) return onClickProp;

View File

@ -17,10 +17,10 @@ export function RecaptchaV3(props: RecaptchaV3Props) {
};
const {
recaptchaKey,
onPress: onClickProp,
onRecaptchaSubmitSuccess,
onRecaptchaSubmitError = noop,
onRecaptchaSubmitSuccess,
recaptchaKey,
} = props;
const onClick: ButtonComponentProps["onPress"] = () => {

View File

@ -101,8 +101,8 @@ export const PopoverStyles = createGlobalStyle<{
}
.${props.portalClassName} .${Classes.INPUT}:focus, .${
props.portalClassName
} .${Classes.INPUT}:active {
props.portalClassName
} .${Classes.INPUT}:active {
border: 1px solid ${props.accentColor} !important;
box-shadow: 0px 0px 0px 2px ${lightenColor(props.accentColor)} !important;
}

View File

@ -66,8 +66,8 @@ export const PopoverStyles = createGlobalStyle<{
}
.${props.portalClassName} .${Classes.INPUT}:focus, .${
props.portalClassName
} .${Classes.INPUT}:active {
props.portalClassName
} .${Classes.INPUT}:active {
border: 1px solid ${props.accentColor} !important;
}

View File

@ -61,8 +61,8 @@ export const PopoverStyles = createGlobalStyle<{
}
.${props.portalClassName} .${Classes.INPUT}:focus, .${
props.portalClassName
} .${Classes.INPUT}:active {
props.portalClassName
} .${Classes.INPUT}:active {
border: 1px solid ${props.accentColor} !important;
box-shadow: 0px 0px 0px 3px ${lightenColor(
props.accentColor,

View File

@ -40,11 +40,14 @@ export type FieldTypeKey = keyof typeof FieldType;
export const inverseFieldType = Object.entries(FieldType).reduce<
Record<FieldType, FieldTypeKey>
>((previousValue, currentValue) => {
const [key, value] = currentValue;
previousValue[value] = key as FieldTypeKey;
return previousValue;
}, {} as Record<FieldType, FieldTypeKey>);
>(
(previousValue, currentValue) => {
const [key, value] = currentValue;
previousValue[value] = key as FieldTypeKey;
return previousValue;
},
{} as Record<FieldType, FieldTypeKey>,
);
export enum DataType {
STRING = "string",

View File

@ -367,7 +367,7 @@ class SchemaParser {
* @param schema Previous generated schema if present.
*/
static parse = (widgetName: string, options: ParseOptions) => {
const { currSourceData, schema = {}, fieldThemeStylesheets } = options;
const { currSourceData, fieldThemeStylesheets, schema = {} } = options;
if (!currSourceData)
return { schema, modifiedSchemaItems: {}, removedSchemaItems: [] };
@ -709,9 +709,9 @@ class SchemaParser {
static convertObjectToSchema = ({
baseSchemaPath,
currSourceData,
removedSchemaItems,
modifiedSchemaItems,
prevSchema = {},
removedSchemaItems,
sourceDataPath,
...rest
}: Omit<ParserOptions, "identifier">): Schema => {

View File

@ -270,9 +270,10 @@ class JSONFormWidget extends BaseWidget<
(column) => `${column.name}`,
);
modify = {
sourceData: `{{_.pick(${
formConfig?.otherFields?.defaultValues
},${selectedColumnNames.map((name) => `'${name}'`).join(",")})}}`,
sourceData: `{{_.pick(${formConfig?.otherFields
?.defaultValues},${selectedColumnNames
.map((name) => `'${name}'`)
.join(",")})}}`,
title: `Update Row ${primaryKey} {{${formConfig?.otherFields?.defaultValues}.${primaryKey}}}`,
onSubmit: queryConfig?.update.run,
};

View File

@ -914,8 +914,8 @@ class MetaWidgetGenerator {
}
return newObj;
})(${metaContainerName}.data, ${JSON.stringify(
BLACKLISTED_ENTITY_DEFINITION_IN_LEVEL_DATA[type],
)} )
BLACKLISTED_ENTITY_DEFINITION_IN_LEVEL_DATA[type],
)} )
}}`,
},
},
@ -1665,8 +1665,8 @@ class MetaWidgetGenerator {
// "Input1: { value: List1_Input1_1.value, text: List1_Input1_1.text }"
dependantBinding[templateWidgetName] = `
${templateWidgetName}: {${
dependantMetaWidget?.entityDefinition || ""
}}
dependantMetaWidget?.entityDefinition || ""
}}
`;
}
});

Some files were not shown because too many files have changed in this diff Show More