Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Patryk Jatczak committed May 28, 2024
2 parents 99ba3ef + edd7054 commit f7618bc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export default function SchemaTableItem({
<SvgIcon
name="data_sources"
className="w-5 h-5 cursor-pointer"
onClick={() => goToTable(item, CheckTypes.SOURCES)}
onClick={() => goToColumn(item, CheckTypes.SOURCES)}
/>
</Tooltip>
<Tooltip
Expand All @@ -203,7 +203,7 @@ export default function SchemaTableItem({
<SvgIcon
name="profiling"
className="w-5 h-5 cursor-pointer"
onClick={() => goToTable(item, CheckTypes.PROFILING)}
onClick={() => goToColumn(item, CheckTypes.PROFILING)}
/>
</Tooltip>
<Tooltip
Expand All @@ -213,7 +213,7 @@ export default function SchemaTableItem({
<SvgIcon
name="monitoring_checks"
className="w-5 h-5 cursor-pointer"
onClick={() => goToTable(item, CheckTypes.MONITORING)}
onClick={() => goToColumn(item, CheckTypes.MONITORING)}
/>
</Tooltip>
<Tooltip
Expand All @@ -223,7 +223,7 @@ export default function SchemaTableItem({
<SvgIcon
name="partitioned_checks"
className="w-5 h-5 cursor-pointer"
onClick={() => goToTable(item, CheckTypes.PARTITIONED)}
onClick={() => goToColumn(item, CheckTypes.PARTITIONED)}
/>
</Tooltip>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import clsx from 'clsx';
import React, { useEffect, useState } from 'react';
import { LabelModel, TableListModel } from '../../api';
import Button from '../../components/Button';
import ColumnList from '../../components/ColumnList';
import Input from '../../components/Input';
import SvgIcon from '../../components/SvgIcon';
import { LabelsApiClient, SearchApiClient } from '../../services/apiClient';
import { CheckTypes } from '../../shared/routes';
import { useDecodedParams } from '../../utils';
import SvgIcon from '../../components/SvgIcon';
import clsx from 'clsx';

type TSearchFilters = {
connection?: string | undefined;
Expand Down
20 changes: 14 additions & 6 deletions dqops/src/main/frontend/src/pages/TableListView/TableListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,18 @@ export default function TableListView() {
};

const getTables = async (labels: string[] = []) => {
const addPrefix = (str: string) => {
const addPrefix = (str?: string) => {
if (!str) return '';
return str.includes('*') || str.length === 0 ? str : '*' + str + '*';
};
setLoading(true);
console.log(
connection ? addPrefix(connection) : addPrefix(searchFilters.connection),
schema ? addPrefix(schema) : addPrefix(searchFilters.schema)
);
const res = await SearchApiClient.findTables(
connection ?? addPrefix(searchFilters.connection ?? ''),
schema ?? addPrefix(searchFilters.schema ?? ''),
connection ? addPrefix(connection) : addPrefix(searchFilters.connection),
schema ? addPrefix(schema) : addPrefix(searchFilters.schema),
addPrefix(searchFilters.table ?? ''),
labels,
filters.page,
Expand Down Expand Up @@ -133,15 +138,16 @@ export default function TableListView() {

return (
<>
<div className="flex items-center justify-between bg-white w-full">
<div className="flex items-center gap-x-4 mb-4 mt-5 px-4">
<div className="flex items-center justify-between bg-white w-full relative">
<div className="flex items-center gap-x-4 mb-4 mt-4 px-4">
{!connection && (
<Input
label="Connection name"
value={searchFilters.connection}
onChange={(e) =>
onChangeSearchFilters({ connection: e.target.value })
}
className="z-[100]"
/>
)}
{!schema && (
Expand All @@ -151,12 +157,14 @@ export default function TableListView() {
onChange={(e) =>
onChangeSearchFilters({ schema: e.target.value })
}
className="z-[100]"
/>
)}
<Input
label="Table name"
value={searchFilters.table}
onChange={(e) => onChangeSearchFilters({ table: e.target.value })}
className="z-[100]"
/>
<Button
label="Search"
Expand All @@ -169,7 +177,7 @@ export default function TableListView() {
);
}}
color="primary"
className="mt-5"
className="mt-5 z-[100]"
/>
</div>
<Button
Expand Down

0 comments on commit f7618bc

Please sign in to comment.