Skip to content

Commit 532787a

Browse files
committed
Merge branch 'main' of https://github.com/shesha-io/shesha-framework into derik/en/numberInput
2 parents 4a90ac3 + 36a24ac commit 532787a

File tree

109 files changed

+3610
-2159
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+3610
-2159
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: shesha-reactjs-build-test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
permissions:
9+
pull-requests: write
10+
contents: read
11+
12+
jobs:
13+
build-and-test:
14+
runs-on: ubuntu-latest
15+
defaults:
16+
run:
17+
working-directory: ./shesha-reactjs
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v3
21+
with:
22+
ref: ${{ github.event.pull_request.head.sha }}
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version: '20'
28+
cache: 'npm'
29+
30+
- name: Install dependencies
31+
run: npm ci
32+
33+
- name: Build
34+
id: build
35+
run: npm run build
36+

shesha-core/src/Shesha.Application/Startup/IShaApplicationModuleConfiguration.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Linq;
43
using System.Reflection;
5-
using System.Text;
6-
using System.Threading.Tasks;
74

85
namespace Shesha.Startup
96
{

shesha-functional-tests/adminportal/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"build-shesha": "echo \"Build Shesha\" && cd ../../shesha-reactjs && npm install && npm run build && npm pack && shx mv shesha-io-reactjs-*.tgz ../shesha-functional-tests/adminportal/shesha-local.tgz",
1010
"preinstall": "npm run build-shesha && npm install shesha-local.tgz --force",
1111
"export": "next export",
12-
"start": "cross-env NODE_ENV=production node --max-old-space-size=8192 server.js",
13-
"build:analyze": "cross-env ANALYZE=true npm run build",
12+
"start": "NODE_ENV=production node --max-old-space-size=8192 server.js",
13+
"build:analyze": "ANALYZE=true npm run build",
1414
"lint": "eslint src/**/*.ts{,x}",
1515
"lint-errors": "eslint src/**/*.ts{,x} --quiet",
1616
"prettier": "prettier --write **/*.{js,jsx,ts,tsx}",

shesha-reactjs/src/components/buttonGroupConfigurator/buttonGroupItem.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ export const ButtonGroupItem: FC<IButtonGroupItemProps> = ({ item, actionConfigu
4444
const actualItem = useActualContextData({ ...item, actionConfiguration });
4545

4646

47-
const { icon, label, tooltip, iconPosition, size, buttonType, borderColor, borderRadius, height, width, backgroundColor, fontSize, fontWeight, color, borderStyle, borderWidth, readOnly, block, danger } = actualItem;
47+
const { icon, label, tooltip, iconPosition, size, buttonType, borderColor, borderRadius,
48+
height, width, backgroundColor, fontSize, fontWeight, color, borderStyle, borderWidth,
49+
readOnly, block, danger } = actualItem;
4850

4951
const model = {
5052
...actualItem,
@@ -61,7 +63,6 @@ export const ButtonGroupItem: FC<IButtonGroupItemProps> = ({ item, actionConfigu
6163
borderRadius: addPx(borderRadius)
6264
};
6365

64-
const jsStyle = getStyle(model.style);
6566

6667
const prevStyles = migratePrevStyles(model, initialValues());
6768
const dimensions = prevStyles?.dimensions;
@@ -72,6 +73,7 @@ export const ButtonGroupItem: FC<IButtonGroupItemProps> = ({ item, actionConfigu
7273
const styling = JSON.parse(model.stylingBox || '{}');
7374

7475
const dimensionsStyles = useMemo(() => getSizeStyle(dimensions), [dimensions]);
76+
const jsStyle = useMemo(() => getStyle(model.style), [model.style]);
7577
const borderStyles = useMemo(() => getBorderStyle(border, jsStyle), [border, jsStyle]);
7678
const fontStyles = useMemo(() => getFontStyle(font), [font]);
7779
const [backgroundStyles, setBackgroundStyles] = useState({});
@@ -91,19 +93,19 @@ export const ButtonGroupItem: FC<IButtonGroupItemProps> = ({ item, actionConfigu
9193
return URL.createObjectURL(blob);
9294
}) : '';
9395

94-
const style = await getBackgroundStyle(background, jsStyle, storedImageUrl);
96+
const style = getBackgroundStyle(background, jsStyle, storedImageUrl);
9597
setBackgroundStyles(style);
9698
};
9799

98100
fetchStyles();
99-
}, [background]);
101+
}, [background, httpHeaders, backendUrl, jsStyle]);
100102

101103
const newStyles = {
102104
...dimensionsStyles,
103-
...borderStyles,
105+
...(['primary', 'default'].includes(item.buttonType) && borderStyles),
104106
...fontStyles,
105-
...backgroundStyles,
106-
...shadowStyles,
107+
...(['dashed', 'default'].includes(item.buttonType) && backgroundStyles),
108+
...(['primary', 'default'].includes(item.buttonType) && shadowStyles),
107109
...jsStyle,
108110
...stylingBoxAsCSS
109111
};

shesha-reactjs/src/components/buttonGroupConfigurator/itemSettings.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,14 @@ export const getItemSettings = (data) => {
124124
type: 'radio',
125125
parentId: "icon-position-s4gmBg31azZC0UjZjpfTm",
126126
buttonGroupOptions: [
127-
{ title: 'start', value: 'start', icon: 'LeftOutlined' },
128-
{ title: 'end', value: 'end', icon: 'RightOutlined' },
127+
{ title: 'Start', value: 'start', icon: 'LeftOutlined' },
128+
{ title: 'End', value: 'end', icon: 'RightOutlined' },
129129
],
130+
hidden: {
131+
_code: 'return !getSettingValue(data?.icon);',
132+
_mode: 'code',
133+
_value: false
134+
} as any
130135
},
131136
],
132137
readOnly: data.readOnly,
@@ -373,7 +378,7 @@ export const getItemSettings = (data) => {
373378
label: 'Border',
374379
labelAlign: 'right',
375380
ghost: true,
376-
hidden: { _code: 'return ["text", "link", "ghost"].includes(getSettingValue(data?.buttonType));', _mode: 'code', _value: false } as any,
381+
hidden: { _code: 'return ["dashed","text", "link", "ghost"].includes(getSettingValue(data?.buttonType));', _mode: 'code', _value: false } as any,
377382
parentId: 'styleRouter',
378383
collapsible: 'header',
379384
content: {

shesha-reactjs/src/components/chevron/styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { addPx } from '@/designer-components/_settings/utils';
12
import { createStyles } from '@/styles';
2-
import { addPx } from '../sectionSeparator/utils';
33

44
export const useStyles = createStyles(({ css, cx, prefixCls }, {height}) => {
55
const chevronButton = cx(`${prefixCls}-chevron-btn`, css`

shesha-reactjs/src/components/colorPicker/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ColorValueType } from 'antd/es/color-picker/interface';
44
import { Color } from 'antd/es/color-picker/color';
55
import type { ColorPickerProps } from 'antd';
66
import { SizeType } from 'antd/lib/config-provider/SizeContext';
7+
import { getStyle, pickStyleFromModel } from '@/index';
78

89
type Preset = Required<ColorPickerProps>['presets'][number];
910
type ColorFormat = ColorPickerProps['format'];
@@ -18,6 +19,8 @@ export interface IColorPickerProps {
1819
disabledAlpha?: boolean;
1920
readOnly?: boolean;
2021
size?: SizeType;
22+
style?: string;
23+
stylingBox?: string;
2124
}
2225

2326
const formatColor = (color: Color, format: ColorFormat) => {
@@ -31,7 +34,7 @@ const formatColor = (color: Color, format: ColorFormat) => {
3134
}
3235
};
3336

34-
export const ColorPicker: FC<IColorPickerProps> = ({ value, onChange, title, presets, showText, allowClear, disabledAlpha, readOnly, size }) => {
37+
export const ColorPicker: FC<IColorPickerProps> = ({ value, onChange, title, presets, showText, allowClear, disabledAlpha, readOnly, size, stylingBox, style}) => {
3538
const [format, setFormat] = useState<ColorFormat>('hex');
3639

3740
const handleChange = (value: Color) => {
@@ -46,6 +49,10 @@ export const ColorPicker: FC<IColorPickerProps> = ({ value, onChange, title, pre
4649
const onPanelClick = (event: React.MouseEvent<HTMLElement>) => {
4750
event.stopPropagation();
4851
};
52+
const styling = JSON.parse(stylingBox || '{}');
53+
const stylingBoxAsCSS = pickStyleFromModel(styling);
54+
55+
const jsStyle = getStyle(style);
4956

5057
return (
5158
<AntdColorPicker
@@ -57,6 +64,7 @@ export const ColorPicker: FC<IColorPickerProps> = ({ value, onChange, title, pre
5764
disabled={readOnly}
5865
onClear={handleClear}
5966
size={size}
67+
style={{...stylingBoxAsCSS, ...jsStyle}}
6068
value={value ?? ""}
6169
onChange={handleChange}
6270
presets={presets}

shesha-reactjs/src/components/dropdown/dropdown.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ export const Dropdown: FC<IDropdownProps> = ({
3636
const { globalState } = useGlobalState();
3737

3838
const selectedMode = mode === 'single' ? undefined : mode;
39-
;
4039
//quick fix not to default to empty string or null while working with multi-mode
4140
const defaultValue = Array.isArray(defaultVal)
4241
? defaultVal
@@ -166,7 +165,7 @@ export const Dropdown: FC<IDropdownProps> = ({
166165
style={{ borderWidth: '0px', ...style }}
167166
size={size}
168167
>
169-
{(dataSourceType === 'values' ? value : options).map((option, index) => (
168+
{(dataSourceType === 'values' ? (value ?? []) : options).map((option, index) => (
170169
<Select.Option key={index} value={option.value}>
171170
{option.label}
172171
</Select.Option>

shesha-reactjs/src/components/endpointsAutocomplete/endpointsAutocomplete.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export const EndpointsAutocomplete: FC<IEndpointsAutocompleteProps> = ({ readOnl
155155
return mode === 'endpoint'
156156
? (
157157
<Space.Compact style={{ width: "100%" }}>
158-
<VerbSelector verbs={props.availableHttpVerbs} onChange={onVerbChange} value={isApiEndpoint(props.value) ? props.value.httpVerb : null} />
158+
<VerbSelector verbs={props.availableHttpVerbs} onChange={onVerbChange} value={isApiEndpoint(props.value) ? props.value.httpVerb : null} size={props.size} />
159159
{autocomplete}
160160
</Space.Compact>
161161
)

shesha-reactjs/src/components/entityPicker/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { EllipsisOutlined } from '@ant-design/icons';
22
import { Button, Space, Select, Skeleton, ConfigProvider } from 'antd';
33
import { DefaultOptionType } from 'antd/lib/select';
4-
import _ from 'lodash';
54
import React, { useMemo, useRef, useState } from 'react';
65
import { useEntitySelectionData } from '@/utils/entity';
76
import ReadOnlyDisplayFormItem from '@/components/readOnlyDisplayFormItem';

0 commit comments

Comments
 (0)