fix(ui): alignment on summary panel (#11174)

* fix(ui): alignment on summary panel
teams name validation
owner dropdown issue resolved

* fix cypress issue for users count
This commit is contained in:
Chirag Madlani 2023-04-21 12:26:23 +05:30 committed by GitHub
parent 6f5d88ff63
commit 00fe67bb83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 65 additions and 50 deletions

View File

@ -16,7 +16,7 @@ import { SEARCH_ENTITY_TABLE } from '../../constants/constants';
const TEAM_DETAILS = SEARCH_ENTITY_TABLE.table_1; const TEAM_DETAILS = SEARCH_ENTITY_TABLE.table_1;
const userURL = const userURL =
'/api/v1/search/query?q=***&from=0&size=10&index=user_search_index'; '/api/v1/search/query?q=**%20AND%20isBot:false&from=0&size=0&index=user_search_index';
const teamURL = const teamURL =
'/api/v1/search/query?q=*%20AND%20teamType:Group&from=0&size=10&index=team_search_index'; '/api/v1/search/query?q=*%20AND%20teamType:Group&from=0&size=10&index=team_search_index';

View File

@ -125,6 +125,7 @@ function DashboardSummary({
<Col data-testid="dashboard-url-value" span={16}> <Col data-testid="dashboard-url-value" span={16}>
{info.isLink ? ( {info.isLink ? (
<Link <Link
className="d-flex items-center"
component={Typography.Link} component={Typography.Link}
target={info.isExternal ? '_blank' : '_self'} target={info.isExternal ? '_blank' : '_self'}
to={{ pathname: info.url }}> to={{ pathname: info.url }}>
@ -136,9 +137,10 @@ function DashboardSummary({
{info.isExternal ? ( {info.isExternal ? (
<SVGIcons <SVGIcons
alt="external-link" alt="external-link"
className="m-l-xs" className="m-l-xss"
height="14px"
icon="external-link" icon="external-link"
width="12px" width="14px"
/> />
) : null} ) : null}
</Link> </Link>

View File

@ -91,15 +91,17 @@ function MlModelSummary({
<Col data-testid={`${info.name}-value`} span={16}> <Col data-testid={`${info.name}-value`} span={16}>
{info.isLink ? ( {info.isLink ? (
<Link <Link
className="d-flex items-center"
target={info.isExternal ? '_blank' : '_self'} target={info.isExternal ? '_blank' : '_self'}
to={{ pathname: info.url }}> to={{ pathname: info.url }}>
{info.value} {info.value}
{info.isExternal ? ( {info.isExternal ? (
<SVGIcons <SVGIcons
alt="external-link" alt="external-link"
className="m-l-xs" className="m-l-xss"
height="14px"
icon="external-link" icon="external-link"
width="12px" width="14px"
/> />
) : null} ) : null}
</Link> </Link>

View File

@ -93,6 +93,7 @@ function PipelineSummary({
{info.isLink ? ( {info.isLink ? (
<Space align="start"> <Space align="start">
<Typography.Link <Typography.Link
className="d-flex items-center"
data-testid="pipeline-link-name" data-testid="pipeline-link-name"
href={info.url} href={info.url}
target={info.isExternal ? '_blank' : '_self'}> target={info.isExternal ? '_blank' : '_self'}>
@ -100,9 +101,10 @@ function PipelineSummary({
{info.isExternal ? ( {info.isExternal ? (
<SVGIcons <SVGIcons
alt="external-link" alt="external-link"
className="m-l-xs" className="m-l-xss"
height="14px"
icon="external-link" icon="external-link"
width="12px" width="14px"
/> />
) : null} ) : null}
</Typography.Link> </Typography.Link>

View File

@ -29,7 +29,7 @@ export default function SummaryList({
const { t } = useTranslation(); const { t } = useTranslation();
return ( return (
<Row> <Row align="middle">
{isEmpty(formattedEntityData) ? ( {isEmpty(formattedEntityData) ? (
<div> <div>
<Text className="text-grey-body"> <Text className="text-grey-body">

View File

@ -15,7 +15,6 @@ import { Col, Divider, Row, Space, Typography } from 'antd';
import TagsViewer from 'components/Tag/TagsViewer/tags-viewer'; import TagsViewer from 'components/Tag/TagsViewer/tags-viewer';
import React from 'react'; import React from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { ReactComponent as IconTagGrey } from '../../../../../assets/svg/tag-grey.svg';
import { MAX_CHAR_LIMIT_ENTITY_SUMMARY } from '../../../../../constants/constants'; import { MAX_CHAR_LIMIT_ENTITY_SUMMARY } from '../../../../../constants/constants';
import { getTagValue } from '../../../../../utils/CommonUtils'; import { getTagValue } from '../../../../../utils/CommonUtils';
import { prepareConstraintIcon } from '../../../../../utils/TableUtils'; import { prepareConstraintIcon } from '../../../../../utils/TableUtils';
@ -46,9 +45,9 @@ function SummaryListItem({
</Col> </Col>
<Col span={24}> <Col span={24}>
<Row className="text-xs font-thin" gutter={[4, 4]}> <Row className="text-xs font-thin" gutter={[4, 4]}>
<Col> <Col className="self-center">
{entityDetails.type && ( {entityDetails.type && (
<Space size={4}> <Space className="h-6" size={4}>
<Text className="text-grey-muted">{`${t( <Text className="text-grey-muted">{`${t(
'label.type' 'label.type'
)}:`}</Text> )}:`}</Text>
@ -63,11 +62,11 @@ function SummaryListItem({
{entityDetails.algorithm && ( {entityDetails.algorithm && (
<> <>
<Col> <Col className="self-center">
<Divider type="vertical" /> <Divider type="vertical" />
</Col> </Col>
<Col> <Col className="self-center">
<Space size={4}> <Space className="h-6" size={4}>
<Text className="text-grey-muted">{`${t( <Text className="text-grey-muted">{`${t(
'label.algorithm' 'label.algorithm'
)}:`}</Text> )}:`}</Text>
@ -82,22 +81,16 @@ function SummaryListItem({
)} )}
{entityDetails.tags && entityDetails.tags.length !== 0 && ( {entityDetails.tags && entityDetails.tags.length !== 0 && (
<> <>
<Col> <Col className="self-center">
<Divider type="vertical" /> <Divider type="vertical" />
</Col> </Col>
<Col className="flex-grow"> <Col className="flex-grow">
<Space> <TagsViewer
<IconTagGrey sizeCap={-1}
className="w-12 h-12" tags={(entityDetails.tags || []).map((tag) =>
data-testid="tag-grey-icon" getTagValue(tag)
/> )}
<TagsViewer />
sizeCap={-1}
tags={(entityDetails.tags || []).map((tag) =>
getTagValue(tag)
)}
/>
</Space>
</Col> </Col>
</> </>
)} )}

View File

@ -119,7 +119,7 @@ export const SelectableList = ({
e.currentTarget.scrollHeight - e.currentTarget.scrollTop === e.currentTarget.scrollHeight - e.currentTarget.scrollTop ===
ADD_USER_CONTAINER_HEIGHT && ADD_USER_CONTAINER_HEIGHT &&
pagingInfo.after && pagingInfo.after &&
uniqueOptions.length !== pagingInfo.total uniqueOptions.length <= pagingInfo.total
) { ) {
const { data, paging } = await fetchOptions(searchText, pagingInfo.after); const { data, paging } = await fetchOptions(searchText, pagingInfo.after);

View File

@ -174,7 +174,15 @@ export const UserTeamSelectableList = ({
// Fetch and store count for Users tab // Fetch and store count for Users tab
const getUserCount = async () => { const getUserCount = async () => {
const res = await searchData('', 1, 0, '', '', '', SearchIndex.USER); const res = await searchData(
'',
1,
0,
'isBot:false',
'',
'',
SearchIndex.USER
);
setUserPaging({ total: res.data.hits.total.value }); setUserPaging({ total: res.data.hits.total.value });
}; };

View File

@ -16,12 +16,12 @@ import { AxiosError } from 'axios';
import RichTextEditor from 'components/common/rich-text-editor/RichTextEditor'; import RichTextEditor from 'components/common/rich-text-editor/RichTextEditor';
import { EditorContentRef } from 'components/common/rich-text-editor/RichTextEditor.interface'; import { EditorContentRef } from 'components/common/rich-text-editor/RichTextEditor.interface';
import { VALIDATION_MESSAGES } from 'constants/constants'; import { VALIDATION_MESSAGES } from 'constants/constants';
import { isUndefined, toLower, trim } from 'lodash'; import { ENTITY_NAME_REGEX } from 'constants/regex.constants';
import { toLower, trim } from 'lodash';
import React, { useEffect, useMemo, useRef, useState } from 'react'; import React, { useEffect, useMemo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { getTeams } from 'rest/teamsAPI'; import { getTeams } from 'rest/teamsAPI';
import { Team, TeamType } from '../../generated/entity/teams/team'; import { Team, TeamType } from '../../generated/entity/teams/team';
import { isUrlFriendlyName } from '../../utils/CommonUtils';
import { showErrorToast } from '../../utils/ToastUtils'; import { showErrorToast } from '../../utils/ToastUtils';
type AddTeamFormType = { type AddTeamFormType = {
@ -112,19 +112,17 @@ const AddTeamForm: React.FC<AddTeamFormType> = ({
max: 128, max: 128,
whitespace: true, whitespace: true,
}, },
{
pattern: ENTITY_NAME_REGEX,
message: t('message.entity-pattern-validation', {
entity: `${t('label.name')}`,
pattern: `- _ & . '`,
}),
},
{ {
validator: (_, value) => { validator: (_, value) => {
if (!isUrlFriendlyName(value)) {
return Promise.reject(
t('message.special-character-not-allowed')
);
}
if ( if (
!isUndefined( allTeam.some((team) => toLower(team.name) === toLower(value))
allTeam.find(
(item) => toLower(item.name) === toLower(value)
)
)
) { ) {
return Promise.reject( return Promise.reject(
t('message.entity-already-exists', { t('message.entity-already-exists', {

View File

@ -11,7 +11,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { Space, Typography } from 'antd'; import { Typography } from 'antd';
import { NO_DATA_PLACEHOLDER } from 'constants/constants'; import { NO_DATA_PLACEHOLDER } from 'constants/constants';
import { isEmpty } from 'lodash'; import { isEmpty } from 'lodash';
import React from 'react'; import React from 'react';
@ -65,12 +65,17 @@ export const getFormattedEntityData = (
name: chart.name, name: chart.name,
title: ( title: (
<Link target="_blank" to={{ pathname: chart.chartUrl }}> <Link target="_blank" to={{ pathname: chart.chartUrl }}>
<Space className="m-b-xs"> <div className="d-flex items-center m-b-xs">
<Text className="entity-title text-primary font-medium"> <Text className="entity-title text-primary font-medium m-r-xss">
{getTitleName(chart)} {getTitleName(chart)}
</Text> </Text>
<SVGIcons alt="external-link" icon="external-link" width="12px" /> <SVGIcons
</Space> alt="external-link"
height="14px"
icon="external-link"
width="14px"
/>
</div>
</Link> </Link>
), ),
type: chart.chartType, type: chart.chartType,
@ -83,12 +88,17 @@ export const getFormattedEntityData = (
name: task.name, name: task.name,
title: ( title: (
<Link target="_blank" to={{ pathname: task.taskUrl }}> <Link target="_blank" to={{ pathname: task.taskUrl }}>
<Space className="m-b-xs"> <div className="d-flex items-center m-b-xs">
<Text className="entity-title text-primary font-medium"> <Text className="entity-title text-primary font-medium m-r-xss">
{getTitleName(task)} {getTitleName(task)}
</Text> </Text>
<SVGIcons alt="external-link" icon="external-link" width="12px" /> <SVGIcons
</Space> alt="external-link"
height="14px"
icon="external-link"
width="14px"
/>
</div>
</Link> </Link>
), ),
type: task.taskType, type: task.taskType,