+
{props.title}
-
+ {!props.hideStyledHr && (
+
+ )}
);
}
diff --git a/app/client/src/pages/Editor/PropertyPane/PropertyHelpLabel.tsx b/app/client/src/pages/Editor/PropertyPane/PropertyHelpLabel.tsx
index c5412f02f3..287979caf7 100644
--- a/app/client/src/pages/Editor/PropertyPane/PropertyHelpLabel.tsx
+++ b/app/client/src/pages/Editor/PropertyPane/PropertyHelpLabel.tsx
@@ -31,6 +31,7 @@ function PropertyHelpLabel(props: Props) {
}
disabled={!toolTipDefined}
hoverOpenDelay={200}
+ openOnTargetFocus={false}
position={Position.TOP}
>
{
messages: [""],
});
});
+ it("should get tested with number", () => {
+ const testValues = [
+ [
+ "1",
+ {
+ isValid: true,
+ parsed: "1",
+ messages: [""],
+ },
+ ],
+ [
+ 1,
+ {
+ isValid: true,
+ parsed: 1,
+ messages: [""],
+ },
+ ],
+ ];
+
+ testValues.forEach(([input, expected]) => {
+ expect(
+ defaultOptionValueValidation(input, {} as SelectWidgetProps, _),
+ ).toEqual(expected);
+ });
+ });
it("should get tested with simple string", () => {
const input = "green";
@@ -43,6 +69,40 @@ describe("defaultOptionValueValidation - ", () => {
messages: [""],
});
});
+ it("should get tested with valid strings", () => {
+ const testValues = [
+ [
+ "undefined",
+ {
+ isValid: true,
+ parsed: "undefined",
+ messages: [""],
+ },
+ ],
+ [
+ "null",
+ {
+ isValid: true,
+ parsed: "null",
+ messages: [""],
+ },
+ ],
+ [
+ "true",
+ {
+ isValid: true,
+ parsed: "true",
+ messages: [""],
+ },
+ ],
+ ];
+
+ testValues.forEach(([input, expected]) => {
+ expect(
+ defaultOptionValueValidation(input, {} as SelectWidgetProps, _),
+ ).toEqual(expected);
+ });
+ });
it("should get tested with invalid values", () => {
const testValues = [
@@ -52,7 +112,7 @@ describe("defaultOptionValueValidation - ", () => {
isValid: false,
parsed: {},
messages: [
- `value does not evaluate to type: string | { "label": "label1", "value": "value1" }`,
+ `value does not evaluate to type: string | number | { "label": "label1", "value": "value1" }`,
],
},
],
@@ -62,7 +122,7 @@ describe("defaultOptionValueValidation - ", () => {
isValid: false,
parsed: {},
messages: [
- `value does not evaluate to type: string | { "label": "label1", "value": "value1" }`,
+ `value does not evaluate to type: string | number | { "label": "label1", "value": "value1" }`,
],
},
],
@@ -72,7 +132,7 @@ describe("defaultOptionValueValidation - ", () => {
isValid: false,
parsed: {},
messages: [
- `value does not evaluate to type: string | { "label": "label1", "value": "value1" }`,
+ `value does not evaluate to type: string | number | { "label": "label1", "value": "value1" }`,
],
},
],
@@ -82,7 +142,7 @@ describe("defaultOptionValueValidation - ", () => {
isValid: false,
parsed: {},
messages: [
- `value does not evaluate to type: string | { "label": "label1", "value": "value1" }`,
+ `value does not evaluate to type: string | number | { "label": "label1", "value": "value1" }`,
],
},
],
@@ -94,7 +154,7 @@ describe("defaultOptionValueValidation - ", () => {
isValid: false,
parsed: {},
messages: [
- `value does not evaluate to type: string | { "label": "label1", "value": "value1" }`,
+ `value does not evaluate to type: string | number | { "label": "label1", "value": "value1" }`,
],
},
],
diff --git a/app/client/src/widgets/SelectWidget/widget/index.tsx b/app/client/src/widgets/SelectWidget/widget/index.tsx
index 369879053d..c0cef0d98e 100644
--- a/app/client/src/widgets/SelectWidget/widget/index.tsx
+++ b/app/client/src/widgets/SelectWidget/widget/index.tsx
@@ -11,12 +11,19 @@ import {
import { EvaluationSubstitutionType } from "entities/DataTree/dataTreeFactory";
import { MinimumPopupRows, GRID_DENSITY_MIGRATION_V1 } from "widgets/constants";
import { AutocompleteDataType } from "utils/autocomplete/TernServer";
-import { findIndex, isArray, isEqual, isNumber, isString } from "lodash";
+import {
+ findIndex,
+ isArray,
+ isEqual,
+ isNumber,
+ isString,
+ LoDashStatic,
+} from "lodash";
export function defaultOptionValueValidation(
value: unknown,
props: SelectWidgetProps,
- _: any,
+ _: LoDashStatic,
): ValidationResponse {
let isValid;
let parsed;
@@ -40,7 +47,10 @@ export function defaultOptionValueValidation(
*/
if (typeof value === "string") {
try {
- value = JSON.parse(value);
+ const parsedValue = JSON.parse(value);
+ if (_.isObject(parsedValue)) {
+ value = parsedValue;
+ }
} catch (e) {}
}
@@ -53,7 +63,7 @@ export function defaultOptionValueValidation(
} else {
isValid = false;
parsed = {};
- message = `value does not evaluate to type: string | { "label": "label1", "value": "value1" }`;
+ message = `value does not evaluate to type: string | number | { "label": "label1", "value": "value1" }`;
}
return {
diff --git a/app/server/appsmith-server/src/main/resources/features/init-flags.yml b/app/server/appsmith-server/src/main/resources/features/init-flags.yml
index 2f529bfac7..df1d9d0fc7 100644
--- a/app/server/appsmith-server/src/main/resources/features/init-flags.yml
+++ b/app/server/appsmith-server/src/main/resources/features/init-flags.yml
@@ -57,7 +57,7 @@ ff4j:
enable: true
description: Allow users to browse application templates and import them
flipstrategy:
- class: com.appsmith.server.featureflags.strategies.EmailBasedRolloutStrategy
+ class: org.ff4j.strategy.PonderationStrategy
param:
- - name: emailDomains
- value: appsmith.com
+ - name: weight
+ value: 1