Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import React, { FunctionComponent } from 'react';
import { Link } from 'react-router-dom';
import { getDatasetDetailsPath } from '../../../constants/constants';
import { stringToHTML } from '../../../utils/StringsUtils';
import { getUsagePercentile } from '../../../utils/TableUtils';
import TableDataCardBody from './TableDataCardBody';

Expand Down Expand Up @@ -59,7 +60,7 @@ const TableDataCard: FunctionComponent<Props> = ({
<h6 className="tw-flex tw-items-center tw-m-0 tw-heading">
<Link to={getDatasetDetailsPath(fullyQualifiedName)}>
<button className="tw-text-grey-body tw-font-medium">
{name + ' '}
{stringToHTML(name)}
</button>
</Link>
</h6>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* limitations under the License.
*/

import { isEmpty } from 'lodash';
import { FormatedTableData } from 'Models';
import PropTypes from 'prop-types';
import React, { ReactNode } from 'react';
Expand Down Expand Up @@ -54,6 +55,38 @@ const SearchedData: React.FC<SearchedDataProp> = ({
totalValue,
fetchLeftPanel,
}) => {
const highlightSearchResult = () => {
return data.map((table, index) => {
const description = isEmpty(table.highlight?.description)
? table.description
: table.highlight?.description.join(' ');

const name = isEmpty(table.highlight?.table_name)
? table.name
: table.highlight?.table_name.join(' ') || table.name;

return (
<div className="tw-mb-3" key={index}>
<TableDataCard
description={description}
fullyQualifiedName={table.fullyQualifiedName}
name={name}
owner={getOwnerFromId(table.owner)?.name}
serviceType={table.serviceType || '--'}
tableType={table.tableType}
tags={table.tags}
tier={
(table.tier || getTierFromSearchTableTags(table.tags))?.split(
'.'
)[1]
}
usage={table.weeklyPercentileRank}
/>
</div>
);
});
};

return (
<>
<PageContainer leftPanelContent={fetchLeftPanel && fetchLeftPanel()}>
Expand All @@ -72,27 +105,7 @@ const SearchedData: React.FC<SearchedDataProp> = ({
) : null}
{data.length > 0 ? (
<div className="tw-grid tw-grid-rows-1 tw-grid-cols-1">
{data.map((table, index) => (
<div className="tw-mb-3" key={index}>
<TableDataCard
description={table.description}
fullyQualifiedName={table.fullyQualifiedName}
name={table.name}
owner={getOwnerFromId(table.owner)?.name}
serviceType={table.serviceType || '--'}
tableType={table.tableType}
tags={table.tags}
tier={
(
table.tier ||
getTierFromSearchTableTags(table.tags)
)?.split('.')[1]
}
usage={table.weeklyPercentileRank}
/>
</div>
))}

{highlightSearchResult()}
{totalValue > PAGE_SIZE && data.length > 0 && (
<Pagination
currentPage={currentPage}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ declare module 'Models' {
service?: string;
serviceType?: string;
tier: string;
highlight?: {
description: string[];
table_name: string[];
};
};

export type NewUser = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,4 +291,8 @@
.disable-cta * {
@apply tw-cursor-not-allowed !important;
}

.text-highlighter {
@apply tw-bg-warning-lite tw-p-1;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const formatDataResponse = (hits) => {
newData.tableEntity = hit._source.table_entity;
newData.tier = hit._source.tier;
newData.owner = hit._source.owner;
newData.highlight = hit.highlight;

return newData;
});
Expand Down
2 changes: 2 additions & 0 deletions catalog-rest-service/src/main/resources/ui/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const success = '#51C41A';
const error = '#FF4C3B';
const info = '#1890FF';
const warning = '#FFC34E';
const warningBG = '#FFC34E40';

// Background colors
const bodyBG = '#FCFBFE';
Expand Down Expand Up @@ -89,6 +90,7 @@ module.exports = {
success: success,
error: error,
warning: warning,
'warning-lite': warningBG,
info: info,
},
fontFamily: {
Expand Down