mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-01 05:03:10 +00:00
fix the ui around domain label, data filter and search index table entity stats (#15720)
* fix the ui around domain label, data filter and searchindex table entity stats * remove unwanted file change * changes as per comments * changes as per comments * fix the missing dependency
This commit is contained in:
parent
eee26e18b0
commit
a3689cad54
@ -177,7 +177,7 @@ const ExecutionsTab = ({ pipelineFQN, tasks }: ExecutionProps) => {
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
setIsClickedCalendar(true);
|
setIsClickedCalendar(true);
|
||||||
}}>
|
}}>
|
||||||
<span>
|
<span className="date-container">
|
||||||
{!datesSelected && (
|
{!datesSelected && (
|
||||||
<label>{t('label.date-filter')}</label>
|
<label>{t('label.date-filter')}</label>
|
||||||
)}
|
)}
|
||||||
|
@ -11,21 +11,31 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.executions-date-picker {
|
.ant-picker-range.executions-date-picker {
|
||||||
|
padding: 0 6px 0 0;
|
||||||
|
max-width: 200px;
|
||||||
.ant-picker-range-separator {
|
.ant-picker-range-separator {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.ant-picker-clear {
|
.ant-picker-clear {
|
||||||
right: 4px;
|
right: -6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-picker-active-bar {
|
||||||
|
margin-left: 0;
|
||||||
|
width: 85px !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.range-picker-button-width {
|
.range-picker-button-width {
|
||||||
@apply delay-100;
|
|
||||||
max-width: 130px;
|
max-width: 130px;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.range-picker-button {
|
.range-picker-button {
|
||||||
padding: 0px 8px;
|
padding: 0px 8px;
|
||||||
|
|
||||||
|
.date-container {
|
||||||
|
display: inline-flex;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -241,22 +241,21 @@ const UserProfileDetails = ({
|
|||||||
|
|
||||||
const userDomainRender = useMemo(
|
const userDomainRender = useMemo(
|
||||||
() => (
|
() => (
|
||||||
<Space align="center">
|
<div className="d-flex items-center gap-2">
|
||||||
<Typography.Text
|
<Typography.Text
|
||||||
className="text-grey-muted"
|
className="text-grey-muted"
|
||||||
data-testid="user-domain-label">{`${t(
|
data-testid="user-domain-label">{`${t(
|
||||||
'label.domain'
|
'label.domain'
|
||||||
)} :`}</Typography.Text>
|
)} :`}</Typography.Text>
|
||||||
<Space align="center">
|
<DomainLabel
|
||||||
<DomainLabel
|
domain={userData?.domain}
|
||||||
domain={userData?.domain}
|
entityFqn={userData.fullyQualifiedName ?? ''}
|
||||||
entityFqn={userData.fullyQualifiedName ?? ''}
|
entityId={userData.id ?? ''}
|
||||||
entityId={userData.id ?? ''}
|
entityType={EntityType.USER}
|
||||||
entityType={EntityType.USER}
|
hasPermission={false}
|
||||||
hasPermission={false}
|
textClassName="text-sm text-grey-muted"
|
||||||
/>
|
/>
|
||||||
</Space>
|
</div>
|
||||||
</Space>
|
|
||||||
),
|
),
|
||||||
[userData.domain]
|
[userData.domain]
|
||||||
);
|
);
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
import { Space, Typography } from 'antd';
|
import { Typography } from 'antd';
|
||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { compare } from 'fast-json-patch';
|
import { compare } from 'fast-json-patch';
|
||||||
@ -41,6 +41,7 @@ export const DomainLabel = ({
|
|||||||
entityType,
|
entityType,
|
||||||
entityFqn,
|
entityFqn,
|
||||||
entityId,
|
entityId,
|
||||||
|
textClassName,
|
||||||
showDomainHeading = false,
|
showDomainHeading = false,
|
||||||
}: DomainLabelProps) => {
|
}: DomainLabelProps) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@ -74,7 +75,7 @@ export const DomainLabel = ({
|
|||||||
showErrorToast(err as AxiosError);
|
showErrorToast(err as AxiosError);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[entityType, entityFqn, afterDomainUpdateAction]
|
[entityType, entityId, entityFqn, afterDomainUpdateAction]
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -87,7 +88,8 @@ export const DomainLabel = ({
|
|||||||
<Link
|
<Link
|
||||||
className={classNames(
|
className={classNames(
|
||||||
'text-primary no-underline domain-link',
|
'text-primary no-underline domain-link',
|
||||||
!showDomainHeading ? 'font-medium text-xs' : ''
|
{ 'font-medium text-xs': !showDomainHeading },
|
||||||
|
textClassName
|
||||||
)}
|
)}
|
||||||
data-testid="domain-link"
|
data-testid="domain-link"
|
||||||
to={getDomainPath(activeDomain?.fullyQualifiedName)}>
|
to={getDomainPath(activeDomain?.fullyQualifiedName)}>
|
||||||
@ -101,14 +103,15 @@ export const DomainLabel = ({
|
|||||||
<Typography.Text
|
<Typography.Text
|
||||||
className={classNames(
|
className={classNames(
|
||||||
'domain-link',
|
'domain-link',
|
||||||
!showDomainHeading ? 'font-medium text-xs' : ''
|
{ 'font-medium text-xs': !showDomainHeading },
|
||||||
|
textClassName
|
||||||
)}
|
)}
|
||||||
data-testid="no-domain-text">
|
data-testid="no-domain-text">
|
||||||
{t('label.no-entity', { entity: t('label.domain') })}
|
{t('label.no-entity', { entity: t('label.domain') })}
|
||||||
</Typography.Text>
|
</Typography.Text>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}, [activeDomain, domainDisplayName]);
|
}, [activeDomain, domainDisplayName, showDomainHeading, textClassName]);
|
||||||
|
|
||||||
const selectableList = useMemo(() => {
|
const selectableList = useMemo(() => {
|
||||||
return (
|
return (
|
||||||
@ -120,7 +123,7 @@ export const DomainLabel = ({
|
|||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}, [hasPermission, activeDomain]);
|
}, [hasPermission, activeDomain, handleDomainSave]);
|
||||||
|
|
||||||
const label = useMemo(() => {
|
const label = useMemo(() => {
|
||||||
if (showDomainHeading) {
|
if (showDomainHeading) {
|
||||||
@ -133,7 +136,7 @@ export const DomainLabel = ({
|
|||||||
{selectableList}
|
{selectableList}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Space>
|
<div className="d-flex items-center gap-1">
|
||||||
<DomainIcon
|
<DomainIcon
|
||||||
className="d-flex"
|
className="d-flex"
|
||||||
color={DE_ACTIVE_COLOR}
|
color={DE_ACTIVE_COLOR}
|
||||||
@ -142,13 +145,15 @@ export const DomainLabel = ({
|
|||||||
width={16}
|
width={16}
|
||||||
/>
|
/>
|
||||||
{domainLink}
|
{domainLink}
|
||||||
</Space>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Space data-testid="header-domain-container">
|
<div
|
||||||
|
className="d-flex items-center gap-1"
|
||||||
|
data-testid="header-domain-container">
|
||||||
<Typography.Text className="self-center text-xs whitespace-nowrap">
|
<Typography.Text className="self-center text-xs whitespace-nowrap">
|
||||||
<DomainIcon
|
<DomainIcon
|
||||||
className="d-flex"
|
className="d-flex"
|
||||||
@ -161,7 +166,7 @@ export const DomainLabel = ({
|
|||||||
{domainLink}
|
{domainLink}
|
||||||
|
|
||||||
{selectableList}
|
{selectableList}
|
||||||
</Space>
|
</div>
|
||||||
);
|
);
|
||||||
}, [activeDomain, hasPermission, selectableList]);
|
}, [activeDomain, hasPermission, selectableList]);
|
||||||
|
|
||||||
|
@ -23,5 +23,6 @@ export type DomainLabelProps = {
|
|||||||
entityType: EntityType;
|
entityType: EntityType;
|
||||||
entityFqn: string;
|
entityFqn: string;
|
||||||
entityId: string;
|
entityId: string;
|
||||||
|
textClassName?: string;
|
||||||
showDomainHeading?: boolean;
|
showDomainHeading?: boolean;
|
||||||
};
|
};
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { upperFirst } from 'lodash';
|
||||||
import { getEntityStatsData } from './ApplicationUtils';
|
import { getEntityStatsData } from './ApplicationUtils';
|
||||||
import {
|
import {
|
||||||
MOCK_APPLICATION_ENTITY_STATS,
|
MOCK_APPLICATION_ENTITY_STATS,
|
||||||
@ -21,6 +22,11 @@ describe('ApplicationUtils tests', () => {
|
|||||||
it('getEntityStatsData should return stats data in array', () => {
|
it('getEntityStatsData should return stats data in array', () => {
|
||||||
const resultData = getEntityStatsData(MOCK_APPLICATION_ENTITY_STATS);
|
const resultData = getEntityStatsData(MOCK_APPLICATION_ENTITY_STATS);
|
||||||
|
|
||||||
expect(resultData).toEqual(MOCK_APPLICATION_ENTITY_STATS_DATA);
|
expect(resultData).toEqual(
|
||||||
|
MOCK_APPLICATION_ENTITY_STATS_DATA.map((data) => ({
|
||||||
|
...data,
|
||||||
|
name: upperFirst(data.name),
|
||||||
|
}))
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
@ -10,6 +10,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
import { upperFirst } from 'lodash';
|
||||||
import { StatusType } from '../components/common/StatusBadge/StatusBadge.interface';
|
import { StatusType } from '../components/common/StatusBadge/StatusBadge.interface';
|
||||||
import {
|
import {
|
||||||
EntityStats,
|
EntityStats,
|
||||||
@ -54,7 +55,7 @@ export const getStatusFromPipelineState = (status: PipelineState) => {
|
|||||||
|
|
||||||
export const getEntityStatsData = (data: EntityStats): EntityStatsData[] => {
|
export const getEntityStatsData = (data: EntityStats): EntityStatsData[] => {
|
||||||
return Object.keys(data).map((key) => ({
|
return Object.keys(data).map((key) => ({
|
||||||
name: key,
|
name: upperFirst(key),
|
||||||
...data[key as EntityTypeSearchIndex],
|
...data[key as EntityTypeSearchIndex],
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user