UI improvements and minor fixes (#11055)

This commit is contained in:
Ashish Gupta 2023-04-14 10:41:59 +05:30 committed by GitHub
parent bdcd97dcd1
commit 91b04ee9a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 41 additions and 105 deletions

View File

@ -27,7 +27,11 @@ import { isUndefined, trim } from 'lodash';
import React, { useEffect, useMemo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { checkEmailInUse, generateRandomPwd } from 'rest/auth-API';
import { getBotsPagePath, getUsersPagePath } from '../../constants/constants';
import {
getBotsPagePath,
getUsersPagePath,
VALIDATE_MESSAGES,
} from '../../constants/constants';
import { passwordErrorMessage } from '../../constants/ErrorMessages.constant';
import {
passwordRegex,
@ -710,7 +714,7 @@ const CreateUser = ({
form={form}
id="create-user-bot-form"
layout="vertical"
validateMessages={{ required: '${label} is required' }}
validateMessages={VALIDATE_MESSAGES}
onFinish={handleSave}>
<Form.Item
label={t('label.email')}

View File

@ -12,6 +12,7 @@
*/
import { Button, Col, Form, Input, Row, Select, Switch } from 'antd';
import { VALIDATE_MESSAGES } from 'constants/constants';
import { TRANSPORTATION_STRATEGY_OPTIONS } from 'constants/EmailConfig.constants';
import { SMTPSettings } from 'generated/email/smtpSettings';
import React, { FocusEvent } from 'react';
@ -42,11 +43,7 @@ function EmailConfigForm({
initialValues={emailConfigValues}
layout="vertical"
name="email-configuration"
validateMessages={{
required: t('message.field-text-is-required', {
fieldText: '${label}',
}),
}}
validateMessages={VALIDATE_MESSAGES}
onBlur={onBlur}
onFinish={onSubmit}
onFocus={onFocus}>

View File

@ -1417,10 +1417,13 @@ const EntityLineageComponent: FunctionComponent<EntityLineageProp> = ({
);
const allTableNodes = nodes.filter(
(node) =>
node.type === EntityType.TABLE &&
isUndefined(tableColumnsRef.current[node.id])
[EntityType.TABLE, EntityType.DASHBOARD_DATA_MODEL].includes(
node.type as EntityType
) && isUndefined(tableColumnsRef.current[node.id])
);
console.log(allTableNodes);
allTableNodes.length &&
allTableNodes.map(async (node) => await getTableColumns(node));
toggleColumnView(true);

View File

@ -20,7 +20,6 @@
@section-header-color: #6b7280;
.summary-panel-container {
background-color: @background-color;
margin-right: -8px;
position: sticky;
height: calc(100vh - @summary-panel-offset);

View File

@ -420,14 +420,14 @@ const Explore: React.FC<ExploreProps> = ({
</Col>
</Row>
</Col>
{showSummaryPanel && entityDetails && (
{showSummaryPanel && entityDetails ? (
<Col flex="400px">
<EntitySummaryPanel
entityDetails={{ details: entityDetails }}
handleClosePanel={handleClosePanel}
/>
</Col>
)}
) : null}
</Row>
</>
)}

View File

@ -13,6 +13,7 @@
import { Form, Input, Modal, Space } from 'antd';
import { AxiosError } from 'axios';
import { VALIDATE_MESSAGES } from 'constants/constants';
import { observer } from 'mobx-react';
import React, { FC, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
@ -22,7 +23,6 @@ import {
CreateThread,
ThreadType,
} from '../../../generated/api/feed/createThread';
import { validateMessages } from '../../../utils/AnnouncementsUtils';
import { getEntityFeedLink } from '../../../utils/EntityUtils';
import { getTimeZone, getUTCDateTime } from '../../../utils/TimeUtils';
import { showErrorToast, showSuccessToast } from '../../../utils/ToastUtils';
@ -112,7 +112,7 @@ const AddAnnouncementModal: FC<Props> = ({
data-testid="announcement-form"
id="announcement-form"
layout="vertical"
validateMessages={validateMessages}
validateMessages={VALIDATE_MESSAGES}
onFinish={handleCreateAnnouncement}>
<Form.Item
label={`${t('label.title')}:`}

View File

@ -12,11 +12,11 @@
*/
import { Form, Input, Modal, Space } from 'antd';
import { VALIDATE_MESSAGES } from 'constants/constants';
import { observer } from 'mobx-react';
import React, { FC, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { AnnouncementDetails } from '../../../generated/entity/feed/thread';
import { validateMessages } from '../../../utils/AnnouncementsUtils';
import {
getLocaleDateFromTimeStamp,
getTimeZone,
@ -92,7 +92,7 @@ const EditAnnouncementModal: FC<Props> = ({
id="announcement-form"
initialValues={{ title, startDate, endDate }}
layout="vertical"
validateMessages={validateMessages}
validateMessages={VALIDATE_MESSAGES}
onFinish={handleConfirm}>
<Form.Item
label={`${t('label.title')}:`}

View File

@ -12,6 +12,7 @@
*/
import { Form, Input, Modal } from 'antd';
import { VALIDATE_MESSAGES } from 'constants/constants';
import React from 'react';
import { useTranslation } from 'react-i18next';
import { passwordErrorMessage } from '../../constants/ErrorMessages.constant';
@ -63,7 +64,7 @@ const ChangePasswordForm: React.FC<ChangePasswordForm> = ({
id="change-password-form"
layout="vertical"
name="change-password-form"
validateMessages={{ required: '${label} is required' }}
validateMessages={VALIDATE_MESSAGES}
onFinish={onSave}>
{isLoggedinUser && (
<Form.Item

View File

@ -14,7 +14,7 @@
@import url('../../../styles/variables.less');
@active-border-color: #1890ff;
@active-box-shadow: 4px 6px 8px rgba(0, 0, 0, 0.14);
@hover-box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.13);
.data-asset-info-card-container {
border: 1px solid @border-color;
@ -24,14 +24,14 @@
transition: 0.3s ease-in-out;
box-shadow: @card-shadow;
&:hover {
box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.13);
box-shadow: @hover-box-shadow;
}
}
.highlight-card {
border-left: 3px solid @active-border-color;
box-shadow: @active-box-shadow;
box-shadow: @hover-box-shadow;
&:hover {
box-shadow: @active-box-shadow;
box-shadow: @hover-box-shadow;
}
}

View File

@ -194,13 +194,6 @@ export const ENTITIES_SUMMARY_LIST = [
},
];
export const VALIDATE_MESSAGES = {
required: '${fieldName} is required!',
string: {
range: '${fieldName} must be between ${min} and ${max} character.',
},
};
export const SUPPORTED_CHARTS_FOR_KPI = [
DataInsightChartType.PercentageOfEntitiesWithDescriptionByType,
DataInsightChartType.PercentageOfEntitiesWithOwnerByType,

View File

@ -49,7 +49,7 @@ export enum GlobalSettingOptions {
ALERT = 'alert',
ADD_ALERTS = 'add-alerts',
EDIT_ALERTS = 'edit-alert',
STORAGES = 'storage',
STORAGES = 'storages',
}
export const GLOBAL_SETTING_PERMISSION_RESOURCES = [

View File

@ -15,20 +15,6 @@ import i18n from 'utils/i18next/LocalUtil';
export const NO_AUTH = 'no-auth';
export const VALIDATION_MESSAGES = {
required: i18n.t('message.field-text-is-required', {
fieldText: '${label}',
}),
types: {
email: i18n.t('message.entity-is-not-valid', {
entity: '${label}',
}),
},
whitespace: i18n.t('message.field-text-is-required', {
fieldText: '${label}',
}),
};
export const LOGIN_FAILED_ERROR = i18n.t('server.invalid-username-or-password');
export const HTTP_STATUS_CODE = {

View File

@ -38,11 +38,10 @@ import { useTranslation } from 'react-i18next';
import { useHistory } from 'react-router-dom';
import { getListDataInsightCharts } from 'rest/DataInsightAPI';
import { getListKPIs, postKPI } from 'rest/KpiAPI';
import { ROUTES } from '../../constants/constants';
import { ROUTES, VALIDATE_MESSAGES } from '../../constants/constants';
import {
KPI_DATE_PICKER_FORMAT,
SUPPORTED_CHARTS_FOR_KPI,
VALIDATE_MESSAGES,
} from '../../constants/DataInsight.constants';
import {
CreateKpiRequest,

View File

@ -40,11 +40,8 @@ import { useTranslation } from 'react-i18next';
import { useHistory, useParams } from 'react-router-dom';
import { getChartById } from 'rest/DataInsightAPI';
import { getKPIByName, patchKPI } from 'rest/KpiAPI';
import { ROUTES } from '../../constants/constants';
import {
KPI_DATE_PICKER_FORMAT,
VALIDATE_MESSAGES,
} from '../../constants/DataInsight.constants';
import { ROUTES, VALIDATE_MESSAGES } from '../../constants/constants';
import { KPI_DATE_PICKER_FORMAT } from '../../constants/DataInsight.constants';
import { DataInsightChart } from '../../generated/dataInsight/dataInsightChart';
import { Kpi, KpiTargetType } from '../../generated/dataInsight/kpi/kpi';
import { useAuth } from '../../hooks/authHooks';

View File

@ -18,7 +18,11 @@ import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useHistory } from 'react-router-dom';
import { getListTestSuites } from 'rest/testAPI';
import { PAGE_SIZE_MEDIUM, ROUTES } from '../../constants/constants';
import {
PAGE_SIZE_MEDIUM,
ROUTES,
VALIDATION_MESSAGES,
} from '../../constants/constants';
import { TestSuite } from '../../generated/tests/testSuite';
import jsonData from '../../jsons/en';
import { AddTestSuiteFormProps } from './testSuite.interface';
@ -30,12 +34,6 @@ const AddTestSuiteForm: React.FC<AddTestSuiteFormProps> = ({ onSubmit }) => {
const [isLoading, setIsLoading] = useState<boolean>(false);
const history = useHistory();
const validateMessages = {
required: t('message.field-text-is-required', {
fieldText: '${label}',
}),
};
const fetchTestSuites = async () => {
try {
setIsLoading(true);
@ -65,7 +63,7 @@ const AddTestSuiteForm: React.FC<AddTestSuiteFormProps> = ({ onSubmit }) => {
form={form}
layout="vertical"
name="selectTestSuite"
validateMessages={validateMessages}
validateMessages={VALIDATION_MESSAGES}
onFinish={(data) => onSubmit(data)}>
<Form.Item
label={t('label.name')}

View File

@ -34,8 +34,7 @@ import React, { useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useHistory } from 'react-router-dom';
import loginBG from '../../assets/img/login-bg.png';
import { VALIDATION_MESSAGES } from '../../constants/auth.constants';
import { ROUTES } from '../../constants/constants';
import { ROUTES, VALIDATION_MESSAGES } from '../../constants/constants';
import { AuthTypes } from '../../enums/signin.enum';
import localState from '../../utils/LocalStorageUtils';
import SVGIcons, { Icons } from '../../utils/SvgUtils';

View File

@ -17,8 +17,7 @@ import { useBasicAuth } from 'components/authentication/auth-provider/basic-auth
import React, { useEffect, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { useHistory, useLocation } from 'react-router-dom';
import { VALIDATION_MESSAGES } from '../../constants/auth.constants';
import { ROUTES } from '../../constants/constants';
import { ROUTES, VALIDATION_MESSAGES } from '../../constants/constants';
import { passwordRegex } from '../../constants/regex.constants';
import { PasswordResetRequest } from '../../generated/auth/passwordResetRequest';
import SVGIcons, { Icons } from '../../utils/SvgUtils';

View File

@ -19,7 +19,7 @@ import React, { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { useHistory } from 'react-router-dom';
import loginBG from '../../assets/img/login-bg.png';
import { ROUTES } from '../../constants/constants';
import { ROUTES, VALIDATION_MESSAGES } from '../../constants/constants';
import { passwordErrorMessage } from '../../constants/ErrorMessages.constant';
import { passwordRegex } from '../../constants/regex.constants';
import { AuthTypes } from '../../enums/signin.enum';
@ -66,20 +66,6 @@ const BasicSignUp = () => {
const handleLogin = () => history.push(ROUTES.SIGNIN);
const validationMessages = {
required: t('message.field-text-is-required', {
fieldText: '${label}',
}),
types: {
email: t('message.entity-is-not-valid', {
entity: '${label}',
}),
},
whitespace: t('message.entity-not-contain-whitespace', {
entity: '${label}',
}),
};
return (
<div className="d-flex flex-col h-full">
<div className="d-flex bg-body-main flex-grow" data-testid="signin-page">
@ -100,7 +86,7 @@ const BasicSignUp = () => {
className="mt-20"
form={form}
layout="vertical"
validateMessages={validationMessages}
validateMessages={VALIDATION_MESSAGES}
onFinish={handleSubmit}>
<Form.Item
label={t('label.entity-name', {

View File

@ -15,6 +15,7 @@ import { Form, Input, Modal, Select } from 'antd';
import { AxiosError } from 'axios';
import RichTextEditor from 'components/common/rich-text-editor/RichTextEditor';
import { EditorContentRef } from 'components/common/rich-text-editor/RichTextEditor.interface';
import { VALIDATION_MESSAGES } from 'constants/constants';
import { isUndefined, toLower, trim } from 'lodash';
import React, { useEffect, useMemo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
@ -51,25 +52,6 @@ const AddTeamForm: React.FC<AddTeamFormType> = ({
}));
}, []);
const validationMessages = useMemo(
() => ({
required: t('message.field-text-is-required', {
fieldText: '${label}',
}),
string: {
range: t('message.entity-size-in-between', {
entity: '${label}',
min: '${min}',
max: '${max}',
}),
},
whitespace: t('message.entity-not-contain-whitespace', {
entity: '${label}',
}),
}),
[]
);
const handleSubmit = (data: Team) => {
data = {
...data,
@ -121,7 +103,7 @@ const AddTeamForm: React.FC<AddTeamFormType> = ({
}}
layout="vertical"
name="add-team-nest-messages"
validateMessages={validationMessages}
validateMessages={VALIDATION_MESSAGES}
onFinish={handleSubmit}>
<Form.Item
label={t('label.name')}

View File

@ -21,13 +21,6 @@ export const ANNOUNCEMENT_ENTITIES = [
EntityType.MLMODEL,
];
export const validateMessages = {
required: '${fieldName} is required!',
string: {
range: '${fieldName} must be between ${min} and ${max} character.',
},
};
export const isActiveAnnouncement = (startTime: number, endTime: number) => {
const currentTime = Date.now() / 1000;