mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-28 01:04:46 +00:00
ui: fixed glossary badge feedback (#13588)
* ui: fixed glossary badge feedback * updated style for glossaryterm * updated style
This commit is contained in:
parent
b0ce93458f
commit
b1d43397f9
@ -20,7 +20,7 @@ import {
|
|||||||
Typography,
|
Typography,
|
||||||
} from 'antd';
|
} from 'antd';
|
||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
import { debounce, isEmpty, isUndefined } from 'lodash';
|
import { debounce, isEmpty, isUndefined, pick } from 'lodash';
|
||||||
import { CustomTagProps } from 'rc-select/lib/BaseSelect';
|
import { CustomTagProps } from 'rc-select/lib/BaseSelect';
|
||||||
import React, { FC, useCallback, useMemo, useRef, useState } from 'react';
|
import React, { FC, useCallback, useMemo, useRef, useState } from 'react';
|
||||||
import Loader from '../../components/Loader/Loader';
|
import Loader from '../../components/Loader/Loader';
|
||||||
@ -153,6 +153,17 @@ const AsyncSelectList: FC<AsyncSelectListProps> = ({
|
|||||||
|
|
||||||
const { label, onClose } = data;
|
const { label, onClose } = data;
|
||||||
const tagLabel = getTagDisplay(label as string);
|
const tagLabel = getTagDisplay(label as string);
|
||||||
|
const tag = {
|
||||||
|
tagFQN: selectedTag?.data.fullyQualifiedName,
|
||||||
|
...pick(
|
||||||
|
selectedTag?.data,
|
||||||
|
'description',
|
||||||
|
'displayName',
|
||||||
|
'name',
|
||||||
|
'style',
|
||||||
|
'tagFQN'
|
||||||
|
),
|
||||||
|
} as TagLabel;
|
||||||
|
|
||||||
const onPreventMouseDown = (event: React.MouseEvent<HTMLSpanElement>) => {
|
const onPreventMouseDown = (event: React.MouseEvent<HTMLSpanElement>) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@ -177,7 +188,7 @@ const AsyncSelectList: FC<AsyncSelectListProps> = ({
|
|||||||
return (
|
return (
|
||||||
<TagsV1
|
<TagsV1
|
||||||
startWith={TAG_START_WITH.SOURCE_ICON}
|
startWith={TAG_START_WITH.SOURCE_ICON}
|
||||||
tag={selectedTag?.data as TagLabel}
|
tag={tag}
|
||||||
tagProps={tagProps}
|
tagProps={tagProps}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -67,7 +67,7 @@ const EntityHeaderTitle = ({
|
|||||||
data-testid="entity-header-display-name"
|
data-testid="entity-header-display-name"
|
||||||
ellipsis={{ tooltip: true }}
|
ellipsis={{ tooltip: true }}
|
||||||
style={{ color: color ?? TEXT_COLOR }}>
|
style={{ color: color ?? TEXT_COLOR }}>
|
||||||
{stringToHTML(displayName ?? name)}
|
{stringToHTML(displayName || name)}
|
||||||
{openEntityInNewPage && (
|
{openEntityInNewPage && (
|
||||||
<IconExternalLink
|
<IconExternalLink
|
||||||
className="anticon vertical-baseline m-l-xss"
|
className="anticon vertical-baseline m-l-xss"
|
||||||
|
|||||||
@ -43,4 +43,5 @@ export interface GlossaryTermForm {
|
|||||||
mutuallyExclusive: boolean;
|
mutuallyExclusive: boolean;
|
||||||
tags: TagLabel[];
|
tags: TagLabel[];
|
||||||
owner: EntityReference;
|
owner: EntityReference;
|
||||||
|
style: GlossaryTerm['style'];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -106,12 +106,22 @@ const GlossaryTermTab = ({
|
|||||||
const name = getEntityName(record);
|
const name = getEntityName(record);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Link
|
<Space align="center">
|
||||||
className="cursor-pointer help-text"
|
{record.style?.iconURL && (
|
||||||
data-testid={name}
|
<img
|
||||||
to={getGlossaryPath(record.fullyQualifiedName || record.name)}>
|
data-testid="tag-icon"
|
||||||
{name}
|
src={record.style.iconURL}
|
||||||
</Link>
|
width={16}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<Link
|
||||||
|
className="cursor-pointer help-text"
|
||||||
|
data-testid={name}
|
||||||
|
style={{ color: record.style?.color }}
|
||||||
|
to={getGlossaryPath(record.fullyQualifiedName || record.name)}>
|
||||||
|
{name}
|
||||||
|
</Link>
|
||||||
|
</Space>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@ -265,9 +265,11 @@ const GlossaryV1 = ({
|
|||||||
reviewers,
|
reviewers,
|
||||||
owner,
|
owner,
|
||||||
relatedTerms,
|
relatedTerms,
|
||||||
|
style,
|
||||||
} = formData || {};
|
} = formData || {};
|
||||||
|
|
||||||
newTermData.name = name;
|
newTermData.name = name;
|
||||||
|
newTermData.style = style;
|
||||||
newTermData.displayName = displayName;
|
newTermData.displayName = displayName;
|
||||||
newTermData.description = description;
|
newTermData.description = description;
|
||||||
newTermData.synonyms = synonyms;
|
newTermData.synonyms = synonyms;
|
||||||
|
|||||||
@ -45,6 +45,7 @@ import TagSelectForm from '../TagsSelectForm/TagsSelectForm.component';
|
|||||||
import TagsV1 from '../TagsV1/TagsV1.component';
|
import TagsV1 from '../TagsV1/TagsV1.component';
|
||||||
import TagsViewer from '../TagsViewer/TagsViewer';
|
import TagsViewer from '../TagsViewer/TagsViewer';
|
||||||
import { LayoutType } from '../TagsViewer/TagsViewer.interface';
|
import { LayoutType } from '../TagsViewer/TagsViewer.interface';
|
||||||
|
import './tags-container.style.less';
|
||||||
import { TagsContainerV2Props } from './TagsContainerV2.interface';
|
import { TagsContainerV2Props } from './TagsContainerV2.interface';
|
||||||
|
|
||||||
const TagsContainerV2 = ({
|
const TagsContainerV2 = ({
|
||||||
@ -404,7 +405,7 @@ const TagsContainerV2 = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="w-full"
|
className="w-full tags-container"
|
||||||
data-testid={isGlossaryType ? 'glossary-container' : 'tags-container'}>
|
data-testid={isGlossaryType ? 'glossary-container' : 'tags-container'}>
|
||||||
{header}
|
{header}
|
||||||
{tagBody}
|
{tagBody}
|
||||||
|
|||||||
@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2023 Collate.
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
.tags-container {
|
||||||
|
.ant-select-selector {
|
||||||
|
padding-top: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user