Skip to content

Commit e81f20e

Browse files
[PRMP-1569] Re-add Control + F search text in PDF Viewer
1 parent 20bac07 commit e81f20e

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

app/src/components/generic/recordCard/RecordCard.test.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ describe('RecordCard Component', () => {
108108
});
109109
});
110110

111+
it('shows find in pdf text when file url exists', async () => {
112+
render(<RecordCard {...props} />);
113+
expect(screen.getByTestId('find-in-pdf-text')).toBeInTheDocument();
114+
});
115+
111116
it('renders nothing while no cloudFrontUrl', async () => {
112117
render(<RecordCard {...props} cloudFrontUrl="" />);
113118
expect(screen.queryByTestId('pdf-viewer')).not.toBeInTheDocument();
@@ -137,6 +142,7 @@ describe('RecordCard Component', () => {
137142
render(<RecordCard {...props} cloudFrontUrl="" />);
138143
expect(screen.queryByTestId('pdf-viewer')).not.toBeInTheDocument();
139144
expect(screen.queryByTestId('full-screen-btn')).not.toBeInTheDocument();
145+
expect(screen.queryByTestId('find-in-pdf-text')).not.toBeInTheDocument();
140146
});
141147

142148
it('does not render the pdf details view when full-screen view is click', async () => {

app/src/components/generic/recordCard/RecordCard.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ function RecordCard({
8686
setStage={setStage}
8787
showMenu={showMenu}
8888
/>
89+
{cloudFrontUrl && (
90+
<p data-testid="find-in-pdf-text">
91+
To search within this record use <strong>Control</strong> and{' '}
92+
<strong>F</strong>
93+
</p>
94+
)}
8995
</Card.Content>
9096
<div>{children}</div>
9197
</Card>

app/src/styles/App.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ $hunit: '%';
298298
}
299299

300300
p {
301-
margin-bottom: 0;
301+
margin-top: 25px;
302302
}
303303

304304
&-no_record {

0 commit comments

Comments
 (0)