Skip to content

Commit

Permalink
chore(ui): improve ui / ux around patch api calls (#15293)
Browse files Browse the repository at this point in the history
* chore(ui): improve ui / ux around patch api calls

* domain loading changes

* add loading state to entityReName modal

* added loading state for following

* setLoading false in entityName modal

* delete style fix

* updated vote loading and delete loading for queries

* fixed loading issue in profilerSettingsModal

* fixed no data placeholder issue while loading in thread drawer

* fix glossary term related changes

* fix glossary term related changes

* fix: Spaces and Tabs of YAML (#15309)

* fix: Simplify the logic for get cypress filter step

* ui/ux fix

* added tooltip on icons

* localizaion keys

* minor changes

* fixed profiler picture loading issue

* Fix UI-UX (#15313)

* incident manager edit displayName loading

* no data placeholder for no search data

* code refactor

* address comments

* fetch latest data in tagsPage

* fix edit description icon alignment

* edit icon fix

* fixed failing unit test

* revert version tests

* addressing comment

---------

Co-authored-by: Shailesh Parmar <shailesh.parmar.webdev@gmail.com>
Co-authored-by: Akash Jain <15995028+akash-jain-10@users.noreply.github.com>
Co-authored-by: Ashish Gupta <ashish@getcollate.io>
Co-authored-by: Harsh Vador <58542468+harsh-vador@users.noreply.github.com>
  • Loading branch information
5 people authored Feb 26, 2024
1 parent f6ba49a commit 8539740
Show file tree
Hide file tree
Showing 72 changed files with 1,331 additions and 1,084 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ import {
} from '../Utils/Owner';
import { assignTags, removeTags, udpateTags } from '../Utils/Tags';
import { addTier, removeTier, updateTier } from '../Utils/Tier';
import { validateDomain } from '../Utils/Versions';
import { downVoteEntity, upVoteEntity } from '../Utils/Voting';

const description =
Expand Down Expand Up @@ -367,7 +366,6 @@ class EntityClass {

assignDomain() {
addDomainToEntity(domainDetails1.displayName);
validateDomain(domainDetails1.displayName, this.endPoint);
}

updateDomain() {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ const ActivityThreadPanelBody: FC<ActivityThreadPanelBodyProp> = ({
</Fragment>
) : (
<Fragment>
{showNewConversation || isEqual(threads.length, 0) ? (
{showNewConversation ||
(isEqual(threads.length, 0) && !isThreadLoading) ? (
<>
{isConversationType && (
<Space className="w-full" direction="vertical">
Expand All @@ -293,7 +294,7 @@ const ActivityThreadPanelBody: FC<ActivityThreadPanelBodyProp> = ({
/>
</Space>
)}
{(isAnnouncementType || isTaskType) && (
{(isAnnouncementType || isTaskType) && !isThreadLoading && (
<ErrorPlaceHolder
className="mt-24"
type={ERROR_PLACEHOLDER_TYPE.CUSTOM}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,13 +449,22 @@ const ClassificationDetails = forwardRef(
)}

<ButtonGroup size="small">
<Button
className="w-16 p-0"
data-testid="version-button"
icon={<Icon component={VersionIcon} />}
onClick={versionHandler}>
<Typography.Text>{currentVersion}</Typography.Text>
</Button>
<Tooltip
title={t(
`label.${
isVersionView
? 'exit-version-history'
: 'version-plural-history'
}`
)}>
<Button
className="w-16 p-0"
data-testid="version-button"
icon={<Icon component={VersionIcon} />}
onClick={versionHandler}>
<Typography.Text>{currentVersion}</Typography.Text>
</Button>
</Tooltip>
{showManageButton && (
<ManageButton
isRecursiveDelete
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Icon from '@ant-design/icons';
import { Button, Col, Divider, Row, Space, Tooltip, Typography } from 'antd';
import ButtonGroup from 'antd/lib/button/button-group';
import { AxiosError } from 'axios';
import { isEmpty } from 'lodash';
import { capitalize, isEmpty } from 'lodash';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useHistory } from 'react-router-dom';
Expand Down Expand Up @@ -136,6 +136,7 @@ export const DataAssetsHeader = ({
const { onCopyToClipBoard } = useClipboard(window.location.href);
const [parentContainers, setParentContainers] = useState<Container[]>([]);
const [isBreadcrumbLoading, setIsBreadcrumbLoading] = useState(false);
const [isFollowingLoading, setIsFollowingLoading] = useState(false);
const history = useHistory();
const icon = useMemo(
() =>
Expand Down Expand Up @@ -273,7 +274,7 @@ export const DataAssetsHeader = ({

const handleShareButtonClick = async () => {
await onCopyToClipBoard();
setCopyTooltip(t('message.copy-to-clipboard'));
setCopyTooltip(t('message.link-copy-to-clipboard'));
setTimeout(() => setCopyTooltip(''), 2000);
};

Expand All @@ -292,8 +293,8 @@ export const DataAssetsHeader = ({
}
}, [isDataAssetsWithServiceField, dataAsset]);

const handleVoteChange = (data: VotingDataProps) => {
onUpdateVote?.(data, dataAsset.id ?? '');
const handleVoteChange = async (data: VotingDataProps) => {
await onUpdateVote?.(data, dataAsset.id ?? '');
};

const handleOpenAnnouncementDrawer = useCallback(
Expand All @@ -305,6 +306,11 @@ export const DataAssetsHeader = ({
() => setIsAnnouncementDrawerOpen(false),
[]
);
const handleFollowingClick = useCallback(async () => {
setIsFollowingLoading(true);
await onFollowClick?.();
setIsFollowingLoading(false);
}, [onFollowClick]);

const { editDomainPermission, editOwnerPermission, editTierPermission } =
useMemo(
Expand Down Expand Up @@ -413,35 +419,46 @@ export const DataAssetsHeader = ({
/>
)}
{!excludeEntityService && (
<Button
className="w-16 p-0"
icon={<Icon component={TaskOpenIcon} />}
onClick={handleOpenTaskClick}>
<Typography.Text>{openTaskCount}</Typography.Text>
</Button>
<Tooltip title={t('label.open-task-plural')}>
<Button
className="w-16 p-0"
icon={<Icon component={TaskOpenIcon} />}
onClick={handleOpenTaskClick}>
<Typography.Text>{openTaskCount}</Typography.Text>
</Button>
</Tooltip>
)}

<Button
className="w-16 p-0"
data-testid="version-button"
icon={<Icon component={VersionIcon} />}
onClick={onVersionClick}>
<Typography.Text>{version}</Typography.Text>
</Button>

{!excludeEntityService && (
<Tooltip title={t('label.version-plural-history')}>
<Button
className="w-16 p-0"
data-testid="entity-follow-button"
disabled={deleted}
icon={
<Icon
component={isFollowing ? StarFilledIcon : StarIcon}
/>
}
onClick={onFollowClick}>
<Typography.Text>{followers}</Typography.Text>
data-testid="version-button"
icon={<Icon component={VersionIcon} />}
onClick={onVersionClick}>
<Typography.Text>{version}</Typography.Text>
</Button>
</Tooltip>

{!excludeEntityService && (
<Tooltip
title={t('label.field-entity', {
field: t(`label.${isFollowing ? 'un-follow' : 'follow'}`),
entity: capitalize(entityType),
})}>
<Button
className="w-16 p-0"
data-testid="entity-follow-button"
disabled={deleted}
icon={
<Icon
component={isFollowing ? StarFilledIcon : StarIcon}
/>
}
loading={isFollowingLoading}
onClick={handleFollowingClick}>
<Typography.Text>{followers}</Typography.Text>
</Button>
</Tooltip>
)}

<Tooltip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/

import Icon from '@ant-design/icons/lib/components/Icon';
import { Button, Col, Divider, Row, Space, Typography } from 'antd';
import { Button, Col, Divider, Row, Space, Tooltip, Typography } from 'antd';
import { isEmpty } from 'lodash';
import React, { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
Expand Down Expand Up @@ -161,13 +161,15 @@ function DataAssetsVersionHeader({
<Col span={3}>
<Row justify="end">
<Col>
<Button
className="w-16 p-0"
data-testid="version-button"
icon={<Icon component={VersionIcon} />}
onClick={onVersionClick}>
<Typography.Text>{version}</Typography.Text>
</Button>
<Tooltip title={t('label.exit-version-history')}>
<Button
className="w-16 p-0"
data-testid="version-button"
icon={<Icon component={VersionIcon} />}
onClick={onVersionClick}>
<Typography.Text>{version}</Typography.Text>
</Button>
</Tooltip>
</Col>
</Row>
</Col>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,20 +499,29 @@ const DataProductsDetailsPage = ({

<ButtonGroup className="p-l-xs" size="small">
{dataProduct?.version && (
<Button
className={classNames('', {
'text-primary border-primary': version,
})}
data-testid="version-button"
icon={<Icon component={VersionIcon} />}
onClick={handleVersionClick}>
<Typography.Text
<Tooltip
title={t(
`label.${
isVersionsView
? 'exit-version-history'
: 'version-plural-history'
}`
)}>
<Button
className={classNames('', {
'text-primary': version,
})}>
{toString(dataProduct.version)}
</Typography.Text>
</Button>
'text-primary border-primary': version,
})}
data-testid="version-button"
icon={<Icon component={VersionIcon} />}
onClick={handleVersionClick}>
<Typography.Text
className={classNames('', {
'text-primary': version,
})}>
{toString(dataProduct.version)}
</Typography.Text>
</Button>
</Tooltip>
)}

{!isVersionsView && manageButtonContent.length > 0 && (
Expand Down
Loading

0 comments on commit 8539740

Please sign in to comment.