Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1553 upgrade react hook form to v7530 #1556

Merged
merged 4 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"popmotion": "^11.0.3",
"rc-select": "14.1.0",
"rc-tree-select": "5.23.0",
"react-hook-form": "7.53.0",
"react-i18next": "^14.1.0",
"reactflow": "^11.6.0",
"uuid": "9.0.1"
Expand Down Expand Up @@ -121,7 +122,6 @@
"prosemirror-keymap": "^1.2.0",
"prosemirror-schema-list": "^1.2.2",
"react-grid-layout": "^1.3.4",
"react-hook-form": "^7.31.2",
"rollup-plugin-visualizer": "5.12.0",
"typescript": "^4.6.3",
"vite-plugin-static-copy": "^0.17.0"
Expand Down Expand Up @@ -183,7 +183,6 @@
"react": "^16.8.0 || 17.x || 18.x",
"react-dom": "^16.8.0 || 17.x || 18.x",
"react-grid-layout": "^1.3.4",
"react-hook-form": "^7.31.2",
"react-router-dom": "^6.3.0",
"react-virtual": "^2.10.4"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export function ReferenceLineField({ control, index, variableOptions }: IReferen
name={`reference_lines.${index}.variable_key`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<Select label={t('common.value')} required data={variableOptions} sx={{ flex: 1 }} {...field} />
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export function VizButtonEditor({ context }: VizConfigProps) {
<Controller
control={control}
name="variant"
// @ts-expect-error type of onChange
render={({ field }) => <Select label="Variant" data={variantOptions} {...field} />}
/>
<Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export function CalendarField({ control, watch }: ICalendarField) {
name="calendar.locale"
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<Select label={t('viz.calendar_heatmap.calendar.locale')} data={localeOptions} sx={{ flex: 1 }} {...field} />
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export function ReferenceAreaField({ control, index, variableOptions }: IReferen
name={`reference_areas.${index}.type`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<Select
label={t('chart.reference_area.type.label')}
required
Expand All @@ -57,7 +56,6 @@ export function ReferenceAreaField({ control, index, variableOptions }: IReferen
name={`reference_areas.${index}.direction`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<Select
label={t('chart.reference_area.direction.label')}
required
Expand All @@ -74,7 +72,6 @@ export function ReferenceAreaField({ control, index, variableOptions }: IReferen
name={`reference_areas.${index}.y_keys.upper`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<Select
label={t('chart.reference_area.boundary.upper')}
required
Expand All @@ -88,7 +85,6 @@ export function ReferenceAreaField({ control, index, variableOptions }: IReferen
name={`reference_areas.${index}.y_keys.lower`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<Select
label={t('chart.reference_area.boundary.lower')}
required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export function ReferenceLineField({ control, index, watch, variableOptions, yAx
name={`reference_lines.${index}.variable_key`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<Select label={t('common.data_field')} required data={variableOptions} sx={{ flex: 1 }} {...field} />
)}
/>
Expand Down Expand Up @@ -107,7 +106,6 @@ export function ReferenceLineField({ control, index, watch, variableOptions, yAx
name={`reference_lines.${index}.lineStyle.width`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<NumberInput label={t('chart.series.line.line_width')} min={1} max={10} sx={{ flexGrow: 1 }} {...field} />
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ export function RegressionField({ control, regressionItem, index, yAxisOptions }
name={`regressions.${index}.transform.config.method`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<Select
label={t('chart.regression_line.method.label')}
data={regressionOptions}
Expand All @@ -97,7 +96,6 @@ export function RegressionField({ control, regressionItem, index, yAxisOptions }
name={`regressions.${index}.transform.config.order`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<NumberInput label={t('chart.regression_line.method.polynomial_order')} sx={{ flex: 1 }} {...field} />
)}
/>
Expand All @@ -114,7 +112,6 @@ export function RegressionField({ control, regressionItem, index, yAxisOptions }
name={`regressions.${index}.plot.lineStyle.width`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<NumberInput label={t('chart.series.line.line_width')} min={1} max={10} sx={{ flexGrow: 1 }} {...field} />
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export function BarFields({ control, index, seriesItem }: IBarFields) {
name={`series.${index}.barGap`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<Select label={t('chart.series.bar.bar_gap.label')} data={barGapOptions} sx={{ flexGrow: 1 }} {...field} />
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export function LineFields({ control, index, seriesItem }: ILineFields) {
name={`series.${index}.lineStyle.width`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<NumberInput label={t('chart.series.line.line_width')} min={1} max={10} sx={{ flexGrow: 1 }} {...field} />
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export function SeriesItemField({ control, index, seriesItem, yAxisOptions }: IS
name={`series.${index}.type`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<SegmentedControl
data={[
{ label: t('chart.series.line.label'), value: 'line' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export function XAxisField({ control, watch }: IXAxisField) {
name="x_axis.type"
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<Select label={<XAxisTypeLabel />} required data={XAxisTypeOptions} sx={{ flex: 1 }} {...field} />
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export const SeriesItemField = ({ item, control, index, remove }: ISeriesItemFie
name={`series.${index}.min.value`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<NumberInput
disabled={!enable_min}
labelProps={{ display: 'block' }}
Expand Down Expand Up @@ -119,7 +118,6 @@ export const SeriesItemField = ({ item, control, index, remove }: ISeriesItemFie
name={`series.${index}.max.value`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<NumberInput
disabled={!enable_max}
labelProps={{ display: 'block' }}
Expand Down Expand Up @@ -162,7 +160,6 @@ export const SeriesItemField = ({ item, control, index, remove }: ISeriesItemFie
<Controller
name={`series.${index}.sort`}
control={control}
// @ts-expect-error type of onChange
render={({ field }) => <Select label={t('viz.funnel_chart.sort.label')} data={sortOptions} {...field} />}
/>
</Group>
Expand All @@ -177,7 +174,6 @@ export const SeriesItemField = ({ item, control, index, remove }: ISeriesItemFie
<Controller
name={`series.${index}.gap`}
control={control}
// @ts-expect-error type of onChange
render={({ field }) => <NumberInput placeholder="0, 5, 10..." label={t('viz.funnel_chart.gap')} {...field} />}
/>
</Group>
Expand All @@ -188,7 +184,6 @@ export const SeriesItemField = ({ item, control, index, remove }: ISeriesItemFie
name={`series.${index}.axisLabel.position`}
control={control}
render={({ field }) => (
// @ts-expect-error type error about undefined
<LabelPositionSelector
label={t('chart.label_position.label')}
options={positionOptions[orient]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export function HeatBlockField({ control, watch }: IHeatBlockField) {
name="heat_block.label.fontSize"
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<NumberInput size="xs" icon={<IconTextSize size={16} />} disabled={!showLabel} {...field} />
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export function ReferenceLineField({ control, index, watch, variableOptions, xAx
name={`reference_lines.${index}.variable_key`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<Select label={t('common.data_field')} required data={variableOptions} sx={{ flex: 1 }} {...field} />
)}
/>
Expand Down Expand Up @@ -75,7 +74,6 @@ export function ReferenceLineField({ control, index, watch, variableOptions, xAx
name={`reference_lines.${index}.xAxisIndex`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<Select
label={t('chart.x_axis.label')}
data={xAxisOptions}
Expand All @@ -98,7 +96,6 @@ export function ReferenceLineField({ control, index, watch, variableOptions, xAx
name={`reference_lines.${index}.lineStyle.width`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<NumberInput label={t('chart.series.line.line_width')} min={1} max={10} sx={{ flexGrow: 1 }} {...field} />
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export function BarFields({ control, index, seriesItem }: IBarFields) {
name={`series.${index}.barGap`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<Select label={t('chart.series.bar.bar_gap.label')} data={barGapOptions} sx={{ flexGrow: 1 }} {...field} />
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export function SeriesItemField({ control, index, seriesItem, xAxisOptions }: IS
name={`series.${index}.xAxisIndex`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<Select
label={t('chart.x_axis.label')}
data={xAxisOptions}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export function HeatBlockField({ control, watch }: IHeatBlockField) {
name="heat_block.label.fontSize"
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<NumberInput size="xs" icon={<IconTextSize size={16} />} disabled={!showLabel} {...field} />
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export function MetricField({ control, index, watch, variableOptions }: IProps)
name={`metrics.${index}.data_keys.value`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<Select
label={t('viz.merico_stats.metric.metric_data_field')}
required
Expand All @@ -52,7 +51,6 @@ export function MetricField({ control, index, watch, variableOptions }: IProps)
name={`metrics.${index}.data_keys.basis`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<Select
label={t('viz.merico_stats.metric.basis_data_field')}
required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export function ReferenceLineField({ control, index, watch, variableOptions, yAx
name={`reference_lines.${index}.variable_key`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<Select label={t('common.data_field')} required data={variableOptions} sx={{ flex: 1 }} {...field} />
)}
/>
Expand Down Expand Up @@ -102,7 +101,6 @@ export function ReferenceLineField({ control, index, watch, variableOptions, yAx
name={`reference_lines.${index}.lineStyle.width`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<NumberInput label={t('chart.series.line.line_width')} min={1} max={10} sx={{ flexGrow: 1 }} {...field} />
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export function RegressionField({ control, watch }: IRegressionField) {
name={`regression.transform.config.method`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<Select
label={t('chart.regression_line.method.label')}
data={regressionOptions}
Expand All @@ -62,7 +61,6 @@ export function RegressionField({ control, watch }: IRegressionField) {
name={`regression.transform.config.order`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<NumberInput label={t('chart.regression_line.method.polynomial_order')} sx={{ flex: 1 }} {...field} />
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export function XAxisField({ control, watch }: IXAxisField) {
name="x_axis.axisLabel.rotate"
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<NumberInput
label="旋转"
hideControls
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export const VizRichTextEditor = observer(({ context }: VizConfigProps) => {
name="content"
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<CustomRichTextEditor
{...field}
key={panel.id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export function ReferenceLineField({ control, index, watch, variableOptions, yAx
name={`reference_lines.${index}.variable_key`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<Select label={t('common.data_field')} required data={variableOptions} sx={{ flex: 1 }} {...field} />
)}
/>
Expand Down Expand Up @@ -105,7 +104,6 @@ export function ReferenceLineField({ control, index, watch, variableOptions, yAx
name={`reference_lines.${index}.lineStyle.width`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<NumberInput label={t('chart.series.line.line_width')} min={1} max={10} sx={{ flexGrow: 1 }} {...field} />
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export function TooltipField({ control, watch }: ITooltipField) {
name="tooltip.trigger"
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<Select
label={t('chart.tooltip.trigger.label')}
data={tooltipTriggerOptions}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export const LevelField = ({ control, index }: ILevelField) => {
name={`levels.${index}.label.show_label_tolerance`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<NumberInput
label={t('viz.sunburst_chart.label.show_label_tolerance')}
precision={4}
Expand All @@ -64,7 +63,6 @@ export const LevelField = ({ control, index }: ILevelField) => {
name={`levels.${index}.label.rotate`}
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<Select label={t('viz.sunburst_chart.label.rotate.label')} data={rotationOptions} {...field} />
)}
/>
Expand All @@ -91,7 +89,6 @@ export const LevelField = ({ control, index }: ILevelField) => {
<Controller
name={`levels.${index}.label.padding`}
control={control}
// @ts-expect-error type of onChange
render={({ field }) => <NumberInput label={t('chart.padding')} min={0} hideControls {...field} />}
/>
</Group>
Expand Down
4 changes: 2 additions & 2 deletions settings-form/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"i18next-browser-languagedetector": "^7.2.0",
"intl-pluralrules": "^2.0.1",
"monaco-editor": "0.52.0",
"react-hook-form": "7.53.0",
"react-i18next": "^14.1.0"
},
"devDependencies": {
Expand All @@ -61,7 +62,6 @@
"crypto-js": "^4.1.1",
"lodash": "^4.17.21",
"react": "^16.8.0 || 17.x || 18.x",
"react-dom": "^16.8.0 || 17.x || 18.x",
"react-hook-form": "^7.31.2"
"react-dom": "^16.8.0 || 17.x || 18.x"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export function AddDataSourceForm_DB({ submit, styles = defaultStyles, type }: I
name="config.port"
control={control}
render={({ field }) => (
// @ts-expect-error type of onChange
<NumberInput
mb={styles.spacing}
size={styles.size}
Expand Down
1 change: 1 addition & 0 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-helmet-async": "1.3.0",
"react-hook-form": "7.53.0",
"react-router-dom": "^6.3.0",
"react-virtual": "^2.10.4",
"socket.io-client": "^4.6.1"
Expand Down
Loading
Loading