Fixed: UI inconsistency as per feedback #4192 (#4840)

This commit is contained in:
Shailesh Parmar 2022-05-11 15:04:27 +05:30 committed by GitHub
parent 0acf88e1ba
commit 4395cae6b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 738 additions and 697 deletions

View File

@ -467,11 +467,12 @@ const DashboardDetails = ({
tabs={tabs} tabs={tabs}
/> />
<div className="tw-bg-white tw-flex-grow tw--mx-6 tw-px-7 tw-py-4"> <div className="tw-flex-grow tw-flex tw-flex-col tw--mx-6 tw-px-7 tw-py-4">
<div className="tw-bg-white tw-flex-grow tw-p-4 tw-shadow tw-rounded-md">
{activeTab === 1 && ( {activeTab === 1 && (
<> <>
<div className="tw-grid tw-grid-cols-4 tw-gap-4 tw-w-full"> <div className="tw-grid tw-grid-cols-4 tw-gap-4 tw-w-full">
<div className="tw-col-span-full"> <div className="tw-col-span-full tw--ml-5">
<Description <Description
description={description} description={description}
entityFieldThreads={getEntityFieldThreadCounts( entityFieldThreads={getEntityFieldThreadCounts(
@ -528,7 +529,9 @@ const DashboardDetails = ({
</span> </span>
</Link> </Link>
</td> </td>
<td className="tableBody-cell">{chart.chartType}</td> <td className="tableBody-cell">
{chart.chartType}
</td>
<td className="tw-group tableBody-cell tw-relative"> <td className="tw-group tableBody-cell tw-relative">
<div className="tw-inline-block"> <div className="tw-inline-block">
<div <div
@ -590,7 +593,9 @@ const DashboardDetails = ({
</div> </div>
) : ( ) : (
<NonAdminAction <NonAdminAction
html={getHtmlForNonAdminAction(Boolean(owner))} html={getHtmlForNonAdminAction(
Boolean(owner)
)}
isOwner={hasEditAccess()} isOwner={hasEditAccess()}
permission={Operation.UpdateTags} permission={Operation.UpdateTags}
position="left" position="left"
@ -660,7 +665,7 @@ const DashboardDetails = ({
</div> </div>
)} )}
{activeTab === 3 && ( {activeTab === 3 && (
<div className="tw-h-full"> <div className="tw-h-full tw-px-3">
<Entitylineage <Entitylineage
addLineageHandler={addLineageHandler} addLineageHandler={addLineageHandler}
deleted={deleted} deleted={deleted}
@ -700,6 +705,7 @@ const DashboardDetails = ({
</div> </div>
</div> </div>
</div> </div>
</div>
{editChart && ( {editChart && (
<ModalWithMarkdownEditor <ModalWithMarkdownEditor
header={`Edit Chart: "${editChart.chart.displayName}"`} header={`Edit Chart: "${editChart.chart.displayName}"`}

View File

@ -579,13 +579,13 @@ const DatasetDetails: React.FC<DatasetDetailsProps> = ({
setActiveTab={setActiveTabHandler} setActiveTab={setActiveTabHandler}
tabs={tabs} tabs={tabs}
/> />
<div className="tw-flex-grow tw-flex tw-flex-col tw--mx-6 tw-px-7 tw-py-4">
<div className="tw-bg-white tw-flex-grow tw--mx-6 tw-px-7 tw-py-4"> <div className="tw-bg-white tw-flex-grow tw-p-4 tw-shadow tw-rounded-md">
{activeTab === 1 && ( {activeTab === 1 && (
<div <div
className="tw-grid tw-grid-cols-4 tw-gap-4 tw-w-full" className="tw-grid tw-grid-cols-4 tw-gap-4 tw-w-full"
id="schemaDetails"> id="schemaDetails">
<div className="tw-col-span-3"> <div className="tw-col-span-3 tw--ml-5">
<Description <Description
description={description} description={description}
entityFieldThreads={getEntityFieldThreadCounts( entityFieldThreads={getEntityFieldThreadCounts(
@ -712,6 +712,7 @@ const DatasetDetails: React.FC<DatasetDetailsProps> = ({
{activeTab === 7 && ( {activeTab === 7 && (
<div <div
className={classNames( className={classNames(
'tw-px-2',
location.pathname.includes(ROUTES.TOUR) location.pathname.includes(ROUTES.TOUR)
? 'tw-h-70vh' ? 'tw-h-70vh'
: 'tw-h-full' : 'tw-h-full'
@ -762,6 +763,7 @@ const DatasetDetails: React.FC<DatasetDetailsProps> = ({
{getLoader()} {getLoader()}
</div> </div>
</div> </div>
</div>
{threadLink ? ( {threadLink ? (
<ActivityThreadPanel <ActivityThreadPanel
createThread={createThread} createThread={createThread}

View File

@ -393,11 +393,12 @@ const PipelineDetails = ({
tabs={tabs} tabs={tabs}
/> />
<div className="tw-bg-white tw-flex-grow tw--mx-6 tw-px-7 tw-py-4"> <div className="tw-flex-grow tw-flex tw-flex-col tw--mx-6 tw-px-7 tw-py-4">
<div className="tw-bg-white tw-flex-grow tw-p-4 tw-shadow tw-rounded-md">
{activeTab === 1 && ( {activeTab === 1 && (
<> <>
<div className="tw-grid tw-grid-cols-4 tw-gap-4 tw-w-full"> <div className="tw-grid tw-grid-cols-4 tw-gap-4 tw-w-full">
<div className="tw-col-span-full"> <div className="tw-col-span-full tw--ml-5">
<Description <Description
description={description} description={description}
entityFieldThreads={getEntityFieldThreadCounts( entityFieldThreads={getEntityFieldThreadCounts(
@ -541,7 +542,9 @@ const PipelineDetails = ({
)} )}
</div> </div>
</td> </td>
<td className="tableBody-cell">{task.taskType}</td> <td className="tableBody-cell">
{task.taskType}
</td>
</tr> </tr>
))} ))}
</tbody> </tbody>
@ -578,7 +581,7 @@ const PipelineDetails = ({
/> />
)} )}
{activeTab === 4 && ( {activeTab === 4 && (
<div className="tw-h-full"> <div className="tw-h-full tw-px-3">
<Entitylineage <Entitylineage
addLineageHandler={addLineageHandler} addLineageHandler={addLineageHandler}
deleted={deleted} deleted={deleted}
@ -617,6 +620,7 @@ const PipelineDetails = ({
</div> </div>
</div> </div>
</div> </div>
</div>
{editTask && ( {editTask && (
<ModalWithMarkdownEditor <ModalWithMarkdownEditor
header={`Edit Task: "${editTask.task.displayName}"`} header={`Edit Task: "${editTask.task.displayName}"`}

View File

@ -387,12 +387,12 @@ const TopicDetails: React.FC<TopicDetailsProps> = ({
setActiveTab={setActiveTabHandler} setActiveTab={setActiveTabHandler}
tabs={tabs} tabs={tabs}
/> />
<div className="tw-flex-grow tw-flex tw-flex-col tw--mx-6 tw-px-7 tw-py-4">
<div className="tw-bg-white tw-flex-grow tw--mx-6 tw-px-7 tw-py-4"> <div className="tw-bg-white tw-flex-grow tw-p-4 tw-shadow tw-rounded-md">
{activeTab === 1 && ( {activeTab === 1 && (
<> <>
<div className="tw-grid tw-grid-cols-4 tw-gap-4 tw-w-full"> <div className="tw-grid tw-grid-cols-4 tw-gap-4 tw-w-full">
<div className="tw-col-span-full"> <div className="tw-col-span-full tw--ml-5">
<Description <Description
description={description} description={description}
entityFieldThreads={getEntityFieldThreadCounts( entityFieldThreads={getEntityFieldThreadCounts(
@ -482,6 +482,7 @@ const TopicDetails: React.FC<TopicDetailsProps> = ({
{getLoader()} {getLoader()}
</div> </div>
</div> </div>
</div>
{threadLink ? ( {threadLink ? (
<ActivityThreadPanel <ActivityThreadPanel
createThread={createThread} createThread={createThread}

View File

@ -25,7 +25,7 @@ type Item = {
email: string; email: string;
isActiveUser?: boolean; isActiveUser?: boolean;
profilePhoto?: string; profilePhoto?: string;
teamCount?: string; teamCount?: string | JSX.Element;
}; };
type Props = { type Props = {
@ -73,7 +73,7 @@ const UserDataCard = ({ item, onClick, onDelete, showTeams = true }: Props) => {
)} )}
</div> </div>
<p className="tw-truncate">{item.email}</p> <p className="tw-truncate">{item.email}</p>
{showTeams && <p>Teams: {item.teamCount}</p>} {showTeams && <div>Teams: {item.teamCount}</div>}
</div> </div>
</div> </div>
{!isNil(onDelete) && ( {!isNil(onDelete) && (

View File

@ -18,6 +18,7 @@ import { getUserPath } from '../../constants/constants';
import { EntityReference, User } from '../../generated/entity/teams/user'; import { EntityReference, User } from '../../generated/entity/teams/user';
import { getEntityName } from '../../utils/CommonUtils'; import { getEntityName } from '../../utils/CommonUtils';
import ErrorPlaceHolder from '../common/error-with-placeholder/ErrorPlaceHolder'; import ErrorPlaceHolder from '../common/error-with-placeholder/ErrorPlaceHolder';
import PopOver from '../common/popover/PopOver';
import Searchbar from '../common/searchbar/Searchbar'; import Searchbar from '../common/searchbar/Searchbar';
import Loader from '../Loader/Loader'; import Loader from '../Loader/Loader';
import ConfirmationModal from '../Modals/ConfirmationModal/ConfirmationModal'; import ConfirmationModal from '../Modals/ConfirmationModal/ConfirmationModal';
@ -66,6 +67,35 @@ const UserDetails = ({
setDeletingUser(undefined); setDeletingUser(undefined);
}; };
const getTeamsText = (teams: EntityReference[]) => {
return teams.length > 1 ? (
<span>
{getEntityName(teams[0])}, &{' '}
<PopOver
html={
<span>
{teams.map((t, i) => {
return i >= 1 ? (
<span className="tw-block tw-text-left" key={i}>
{getEntityName(t)}
</span>
) : null;
})}
</span>
}
position="bottom"
theme="light"
trigger="mouseenter">
<span className="tw-underline tw-cursor-pointer">
{teams.length - 1} more
</span>
</PopOver>
</span>
) : (
`${getEntityName(teams[0])}`
);
};
const getUserCards = () => { const getUserCards = () => {
return isUsersLoading ? ( return isUsersLoading ? (
<Loader /> <Loader />
@ -84,10 +114,8 @@ const UserDetails = ({
isActiveUser: !user.deleted, isActiveUser: !user.deleted,
profilePhoto: user.profile?.images?.image || '', profilePhoto: user.profile?.images?.image || '',
teamCount: teamCount:
user.teams && user.teams?.length user.teams && user.teams.length
? user.teams ? getTeamsText(user.teams)
?.map((team) => team.displayName ?? team.name)
?.join(', ')
: 'No teams', : 'No teams',
}; };