Skip to content

Commit

Permalink
Nitpicks to reduce changes from #279
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel-Therrien-Beslogic committed Nov 15, 2024
1 parent 5711a78 commit 153692d
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const SiteSuccessRatesChart = ({ siteSummaries }: Props) => {

const renderChartTooltip = (props: ChartsAxisContentProps) => {
const selectedSerie = props.series.find(serie => serie.id === props.axisValue)
// @typescript-eslint/no-unsafe-type-assertion -- value type is known from the context
const data = selectedSerie?.data.find(value => !!value) as number | undefined

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const MultipleSelectChip = <TValue extends SelectionValueType>(
<Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 0.5 }}>
{
// TODO(NicolasDontigny): Find a more efficient way
// map values to their display text here
// to map values to their display text here
}
{selected
.map(value => options.find(option => option.value === value))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const AdminInvitationDialog = ({ open, handleClose }: Props) => {
emailError
? 'is-invalid'
: ''
} `}
}`}
id='email-input'
onBlur={() => validateEmail()}
onChange={event => setEmail(event.target.value)}
Expand Down
4 changes: 2 additions & 2 deletions canopeum_frontend/src/components/settings/EditProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ const EditProfile = () => {
Could be fixed by creating a global Input component */
? 'is-invalid'
: ''
} `}
}`}
id='password-input'
onBlur={() => validateCurrentPassword()}
onChange={event => setCurrentPassword(event.target.value)}
Expand All @@ -314,7 +314,7 @@ const EditProfile = () => {
newPasswordError
? 'is-invalid'
: ''
} `}
}`}
id='password-input'
onBlur={() => validateNewPassword()}
onChange={event => setNewPassword(event.target.value)}
Expand Down
3 changes: 2 additions & 1 deletion canopeum_frontend/src/models/Coordinate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export const extractCoordinate = (coordinates: string) => {
const char3 = coordinates.indexOf('.')
const char4 = coordinates.indexOf('"')

/* NOTE: It should be impossible for the nullish coalescence to happen here,
/* @typescript-eslint/no-unsafe-type-assertion --
NOTE: It should be impossible for the nullish coalescence to happen here,
We're also type-guarding the string union immediatly after */
const cardinal = coordinates.at(-1) as Cardinal
if (!(VALID_CARDINALS.includes(cardinal))) {
Expand Down
4 changes: 2 additions & 2 deletions canopeum_frontend/src/pages/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const Login = () => {
emailError
? 'is-invalid'
: ''
} `}
}`}
id='email-input'
onBlur={() => validateEmail()}
onChange={event => setEmail(event.target.value)}
Expand All @@ -113,7 +113,7 @@ const Login = () => {
passwordError
? 'is-invalid'
: ''
} `}
}`}
id='password-input'
onBlur={() => validatePassword()}
onChange={event => setPassword(event.target.value)}
Expand Down
6 changes: 3 additions & 3 deletions canopeum_frontend/src/pages/Register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ const Register = () => {
-- Create an Input Component? */
? 'is-invalid'
: ''
} `}
}`}
id='username-input'
onBlur={() => validateUsername()}
onChange={event => setUsername(event.target.value)}
Expand All @@ -208,7 +208,7 @@ const Register = () => {
emailError
? 'is-invalid'
: ''
} `}
}`}
disabled={!!userInvitation}
id='email-input'
onBlur={() => validateEmail()}
Expand All @@ -235,7 +235,7 @@ const Register = () => {
passwordError
? 'is-invalid'
: ''
} `}
}`}
id='password-input'
onBlur={() => validatePassword()}
onChange={event => setPassword(event.target.value)}
Expand Down

0 comments on commit 153692d

Please sign in to comment.