Fixed #903 #868 Data Profiler styling issues and owner dropdown. (#951)

This commit is contained in:
Sachin Chaurasiya 2021-10-27 14:19:37 +05:30 committed by GitHub
parent 451b96e15e
commit 91ea0110f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 38 additions and 34 deletions

View File

@ -381,7 +381,7 @@ const Entitylineage: FunctionComponent<{ entityLineage: EntityLineage }> = ({
</ReactFlow>
</ReactFlowProvider>
) : (
<div className="tw-flex tw-justify-center tw-font-medium tw-items-center tw-border tw-border-main tw-rounded-md tw-p-8">
<div className="tw-mt-4 tw-ml-4 tw-flex tw-justify-center tw-font-medium tw-items-center tw-border tw-border-main tw-rounded-md tw-p-8">
No Lineage data available
</div>
)}

View File

@ -235,7 +235,7 @@ const ManageTab: FunctionComponent<Props> = ({
showSearchBar
dropDownList={listOwners}
groupType="tab"
listGroups={['Users', 'Teams']}
listGroups={['Teams', 'Users']}
value={owner}
onSelect={handleOwnerSelection}
/>

View File

@ -72,28 +72,30 @@ const TableProfiler = ({ tableProfiles, columns }: Props) => {
<td
className="tw-relative tableBody-cell"
data-testid="tableBody-cell">
<span
className="tw-mr-2 tw-cursor-pointer"
onClick={() =>
setExpandedColumn((prevState) => ({
name: col.name,
isExpanded:
prevState.name === col.name
? !prevState.isExpanded
: true,
}))
}>
{expandedColumn.name === col.name ? (
expandedColumn.isExpanded ? (
<i className="fas fa-caret-down" />
<p className="tw-flex">
<span
className="tw-mr-2 tw-cursor-pointer"
onClick={() =>
setExpandedColumn((prevState) => ({
name: col.name,
isExpanded:
prevState.name === col.name
? !prevState.isExpanded
: true,
}))
}>
{expandedColumn.name === col.name ? (
expandedColumn.isExpanded ? (
<i className="fas fa-caret-down" />
) : (
<i className="fas fa-caret-right" />
)
) : (
<i className="fas fa-caret-right" />
)
) : (
<i className="fas fa-caret-right" />
)}
</span>
{col.name}
)}
</span>
<span>{col.name}</span>
</p>
</td>
<td
className="tw-relative tableBody-cell profiler-graph"
@ -196,7 +198,7 @@ const TableProfiler = ({ tableProfiles, columns }: Props) => {
})}
</table>
) : (
<div className="tw-flex tw-justify-center tw-font-medium tw-items-center tw-border tw-border-main tw-rounded-md tw-p-8">
<div className="tw-mt-4 tw-ml-4 tw-flex tw-justify-center tw-font-medium tw-items-center tw-border tw-border-main tw-rounded-md tw-p-8">
No profiler data available
</div>
)}

View File

@ -34,7 +34,18 @@ const DropDownList: FunctionComponent<DropDownListProp> = ({
const isMounted = useRef<boolean>(false);
const [searchedList, setSearchedList] = useState(dropDownList);
const [searchText, setSearchText] = useState(searchString);
const [activeTab, setActiveTab] = useState<number>(1);
const setCurrentTabOnMount = () => {
const selectedItem = dropDownList.find((l) => l.value === value);
let index = 0;
if (selectedItem) {
index = listGroups.indexOf(selectedItem.group as string);
}
return index >= 0 ? index + 1 : 1;
};
const [activeTab, setActiveTab] = useState<number>(setCurrentTabOnMount());
const getTabClasses = (tab: number, activeTab: number) => {
return 'tw-gh-tabs' + (activeTab === tab ? ' active' : '');
@ -70,15 +81,6 @@ const DropDownList: FunctionComponent<DropDownListProp> = ({
);
};
const setCurrentTabOnMount = () => {
const owner = dropDownList.find((l) => l.value === value);
if (owner) {
const index = listGroups.indexOf(owner.group as string);
setActiveTab(index >= 0 ? index + 1 : 1);
}
};
useEffect(() => {
setSearchText(searchString);
}, [searchString]);
@ -108,8 +110,8 @@ const DropDownList: FunctionComponent<DropDownListProp> = ({
}, [searchText]);
useEffect(() => {
setActiveTab(setCurrentTabOnMount());
isMounted.current = true;
setCurrentTabOnMount();
}, []);
return (