Skip to content

Commit

Permalink
code review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Pawan Kumar authored and Pawan Kumar committed May 16, 2024
1 parent 3377b22 commit 54647df
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RecaptchaTypes } from "components/constants";
import { COLORS, BUTTON_VARIANTS } from "@design-system/widgets";
import { COLORS, BUTTON_VARIANTS, objectKeys } from "@design-system/widgets";
import { ResponsiveBehavior } from "layoutSystems/common/utils/constants";
import {
BUTTON_WIDGET_DEFAULT_LABEL,
Expand All @@ -9,7 +9,7 @@ import {
export const defaultsConfig = {
animateLoading: true,
text: createMessage(BUTTON_WIDGET_DEFAULT_LABEL),
buttonVariant: BUTTON_VARIANTS.filled,
buttonVariant: objectKeys(BUTTON_VARIANTS)[0],
buttonColor: COLORS.accent,
widgetName: "Button",
isDisabled: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const propertyPaneStyleConfig = [
type: ValidationTypes.TEXT,
params: {
allowedValues: objectKeys(BUTTON_VARIANTS),
default: BUTTON_VARIANTS.filled,
default: objectKeys(BUTTON_VARIANTS)[0],
},
},
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { BUTTON_VARIANTS, COLORS } from "@design-system/widgets";
import { BUTTON_VARIANTS, COLORS, objectKeys } from "@design-system/widgets";
import { ResponsiveBehavior } from "layoutSystems/common/utils/constants";

export const defaultsConfig = {
iconName: "plus",
buttonVariant: BUTTON_VARIANTS.filled,
buttonVariant: objectKeys(BUTTON_VARIANTS)[0],
buttonColor: COLORS.accent,
isDisabled: false,
isVisible: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const propertyPaneStyleConfig = [
type: ValidationTypes.TEXT,
params: {
allowedValues: objectKeys(BUTTON_VARIANTS),
default: BUTTON_VARIANTS.filled,
default: objectKeys(BUTTON_VARIANTS)[0],
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const propertyPaneContentConfig = [
type: ValidationTypes.TEXT,
params: {
allowedValues: objectKeys(BUTTON_VARIANTS),
default: BUTTON_VARIANTS.filled,
default: objectKeys(BUTTON_VARIANTS)[0],
},
},
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { BUTTON_VARIANTS, COLORS } from "@design-system/widgets";
import { BUTTON_VARIANTS, COLORS, objectKeys } from "@design-system/widgets";
import type { WidgetDefaultProps } from "WidgetProvider/constants";

export const defaultsConfig = {
label: "Open The Menu…",
triggerButtonVariant: BUTTON_VARIANTS.filled,
triggerButtonVariant: objectKeys(BUTTON_VARIANTS)[0],
triggerButtonColor: COLORS.accent,
isCompact: false,
isDisabled: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const propertyPaneStyleConfig = [
type: ValidationTypes.TEXT,
params: {
allowedValues: objectKeys(BUTTON_VARIANTS),
default: BUTTON_VARIANTS.filled,
default: objectKeys(BUTTON_VARIANTS)[0],
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,17 +168,15 @@ const HeaderCellComponent = (props: HeaderProps) => {
onDrop={onDrop}
style={
{
"--padding-inline-end": props.isAscOrder
? "calc((var(--outer-spacing-2) * 2) + (2 *var(--sizing-7)))"
: "calc((var(--outer-spacing-2) * 2) + var(--sizing-7))",
"--padding-inline-end":
props.isAscOrder !== undefined
? "calc((var(--outer-spacing-2) * 2) + (2 *var(--sizing-7)))"
: "calc((var(--outer-spacing-2) * 2) + var(--sizing-7))",
justifyContent: column.columnProperties.horizontalAlignment,
} as React.CSSProperties
}
>
<Flex
alignItems="center"
gap="spacing-1"
justifyContent={column.columnProperties.horizontalAlignment}
>
<Flex alignItems="center" gap="spacing-1">
{isColumnEditable && <Icon name="edit" size="small" />}
<Text
lineClamp={1}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,15 @@
[data-column-type="text"],
[data-column-type="number"],
[data-column-type="url"],
[data-column-type="date"]
[data-column-type="date"],

) {
padding: var(--outer-spacing-4) var(--outer-spacing-3);
}

& [role="cell"]:is([data-column-type="button"]) {
align-items: center !important;
justify-content: center !important;
padding-inline: var(--outer-spacing-3);
}

@each $color in colors {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const GeneralStyle = {
label: BUTTON_VARIANTS[variant],
value: variant,
})),
defaultValue: BUTTON_VARIANTS.filled,
defaultValue: objectKeys(BUTTON_VARIANTS)[0],
isJSConvertible: true,
isBindProperty: true,
isTriggerProperty: false,
Expand All @@ -93,7 +93,7 @@ export const GeneralStyle = {
type: ValidationTypes.TEXT,
params: {
allowedValues: objectKeys(BUTTON_VARIANTS),
default: BUTTON_VARIANTS.filled,
default: objectKeys(BUTTON_VARIANTS)[0],
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export function getDefaultColumnProperties(
originalId: id,
id: sanitizedId,
alias: id,
horizontalAlignment: "start",
horizontalAlignment: columnType === ColumnTypes.NUMBER ? "end" : "start",
verticalAlignment: "center",
columnType: columnType || ColumnTypes.TEXT,
textColor: Colors.THUNDER,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BUTTON_VARIANTS, COLORS } from "@design-system/widgets";
import { BUTTON_VARIANTS, COLORS, objectKeys } from "@design-system/widgets";
import { ValidationTypes } from "constants/WidgetValidation";
import { capitalize } from "lodash";

Expand All @@ -12,8 +12,8 @@ export const propertyPaneStyleConfig = [
controlType: "ICON_TABS",
fullWidth: true,
helpText: "Sets the variant of the button",
options: Object.values(BUTTON_VARIANTS).map((variant) => ({
label: capitalize(variant),
options: objectKeys(BUTTON_VARIANTS).map((variant) => ({
label: BUTTON_VARIANTS[variant],
value: variant,
})),
isJSConvertible: true,
Expand All @@ -22,8 +22,8 @@ export const propertyPaneStyleConfig = [
validation: {
type: ValidationTypes.TEXT,
params: {
allowedValues: Object.values(BUTTON_VARIANTS),
default: BUTTON_VARIANTS.filled,
allowedValues: objectKeys(BUTTON_VARIANTS),
default: objectKeys(BUTTON_VARIANTS)[0],
},
},
},
Expand Down

0 comments on commit 54647df

Please sign in to comment.