-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ok 785 muut hakukohde #67
Conversation
9ceb62e
to
8708ef0
Compare
}) => ( | ||
<div> | ||
<button | ||
aria-label="Previous Month" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tämä pitäs varmaan ottaa käännöksistä?
)} | ||
</span> | ||
<button | ||
aria-label="Next Month" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tämä myös käännöksistä
|
||
type QuillProps = { | ||
defaultValue: string; | ||
setContentChanged: (value: string) => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Olisko tämä ennemmin onContentChanged
? Vai ymmärsinkö väärin miten tää toimii? Vois näille propseille laittaa lyhyet kommentit, ja myös EditorComponentin propseille.
FormControlLabel, | ||
Radio, | ||
RadioGroup, | ||
styled, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
styled pitäs dokumentaation mukaan importoida @mui/material/styles
:stä. Meillä on theme.tsx:ssä oma styled-wrapperi, jota olisi suositeltavaa aina käyttää.
const CustomRadio = styled(Radio)(() => ({ | ||
padding: 0, | ||
'&:first-child': { | ||
padding: '5px 0', | ||
}, | ||
})); | ||
|
||
const CustomContainer = styled(Box)(() => ({ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
rowGap: '1rem', | ||
})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Voisko css:n välitykset yrittää pitää yhdenmukaisena? Gapit, marginaalit ja paddingit mun mielestä spacingilla niin pitkälle kuin mahdollista.
const openAcceptedLetterTemplateModal = async () => { | ||
showModal(AcceptedLetterTemplateModal, { | ||
title: 'kirje-modaali.otsikko-hyvaksymiskirjeet', | ||
hakukohde: hakukohde, | ||
template: 'hyvaksymiskirje', | ||
sijoitteluajoId, | ||
setDocument: setHyvaksymiskirjeDocument, | ||
}); | ||
closeMenu(); | ||
}; | ||
|
||
const openNonAcceptedLetterTemplateModal = async () => { | ||
showModal(NonAcceptedLetterTemplateModal, { | ||
title: 'kirje-modaali.otsikko-ei-hyvaksymiskirjeet', | ||
hakukohde: hakukohde, | ||
template: 'jalkiohjauskirje', | ||
sijoitteluajoId, | ||
}); | ||
closeMenu(); | ||
}; | ||
|
||
const openOsoitetarratModal = async () => { | ||
showModal(ProgressModal, { | ||
title: 'Osoitetarrojen muodostaminen', | ||
defaultFileName: 'osoitetarrat.pdf', | ||
progressMessage: 'Osoitetarroja muodostetaan....', | ||
setDocument: setOsoitetarraDocument, | ||
functionToMutate: () => | ||
luoOsoitetarratHakukohteessaHyvaksytyille({ | ||
sijoitteluajoId, | ||
hakukohde, | ||
}), | ||
}); | ||
closeMenu(); | ||
}; | ||
|
||
const sendVastaanottoposti = async () => { | ||
try { | ||
const data = await sendVastaanottopostiHakukohteelle(hakukohde.oid); | ||
if (!data || data.length < 1) { | ||
addToast({ | ||
key: 'vastaanottoposti-hakemus-empty', | ||
message: | ||
'sijoittelun-tulokset.toiminnot.vastaanottoposti-hakukohteelle-ei-lahetettavia', | ||
type: 'error', | ||
}); | ||
} else { | ||
addToast({ | ||
key: 'vastaanottoposti-hakemus', | ||
message: | ||
'sijoittelun-tulokset.toiminnot.vastaanottoposti-hakukohteelle-lahetetty', | ||
type: 'success', | ||
}); | ||
} | ||
} catch (e) { | ||
addToast({ | ||
key: 'vastaanottoposti-hakemus-virhe', | ||
message: | ||
'sijoittelun-tulokset.toiminnot.vastaanottoposti-hakukohteelle-virhe', | ||
type: 'error', | ||
}); | ||
console.error(e); | ||
} | ||
closeMenu(); | ||
}; | ||
|
||
const openDocument = async (documentId: string | null) => { | ||
if (documentId) { | ||
window.open( | ||
configuration.lataaDokumenttiUrl({ dokumenttiId: documentId }), | ||
); | ||
} | ||
closeMenu(); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tätä komponenttia selkeyttäisi aika paljon, jos eri MenuItem-palasia jakaisi omiksi komponenteikseen, jolloin esim. näitä handlereita saisi lähemmäksi komponentin koodia, jossa niitä oikeasti käytetään.
const sendVastaanottoposti = async () => { | ||
try { | ||
const data = await sendVastaanottopostiValintatapaJonolle( | ||
hakukohde.oid, | ||
valintatapajono.oid, | ||
); | ||
if (!data || data.length < 1) { | ||
addToast({ | ||
key: 'vastaanottoposti-valintatapajono-empty', | ||
message: | ||
'sijoittelun-tulokset.toiminnot.vastaanottoposti-jonolle-ei-lahetettavia', | ||
type: 'error', | ||
}); | ||
} else { | ||
addToast({ | ||
key: 'vastaanottoposti-valintatapajonos', | ||
message: | ||
'sijoittelun-tulokset.toiminnot.vastaanottoposti-jonolle-lahetetty', | ||
type: 'success', | ||
}); | ||
} | ||
} catch (e) { | ||
addToast({ | ||
key: 'vastaanottoposti-valintatapajono-virhe', | ||
message: | ||
'sijoittelun-tulokset.toiminnot.vastaanottoposti-jonolle-virhe', | ||
type: 'error', | ||
}); | ||
console.error(e); | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tälle ei tarvi näyttää spinneriä?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tämä on toistaiseksi ollut yhtä nopea kuin noiden filujen avauskin, Muutetaan jos osoittautuu joissain tilanteissa hitaammaksi?
src/app/lib/valinta-tulos-service.ts
Outdated
valintatapajonoOid: string, | ||
): Promise<string[]> => { | ||
const response = await client.post( | ||
`${configuration.vastaanottopostiJonolleUrl({ hakukohdeOid, valintatapajonoOid })}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`${configuration.vastaanottopostiJonolleUrl({ hakukohdeOid, valintatapajonoOid })}`, | |
configuration.vastaanottopostiJonolleUrl({ hakukohdeOid, valintatapajonoOid }), |
src/app/lib/valinta-tulos-service.ts
Outdated
hakukohdeOid: string, | ||
valintatapajonoOid: string, | ||
): Promise<string[]> => { | ||
const response = await client.post( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Response-tyyppi pitäs pystyä antaamaan post-funkkarillekin, eli ei pitäs tarvita tehdä as string[]
const response = await client.post( | |
const response = await client.post<Array<string>>( |
tarjoajaOid: hakukohde.tarjoajaOid, | ||
hakukohdeNimi: hakukohde.nimi.fi, | ||
hakemusOids: hakemusOids, | ||
letterBodyText: letterBody.replaceAll(' ', ' '), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kannattaiskohan tällanen letterBodyn siivous laittaa johonkin omaan funktioonsa? Oli toisessakin kohdassa tehty ja saattanee tulla muutakin siivottavaa.
Oletko lisännyt tarvittavat yksikkö- tai ui-testit toiminnallisuudelle? Kyllä
Oletko tarkistanut ja päivittänyt riippuvuudet? Kyllä
Oletko kokeillut toimiiko käyttöliittymä mobiilissa landscape moodissa? Joo, huonosti (modaalissa oleva tekstieditori ja kalenterikomponenttia pystyy jotenkuten käyttämään)
Oletko testannut että lisäämäsi toiminto on saavutettava? Kyllä osittain (tekstieditorin kaikkia ominaisuuksia en ole testannut)