#19850: fix the scroll issue for action button in Glossary import (#19965)

* fix the scroll issue for action button in Glossary import

* minor translation fix

* fix sonar issue
This commit is contained in:
Ashish Gupta 2025-02-25 19:38:55 +05:30 committed by GitHub
parent 769e681348
commit df00d2f392
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 45 additions and 53 deletions

View File

@ -432,8 +432,8 @@ const BulkEntityImport = ({
<Col span={24}> <Col span={24}>
<Stepper activeStep={activeStep} steps={ENTITY_IMPORT_STEPS} /> <Stepper activeStep={activeStep} steps={ENTITY_IMPORT_STEPS} />
</Col> </Col>
<Col span={24}> {activeAsyncImportJob?.jobId && (
{activeAsyncImportJob?.jobId && ( <Col span={24}>
<Banner <Banner
className="border-radius" className="border-radius"
isLoading={!activeAsyncImportJob.error} isLoading={!activeAsyncImportJob.error}
@ -442,8 +442,8 @@ const BulkEntityImport = ({
} }
type={activeAsyncImportJob.error ? 'error' : 'success'} type={activeAsyncImportJob.error ? 'error' : 'success'}
/> />
)} </Col>
</Col> )}
<Col span={24}> <Col span={24}>
{activeStep === 0 && ( {activeStep === 0 && (
<> <>

View File

@ -381,7 +381,7 @@ const GlossaryDetails = ({
type={EntityType.GLOSSARY} type={EntityType.GLOSSARY}
onUpdate={handleGlossaryUpdate}> onUpdate={handleGlossaryUpdate}>
<Row <Row
className="glossary-details" className="glossary-details p-t-sm"
data-testid="glossary-details" data-testid="glossary-details"
gutter={[0, 16]}> gutter={[0, 16]}>
<Col <Col

View File

@ -37,6 +37,10 @@ jest.mock('../../common/Loader/Loader', () =>
jest.fn().mockReturnValue(<div data-testid="loader">Loader</div>) jest.fn().mockReturnValue(<div data-testid="loader">Loader</div>)
); );
jest.mock('../../PageLayoutV1/PageLayoutV1', () => {
return jest.fn().mockImplementation(({ children }) => <p>{children}</p>);
});
jest.mock('../../BulkImport/BulkEntityImport.component', () => jest.mock('../../BulkImport/BulkEntityImport.component', () =>
jest.fn().mockImplementation(({ onSuccess, onValidateCsvString }) => ( jest.fn().mockImplementation(({ onSuccess, onValidateCsvString }) => (
<div> <div>
@ -87,7 +91,6 @@ describe('Import Glossary', () => {
render(<ImportGlossary glossaryName={glossaryName} />); render(<ImportGlossary glossaryName={glossaryName} />);
expect(await screen.findByTestId('breadcrumb')).toBeInTheDocument(); expect(await screen.findByTestId('breadcrumb')).toBeInTheDocument();
expect(await screen.findByTestId('title')).toBeInTheDocument();
expect(screen.getByText('BulkEntityImport')).toBeInTheDocument(); expect(screen.getByText('BulkEntityImport')).toBeInTheDocument();
expect(screen.getByText('SuccessButton')).toBeInTheDocument(); expect(screen.getByText('SuccessButton')).toBeInTheDocument();
expect(screen.getByText('ValidateCsvButton')).toBeInTheDocument(); expect(screen.getByText('ValidateCsvButton')).toBeInTheDocument();

View File

@ -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 { Col, Row, Typography } from 'antd'; import { Col, Row } from 'antd';
import { AxiosError } from 'axios'; import { AxiosError } from 'axios';
import React, { FC, useMemo } from 'react'; import React, { FC, useMemo } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
@ -22,6 +22,7 @@ import { showErrorToast } from '../../../utils/ToastUtils';
import BulkEntityImport from '../../BulkImport/BulkEntityImport.component'; import BulkEntityImport from '../../BulkImport/BulkEntityImport.component';
import TitleBreadcrumb from '../../common/TitleBreadcrumb/TitleBreadcrumb.component'; import TitleBreadcrumb from '../../common/TitleBreadcrumb/TitleBreadcrumb.component';
import { TitleBreadcrumbProps } from '../../common/TitleBreadcrumb/TitleBreadcrumb.interface'; import { TitleBreadcrumbProps } from '../../common/TitleBreadcrumb/TitleBreadcrumb.interface';
import PageLayoutV1 from '../../PageLayoutV1/PageLayoutV1';
import './import-glossary.less'; import './import-glossary.less';
interface Props { interface Props {
@ -68,26 +69,24 @@ const ImportGlossary: FC<Props> = ({ glossaryName }) => {
}; };
return ( return (
<Row className="import-glossary p-x-md p-b-md" gutter={[16, 8]}> <PageLayoutV1
<Col span={24}> pageTitle={t('label.import-entity', {
<TitleBreadcrumb titleLinks={breadcrumbList} /> entity: t('label.glossary-term-plural'),
</Col> })}>
<Col span={24}> <Row className="import-glossary p-x-lg" gutter={[16, 16]}>
<Typography.Title data-testid="title" level={5}> <Col span={24}>
{t('label.import-entity', { <TitleBreadcrumb titleLinks={breadcrumbList} />
entity: t('label.glossary-term-plural'), </Col>
})} <Col span={24}>
</Typography.Title> <BulkEntityImport
</Col> entityType={EntityType.GLOSSARY_TERM}
<Col span={24}> fqn={glossaryName}
<BulkEntityImport onSuccess={handleGlossaryRedirection}
entityType={EntityType.GLOSSARY_TERM} onValidateCsvString={handleImportCsv}
fqn={glossaryName} />
onSuccess={handleGlossaryRedirection} </Col>
onValidateCsvString={handleImportCsv} </Row>
/> </PageLayoutV1>
</Col>
</Row>
); );
}; };

View File

@ -38,12 +38,6 @@
} }
.import-glossary { .import-glossary {
.stepper-container {
max-width: 450px;
margin: auto;
margin-top: 24px;
padding: 0;
}
.browse-text { .browse-text {
border-bottom: 1px solid; border-bottom: 1px solid;
} }

View File

@ -460,26 +460,22 @@ const GlossaryPage = () => {
); );
} }
const glossaryElement = ( const glossaryElement = isRightPanelLoading ? (
<div className="p-t-sm"> <Loader />
{isRightPanelLoading ? ( ) : (
<Loader /> <GlossaryV1
) : ( isGlossaryActive={isGlossaryActive}
<GlossaryV1 isSummaryPanelOpen={Boolean(previewAsset)}
isGlossaryActive={isGlossaryActive} isVersionsView={false}
isSummaryPanelOpen={Boolean(previewAsset)} refreshActiveGlossaryTerm={fetchGlossaryTermDetails}
isVersionsView={false} selectedData={activeGlossary as Glossary}
refreshActiveGlossaryTerm={fetchGlossaryTermDetails} updateGlossary={updateGlossary}
selectedData={activeGlossary as Glossary} updateVote={updateVote}
updateGlossary={updateGlossary} onAssetClick={handleAssetClick}
updateVote={updateVote} onGlossaryDelete={handleGlossaryDelete}
onAssetClick={handleAssetClick} onGlossaryTermDelete={handleGlossaryTermDelete}
onGlossaryDelete={handleGlossaryDelete} onGlossaryTermUpdate={handleGlossaryTermUpdate}
onGlossaryTermDelete={handleGlossaryTermDelete} />
onGlossaryTermUpdate={handleGlossaryTermUpdate}
/>
)}
</div>
); );
const resizableLayout = isGlossaryActive ? ( const resizableLayout = isGlossaryActive ? (