Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GEN-2078: fix minor styling of domain component #18738

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,16 @@ import {
getEntityName,
getEntityReferenceListFromEntities,
} from '../../../utils/EntityUtils';
import Fqn from '../../../utils/Fqn';
import { getDomainPath } from '../../../utils/RouterUtils';
import { SelectableList } from '../SelectableList/SelectableList.component';
import './domain-select-dropdown.less';
import { DomainSelectableListProps } from './DomainSelectableList.interface';

export const DomainListItemRenderer = (props: EntityReference) => {
const isSubDomain = Fqn.split(props.fullyQualifiedName ?? '').length > 1;
const fqn = `(${props.fullyQualifiedName ?? ''})`;

return (
<div className="d-flex items-center gap-2">
<DomainIcon
Expand All @@ -46,7 +50,17 @@ export const DomainListItemRenderer = (props: EntityReference) => {
name="folder"
width={20}
/>
<Typography.Text>{getEntityName(props)}</Typography.Text>
<div className="d-flex items-center w-max-400">
<Typography.Text ellipsis>{getEntityName(props)}</Typography.Text>
{isSubDomain && (
<Typography.Text
ellipsis
className="m-l-xss text-xs"
type="secondary">
{fqn}
</Typography.Text>
)}
</div>
</div>
);
};
Expand All @@ -71,7 +85,7 @@ const DomainSelectableList = ({
return [];
}, [selectedDomain]);

const fetchOptions = async (searchText: string) => {
const fetchOptions = async (searchText: string, after?: string) => {
if (searchText) {
try {
const res = await searchData(
Expand All @@ -97,6 +111,7 @@ const DomainSelectableList = ({
try {
const { data, paging } = await getDomainList({
limit: PAGE_SIZE_MEDIUM,
after: after ?? undefined,
});
const filterData = getEntityReferenceListFromEntities(
data,
Expand Down
Loading