Skip to content

Commit

Permalink
making sure that checksUi are defined
Browse files Browse the repository at this point in the history
  • Loading branch information
psychologianauki committed Aug 27, 2024
1 parent 73afebf commit 0d3e009
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ export const EditProfilingReferenceTable = ({
};

const onUpdateChecksUI = (
checksUI: any,
type: 'row' | 'column',
disabled?: boolean,
severity?: TSeverityValues
Expand All @@ -120,6 +119,7 @@ export const EditProfilingReferenceTable = ({
String(item.check_name).includes('column')
);
}

if (disabled !== undefined) {
selectedCheck.configured = disabled;
if (type === 'row') {
Expand Down Expand Up @@ -562,6 +562,7 @@ export const EditProfilingReferenceTable = ({
</div>
);
}
console.log(checksUI);

return (
<div className="text-sm">
Expand Down Expand Up @@ -626,7 +627,6 @@ export const EditProfilingReferenceTable = ({
}
showRowCount={showRowCount}
onUpdateChecksUI={onUpdateChecksUI}
checksUI={checksUI}
setIsUpdated={setIsUpdated}
tableComparisonResults={tableComparisonResults}
showColumnCount={showColumnCount}
Expand All @@ -644,7 +644,6 @@ export const EditProfilingReferenceTable = ({
onChange={onChangeCompareRowCount}
reference={reference}
onUpdateChecksUI={onUpdateChecksUI}
checksUI={checksUI}
type="row"
/>
) : (
Expand All @@ -666,7 +665,6 @@ export const EditProfilingReferenceTable = ({
onChange={onChangeCompareColumnCount}
reference={reference}
onUpdateChecksUI={onUpdateChecksUI}
checksUI={checksUI}
type="column"
/>
) : (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
import React from 'react';
import Input from '../../../Input';
import { CompareThresholdsModel, TableComparisonModel } from '../../../../api';
import Input from '../../../Input';
import { TSeverityValues } from './TableComparisonConstans';

type TSeverityInputBlock = {
onChange: (obj: Partial<CompareThresholdsModel>) => void;
reference: TableComparisonModel;
onUpdateChecksUI: (
checksUI: any,
type: 'row' | 'column',
disabled?: boolean,
severity?: TSeverityValues
) => void;
checksUI: any;
type: 'row' | 'column';
};

export default function SeverityInputBlock({
onChange,
reference,
onUpdateChecksUI,
checksUI,
type
}: TSeverityInputBlock) {
return (
Expand All @@ -40,7 +37,7 @@ export default function SeverityInputBlock({
? undefined
: Number(e.target.value)
});
onUpdateChecksUI(checksUI, type, undefined, {
onUpdateChecksUI(type, undefined, {
warning:
String(e.target.value).length === 0
? undefined
Expand All @@ -65,7 +62,7 @@ export default function SeverityInputBlock({
? undefined
: Number(e.target.value)
});
onUpdateChecksUI(checksUI, type, undefined, {
onUpdateChecksUI(type, undefined, {
error:
String(e.target.value).length === 0
? undefined
Expand All @@ -90,7 +87,7 @@ export default function SeverityInputBlock({
? undefined
: Number(e.target.value)
});
onUpdateChecksUI(checksUI, type, undefined, {
onUpdateChecksUI(type, undefined, {
fatal:
String(e.target.value).length === 0
? undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ interface TableRowProps {
>;
showRowCount: boolean;
onUpdateChecksUI: (
checksUI: any,
type: 'row' | 'column',
disabled?: boolean,
severity?: TSeverityValues
) => void;
checksUI: any;
setIsUpdated: React.Dispatch<React.SetStateAction<boolean>>;
tableComparisonResults: any;
showColumnCount: boolean;
Expand All @@ -33,7 +31,6 @@ const TableRow: React.FC<TableRowProps> = ({
settableLevelComparisonExtended,
showRowCount,
onUpdateChecksUI,
checksUI,
setIsUpdated,
tableComparisonResults,
showColumnCount,
Expand Down Expand Up @@ -88,7 +85,7 @@ const TableRow: React.FC<TableRowProps> = ({
<Checkbox
checked={showRowCount}
onChange={(checked) => {
onUpdateChecksUI(checksUI, 'row', checked);
onUpdateChecksUI('row', checked);
setIsUpdated(true);
}}
/>
Expand Down Expand Up @@ -121,7 +118,7 @@ const TableRow: React.FC<TableRowProps> = ({
<Checkbox
checked={showColumnCount}
onChange={(checked) => {
onUpdateChecksUI(checksUI, 'column', checked);
onUpdateChecksUI('column', checked);
setIsUpdated(true);
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ export const TableReferenceComparisons = ({
schema,
table
),
state: {},
state: {
checksUI
},
label: table
})
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
import { CheckResultOverviewApi } from '../../services/apiClient';
import { CheckTypes } from '../../shared/routes';
import { useDecodedParams } from '../../utils';
import { table } from 'console';

const TableProfilingChecks = () => {
const {
Expand Down Expand Up @@ -98,9 +97,7 @@ const TableProfilingChecks = () => {
};

return (
<div
className=" flex flex-col overflow-x-auto overflow-y-hidden h-full"
>
<div className=" flex flex-col overflow-x-auto overflow-y-hidden h-full">
<TableActionGroup
shouldDelete={false}
onUpdate={onUpdate}
Expand Down

0 comments on commit 0d3e009

Please sign in to comment.