mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-18 14:06:59 +00:00
parent
f70755f0cc
commit
aa17b32cd3
@ -12,6 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { AxiosResponse } from 'axios';
|
import { AxiosResponse } from 'axios';
|
||||||
|
import classNames from 'classnames';
|
||||||
import { isEmpty } from 'lodash';
|
import { isEmpty } from 'lodash';
|
||||||
import { observer } from 'mobx-react';
|
import { observer } from 'mobx-react';
|
||||||
import { TableDetail } from 'Models';
|
import { TableDetail } from 'Models';
|
||||||
@ -181,6 +182,8 @@ const ManageTab: FunctionComponent<Props> = ({
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const ownerName = getOwnerById();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getTierData();
|
getTierData();
|
||||||
}, []);
|
}, []);
|
||||||
@ -225,7 +228,17 @@ const ManageTab: FunctionComponent<Props> = ({
|
|||||||
theme="primary"
|
theme="primary"
|
||||||
variant="link"
|
variant="link"
|
||||||
onClick={() => setListVisible((visible) => !visible)}>
|
onClick={() => setListVisible((visible) => !visible)}>
|
||||||
{getOwnerById() || 'Select Owner'}
|
{ownerName ? (
|
||||||
|
<span
|
||||||
|
className={classNames('tw-truncate', {
|
||||||
|
'tw-w-52': ownerName.length > 32,
|
||||||
|
})}
|
||||||
|
title={ownerName}>
|
||||||
|
{ownerName}
|
||||||
|
</span>
|
||||||
|
) : (
|
||||||
|
'Select Owner'
|
||||||
|
)}
|
||||||
<SVGIcons
|
<SVGIcons
|
||||||
alt="edit"
|
alt="edit"
|
||||||
className="tw-ml-1"
|
className="tw-ml-1"
|
||||||
|
@ -47,8 +47,15 @@ const CheckBoxDropDownList = ({
|
|||||||
checked={selectedItems?.includes(item.value as string)}
|
checked={selectedItems?.includes(item.value as string)}
|
||||||
className="tw-ml-3 tw-mr-2 tw-align-middle custom-checkbox"
|
className="tw-ml-3 tw-mr-2 tw-align-middle custom-checkbox"
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
|
onChange={() => {
|
||||||
|
return;
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<p className="tw-inline-block">{item.name}</p>
|
<p
|
||||||
|
className="tw-inline-block tw-truncate tw-w-52 tw-align-middle"
|
||||||
|
title={item.name as string}>
|
||||||
|
{item.name}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<Fragment />
|
<Fragment />
|
||||||
|
@ -85,9 +85,10 @@ const DropDown: React.FC<DropDownProp> = ({
|
|||||||
if (selectedItems?.includes(item.value as string)) {
|
if (selectedItems?.includes(item.value as string)) {
|
||||||
return (
|
return (
|
||||||
<p
|
<p
|
||||||
className="tw-bg-gray-200 tw-rounded tw-px-1 tw-text-grey-body"
|
className="tw-bg-gray-200 tw-rounded tw-px-1 tw-text-grey-body tw-truncate tw-w-52 tw-align-middle"
|
||||||
key={item.value}
|
key={item.value}
|
||||||
style={{ margin: '2px' }}>
|
style={{ margin: '2px' }}
|
||||||
|
title={item.name as string}>
|
||||||
{item.name}
|
{item.name}
|
||||||
</p>
|
</p>
|
||||||
);
|
);
|
||||||
|
@ -69,7 +69,7 @@ const DropDownList: FunctionComponent<DropDownListProp> = ({
|
|||||||
|
|
||||||
const getDropDownElement = (item: DropDownListItem, index: number) => {
|
const getDropDownElement = (item: DropDownListItem, index: number) => {
|
||||||
return (
|
return (
|
||||||
<span
|
<div
|
||||||
aria-disabled={item.disabled as boolean}
|
aria-disabled={item.disabled as boolean}
|
||||||
className={classNames(
|
className={classNames(
|
||||||
'tw-text-gray-700 tw-block tw-px-4 tw-py-2 tw-text-sm hover:tw-bg-body-hover tw-cursor-pointer',
|
'tw-text-gray-700 tw-block tw-px-4 tw-py-2 tw-text-sm hover:tw-bg-body-hover tw-cursor-pointer',
|
||||||
@ -80,8 +80,10 @@ const DropDownList: FunctionComponent<DropDownListProp> = ({
|
|||||||
key={index}
|
key={index}
|
||||||
role="menuitem"
|
role="menuitem"
|
||||||
onClick={(e) => onSelect && onSelect(e, item.value)}>
|
onClick={(e) => onSelect && onSelect(e, item.value)}>
|
||||||
|
<p className="tw-truncate tw-w-52" title={item.name as string}>
|
||||||
{item.name}
|
{item.name}
|
||||||
</span>
|
</p>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -120,9 +120,13 @@ const TeamsPage = () => {
|
|||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
errData['name'] = 'Name already exists';
|
errData['name'] = 'Name already exists';
|
||||||
|
} else if (data.name.length < 1 || data.name.length > 128) {
|
||||||
|
errData['name'] = 'Name size must be between 1 and 128';
|
||||||
}
|
}
|
||||||
if (!data.displayName?.trim()) {
|
if (!data.displayName?.trim()) {
|
||||||
errData['displayName'] = 'Display name is required';
|
errData['displayName'] = 'Display name is required';
|
||||||
|
} else if (data.displayName.length < 1 || data.displayName.length > 128) {
|
||||||
|
errData['displayName'] = 'Display name size must be between 1 and 128';
|
||||||
}
|
}
|
||||||
setErrorData(errData);
|
setErrorData(errData);
|
||||||
|
|
||||||
@ -424,7 +428,9 @@ const TeamsPage = () => {
|
|||||||
<div
|
<div
|
||||||
className="tw-flex tw-justify-between tw-items-center"
|
className="tw-flex tw-justify-between tw-items-center"
|
||||||
data-testid="header">
|
data-testid="header">
|
||||||
<div className="tw-heading tw-text-link tw-text-base">
|
<div
|
||||||
|
className="tw-heading tw-text-link tw-text-base tw-truncate tw-w-52"
|
||||||
|
title={currentTeam?.displayName}>
|
||||||
{currentTeam?.displayName}
|
{currentTeam?.displayName}
|
||||||
</div>
|
</div>
|
||||||
<NonAdminAction
|
<NonAdminAction
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import classNames from 'classnames';
|
||||||
import { isEmpty, isNil, isString } from 'lodash';
|
import { isEmpty, isNil, isString } from 'lodash';
|
||||||
import { Bucket, ExtraInfo, LeafNodes, LineagePos } from 'Models';
|
import { Bucket, ExtraInfo, LeafNodes, LineagePos } from 'Models';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
@ -432,7 +433,13 @@ export const getInfoElements = (data: ExtraInfo) => {
|
|||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
target={data.openInNewTab ? '_blank' : '_self'}>
|
target={data.openInNewTab ? '_blank' : '_self'}>
|
||||||
<>
|
<>
|
||||||
<span className="tw-mr-1">{displayVal}</span>
|
<span
|
||||||
|
className={classNames('tw-mr-1 tw-inline-block tw-truncate', {
|
||||||
|
'tw-w-52': (displayVal as string).length > 32,
|
||||||
|
})}
|
||||||
|
title={displayVal as string}>
|
||||||
|
{displayVal}
|
||||||
|
</span>
|
||||||
{data.openInNewTab && (
|
{data.openInNewTab && (
|
||||||
<SVGIcons
|
<SVGIcons
|
||||||
alt="external-link"
|
alt="external-link"
|
||||||
@ -444,7 +451,20 @@ export const getInfoElements = (data: ExtraInfo) => {
|
|||||||
</>
|
</>
|
||||||
</a>
|
</a>
|
||||||
) : (
|
) : (
|
||||||
displayVal
|
<>
|
||||||
|
{data.key === 'Owner' ? (
|
||||||
|
<span
|
||||||
|
className={classNames(
|
||||||
|
'tw-mr-1 tw-inline-block tw-truncate tw-align-text-bottom',
|
||||||
|
{ 'tw-w-52': (displayVal as string).length > 32 }
|
||||||
|
)}
|
||||||
|
title={displayVal as string}>
|
||||||
|
{displayVal}
|
||||||
|
</span>
|
||||||
|
) : (
|
||||||
|
<span>{displayVal}</span>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
) : null}
|
) : null}
|
||||||
|
@ -356,6 +356,9 @@ export const feedSummaryFromatter = (
|
|||||||
}
|
}
|
||||||
|
|
||||||
case fieldChange?.name === 'owner': {
|
case fieldChange?.name === 'owner': {
|
||||||
|
const ownerName =
|
||||||
|
getOwnerName(newValue?.id as string) ||
|
||||||
|
getOwnerName(value?.id as string);
|
||||||
const ownerText =
|
const ownerText =
|
||||||
!isEmpty(oldValue) && !isEmpty(newValue) ? (
|
!isEmpty(oldValue) && !isEmpty(newValue) ? (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
@ -363,11 +366,11 @@ export const feedSummaryFromatter = (
|
|||||||
<Link
|
<Link
|
||||||
className="tw-pl-1"
|
className="tw-pl-1"
|
||||||
to={getTeamDetailsPath(newValue?.name || '')}>
|
to={getTeamDetailsPath(newValue?.name || '')}>
|
||||||
{getOwnerName(newValue?.id as string)}
|
<span title={ownerName}>{ownerName}</span>
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
<span className="tw-pl-1">
|
<span className="tw-pl-1" title={ownerName}>
|
||||||
{getOwnerName(newValue?.id as string)}
|
{ownerName}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</Fragment>
|
</Fragment>
|
||||||
@ -377,17 +380,21 @@ export const feedSummaryFromatter = (
|
|||||||
<Link
|
<Link
|
||||||
className="tw-pl-1"
|
className="tw-pl-1"
|
||||||
to={getTeamDetailsPath(value?.name || '')}>
|
to={getTeamDetailsPath(value?.name || '')}>
|
||||||
{getOwnerName(value?.id as string)}
|
<span title={ownerName}>{ownerName}</span>
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
<span className="tw-pl-1">
|
<span className="tw-pl-1" title={ownerName}>
|
||||||
{getOwnerName(value?.id as string)}
|
{ownerName}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
summary = (
|
summary = (
|
||||||
<p key={uniqueId()}>
|
<p
|
||||||
|
className={classNames('tw-truncate', {
|
||||||
|
'tw-w-52': ownerName.length > 32,
|
||||||
|
})}
|
||||||
|
key={uniqueId()}>
|
||||||
{`Assigned ownership to`}
|
{`Assigned ownership to`}
|
||||||
{ownerText}
|
{ownerText}
|
||||||
</p>
|
</p>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user