mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-01 21:23:10 +00:00
fix(ui): updated icon to be consistent with glossary (#11101)
* fix(ui): updated icon to be consistent with glossary * remove primery class * addressing comments
This commit is contained in:
parent
3bd1262992
commit
d618f5c32c
@ -12,6 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { CheckOutlined, CloseOutlined } from '@ant-design/icons';
|
import { CheckOutlined, CloseOutlined } from '@ant-design/icons';
|
||||||
|
import { ExtraInfo } from 'Models';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Col,
|
Col,
|
||||||
@ -34,7 +35,6 @@ import { ERROR_PLACEHOLDER_TYPE } from 'enums/common.enum';
|
|||||||
import { SearchIndex } from 'enums/search.enum';
|
import { SearchIndex } from 'enums/search.enum';
|
||||||
import { compare } from 'fast-json-patch';
|
import { compare } from 'fast-json-patch';
|
||||||
import { cloneDeep, isEmpty, isUndefined, orderBy, uniqueId } from 'lodash';
|
import { cloneDeep, isEmpty, isUndefined, orderBy, uniqueId } from 'lodash';
|
||||||
import { ExtraInfo } from 'Models';
|
|
||||||
import AddAttributeModal from 'pages/RolesPage/AddAttributeModal/AddAttributeModal';
|
import AddAttributeModal from 'pages/RolesPage/AddAttributeModal/AddAttributeModal';
|
||||||
import React, {
|
import React, {
|
||||||
Fragment,
|
Fragment,
|
||||||
@ -55,10 +55,10 @@ import { ReactComponent as IconDropdown } from '../../assets/svg/menu.svg';
|
|||||||
import { ReactComponent as IconOpenLock } from '../../assets/svg/open-lock.svg';
|
import { ReactComponent as IconOpenLock } from '../../assets/svg/open-lock.svg';
|
||||||
import { ReactComponent as IconShowPassword } from '../../assets/svg/show-password.svg';
|
import { ReactComponent as IconShowPassword } from '../../assets/svg/show-password.svg';
|
||||||
import {
|
import {
|
||||||
getTeamAndUserDetailsPath,
|
|
||||||
getUserPath,
|
|
||||||
LIST_SIZE,
|
LIST_SIZE,
|
||||||
PAGE_SIZE_MEDIUM,
|
PAGE_SIZE_MEDIUM,
|
||||||
|
getTeamAndUserDetailsPath,
|
||||||
|
getUserPath,
|
||||||
} from '../../constants/constants';
|
} from '../../constants/constants';
|
||||||
import {
|
import {
|
||||||
POLICY_DOCS,
|
POLICY_DOCS,
|
||||||
@ -70,8 +70,8 @@ import { OwnerType } from '../../enums/user.enum';
|
|||||||
import { Operation } from '../../generated/entity/policies/policy';
|
import { Operation } from '../../generated/entity/policies/policy';
|
||||||
import { Team, TeamType } from '../../generated/entity/teams/team';
|
import { Team, TeamType } from '../../generated/entity/teams/team';
|
||||||
import {
|
import {
|
||||||
EntityReference as UserTeams,
|
|
||||||
User,
|
User,
|
||||||
|
EntityReference as UserTeams,
|
||||||
} from '../../generated/entity/teams/user';
|
} from '../../generated/entity/teams/user';
|
||||||
import { EntityReference } from '../../generated/type/entityReference';
|
import { EntityReference } from '../../generated/type/entityReference';
|
||||||
import { Paging } from '../../generated/type/paging';
|
import { Paging } from '../../generated/type/paging';
|
||||||
@ -83,8 +83,8 @@ import {
|
|||||||
import { hasEditAccess } from '../../utils/CommonUtils';
|
import { hasEditAccess } from '../../utils/CommonUtils';
|
||||||
import { filterEntityAssets, getEntityName } from '../../utils/EntityUtils';
|
import { filterEntityAssets, getEntityName } from '../../utils/EntityUtils';
|
||||||
import {
|
import {
|
||||||
checkPermission,
|
|
||||||
DEFAULT_ENTITY_PERMISSION,
|
DEFAULT_ENTITY_PERMISSION,
|
||||||
|
checkPermission,
|
||||||
} from '../../utils/PermissionsUtils';
|
} from '../../utils/PermissionsUtils';
|
||||||
import { getTeamsWithFqnPath } from '../../utils/RouterUtils';
|
import { getTeamsWithFqnPath } from '../../utils/RouterUtils';
|
||||||
import {
|
import {
|
||||||
@ -92,15 +92,6 @@ import {
|
|||||||
getDeleteMessagePostFix,
|
getDeleteMessagePostFix,
|
||||||
} from '../../utils/TeamUtils';
|
} from '../../utils/TeamUtils';
|
||||||
import { showErrorToast, showSuccessToast } from '../../utils/ToastUtils';
|
import { showErrorToast, showSuccessToast } from '../../utils/ToastUtils';
|
||||||
import Description from '../common/description/Description';
|
|
||||||
import ManageButton from '../common/entityPageInfo/ManageButton/ManageButton';
|
|
||||||
import EntitySummaryDetails from '../common/EntitySummaryDetails/EntitySummaryDetails';
|
|
||||||
import ErrorPlaceHolder from '../common/error-with-placeholder/ErrorPlaceHolder';
|
|
||||||
import NextPrevious from '../common/next-previous/NextPrevious';
|
|
||||||
import Searchbar from '../common/searchbar/Searchbar';
|
|
||||||
import TabsPane from '../common/TabsPane/TabsPane';
|
|
||||||
import TitleBreadcrumb from '../common/title-breadcrumb/title-breadcrumb.component';
|
|
||||||
import { TitleBreadcrumbProps } from '../common/title-breadcrumb/title-breadcrumb.interface';
|
|
||||||
import Loader from '../Loader/Loader';
|
import Loader from '../Loader/Loader';
|
||||||
import ConfirmationModal from '../Modals/ConfirmationModal/ConfirmationModal';
|
import ConfirmationModal from '../Modals/ConfirmationModal/ConfirmationModal';
|
||||||
import { usePermissionProvider } from '../PermissionProvider/PermissionProvider';
|
import { usePermissionProvider } from '../PermissionProvider/PermissionProvider';
|
||||||
@ -109,6 +100,15 @@ import {
|
|||||||
ResourceEntity,
|
ResourceEntity,
|
||||||
} from '../PermissionProvider/PermissionProvider.interface';
|
} from '../PermissionProvider/PermissionProvider.interface';
|
||||||
import { commonUserDetailColumns } from '../Users/Users.util';
|
import { commonUserDetailColumns } from '../Users/Users.util';
|
||||||
|
import EntitySummaryDetails from '../common/EntitySummaryDetails/EntitySummaryDetails';
|
||||||
|
import TabsPane from '../common/TabsPane/TabsPane';
|
||||||
|
import Description from '../common/description/Description';
|
||||||
|
import ManageButton from '../common/entityPageInfo/ManageButton/ManageButton';
|
||||||
|
import ErrorPlaceHolder from '../common/error-with-placeholder/ErrorPlaceHolder';
|
||||||
|
import NextPrevious from '../common/next-previous/NextPrevious';
|
||||||
|
import Searchbar from '../common/searchbar/Searchbar';
|
||||||
|
import TitleBreadcrumb from '../common/title-breadcrumb/title-breadcrumb.component';
|
||||||
|
import { TitleBreadcrumbProps } from '../common/title-breadcrumb/title-breadcrumb.interface';
|
||||||
import ListEntities from './RolesAndPoliciesList';
|
import ListEntities from './RolesAndPoliciesList';
|
||||||
import { getTabs } from './TeamDetailsV1.utils';
|
import { getTabs } from './TeamDetailsV1.utils';
|
||||||
import TeamHierarchy from './TeamHierarchy';
|
import TeamHierarchy from './TeamHierarchy';
|
||||||
@ -1042,7 +1042,6 @@ const TeamDetailsV1 = ({
|
|||||||
isRecursiveDelete
|
isRecursiveDelete
|
||||||
afterDeleteAction={afterDeleteAction}
|
afterDeleteAction={afterDeleteAction}
|
||||||
allowSoftDelete={!currentTeam.deleted}
|
allowSoftDelete={!currentTeam.deleted}
|
||||||
buttonClassName="tw-p-4"
|
|
||||||
canDelete={entityPermissions.EditAll}
|
canDelete={entityPermissions.EditAll}
|
||||||
entityId={currentTeam.id}
|
entityId={currentTeam.id}
|
||||||
entityName={
|
entityName={
|
||||||
@ -1071,13 +1070,11 @@ const TeamDetailsV1 = ({
|
|||||||
trigger={['click']}
|
trigger={['click']}
|
||||||
onOpenChange={setShowActions}>
|
onOpenChange={setShowActions}>
|
||||||
<Button
|
<Button
|
||||||
className="manage-dropdown-button"
|
className="flex-center px-1.5"
|
||||||
data-testid="teams-dropdown"
|
data-testid="teams-dropdown"
|
||||||
icon={
|
type="default">
|
||||||
<IconDropdown className="text-primary self-center manage-dropdown-icon" />
|
<IconDropdown className="self-center manage-dropdown-icon" />
|
||||||
}
|
</Button>
|
||||||
size="small"
|
|
||||||
/>
|
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -302,12 +302,11 @@ describe('Test EntityPageInfo component', () => {
|
|||||||
|
|
||||||
expect(followButton).toBeInTheDocument();
|
expect(followButton).toBeInTheDocument();
|
||||||
|
|
||||||
fireEvent.click(
|
await act(async () => {
|
||||||
followButton,
|
fireEvent.click(followButton);
|
||||||
new MouseEvent('click', { bubbles: true, cancelable: true })
|
});
|
||||||
);
|
|
||||||
|
|
||||||
expect(followHandler).toHaveBeenCalled();
|
expect(mockEntityInfoProp.followHandler).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should render all the extra info', async () => {
|
it('Should render all the extra info', async () => {
|
||||||
|
@ -11,16 +11,17 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { StarFilled } from '@ant-design/icons';
|
import { StarOutlined } from '@ant-design/icons';
|
||||||
import { Button, Popover, Space, Tooltip } from 'antd';
|
import { Button, Dropdown, Popover, Space, Typography } from 'antd';
|
||||||
import { ItemType } from 'antd/lib/menu/hooks/useItems';
|
import { ItemType } from 'antd/lib/menu/hooks/useItems';
|
||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { EntityHeader } from 'components/Entity/EntityHeader/EntityHeader.component';
|
import { EntityHeader } from 'components/Entity/EntityHeader/EntityHeader.component';
|
||||||
|
import VersionButton from 'components/VersionButton/VersionButton.component';
|
||||||
import { t } from 'i18next';
|
import { t } from 'i18next';
|
||||||
import { cloneDeep, isEmpty, isUndefined, toString } from 'lodash';
|
import { cloneDeep, isEmpty, isUndefined, toString } from 'lodash';
|
||||||
import { EntityTags, ExtraInfo, TagOption } from 'Models';
|
import { EntityTags, ExtraInfo, TagOption } from 'Models';
|
||||||
import React, { Fragment, useCallback, useEffect, useState } from 'react';
|
import React, { Fragment, useCallback, useMemo, useState } from 'react';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
import { getActiveAnnouncement } from 'rest/feedsAPI';
|
import { getActiveAnnouncement } from 'rest/feedsAPI';
|
||||||
import { sortTagsCaseInsensitive } from 'utils/CommonUtils';
|
import { sortTagsCaseInsensitive } from 'utils/CommonUtils';
|
||||||
@ -40,7 +41,6 @@ import { useAfterMount } from '../../../hooks/useAfterMount';
|
|||||||
import { EntityFieldThreads } from '../../../interface/feed.interface';
|
import { EntityFieldThreads } from '../../../interface/feed.interface';
|
||||||
import { ANNOUNCEMENT_ENTITIES } from '../../../utils/AnnouncementsUtils';
|
import { ANNOUNCEMENT_ENTITIES } from '../../../utils/AnnouncementsUtils';
|
||||||
import { getEntityFeedLink } from '../../../utils/EntityUtils';
|
import { getEntityFeedLink } from '../../../utils/EntityUtils';
|
||||||
import SVGIcons from '../../../utils/SvgUtils';
|
|
||||||
import { fetchTagsAndGlossaryTerms } from '../../../utils/TagsUtils';
|
import { fetchTagsAndGlossaryTerms } from '../../../utils/TagsUtils';
|
||||||
import {
|
import {
|
||||||
getRequestTagsPath,
|
getRequestTagsPath,
|
||||||
@ -126,8 +126,6 @@ const EntityPageInfo = ({
|
|||||||
const tagThread = entityFieldThreads?.[0];
|
const tagThread = entityFieldThreads?.[0];
|
||||||
const tagTask = entityFieldTasks?.[0];
|
const tagTask = entityFieldTasks?.[0];
|
||||||
const [isEditable, setIsEditable] = useState<boolean>(false);
|
const [isEditable, setIsEditable] = useState<boolean>(false);
|
||||||
const [entityFollowers, setEntityFollowers] =
|
|
||||||
useState<Array<EntityReference>>(followersList);
|
|
||||||
const [isViewMore, setIsViewMore] = useState<boolean>(false);
|
const [isViewMore, setIsViewMore] = useState<boolean>(false);
|
||||||
const [tagList, setTagList] = useState<Array<TagOption>>([]);
|
const [tagList, setTagList] = useState<Array<TagOption>>([]);
|
||||||
const [isTagLoading, setIsTagLoading] = useState<boolean>(false);
|
const [isTagLoading, setIsTagLoading] = useState<boolean>(false);
|
||||||
@ -179,8 +177,8 @@ const EntityPageInfo = ({
|
|||||||
[tags]
|
[tags]
|
||||||
);
|
);
|
||||||
|
|
||||||
const getFollowers = () => {
|
const entityFollowers = useMemo(() => {
|
||||||
const list = cloneDeep(entityFollowers);
|
const list = cloneDeep(followersList);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@ -219,39 +217,7 @@ const EntityPageInfo = ({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
}, [followersList]);
|
||||||
|
|
||||||
const getVersionButton = (version: string) => {
|
|
||||||
return (
|
|
||||||
<Button
|
|
||||||
className={classNames(
|
|
||||||
'tw-border tw-border-primary tw-rounded',
|
|
||||||
!isUndefined(isVersionSelected) ? 'tw-text-white' : 'tw-text-primary'
|
|
||||||
)}
|
|
||||||
data-testid="version-button"
|
|
||||||
size="small"
|
|
||||||
type={!isUndefined(isVersionSelected) ? 'primary' : 'default'}
|
|
||||||
onClick={versionHandler}>
|
|
||||||
<Space>
|
|
||||||
<span>
|
|
||||||
<SVGIcons
|
|
||||||
alt="version icon"
|
|
||||||
icon={isVersionSelected ? 'icon-version-white' : 'icon-version'}
|
|
||||||
/>
|
|
||||||
<span>{t('label.version-plural')}</span>
|
|
||||||
</span>
|
|
||||||
<span
|
|
||||||
className={classNames(
|
|
||||||
'tw-border-l tw-font-medium tw-cursor-pointer hover:tw-underline tw-pl-1',
|
|
||||||
{ 'tw-border-primary': isUndefined(isVersionSelected) }
|
|
||||||
)}
|
|
||||||
data-testid="version-value">
|
|
||||||
{parseFloat(version).toFixed(1)}
|
|
||||||
</span>
|
|
||||||
</Space>
|
|
||||||
</Button>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const fetchTags = async () => {
|
const fetchTags = async () => {
|
||||||
setIsTagLoading(true);
|
setIsTagLoading(true);
|
||||||
@ -360,10 +326,6 @@ const EntityPageInfo = ({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
setEntityFollowers(followersList);
|
|
||||||
}, [followersList]);
|
|
||||||
|
|
||||||
useAfterMount(() => {
|
useAfterMount(() => {
|
||||||
if (ANNOUNCEMENT_ENTITIES.includes(entityType as EntityType)) {
|
if (ANNOUNCEMENT_ENTITIES.includes(entityType as EntityType)) {
|
||||||
fetchActiveAnnouncement();
|
fetchActiveAnnouncement();
|
||||||
@ -385,53 +347,50 @@ const EntityPageInfo = ({
|
|||||||
entityType={(entityType as EntityType) ?? EntityType.TABLE}
|
entityType={(entityType as EntityType) ?? EntityType.TABLE}
|
||||||
extra={
|
extra={
|
||||||
<Space align="center" id="version-and-follow-section">
|
<Space align="center" id="version-and-follow-section">
|
||||||
{!isUndefined(version) ? (
|
{!isUndefined(version) && (
|
||||||
<>
|
<VersionButton
|
||||||
{!isUndefined(isVersionSelected) ? (
|
className="m-l-xs px-1.5"
|
||||||
<Tooltip
|
selected={Boolean(isVersionSelected)}
|
||||||
placement="bottom"
|
version={toString(version)}
|
||||||
title={
|
onClick={versionHandler}
|
||||||
<p className="tw-text-xs">
|
/>
|
||||||
{t('message.viewing-older-version')}
|
|
||||||
</p>
|
|
||||||
}
|
|
||||||
trigger="hover">
|
|
||||||
{getVersionButton(toString(version))}
|
|
||||||
</Tooltip>
|
|
||||||
) : (
|
|
||||||
<>{getVersionButton(toString(version))}</>
|
|
||||||
)}
|
)}
|
||||||
</>
|
|
||||||
) : null}
|
|
||||||
{!isUndefined(isFollowing) ? (
|
{!isUndefined(isFollowing) ? (
|
||||||
<Button
|
<Dropdown.Button
|
||||||
|
icon={
|
||||||
|
<Typography.Text
|
||||||
className={classNames(
|
className={classNames(
|
||||||
'tw-border tw-border-primary tw-rounded',
|
isFollowing ? 'text-white' : 'text-primary'
|
||||||
isFollowing ? 'tw-text-white' : 'tw-text-primary'
|
|
||||||
)}
|
)}
|
||||||
data-testid="follow-button"
|
data-testid="follower-value">
|
||||||
size="small"
|
{followers}
|
||||||
|
</Typography.Text>
|
||||||
|
}
|
||||||
|
menu={{
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
key: 'followers',
|
||||||
|
label: entityFollowers,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}}
|
||||||
|
trigger={['click']}
|
||||||
type={isFollowing ? 'primary' : 'default'}
|
type={isFollowing ? 'primary' : 'default'}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
!deleted && followHandler?.();
|
!deleted && followHandler?.();
|
||||||
}}>
|
}}>
|
||||||
<Space>
|
<Space
|
||||||
<StarFilled className="tw-text-xs" />
|
align="center"
|
||||||
{isFollowing ? t('label.un-follow') : t('label.follow')}
|
|
||||||
<Popover content={getFollowers()} trigger="click">
|
|
||||||
<span
|
|
||||||
className={classNames(
|
className={classNames(
|
||||||
'tw-border-l tw-font-medium tw-cursor-pointer hover:tw-underline tw-pl-1',
|
isFollowing ? 'text-white' : 'text-primary'
|
||||||
{ 'tw-border-primary': !isFollowing }
|
|
||||||
)}
|
)}
|
||||||
data-testid="follower-value"
|
data-testid="follow-button">
|
||||||
onClick={(e) => e.stopPropagation()}>
|
<StarOutlined className="text-xs" />
|
||||||
{followers}
|
{isFollowing ? t('label.un-follow') : t('label.follow')}
|
||||||
</span>
|
|
||||||
</Popover>
|
|
||||||
</Space>
|
</Space>
|
||||||
</Button>
|
</Dropdown.Button>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{!isVersionSelected && (
|
{!isVersionSelected && (
|
||||||
<ManageButton
|
<ManageButton
|
||||||
allowSoftDelete={!deleted}
|
allowSoftDelete={!deleted}
|
||||||
@ -534,7 +493,7 @@ const EntityPageInfo = ({
|
|||||||
header={t('label.followers-of-entity-name', {
|
header={t('label.followers-of-entity-name', {
|
||||||
entityName,
|
entityName,
|
||||||
})}
|
})}
|
||||||
list={entityFollowers}
|
list={followersList}
|
||||||
visible={isViewMore}
|
visible={isViewMore}
|
||||||
onCancel={() => setIsViewMore(false)}
|
onCancel={() => setIsViewMore(false)}
|
||||||
/>
|
/>
|
||||||
|
@ -220,16 +220,12 @@ const ManageButton: FC<Props> = ({
|
|||||||
trigger={['click']}
|
trigger={['click']}
|
||||||
onOpenChange={setShowActions}>
|
onOpenChange={setShowActions}>
|
||||||
<Button
|
<Button
|
||||||
className={classNames(
|
className={classNames('flex-center px-1.5', buttonClassName)}
|
||||||
'tw-rounded tw-flex tw-justify-center tw-w-6 manage-dropdown-button',
|
|
||||||
buttonClassName
|
|
||||||
)}
|
|
||||||
data-testid="manage-button"
|
data-testid="manage-button"
|
||||||
size="small"
|
|
||||||
title="Manage"
|
title="Manage"
|
||||||
type="default"
|
type="default"
|
||||||
onClick={() => setShowActions(true)}>
|
onClick={() => setShowActions(true)}>
|
||||||
<IconDropdown className="text-primary self-center manage-dropdown-icon" />
|
<IconDropdown className="anticon self-center manage-dropdown-icon" />
|
||||||
</Button>
|
</Button>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
{isDelete && (
|
{isDelete && (
|
||||||
|
@ -876,7 +876,7 @@
|
|||||||
"type-filed-name": "Type {{fieldName}}",
|
"type-filed-name": "Type {{fieldName}}",
|
||||||
"type-lowercase": "type",
|
"type-lowercase": "type",
|
||||||
"type-to-confirm": "Type <0>{{text}}</0> to confirm",
|
"type-to-confirm": "Type <0>{{text}}</0> to confirm",
|
||||||
"un-follow": "UnFollow",
|
"un-follow": "Unfollow",
|
||||||
"unique": "Unique",
|
"unique": "Unique",
|
||||||
"unpause": "UnPause",
|
"unpause": "UnPause",
|
||||||
"update": "Update",
|
"update": "Update",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user