generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/1454-smp-success-on-parent-step-5
- Loading branch information
Showing
12 changed files
with
158 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ concurrency: | |
jobs: | ||
cleanup: | ||
name: Cleanup and Images | ||
uses: bcgov/quickstart-openshift-helpers/.github/workflows/[email protected].0 | ||
uses: bcgov/quickstart-openshift-helpers/.github/workflows/[email protected].1 | ||
secrets: | ||
oc_namespace: ${{ vars.OC_NAMESPACE }} | ||
oc_token: ${{ secrets.OC_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ jobs: | |
validate: | ||
name: Validate PR | ||
needs: [init] | ||
uses: bcgov/quickstart-openshift-helpers/.github/workflows/[email protected].0 | ||
uses: bcgov/quickstart-openshift-helpers/.github/workflows/[email protected].1 | ||
with: | ||
markdown_links: | | ||
- [Frontend](https://${{ github.event.repository.name }}-${{ needs.init.outputs.mod-tag }}-frontend.apps.silver.devops.gov.bc.ca/) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import React, { useState } from 'react'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
import { | ||
Button, TextInput, Column | ||
} from '@carbon/react'; | ||
import { ArrowRight } from '@carbon/icons-react'; | ||
import ROUTES from '../../routes/constants'; | ||
import useWindowSize from '../../hooks/UseWindowSize'; | ||
import { MEDIUM_SCREEN_WIDTH } from '../../shared-constants/shared-constants'; | ||
|
||
import { addParamToPath } from '../../utils/PathUtils'; | ||
import focusById from '../../utils/FocusUtils'; | ||
import { isNumeric } from '../../utils/NumberUtils'; | ||
|
||
import './styles.scss'; | ||
|
||
const SeedlotNavigator = () => { | ||
const navigate = useNavigate(); | ||
const windowSize = useWindowSize(); | ||
|
||
const [seedlotNumber, setSeedlotNumber] = useState<string>(''); | ||
const [errorMessage, setErrorMessage] = useState<string>(''); | ||
|
||
return ( | ||
<> | ||
<Column className="no-padding-col" sm={4} md={6} lg={12} xlg={12}> | ||
<TextInput | ||
id="go-to-seedlot-input" | ||
labelText="" | ||
placeholder="Enter seedlot number" | ||
value={seedlotNumber} | ||
invalid={!!errorMessage} | ||
invalidText={errorMessage} | ||
onChange={(e: React.ChangeEvent<HTMLInputElement>) => { | ||
const inputValue = e.target.value; | ||
if (inputValue && !isNumeric(inputValue)) { | ||
setErrorMessage('Numbers only'); | ||
return; | ||
} | ||
|
||
setSeedlotNumber(e.target.value); | ||
setErrorMessage(''); | ||
}} | ||
onWheel={(e: React.ChangeEvent<HTMLInputElement>) => e.target.blur()} | ||
/> | ||
</Column> | ||
<Column className="no-padding-col" sm={4} md={2} lg={4} xlg={4}> | ||
<Button | ||
className={`seedlot-nav-btn ${windowSize.innerWidth >= MEDIUM_SCREEN_WIDTH && 'seedlot-nav-btn-float-right'}`} | ||
kind="primary" | ||
size="md" | ||
renderIcon={ArrowRight} | ||
onClick={() => { | ||
if (seedlotNumber) { | ||
navigate(addParamToPath(ROUTES.SEEDLOT_DETAILS, seedlotNumber)); | ||
} else { | ||
setErrorMessage('Please enter a seedlot number'); | ||
focusById('go-to-seedlot-input'); | ||
} | ||
}} | ||
> | ||
Go to seedlot | ||
</Button> | ||
</Column> | ||
</> | ||
); | ||
}; | ||
|
||
export default SeedlotNavigator; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@use "@bcgov-nr/nr-theme/design-tokens/variables.scss" as vars; | ||
@use "@carbon/type"; | ||
|
||
.seedlot-nav-btn { | ||
width: fit-content; | ||
max-width: 16rem; | ||
margin-top: 1rem; | ||
white-space: nowrap; | ||
} | ||
|
||
.seedlot-nav-btn-float-right { | ||
float: right; | ||
margin-top: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters