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

VKT(Frontend): OPHKIOS-92 UI-parannuksia #693

Merged
merged 23 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5c8accb
VKT(Frontend): Improve front page legibility
pkoivisto Aug 16, 2024
a3b4f41
VKT(Frontend): Drop pagination from exam listing table
pkoivisto Aug 16, 2024
e2dc7d7
VKT(Frontend): File upload instructions as a bullet point list [deploy]
pkoivisto Aug 16, 2024
00f8c16
VKT(Frontend): Fix DOM nesting
pkoivisto Aug 21, 2024
305988e
VKT(Frontend): Separate step for education details, move address deta…
pkoivisto Aug 21, 2024
8ff6070
VKT(Frontend): Remove now obsolete privacy policy page
pkoivisto Aug 22, 2024
76129dc
VKT(Frontend): Fix layout for education details
pkoivisto Aug 23, 2024
92d8e27
VKT(Frontend): Bump Cypress version
pkoivisto Aug 23, 2024
14114c3
VKT(Frontend): Fix tests [deploy]
pkoivisto Aug 23, 2024
3940cfb
SHARED(Frontend): Include a file drop zone by default on desktop with…
pkoivisto Aug 26, 2024
d51433d
VKT(Frontend): Take updated FileUpload component into use [deploy]
pkoivisto Aug 26, 2024
43daae8
VKT(Frontend): Minor fixes [deploy]
pkoivisto Aug 27, 2024
ecb1f47
VKT(Frontend): Try to fix focusing on stepper heading
pkoivisto Sep 2, 2024
1a392f6
VKT(Frontend): Add dividers between sections of preview page, move ad…
pkoivisto Sep 2, 2024
e5e40ba
VKT(Frontend): Fix translation string [deploy]
pkoivisto Sep 2, 2024
ccb907a
VKT(Frontend): Show UploadAttachments also when user has run out of f…
pkoivisto Sep 5, 2024
3839ab5
VKT(Frontend): Fix error handling when using fetch to POST instead of…
pkoivisto Sep 5, 2024
d5f3678
VKT(Frontend): Improve enrollment preview step layout
pkoivisto Sep 6, 2024
3c779b4
VKT(Frontend): Fix overflow of privacy checkbox label on mobile
pkoivisto Sep 6, 2024
9089802
VKT(Frontend): Allow step contents to grow more on phone, add some mo…
pkoivisto Sep 6, 2024
1ab2187
VKT(Backend): Fix saving files to localstack on Linux [deploy]
lket Sep 6, 2024
8fd24b8
VKT(Backend): Add missing imports [deploy]
pkoivisto Sep 6, 2024
2554b41
VKT(Frontend): Rework enrollment preview structure on mobile to bette…
pkoivisto Sep 6, 2024
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 @@ -3,9 +3,11 @@
import fi.oph.vkt.util.exception.APIException;
import fi.oph.vkt.util.exception.APIExceptionType;
import java.time.Duration;
import java.time.Instant;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoField;
import java.util.HashMap;
import java.util.Map;
import lombok.RequiredArgsConstructor;
Expand Down Expand Up @@ -68,7 +70,7 @@ public Map<String, String> getPresignedPostRequest(String key, String extension)
S3PostObjectRequest.Builder requestBuilder = S3PostObjectRequest
.builder()
.bucket(s3Config.getBucketName())
.expiration(POST_POLICY_VALID_FOR_ONE_MIN)
.expiration(Instant.now().with(ChronoField.MICRO_OF_SECOND, 1).plus(POST_POLICY_VALID_FOR_ONE_MIN))
.withCondition(Conditions.keyStartsWith(key))
.withCondition(Conditions.contentLengthRange(0, MAX_SIZE_100_MB))
.withCondition(Conditions.contentTypeHeaderEquals(contentType))
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"compression-webpack-plugin": "^10.0.0",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.8.1",
"cypress": "^13.4.0",
"cypress": "^13.13.3",
"eslint": "^8.53.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-webpack": "^0.13.8",
Expand Down
5 changes: 5 additions & 0 deletions frontend/packages/shared/CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Released]

## [1.10.8] - 2024-08-26

### Changed
- Include a file drop zone by default on desktop with the file upload component

## [1.10.7] - 2024-08-07

### Added
Expand Down
2 changes: 1 addition & 1 deletion frontend/packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opetushallitus/kieli-ja-kaantajatutkinnot.shared",
"version": "1.10.7",
"version": "1.10.8",
"description": "Shared Frontend Package",
"exports": {
"./components": "./src/components/index.tsx",
Expand Down
42 changes: 24 additions & 18 deletions frontend/packages/shared/src/components/FileUpload/FileUpload.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,30 @@
@use '../../styles/abstracts/colors';
@use '../../styles/abstracts/maps';

.custom-fileupload input {
width: fit-content;
border: 1px dashed colors.$color-secondary;
font-size: 120%;
display: none;
}

.custom-fileupload.file-upload-error input {
border: 1px dashed colors.$color-red-500;
}
.custom-fileupload {
input {
display: none;
}

.custom-fileupload.file-upload-error input::file-selector-button {
background: colors.$color-red-500;
}
&.file-upload-error {
.file-dropzone {
border-top: 1px dashed colors.$color-red-500;
border-right: 1px dashed colors.$color-red-500;
border-bottom: 1px dashed colors.$color-red-500;
p {
color: colors.$color-red-500;
}
}
}

.custom-fileupload input::file-selector-button {
background: colors.$color-secondary;
border: 1px solid colors.$color-primary;
color: colors.$color-primary;
padding: 10px;
.file-dropzone {
align-content: center;
height: 100%;
border-top: 1px dashed colors.$color-secondary;
border-right: 1px dashed colors.$color-secondary;
border-bottom: 1px dashed colors.$color-secondary;
padding-left: 1vw;
padding-right: 10vw;
cursor: copy;
}
}
34 changes: 27 additions & 7 deletions frontend/packages/shared/src/components/FileUpload/FileUpload.tsx
Original file line number Diff line number Diff line change
@@ -1,48 +1,68 @@
import FileUploadIcon from '@mui/icons-material/FileUpload';
import { Button } from '@mui/material';
import { ChangeEvent, FC } from 'react';
import { ChangeEvent, DragEvent, FC } from 'react';

import './FileUpload.scss';
import { Text } from '../../components';
import { Color, Variant } from '../../enums';
import { useWindowProperties } from '../../hooks';

type FileUploadProps = {
accept?: string;
error?: boolean;
onChange: (files: FileList) => void;
labelText: string;
buttonText: string;
dropZoneText: string;
};

export const FileUpload: FC<FileUploadProps> = ({
accept,
onChange,
error,
labelText,
buttonText,
dropZoneText,
}) => {
const handleChange = (event: ChangeEvent<HTMLInputElement>) => {
if (event.target.files) {
onChange(event.target.files);
}
};
const { isPhone } = useWindowProperties();

return (
<div
className={
error ? 'custom-fileupload file-upload-error' : 'custom-fileupload'
}
className={`columns custom-fileupload ${
error ? 'file-upload-error' : ''
}`}
>
<Button
component="label"
variant={Variant.Contained}
color={error ? Color.Error : Color.Secondary}
startIcon={<FileUploadIcon />}
>
{labelText}
{buttonText}
<input
id="custom-fileupload"
accept={accept}
type="file"
onChange={handleChange}
/>
</Button>
{!isPhone && (
<div
className="file-dropzone"
onDragOver={(e: DragEvent<HTMLDivElement>) => {
e.preventDefault();
}}
onDrop={(e: DragEvent<HTMLDivElement>) => {
e.preventDefault();
onChange(e.dataTransfer.files);
}}
>
<Text>{dropZoneText}</Text>
</div>
)}
</div>
);
};
2 changes: 1 addition & 1 deletion frontend/packages/vkt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
},
"dependencies": {
"reduxjs-toolkit-persist": "^7.2.1",
"shared": "npm:@opetushallitus/[email protected].7"
"shared": "npm:@opetushallitus/[email protected].8"
}
}
3 changes: 2 additions & 1 deletion frontend/packages/vkt/public/i18n/fi-FI/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
}
},
"info": {
"previousEnrollment": "Voit suorittaa suullisen ja kirjallisen taidon tutkinnot joko samalla kertaa tai osissa eri suorituskertojen aikana. Jos suoritat tutkinnon osissa, sinulla on kolme vuotta aikaa suorittaa koko tutkinto loppuun. Aika lasketaan ensimmäisen osan suorittamispäivästä alkaen.",
"previousEnrollment": "<0>Voit suorittaa suullisen ja kirjallisen taidon tutkinnot joko samalla kertaa tai osissa eri suorituskertojen aikana.</0> Jos suoritat tutkinnon osissa, <1>sinulla on kolme vuotta aikaa suorittaa koko tutkinto loppuun.</1> Aika lasketaan ensimmäisen osan suorittamispäivästä alkaen.",
"selectExam": "Kun olet suorittanut hyväksytysti suullisen ja kirjallisen taidon tutkinnot, saat todistukseen merkinnän myös ymmärtämisen taidon tutkinnon suorittamisesta."
},
"languageFilter": {
Expand Down Expand Up @@ -144,6 +144,7 @@
"clerkExamOverview": "Virkailija tutkintosivu",
"clerkHomepage": "Virkailija",
"contactDetails": "Ilmoittautuminen - täytä yhteystietosi",
"educationDetails": "Ilmoittautuminen - koulutustiedot",
"done": "Ilmoittautuminen - valmis",
"frontPage": "Etusivu",
"logoutSuccess": "Uloskirjautuminen onnnistui",
Expand Down
120 changes: 0 additions & 120 deletions frontend/packages/vkt/public/i18n/fi-FI/privacy.json

This file was deleted.

Loading
Loading