Skip to content

Commit

Permalink
landing page improvements / fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mgtennant committed Aug 27, 2024
1 parent 962d697 commit 191b6c5
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions frontend/src/app/content/pages/LandingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,10 @@ const LandingPage: FC = () => {
const displayData: { dtr: DTRDisplayObject | null; error: string | null } = await getDisplayData(
searchState.dtid
);
if (!displayData.error) setData(displayData.dtr);
else {
if (!displayData.error) {
setData(displayData.dtr);
setIsOpen(true);
} else {
setError(displayData.error);
setShowError(true);
}
Expand Down Expand Up @@ -236,6 +238,9 @@ const LandingPage: FC = () => {
setShowError(false);
setData(null);
setSelectedDocTypeId(null);
// clear tables on search
setDocumentType(null);
setProvisionGroups([]);
if (dtidInput) {
fetchData(dtidInput);
} else {
Expand Down Expand Up @@ -403,7 +408,22 @@ const LandingPage: FC = () => {
<div className="mb-3 mt-3">
<div className="font-weight-bold inlineDiv">DTID:</div>
<div className="inlineDiv ml-4 mr-4">
<input type="number" className="form-control" id="dtid" value={dtidInput || ''} onChange={handleDtidChange} />
<input
type="number"
className="form-control"
id="dtid"
value={dtidInput || ''}
onChange={handleDtidChange}
onKeyDown={(e) => {
if (e.key === 'Enter') {
e.preventDefault();
fetchDataHandler();
if (document.activeElement instanceof HTMLElement) {
document.activeElement.blur();
}
}
}}
/>
</div>
<Button variant="success" onClick={fetchDataHandler} style={{ marginRight: '10px', width: '150px' }}>
Retrieve
Expand Down

0 comments on commit 191b6c5

Please sign in to comment.