Skip to content
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

Lisätty tuki palveluohjauksen sisäisille liitteille hakemuksilla #6159

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1292,6 +1292,21 @@ export default React.memo(function ApplicationEditView({
/>
</>
)}
<Label>
{i18n.application.additionalInfo.serviceWorkerAttachmentsTitle}
</Label>

<FileUploadGridContainer>
<FileUpload
onUpload={onUploadAttachment('SERVICE_WORKER_ATTACHMENT')}
onDelete={onDeleteAttachment}
getDownloadUrl={getAttachmentUrl}
files={attachments.filter(
(a) => a.type === 'SERVICE_WORKER_ATTACHMENT'
)}
data-qa="file-upload-service-worker"
/>
</FileUploadGridContainer>
</ListGrid>
</CollapsibleSection>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ export default React.memo(function ApplicationReadView({
({ type }) => type === 'EXTENDED_CARE'
)

const serviceWorkerAttachments = attachments.filter(
({ type }) => type === 'SERVICE_WORKER_ATTACHMENT'
)

const connectedDaycare = type === 'PRESCHOOL' && serviceNeed !== null
const paid = type === 'DAYCARE' || connectedDaycare

Expand Down Expand Up @@ -576,6 +580,25 @@ export default React.memo(function ApplicationReadView({
<span>{child.diet}</span>
</>
)}
<Label>
{i18n.application.additionalInfo.serviceWorkerAttachmentsTitle}
</Label>
<AttachmentContainer>
{serviceWorkerAttachments.length ? (
<>
{serviceWorkerAttachments.map((attachment) => (
<Attachment
key={attachment.id}
attachment={attachment}
receivedAt={attachmentReceivedAt(attachment)}
data-qa={`service-need-attachment-${attachment.name}`}
/>
))}
</>
) : (
<Dimmed>{i18n.application.additionalInfo.noAttachments}</Dimmed>
)}
</AttachmentContainer>
</ListGrid>
</CollapsibleSection>

Expand Down
1 change: 1 addition & 0 deletions frontend/src/lib-common/generated/api-types/attachment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { AttachmentId } from './shared'
export type AttachmentType =
| 'URGENCY'
| 'EXTENDED_CARE'
| 'SERVICE_WORKER_ATTACHMENT'

/**
* Generated from fi.espoo.evaka.attachment.IncomeAttachment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,9 @@ export const fi = {
applicationInfo: 'Hakemuksen lisätiedot',
allergies: 'Allergiat',
diet: 'Erityisruokavalio',
maxFeeAccepted: 'Suostumus korkeimpaan maksuun'
maxFeeAccepted: 'Suostumus korkeimpaan maksuun',
serviceWorkerAttachmentsTitle: 'Palveluohjauksen liitteet',
noAttachments: 'Ei liitteitä'
},
decisions: {
title: 'Päätökset',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@ data class MessageAttachment(val id: AttachmentId, val name: String, val content
enum class AttachmentType {
URGENCY,
EXTENDED_CARE,
SERVICE_WORKER_ATTACHMENT,
}
Loading