Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrczarnas committed Nov 9, 2024
2 parents 8599eda + cceeaef commit 1bb143b
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,48 @@
import React, { useEffect, useState } from 'react';
import { useSelector } from 'react-redux';
import { CheckContainerModel, CheckResultsOverviewDataModel } from '../../api';
import Button from "../../components/Button";
import Button from '../../components/Button';
import DataQualityChecks from '../../components/DataQualityChecks';
import SvgIcon from '../../components/SvgIcon';
import { useActionDispatch } from '../../hooks/useActionDispatch';
import {
getTableMonitoringChecksModelFilter,
setTableUpdatedMonitoringChecksModelFilter
} from '../../redux/actions/table.actions';
import { getFirstLevelActiveTab, getFirstLevelState } from "../../redux/selectors";
import { CheckResultOverviewApi, TableApiClient } from "../../services/apiClient";
import { CheckTypes } from "../../shared/routes";
import {
getFirstLevelActiveTab,
getFirstLevelState
} from '../../redux/selectors';
import {
CheckResultOverviewApi,
TableApiClient
} from '../../services/apiClient';
import { CheckTypes } from '../../shared/routes';
import { useDecodedParams } from '../../utils';

const TableMonitoringChecksUIFilterView = () => {
const { checkTypes, connection: connectionName, schema: schemaName, table: tableName, timePartitioned, category, checkName }: { checkTypes: CheckTypes, connection: string, schema: string, table: string, timePartitioned: 'daily' | 'monthly', category: string, checkName: string } = useDecodedParams();
const { monitoringChecksUIFilter, isUpdatedMonitoringChecksUIFilter, loading } = useSelector(getFirstLevelState(checkTypes));
const {
checkTypes,
connection: connectionName,
schema: schemaName,
table: tableName,
timePartitioned,
category,
checkName
}: {
checkTypes: CheckTypes;
connection: string;
schema: string;
table: string;
timePartitioned: 'daily' | 'monthly';
category: string;
checkName: string;
} = useDecodedParams();
const {
monitoringChecksUIFilter,
isUpdatedMonitoringChecksUIFilter,
loading
} = useSelector(getFirstLevelState(checkTypes));
const dispatch = useActionDispatch();
const [checkResultsOverview, setCheckResultsOverview] = useState<
CheckResultsOverviewDataModel[]
Expand Down Expand Up @@ -50,7 +76,14 @@ const TableMonitoringChecksUIFilterView = () => {
checkName
)
);
}, [connectionName, schemaName, tableName, category, checkName]);
}, [
connectionName,
schemaName,
tableName,
category,
checkName,
firstLevelActiveTab
]);

const onUpdate = async () => {
setIsUpdating(true);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,48 @@
import React, { useEffect, useState } from 'react';
import { useSelector } from 'react-redux';
import { CheckContainerModel, CheckResultsOverviewDataModel } from '../../api';
import Button from "../../components/Button";
import Button from '../../components/Button';
import DataQualityChecks from '../../components/DataQualityChecks';
import SvgIcon from '../../components/SvgIcon';
import { useActionDispatch } from '../../hooks/useActionDispatch';
import {
getTablePartitionedChecksModelFilter,
setTableUpdatedPartitionedChecksModelFilter
} from '../../redux/actions/table.actions';
import { getFirstLevelActiveTab, getFirstLevelState } from "../../redux/selectors";
import { CheckResultOverviewApi, TableApiClient } from "../../services/apiClient";
import { CheckTypes } from "../../shared/routes";
import {
getFirstLevelActiveTab,
getFirstLevelState
} from '../../redux/selectors';
import {
CheckResultOverviewApi,
TableApiClient
} from '../../services/apiClient';
import { CheckTypes } from '../../shared/routes';
import { useDecodedParams } from '../../utils';

const TablePartitionedChecksUIFilterView = () => {
const { checkTypes, connection: connectionName, schema: schemaName, table: tableName, timePartitioned, category, checkName }: { checkTypes: CheckTypes, connection: string, schema: string, table: string, timePartitioned: 'daily' | 'monthly', category: string, checkName: string } = useDecodedParams();
const { partitionedChecksUIFilter, isUpdatedPartitionedChecksUIFilter, loading } = useSelector(getFirstLevelState(checkTypes));
const {
checkTypes,
connection: connectionName,
schema: schemaName,
table: tableName,
timePartitioned,
category,
checkName
}: {
checkTypes: CheckTypes;
connection: string;
schema: string;
table: string;
timePartitioned: 'daily' | 'monthly';
category: string;
checkName: string;
} = useDecodedParams();
const {
partitionedChecksUIFilter,
isUpdatedPartitionedChecksUIFilter,
loading
} = useSelector(getFirstLevelState(checkTypes));
const dispatch = useActionDispatch();
const [checkResultsOverview, setCheckResultsOverview] = useState<
CheckResultsOverviewDataModel[]
Expand Down Expand Up @@ -50,7 +76,14 @@ const TablePartitionedChecksUIFilterView = () => {
checkName
)
);
}, [connectionName, schemaName, tableName, category, checkName]);
}, [
connectionName,
schemaName,
tableName,
category,
checkName,
firstLevelActiveTab
]);

const onUpdate = async () => {
setIsUpdating(true);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,51 @@
import React, { useEffect, useState } from 'react';
import { useSelector } from 'react-redux';
import { CheckContainerModel, CheckResultsOverviewDataModel } from '../../api';
import Button from "../../components/Button";
import Button from '../../components/Button';
import DataQualityChecks from '../../components/DataQualityChecks';
import SvgIcon from '../../components/SvgIcon';
import { useActionDispatch } from '../../hooks/useActionDispatch';
import {
getTableProfilingChecksModelFilter,
setTableUpdatedProfilingChecksModelFilter
} from '../../redux/actions/table.actions';
import { getFirstLevelActiveTab, getFirstLevelState } from "../../redux/selectors";
import { CheckResultOverviewApi, TableApiClient } from "../../services/apiClient";
import { CheckTypes } from "../../shared/routes";
import {
getFirstLevelActiveTab,
getFirstLevelState
} from '../../redux/selectors';
import {
CheckResultOverviewApi,
TableApiClient
} from '../../services/apiClient';
import { CheckTypes } from '../../shared/routes';
import { useDecodedParams } from '../../utils';

const TableProfilingChecksUIFilterView = () => {
const { checkTypes, connection: connectionName, schema: schemaName, table: tableName, category, checkName }: { checkTypes: CheckTypes, connection: string, schema: string, table: string, category: string, checkName: string } = useDecodedParams();
const { checksUIFilter, isUpdatedChecksUIFilter, loading } = useSelector(getFirstLevelState(checkTypes));
const {
checkTypes,
connection: connectionName,
schema: schemaName,
table: tableName,
category,
checkName
}: {
checkTypes: CheckTypes;
connection: string;
schema: string;
table: string;
category: string;
checkName: string;
} = useDecodedParams();
const { checksUIFilter, isUpdatedChecksUIFilter, loading } = useSelector(
getFirstLevelState(checkTypes)
);
const dispatch = useActionDispatch();
const [checkResultsOverview, setCheckResultsOverview] = useState<
CheckResultsOverviewDataModel[]
>([]);
const [isUpdating, setIsUpdating] = useState(false);
const firstLevelActiveTab = useSelector(getFirstLevelActiveTab(checkTypes));

console.log(firstLevelActiveTab);
const getCheckOverview = () => {
CheckResultOverviewApi.getTableProfilingChecksOverview(
connectionName,
Expand All @@ -37,6 +59,7 @@ const TableProfilingChecksUIFilterView = () => {
};

useEffect(() => {
console.log(connectionName, schemaName, tableName, category, checkName);
dispatch(
getTableProfilingChecksModelFilter(
checkTypes,
Expand All @@ -48,7 +71,14 @@ const TableProfilingChecksUIFilterView = () => {
checkName
)
);
}, [connectionName, schemaName, tableName, category, checkName]);
}, [
connectionName,
schemaName,
tableName,
category,
checkName,
firstLevelActiveTab
]);

const onUpdate = async () => {
setIsUpdating(true);
Expand Down Expand Up @@ -82,7 +112,7 @@ const TableProfilingChecksUIFilterView = () => {
)
);
};

console.log(checksUIFilter);
return (
<>
<div className="flex justify-between px-4 py-2 border-b border-gray-300 mb-2 min-h-14">
Expand Down

0 comments on commit 1bb143b

Please sign in to comment.