This commit is contained in:
Sachin Chaurasiya 2022-02-03 19:57:02 +05:30 committed by GitHub
parent 43f4417f8d
commit abb4d0f218
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 14 deletions

View File

@ -51,6 +51,7 @@ import {
getSeparator,
getServiceLogo,
requiredField,
restrictFormSubmit,
} from '../../../utils/CommonUtils';
import {
getIngestionTypeList,
@ -2149,7 +2150,10 @@ export const AddServiceModal: FunctionComponent<Props> = ({
}
steps={steps}
/>
<form className="tw-min-w-full" data-testid="form">
<form
className="tw-min-w-full"
data-testid="form"
onSubmit={restrictFormSubmit}>
<div className="tw-px-4 tw-pt-3 tw-mx-auto">
{getActiveStepFields(activeStepperStep)}
</div>

View File

@ -119,7 +119,6 @@ const ServicesPage = () => {
const [editData, setEditData] = useState<ServiceDataObj>();
const [isLoading, setIsLoading] = useState<boolean>(false);
const [searchText, setSearchText] = useState('');
const [currentTabTotalCount, setCurrentTabTotalCount] = useState(0);
const [servicesCount, setServicesCount] = useState({
databaseServices: 0,
@ -168,7 +167,6 @@ const ServicesPage = () => {
setServiceList(
serviceRecord[serviceName] as unknown as Array<ServiceDataObj>
);
setCurrentTabTotalCount(servicePaging[serviceName].total || 0);
}
setIsLoading(false);
}
@ -349,10 +347,6 @@ const ServicesPage = () => {
const handleTabChange = (tabName: ServiceTypes) => {
setSearchText('');
setServicesCount({
...servicesCount,
[serviceName]: currentTabTotalCount,
});
setServiceName(tabName);
setServiceList(services[tabName] as unknown as Array<ServiceDataObj>);
};
@ -496,10 +490,6 @@ const ServicesPage = () => {
});
}, []);
useEffect(() => {
setCurrentTabTotalCount(servicesCount[serviceName]);
}, [serviceName]);
return (
<>
{!isLoading ? (

View File

@ -346,8 +346,8 @@ const TeamsPage = () => {
}}>
<p
className="tag-category label-category tw-self-center tw-truncate tw-w-52"
title={team.displayName}>
{team.displayName}
title={team.displayName ?? team.name}>
{team.displayName ?? team.name}
</p>
</div>
))}

View File

@ -20,7 +20,7 @@ import {
RecentlyViewedData,
} from 'Models';
import { utc } from 'moment';
import React from 'react';
import React, { FormEvent } from 'react';
import { reactLocalStorage } from 'reactjs-localstorage';
import AppState from '../AppState';
import {
@ -382,3 +382,7 @@ export const getFields = (defaultFields: string, tabSpecificField: string) => {
return `${defaultFields}, ${tabSpecificField}`;
};
export const restrictFormSubmit = (e: FormEvent) => {
e.preventDefault();
};