Skip to content

Commit

Permalink
Merge branch 'master' into Nekku_meal_integration
Browse files Browse the repository at this point in the history
  • Loading branch information
tahtee committed Feb 14, 2025
2 parents 31bb69a + fdd41fa commit e6c4176
Show file tree
Hide file tree
Showing 20 changed files with 120 additions and 88 deletions.
32 changes: 2 additions & 30 deletions compose/db/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,12 @@
#
# SPDX-License-Identifier: LGPL-2.1-or-later

ARG BASE_IMAGE=library/postgres
ARG BASE_IMAGE_VERSION=16-alpine3.19

FROM ${BASE_IMAGE}:${BASE_IMAGE_VERSION} AS ext_builder
# Extension whitelisting to simulate the RDS behaviour
# Build https://github.com/dimitri/pgextwlist package from source, transfer it to target installation

WORKDIR /build/

RUN apk add --update alpine-sdk postgresql-dev

ARG PGEXTWLIST_VERSION="1.17"
RUN curl -sSfL https://github.com/dimitri/pgextwlist/archive/refs/tags/v${PGEXTWLIST_VERSION}.tar.gz \
-o pgextwlist.tar.gz \
&& echo "183eae8b80e61431f0950b29a2552dd20ceebc9cb63f8fe40e48c84d6e6c033b pgextwlist.tar.gz" | sha256sum -c - \
&& tar xvzf pgextwlist.tar.gz \
&& cd pgextwlist-${PGEXTWLIST_VERSION} \
&& make \
&& make install \
&& cp pgextwlist.so .. \
&& cd - \
&& rm pgextwlist.tar.gz pgextwlist-${PGEXTWLIST_VERSION} -rf

FROM ${BASE_IMAGE}:${BASE_IMAGE_VERSION}

COPY --from=ext_builder /build/pgextwlist.so pgextwlist.so

RUN mkdir "$(pg_config --pkglibdir)/plugins" \
&& install pgextwlist.so "$(pg_config --pkglibdir)/plugins/pgextwlist.so"
FROM library/postgres:17-alpine3.21

COPY postgresql.conf /var/lib/postgresql/

# Add the initialisation scripts
COPY entry/* /docker-entrypoint-initdb.d/

# Force the modified postgres configuration ito use
# Force the modified postgres configuration into use
CMD ["-c", "config_file=/var/lib/postgresql/postgresql.conf"]
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ beforeEach(async () => {
familyWithRestrictedDetailsGuardian.guardian,
familyWithRestrictedDetailsGuardian.otherGuardian,
'DAYCARE',
'NOT_AGREED'
'AGREED'
),
id: fromUuid<ApplicationId>('6a9b1b1e-3fdf-11eb-b378-0242ac130002')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ describe('Application transitions', () => {
familyWithRestrictedDetailsGuardian.guardian,
familyWithRestrictedDetailsGuardian.otherGuardian,
'DAYCARE',
'NOT_AGREED'
'AGREED'
),
id: fromUuid<ApplicationId>('6a9b1b1e-3fdf-11eb-b378-0242ac130002')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const StickyTitleRow = styled(TitleRow)`
const MessageContent = styled.div`
padding-top: ${defaultMargins.s};
white-space: pre-line;
word-break: break-word;
`

function SingleMessage({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ import { useNavigate, useSearchParams } from 'react-router'
import styled from 'styled-components'

import { wrapResult } from 'lib-common/api'
import {
AssistanceNeedDecisionStatus,
assistanceNeedDecisionStatuses
} from 'lib-common/generated/api-types/assistanceneed'
import { SortDirection } from 'lib-common/generated/api-types/invoicing'
import { AssistanceNeedDecisionsReportRow } from 'lib-common/generated/api-types/reports'
import { useApiState } from 'lib-common/utils/useRestApi'
import { AssistanceNeedDecisionStatusChip } from 'lib-components/assistance-need-decision/AssistanceNeedDecisionStatusChip'
import Title from 'lib-components/atoms/Title'
import ReturnButton from 'lib-components/atoms/buttons/ReturnButton'
import Combobox from 'lib-components/atoms/dropdowns/Combobox'
import Checkbox from 'lib-components/atoms/form/Checkbox'
import { Container, ContentArea } from 'lib-components/layout/Container'
import {
SortableTh,
Expand All @@ -25,6 +30,7 @@ import {
Thead,
Tr
} from 'lib-components/layout/Table'
import { FixedSpaceRow } from 'lib-components/layout/flex-helpers'

import { getAssistanceNeedDecisionsReport } from '../../generated/api-clients/reports'
import { useTranslation } from '../../state/i18n'
Expand Down Expand Up @@ -87,18 +93,33 @@ export default React.memo(function AssistanceNeedDecisionsReport() {
[sortColumn, sortDirection]
)

const [shownStatuses, setShownStatuses] = useState<
AssistanceNeedDecisionStatus[]
>(['DRAFT', 'NEEDS_WORK', 'ACCEPTED'])
const [showExpired, setShowExpired] = useState(false)

const decisionRows = useMemo(
() =>
report.map((rs) =>
orderBy(
rs.filter(
(row) => !careAreaFilter || row.careAreaName === careAreaFilter
(row) =>
(!careAreaFilter || row.careAreaName === careAreaFilter) &&
(showExpired || !row.expired) &&
shownStatuses.includes(row.status)
),
[sortColumn],
[sortDirection === 'ASC' ? 'asc' : 'desc']
)
),
[report, careAreaFilter, sortColumn, sortDirection]
[
report,
careAreaFilter,
shownStatuses,
showExpired,
sortColumn,
sortDirection
]
)

const navigate = useNavigate()
Expand All @@ -118,6 +139,7 @@ export default React.memo(function AssistanceNeedDecisionsReport() {
<ReturnButton label={i18n.common.goBack} />
<ContentArea opaque>
<Title size={1}>{i18n.reports.assistanceNeedDecisions.title}</Title>

<FilterRow>
<FilterLabel>{i18n.reports.common.careAreaName}</FilterLabel>
<Wrapper>
Expand Down Expand Up @@ -153,6 +175,41 @@ export default React.memo(function AssistanceNeedDecisionsReport() {
</Wrapper>
</FilterRow>

<FilterRow>
<FilterLabel>
{i18n.reports.assistanceNeedDecisions.statusFilter}
</FilterLabel>
<FixedSpaceRow>
{assistanceNeedDecisionStatuses.map((status) => (
<Checkbox
key={status}
label={
i18n.childInformation.assistanceNeedDecision.statuses[status]
}
checked={shownStatuses.includes(status)}
onChange={(checked) =>
setShownStatuses((prev) =>
checked
? [...prev, status]
: prev.filter((s) => s !== status)
)
}
/>
))}
</FixedSpaceRow>
</FilterRow>

<FilterRow>
<FilterLabel>
{i18n.reports.assistanceNeedDecisions.otherFilters}
</FilterLabel>
<Checkbox
label={i18n.reports.assistanceNeedDecisions.showExpired}
checked={showExpired}
onChange={setShowExpired}
/>
</FilterRow>

{renderResult(decisionRows, (rows) => (
<Table>
<Thead>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ const SenderName = styled.div`
const MessageContent = styled.div`
padding-top: ${defaultMargins.s};
white-space: pre-line;
word-break: break-word;
`

const ActionRow = styled(FixedSpaceRow)`
Expand Down
15 changes: 9 additions & 6 deletions frontend/src/lib-common/generated/api-types/assistanceneed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,15 @@ export interface AssistanceNeedDecisionResponse {
/**
* Generated from fi.espoo.evaka.assistanceneed.decision.AssistanceNeedDecisionStatus
*/
export type AssistanceNeedDecisionStatus =
| 'DRAFT'
| 'NEEDS_WORK'
| 'ACCEPTED'
| 'REJECTED'
| 'ANNULLED'
export const assistanceNeedDecisionStatuses = [
'DRAFT',
'NEEDS_WORK',
'ACCEPTED',
'REJECTED',
'ANNULLED'
] as const

export type AssistanceNeedDecisionStatus = typeof assistanceNeedDecisionStatuses[number]

/**
* Generated from fi.espoo.evaka.assistanceneed.preschooldecision.AssistanceNeedPreschoolDecision
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lib-common/generated/api-types/reports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export interface AssistanceNeedDecisionsReportRow {
childName: string
decisionMade: LocalDate | null
decisionNumber: number
expired: boolean
id: UUID
isOpened: boolean | null
preschool: boolean
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/lib-common/generated/api-types/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ export const pilotFeatures = [
'PLACEMENT_TERMINATION',
'REALTIME_STAFF_ATTENDANCE',
'PUSH_NOTIFICATIONS',
'SERVICE_APPLICATIONS'
'SERVICE_APPLICATIONS',
'STAFF_ATTENDANCE_INTEGRATION'
] as const

export type PilotFeature = typeof pilotFeatures[number]
Expand Down
15 changes: 3 additions & 12 deletions frontend/src/lib-customizations/defaults/citizen/i18n/en.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2100,7 +2100,7 @@ const en: Translations = {
'Average earnings including holiday bonus, €/month',
otherIncome: 'Other income',
otherIncomeDescription:
'If you have other income, it must be itemised in an attachment. A list of the required attachments can be found at the bottom of the form under: Attachments related to income and early childhood education fees.',
'If you have other income, it must be itemised in an attachment.',
choosePlaceholder: 'Select',
otherIncomeTypes: {
PENSION: 'Pension',
Expand Down Expand Up @@ -2135,17 +2135,8 @@ const en: Translations = {
},
entrepreneurIncome: {
title: "Filling in the entrepreneur's income information",
description: (
<>
If necessary, you can fill in the information for more than one
company by ticking the boxes that apply to all of your companies.
Please provide more detailed company-specific information as
attachments.
<br />A list of the required attachments can be found at the bottom of
the form under &quot;Attachments related to income and early childhood
education fees&quot;.
</>
),
description:
'If necessary, you can fill in the information for more than one company by ticking the boxes that apply to all of your companies.',
fullTimeLabel: 'Are the business activities full-time or part-time?',
fullTime: 'Full-time',
partTime: 'Part-time',
Expand Down
14 changes: 3 additions & 11 deletions frontend/src/lib-customizations/defaults/citizen/i18n/fi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2341,7 +2341,7 @@ export default {
estimatedMonthlyIncome: 'Keskimääräiset tulot sisältäen lomarahat, €/kk',
otherIncome: 'Muut tulot',
otherIncomeDescription:
'Mikäli sinulla on muita tuloja, tulee niistä toimittaa tositteet liitteenä. Listan tarvittavista liitteistä löydät lomakkeen alaosasta kohdasta: Tuloihin ja varhaiskasvatusmaksuihin liittyvät liitteet.',
'Mikäli sinulla on muita tuloja, tulee niistä toimittaa tositteet liitteenä.',
choosePlaceholder: 'Valitse',
otherIncomeTypes: {
PENSION: 'Eläke',
Expand Down Expand Up @@ -2376,16 +2376,8 @@ export default {
},
entrepreneurIncome: {
title: 'Yrittäjän tulotietojen täyttäminen',
description: (
<>
Tällä lomakkeella voit tarvittaessa täyttää tiedot myös useammalle
yritykselle valitsemalla kaikkia yrityksiäsi koskevat kohdat. Toimita
tarkemmat yrityskohtaiset tiedot liitteinä.
<br />
Listan tarvittavista liitteistä löydät lomakkeen alaosasta kohdasta
“Tuloihin ja varhaiskasvatusmaksuihin liittyvät liitteet”.
</>
),
description:
'Tällä lomakkeella voit tarvittaessa täyttää tiedot myös useammalle yritykselle valitsemalla kaikkia yrityksiäsi koskevat kohdat.',
fullTimeLabel: 'Onko yritystoiminta päätoimista vai sivutoimista?',
fullTime: 'Päätoimista',
partTime: 'Sivutoimista',
Expand Down
15 changes: 3 additions & 12 deletions frontend/src/lib-customizations/defaults/citizen/i18n/sv.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2345,7 +2345,7 @@ const sv: Translations = {
'Genomsnittliga inkomster inklusive semesterpenning, €/månad',
otherIncome: 'Övriga inkomster',
otherIncomeDescription:
'Om du har några andra inkomster, ska du lämna in uppgifterna som bilaga. En lista över nödvändiga bilagor finns längst ner på blanketten under: Bilagor som rör inkomsterna och avgifterna för småbarnspedagogik.',
'Om du har några andra inkomster, ska du lämna in uppgifterna som bilaga.',
choosePlaceholder: 'Välj',
otherIncomeTypes: {
PENSION: 'Pension',
Expand Down Expand Up @@ -2381,17 +2381,8 @@ const sv: Translations = {
},
entrepreneurIncome: {
title: 'Att fylla i företagarens inkomstuppgifter',
description: (
<>
Med denna blankett kan du vid behov fylla i uppgifterna för flera
företag genom att välja de punkter som gäller alla dina företag.
Skicka mer detaljerade företagsspecifika uppgifter som bilaga.
<br />
En lista över obligatoriska bilagor finns längst ner på blanketten
under ”Bilagor som rör inkomsterna och avgifterna för
småbarnspedagogik”.
</>
),
description:
'Med denna blankett kan du vid behov fylla i uppgifterna för flera företag genom att välja de punkter som gäller alla dina företag.',
fullTimeLabel: 'Är företagsverksamheten en huvudsyssla eller bisyssla?',
fullTime: 'Huvudsyssla',
partTime: 'Bisyssla',
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/lib-customizations/defaults/employee/i18n/fi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3674,6 +3674,9 @@ export const fi = {
sentToDecisionMaker: 'Lähetetty päätöksen tekijälle',
decisionMade: 'Päätös tehty',
status: 'Tila',
statusFilter: 'Näytettävät tilat',
otherFilters: 'Muut valinnat',
showExpired: 'Näytä päättyneet tuen päätökset',
returnForEditModal: {
title: 'Palautetaanko päätös korjattavaksi?',
okBtn: 'Palauta korjattavaksi',
Expand Down Expand Up @@ -4992,11 +4995,12 @@ export const fi = {
MOBILE: 'Mobiili',
RESERVATIONS: 'Varaukset',
VASU_AND_PEDADOC: 'Pedagogiset asiakirjat ja pedagoginen dokumentointi',
MOBILE_MESSAGING: 'Mobiili-viestintä',
MOBILE_MESSAGING: 'Mobiili­viestintä',
PLACEMENT_TERMINATION: 'Paikan irtisanominen',
REALTIME_STAFF_ATTENDANCE: 'Henkilökunnan reaaliaikainen läsnäolo',
PUSH_NOTIFICATIONS: 'Mobiilinotifikaatiot',
SERVICE_APPLICATIONS: 'Palveluntarpeen muutoshakemukset'
SERVICE_APPLICATIONS: 'Palveluntarpeen muutoshakemukset',
STAFF_ATTENDANCE_INTEGRATION: 'Työvuoro­suunnittelu­integraatio'
}
},
roles: {
Expand Down
6 changes: 3 additions & 3 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11561,11 +11561,11 @@ __metadata:
linkType: hard

"serialize-javascript@npm:^6.0.1":
version: 6.0.1
resolution: "serialize-javascript@npm:6.0.1"
version: 6.0.2
resolution: "serialize-javascript@npm:6.0.2"
dependencies:
randombytes: "npm:^2.1.0"
checksum: 10/f756b1ff34b655b2183c64dd6683d28d4d9b9a80284b264cac9fd421c73890491eafd6c5c2bbe93f1f21bf78b572037c5a18d24b044c317ee1c9dc44d22db94c
checksum: 10/445a420a6fa2eaee4b70cbd884d538e259ab278200a2ededd73253ada17d5d48e91fb1f4cd224a236ab62ea7ba0a70c6af29fc93b4f3d3078bf7da1c031fde58
languageName: node
linkType: hard

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,8 @@ fun Database.Transaction.resetCheckedByAdminAndConfidentiality(
form.child.assistanceNeeded ||
form.child.allergies.isNotBlank() ||
form.child.diet.isNotBlank() ||
form.otherInfo.isNotBlank()
form.otherInfo.isNotBlank() ||
form.secondGuardian?.agreementStatus == OtherGuardianAgreementStatus.NOT_AGREED

execute {
sql(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package fi.espoo.evaka.assistanceneed.decision

import fi.espoo.evaka.ConstList
import fi.espoo.evaka.shared.AssistanceNeedDecisionGuardianId
import fi.espoo.evaka.shared.AssistanceNeedDecisionId
import fi.espoo.evaka.shared.ChildId
Expand Down Expand Up @@ -124,6 +125,7 @@ data class AssistanceNeedDecisionBasics(
val created: HelsinkiDateTime,
)

@ConstList("assistanceNeedDecisionStatuses")
enum class AssistanceNeedDecisionStatus : DatabaseEnum {
DRAFT,
NEEDS_WORK,
Expand Down
Loading

0 comments on commit e6c4176

Please sign in to comment.