Skip to content

Commit

Permalink
Merge branch 'dev' into feature/OPHAKRKEH-505 [deploy]
Browse files Browse the repository at this point in the history
  • Loading branch information
jrkkp committed Oct 11, 2023
2 parents f679526 + 564e432 commit 2b46f64
Show file tree
Hide file tree
Showing 123 changed files with 3,587 additions and 836 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ For example:
AKR(Frontend): Added new translations
```

Consider writing a detailed commit body when the change is extensive or the reasons behind it are intricate.

### Branching naming conventions

Jira ticket numbers are used as branch names with possible suffix indicating what the branch is for.
Expand All @@ -192,6 +194,15 @@ feature/<ticket-number> ----> feature/OPHAKRKEH-250
hotfix/<service-name> ----> hotfix/akr
```

### GitHub conventions

Ensure the ticket number is included in the pull request title. This enables the association of a commit with its corresponding Jira ticket.

Merging pull requests:

- "Create a merge commit" and "Squash and merge": These options preserve a reference to the pull request and its associated branch.
- "Rebase and Merge": If you choose this option, make sure that commit messages explicitly mention the relevant ticket number.

### Releases

Production releases for different applications are marked with tags. For example for AKR, tags are named as `AKR-ga-1234` where `ga-1234` stands for the Github Action workflow number. The name of the tag also matches the name of the release in Jira.
Expand Down
18 changes: 16 additions & 2 deletions backend/vkt/src/main/java/fi/oph/vkt/api/PublicController.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import fi.oph.vkt.api.dto.PublicEnrollmentDTO;
import fi.oph.vkt.api.dto.PublicEnrollmentInitialisationDTO;
import fi.oph.vkt.api.dto.PublicExamEventDTO;
import fi.oph.vkt.api.dto.PublicPersonDTO;
import fi.oph.vkt.api.dto.PublicReservationDTO;
import fi.oph.vkt.model.Enrollment;
import fi.oph.vkt.model.Person;
Expand Down Expand Up @@ -209,8 +210,21 @@ public void validateTicket(
}

@GetMapping(path = "/auth/info")
public Person authInfo(final HttpSession session) {
return publicPersonService.getPerson(SessionUtil.getPersonId(session));
public Optional<PublicPersonDTO> authInfo(final HttpSession session) {
if (session == null || !SessionUtil.hasPersonId(session)) {
return Optional.empty();
}

return Optional.of(publicPersonService.getPersonDTO(SessionUtil.getPersonId(session)));
}

@GetMapping(path = "/auth/logout")
public void logout(final HttpSession session, final HttpServletResponse httpResponse) throws IOException {
if (session != null) {
session.invalidate();
}

httpResponse.sendRedirect(publicAuthService.createCasLogoutUrl());
}

@GetMapping(path = "/payment/create/{enrollmentId:\\d+}/redirect")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import fi.oph.vkt.model.type.EnrollmentType;
import fi.oph.vkt.repository.PersonRepository;
import fi.oph.vkt.service.auth.CasTicketValidationService;
import fi.oph.vkt.util.UIRouteUtil;
import fi.oph.vkt.util.exception.APIException;
import fi.oph.vkt.util.exception.APIExceptionType;
import java.net.URLEncoder;
Expand Down Expand Up @@ -38,6 +39,15 @@ public String createCasLoginUrl(final long examEventId, final EnrollmentType typ
return casLoginUrl + "?service=" + casServiceUrl + "&locale=" + appLocale.name().toLowerCase();
}

public String createCasLogoutUrl() {
final String casLogoutUrl = environment.getRequiredProperty("app.cas-oppija.logout-url");
final String casServiceUrl = URLEncoder.encode(
environment.getRequiredProperty("app.cas-oppija.service-logout-url"),
StandardCharsets.UTF_8
);
return casLogoutUrl + "?service=" + casServiceUrl;
}

@Transactional
public Person createPersonFromTicket(final String ticket, final long examEventId, final EnrollmentType type) {
final Map<String, String> personDetails = casTicketValidationService.validate(ticket, examEventId, type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import fi.oph.vkt.repository.ExamEventRepository;
import fi.oph.vkt.repository.ReservationRepository;
import fi.oph.vkt.util.ExamEventUtil;
import fi.oph.vkt.util.PersonUtil;
import fi.oph.vkt.util.exception.APIException;
import fi.oph.vkt.util.exception.APIExceptionType;
import fi.oph.vkt.util.exception.NotFoundException;
Expand Down Expand Up @@ -137,12 +138,7 @@ private PublicEnrollmentInitialisationDTO createEnrollmentInitialisationDTO(
.hasCongestion(false)
.build();

final PublicPersonDTO personDTO = PublicPersonDTO
.builder()
.id(person.getId())
.lastName(person.getLastName())
.firstName(person.getFirstName())
.build();
final PublicPersonDTO personDTO = PersonUtil.createPublicPersonDTO(person);

return PublicEnrollmentInitialisationDTO
.builder()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package fi.oph.vkt.service;

import fi.oph.vkt.api.dto.PublicPersonDTO;
import fi.oph.vkt.model.Person;
import fi.oph.vkt.repository.PersonRepository;
import fi.oph.vkt.util.PersonUtil;
import fi.oph.vkt.util.exception.NotFoundException;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
Expand All @@ -15,4 +17,8 @@ public class PublicPersonService {
public Person getPerson(final Long personId) {
return personRepository.findById(personId).orElseThrow(() -> new NotFoundException("Person not found"));
}

public PublicPersonDTO getPersonDTO(final Long personId) {
return PersonUtil.createPublicPersonDTO(getPerson(personId));
}
}
16 changes: 16 additions & 0 deletions backend/vkt/src/main/java/fi/oph/vkt/util/PersonUtil.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package fi.oph.vkt.util;

import fi.oph.vkt.api.dto.PublicPersonDTO;
import fi.oph.vkt.model.Person;

public class PersonUtil {

public static PublicPersonDTO createPublicPersonDTO(final Person person) {
return PublicPersonDTO
.builder()
.id(person.getId())
.lastName(person.getLastName())
.firstName(person.getFirstName())
.build();
}
}
4 changes: 4 additions & 0 deletions backend/vkt/src/main/java/fi/oph/vkt/util/SessionUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ public class SessionUtil {

private static final String PERSON_ID_SESSION_KEY = "person_id";

public static boolean hasPersonId(final HttpSession session) {
return session.getAttribute(PERSON_ID_SESSION_KEY) != null;
}

public static Long getPersonId(final HttpSession session) {
final Long personId = (Long) session.getAttribute(PERSON_ID_SESSION_KEY);

Expand Down
2 changes: 2 additions & 0 deletions backend/vkt/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ app:
api: ${public-base-url:http://localhost:${server.port}}/vkt/api/v1
cas-oppija:
login-url: ${cas-oppija.login-url:https://testiopintopolku.fi/cas-oppija/login}
logout-url: ${cas-oppija.logout-url:https://testiopintopolku.fi/cas-oppija/logout}
service-url: ${cas-oppija.service-url:http://localhost:${server.port}/vkt/api/v1/auth/validate/%s/%s}
service-logout-url: ${public-base-url:http://localhost:4002}/vkt/uloskirjautuminen-onnistui
validate-ticket-url: ${cas-oppija.validate-ticket-url:https://testiopintopolku.fi/cas-oppija/serviceValidate}
reservation:
duration: ${reservation.duration:PT30M}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ reservation.duration=PT30M
public-base-url={{vkt_app_url}}

cas-oppija.login-url={{opintopolku_baseurl}}/cas-oppija/login
cas-oppija.logout-url={{opintopolku_baseurl}}/cas-oppija/logout
cas-oppija.service-url={{vkt_app_url}}/vkt/api/v1/auth/validate/%s/%s
cas-oppija.validate-ticket-url={{opintopolku_baseurl}}/cas-oppija/serviceValidate

Expand Down
2 changes: 1 addition & 1 deletion frontend/packages/akr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"akr:tslint": "yarn g:tsc --pretty --noEmit"
},
"dependencies": {
"shared": "npm:@opetushallitus/[email protected].23"
"shared": "npm:@opetushallitus/[email protected].28"
}
}
84 changes: 83 additions & 1 deletion frontend/packages/akr/public/i18n/en-GB/accessibility.json
Original file line number Diff line number Diff line change
@@ -1 +1,83 @@
{}
{
"akr": {
"accessibility": {
"content": {
"administrativeAgency": {
"description": "If you notice any accessibility issues on the website, please first send feedback to us, i.e. the site administrator. It may take us up to 14 days to reply. If you are not satisfied with the reply or you do not receive a reply at all within two weeks,",
"extraDescription": "You can find information about how to submit a notification and how the matter will be handled from the website of the Regional State Administrative Agency for Southern Finland.",
"links": {
"link": "https://www.webaccessibility.fi/rights-of-users/",
"title": "you can submit a report to the Regional State Administrative Agency for Southern Finland (opens in a new window)"
},
"title": "Regulatory authority"
},
"caveats": {
"description": "Non-accessible content and its limitations",
"extraDescription": "Accessibility requirements, which are not fulfilled",
"items": [
{
"description": "The progression of heading ranks is not in order on every page.",
"claim": "1.3.1 Info and Relationships",
"title": "Perceivable: Progression of heading ranks"
},
{
"description": "The header of the first table column is empty",
"claim": "1.3.1 Info and Relationships",
"title": "Perceivable: Missing table header"
},
{
"description": "The language selector component has no traditional label. There is, however, an aria-label.",
"claim": "2.4.6 Headings and Labels",
"title": "Operable: Label is missing from the language selector component"
},
{
"description": "The ‘Display on page’ component of the table has no traditional label. There is, however, an aria-label.",
"claim": "2.4.6 Headings and Labels",
"title": "Operable: Label is missing from a table’s ‘Display on page’ component"
}
]
},
"contactAdministrativeAgency": {
"links": {
"email": {
"link": "[email protected]",
"title": "[email protected]"
},
"website": {
"ariaLabel": "Accessibility Monitoring Unit, opens in a new window",
"link": "https://www.webaccessibility.fi/",
"title": "Accessibility Monitoring Unit website"
}
},
"name": "Regional State Administrative Agency for Southern Finland",
"phone": "telephone switchboard 0295 016 000",
"title": "Contact details of the regulatory authority",
"unit": "Accessibility control unit"
},
"feedback": {
"description": "By email",
"subtitle": "Did you notice an accessibility issue in our digital service? Let us know and we will do the best we can to fix it.",
"title": "Feedback and contact details"
},
"furtherImprove": {
"description": "We are committed to improving the accessibility of digital services.",
"extraDescription": "Did you notice an accessibility issue? Let us know and we will do the best we can to fix it.",
"subtitle": "We offer support to users for whom digital services are not accessible",
"title": "We are continuously working to improve accessibility"
},
"nonAccessible": {
"description": "The website is not yet fully compliant",
"title": "Non-accessible content"
},
"status": {
"description": "Partly compliant with accessibility requirements",
"title": "The state of accessibility of the digital service"
}
},
"heading": {
"description": "This accessibility statement applies to the service akr.opintopolku.fi and has been created / updated on 4 October 2023. The service is subject to the Act on the Provision of Digital Services, which requires public sector to comply with accessibility requirements in their digital services. The accessibility of the service has been evaluated by an external expert organisation.",
"title": "Accessibility statement for the Register of Authorised Translators"
}
}
}
}
2 changes: 1 addition & 1 deletion frontend/packages/akr/public/i18n/en-GB/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
},
"links": {
"accessibility": {
"text": "Accessibility statement (in Finnish)"
"text": "Accessibility statement"
},
"akrHomepage": {
"ariaLabel": "Examination system of authorised translators (oph.fi), open in a new tab",
Expand Down
84 changes: 83 additions & 1 deletion frontend/packages/akr/public/i18n/sv-SE/accessibility.json
Original file line number Diff line number Diff line change
@@ -1 +1,83 @@
{}
{
"akr": {
"accessibility": {
"content": {
"administrativeAgency": {
"description": "Om du upptäcker tillgänglighetsproblem på webbplatsen, påtala det först för oss, dvs. webbplatsens administratörer. Det kan ta 14 dagar innan du får ett svar. Om du inte är nöjd med det svar du har fått eller inte får något svar alls inom två veckor, ",
"extraDescription": "På regionförvaltningsverkets webbplats finns det noggrant beskrivet hur du kan lämna in en anmälan och hur ärendet behandlas.",
"links": {
"link": "https://www.tillganglighetskrav.fi/dina-rattigheter/",
"title": "kan du göra en anmälan till Regionförvaltningsverket i Södra Finland (öppnas i ett nytt fönster)."
},
"title": "Tillsynsmyndighet"
},
"caveats": {
"description": "Icke tillgängligt innehåll och dess brister",
"extraDescription": "Tillgänglighetskrav som inte uppfylls",
"items": [
{
"description": "Rubriknivåerna avancerar inte i ordningsföljd på alla sidor.",
"claim": "1.3.1 Information och relationer",
"title": "Möjlig att uppfatta: Hur rubriknivåerna avancerar"
},
{
"description": "Rubriken i den första kolumnen i tabellen är tom.",
"claim": "1.3.1 Information och relationer",
"title": "Möjlig att uppfatta: Tabellrubrik saknas"
},
{
"description": "Språkvalskomponenten har ingen traditionell ledtext/etikett. Det finns emellertid en Aria-label.",
"claim": "2.4.6 Rubriker och ledtexter/etiketter",
"title": "Hanterbar: Ledtext/etikett saknas i språkvalskomponenten"
},
{
"description": "Komponenten ”Visa på sida” i tabellen har ingen traditionell ledtext/etikett. Det finns emellertid en Aria-label.",
"claim": "2.4.6 Rubriker och ledtexter/etiketter",
"title": "Hanterbar: Ledtext/etikett saknas i komponenten ”Visa på sida”"
}
]
},
"contactAdministrativeAgency": {
"links": {
"email": {
"link": "[email protected]",
"title": "[email protected]"
},
"website": {
"ariaLabel": "Enheten för tillgänglighetstillsyn webbplats, öppnas i ett nytt fönster",
"link": "https://www.tillganglighetskrav.fi/",
"title": "Enheten för tillgänglighetstillsyn webbplats"
}
},
"name": "Regionförvaltningsverket i Södra Finland",
"phone": "telefonnummer växel 0295 016 000",
"title": "Tillsynsmyndighetens kontaktuppgifter",
"unit": "Enheten för tillgänglighetstillsyn"
},
"feedback": {
"description": "Per e-post",
"subtitle": "Märkte du ett fel i våra digitala tjänster? Berätta om det för oss och vi gör vårt bästa för att åtgärda bristen.",
"title": "Respons och kontaktuppgifter"
},
"furtherImprove": {
"description": "Vi har förbundit oss till att förbättra tillgängligheten i digitala tjänster.",
"extraDescription": "Märkte du en brist i tillgängligheten? Berätta om det för oss och vi gör vårt bästa för att åtgärda bristen.",
"subtitle": "Vi erbjuder stöd åt de användare för vilka digitala tjänster inte är tillgängliga",
"title": "Vi arbetar ständigt för att förbättra tillgängligheten"
},
"nonAccessible": {
"description": "Webbplatsen är ännu inte till alla delar förenlig med kraven",
"title": "Icke tillgängligt innehåll"
},
"status": {
"description": "Uppfyller tillgänglighetskraven delvis",
"title": "Status för tillgänglighet i den digitala tjänsten"
}
},
"heading": {
"description": "Detta tillgänglighetsutlåtande gäller tjänsten akr.opintopolku.fi och har utarbetats / uppdaterats 04.10.2023. Tjänsten omfattas av lagen om tillhandahållande av digitala tjänster, där det förutsätts att offentliga nättjänster ska vara tillgängliga. Tjänstens tillgänglighet har bedömts av en utomstående expertorganisation.",
"title": "Tillgänglighetsutlåtande för registret över auktoriserade translatorer"
}
}
}
}
2 changes: 1 addition & 1 deletion frontend/packages/akr/public/i18n/sv-SE/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
},
"links": {
"accessibility": {
"text": "Tillgänglighetsdirektiv (på finska)"
"text": "Tillgänglighetsdirektiv"
},
"akrHomepage": {
"ariaLabel": "Examenssystemet för auktoriserade translatorer (oph.fi), öppnas i en ny flik",
Expand Down
2 changes: 1 addition & 1 deletion frontend/packages/akr/src/redux/selectors/meetingDate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const filterMeetingDateByStatus = (
status: MeetingDateStatus,
currentDate: Dayjs
) => {
const isBefore = DateUtils.isDatePartBefore(date, currentDate);
const isBefore = DateUtils.isDatePartBeforeOrEqual(date, currentDate);

return status === MeetingDateStatus.Upcoming ? !isBefore : isBefore;
};
2 changes: 1 addition & 1 deletion frontend/packages/otr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"otr:tslint": "yarn g:tsc --pretty --noEmit"
},
"dependencies": {
"shared": "npm:@opetushallitus/[email protected].23"
"shared": "npm:@opetushallitus/[email protected].28"
}
}
Loading

0 comments on commit 2b46f64

Please sign in to comment.