Skip to content

Commit

Permalink
Merge branch 'main' into feat/FSADT1-992
Browse files Browse the repository at this point in the history
  • Loading branch information
paulushcgcj authored Jan 10, 2024
2 parents 747a667 + c70b373 commit 60db9a8
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 86 deletions.
2 changes: 2 additions & 0 deletions backend/src/main/java/ca/bc/gov/app/ApplicationConstant.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,7 @@ left join nrfc.province_code pc on (pc.province_code = sl.province_code and pc.c
public static final String REFRESH_TOKEN = "refreshToken";
public static final String ID_TOKEN = "idToken";
public static final String ACCESS_TOKEN = "accessToken";
public static final List<String> AVAILABLE_CLIENT_TYPES = List.of("A", "I", "S", "SP", "RSP",
"USP", "BC", "GP");
}

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ca.bc.gov.app.dto.submissions;

import java.util.List;
import java.util.Set;

public record SubmissionContactDto(
Integer index,
Expand All @@ -9,7 +9,7 @@ public record SubmissionContactDto(
String lastName,
String phoneNumber,
String emailAddress,
List<String> locations,
Set<String> locations,
String userId
) {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ca.bc.gov.app.service.client;

import ca.bc.gov.app.ApplicationConstant;
import ca.bc.gov.app.dto.bcregistry.BcRegistryDocumentDto;
import ca.bc.gov.app.dto.bcregistry.BcRegistryFacetSearchResultEntryDto;
import ca.bc.gov.app.dto.bcregistry.BcRegistryPartyDto;
Expand Down Expand Up @@ -216,6 +217,13 @@ public Mono<ClientDetailsDto> getClientDetails(
)
.map(BcRegistryDocumentDto.class::cast)

.flatMap(client ->{
if(ApplicationConstant.AVAILABLE_CLIENT_TYPES.contains(client.business().legalType())){
return Mono.just(client);
}
return Mono.error(new UnsuportedClientTypeException(client.business().legalType()));
})

//if document type is SP and party contains only one entry that is not a person, fail
.filter(document ->
!("SP".equalsIgnoreCase(document.business().legalType())
Expand Down Expand Up @@ -248,13 +256,7 @@ public Flux<ClientLookUpDto> findByClientNameOrIncorporation(String value) {
entry.status(),
entry.legalType()
)
)
.flatMap(client ->{
if(List.of("A", "I", "S", "SP","RSP","USP","BC","GP").contains(client.legalType())){
return Mono.just(client);
}
return Mono.error(new UnsuportedClientTypeException(client.legalType()));
});
);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Objects;
Expand Down Expand Up @@ -238,7 +239,9 @@ public Mono<SubmissionDetailsDto> getSubmissionDetail(Long id) {
row.get("last_name", String.class),
row.get("business_phone_number", String.class),
row.get("email_address", String.class),
List.of(StringUtils.defaultString(row.get("locations", String.class)).split(", ")),
Arrays.stream(StringUtils.defaultString(row.get("locations", String.class))
.split(", "))
.collect(Collectors.toSet()),
row.get("idp_user_id", String.class)
))
.all();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private void validateBusinessInformation(
validateBirthdate(businessInformation.birthdate(), errors);
}

if (!List.of("A", "I", "S", "USP", "RSP","SP","BC","GP").contains(clientType)) {
if (!ApplicationConstant.AVAILABLE_CLIENT_TYPES.contains(clientType)) {
errors.rejectValue("businessType",
String.format("%s %s is not supported at the moment", "Business type",clientType));
}
Expand Down
87 changes: 17 additions & 70 deletions frontend/src/assets/styles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,15 @@ cds-modal-footer {
padding: 1rem 1rem 1rem 1rem;
}

cds-modal:is(#reject-modal, #approve-modal) cds-modal-footer {
padding-top: 0;
height: auto;
}

cds-modal:is(#reject-modal, #approve-modal) cds-modal-footer-button {
height: min-content;
}

cds-modal-footer-button::part(button) {
border-radius: 0.25rem;
height: 75%;
Expand All @@ -1022,6 +1031,10 @@ cds-modal-footer-button::part(button) {
--cds-button-danger-hover: var(--light-theme-button-danger-hover, #b32001);
}

cds-modal:is(#reject-modal, #approve-modal) cds-modal-footer-button::part(button) {
padding-bottom: 1rem;
}

.cds--modal-close-btn {
margin-right: 0.25rem;
}
Expand Down Expand Up @@ -1296,6 +1309,10 @@ Useful for scrolling to the *start* of an HTML element without having it covered
display: unset;
}

.invisible {
visibility: hidden;
}

/* Small (up to 671px) */
@media screen and (max-width: 671px) {
.content-landing {
Expand Down Expand Up @@ -1340,11 +1357,6 @@ Useful for scrolling to the *start* of an HTML element without having it covered
padding-bottom: 1rem;
}

cds-modal#reject-modal cds-modal-body.grouping-12,
cds-modal#approve-modal cds-modal-body {
margin-bottom: 3rem;
}

.screen {
padding: 1.5rem 1rem 2.5rem 1rem;
flex-direction: column;
Expand Down Expand Up @@ -1548,27 +1560,6 @@ Useful for scrolling to the *start* of an HTML element without having it covered
width: 40%;
}

cds-modal#reject-modal::part(dialog),
cds-modal#approve-modal::part(dialog) {
width: 95%;
}

cds-modal#reject-modal cds-modal-body.grouping-12,
cds-modal#approve-modal cds-modal-body {
margin-bottom: 3rem;
}

cds-modal#reject-modal cds-modal-body.grouping-12 {
height: 19rem;
}

cds-modal#reject-modal cds-modal-footer,
cds-modal#approve-modal cds-modal-footer {
height: 6rem;
margin: -2rem 0 -2rem 0;
padding: 0 1rem 1rem 1rem !important;
}

.mg-sd-25 {
margin: 0rem 2.5rem 2rem 2rem;
}
Expand Down Expand Up @@ -1635,17 +1626,6 @@ Useful for scrolling to the *start* of an HTML element without having it covered
height: 16rem;
}

cds-modal#reject-modal cds-modal-body.grouping-12 {
margin: 1rem 1rem 3rem 1rem;
height: 19rem;
}
cds-modal#reject-modal cds-modal-footer,
cds-modal#approve-modal cds-modal-footer {
height: 6rem;
margin: -2rem 0 -2rem 0;
padding: 0 1rem 1rem 1rem !important;
}

cds-modal#reject-modal cds-modal-body.grouping-12 .grouping-02,
cds-modal#reject-modal cds-modal-body.grouping-12 .grouping-03 {
width: auto;
Expand Down Expand Up @@ -1702,17 +1682,6 @@ Useful for scrolling to the *start* of an HTML element without having it covered
height: 22rem;
}

cds-modal#reject-modal cds-modal-body.grouping-12 {
margin: 1rem 1rem 3rem 1rem;
height: 19rem;
}
cds-modal#reject-modal cds-modal-footer,
cds-modal#approve-modal cds-modal-footer {
height: 6rem;
margin: -2rem 0 -2rem 0;
padding: 0 1rem 1rem 1rem !important;
}

cds-modal#reject-modal cds-modal-body.grouping-12 .grouping-02,
cds-modal#reject-modal cds-modal-body.grouping-12 .grouping-03 {
width: auto;
Expand Down Expand Up @@ -1748,17 +1717,6 @@ Useful for scrolling to the *start* of an HTML element without having it covered
height: 29.8125rem;
}

cds-modal#reject-modal cds-modal-body.grouping-12 {
margin: 1rem 1rem 3rem 1rem;
height: 19rem;
}
cds-modal#reject-modal cds-modal-footer,
cds-modal#approve-modal cds-modal-footer {
height: 6rem;
margin: -2rem 0 -2rem 0;
padding: 0 1rem 1rem 1rem !important;
}

cds-modal#reject-modal cds-modal-body.grouping-12 .grouping-02,
cds-modal#reject-modal cds-modal-body.grouping-12 .grouping-03 {
width: auto;
Expand Down Expand Up @@ -1795,17 +1753,6 @@ Useful for scrolling to the *start* of an HTML element without having it covered
height: 31.375rem;
}

cds-modal#reject-modal cds-modal-body.grouping-12 {
margin: 1rem 1rem 3rem 1rem;
height: 19rem;
}
cds-modal#reject-modal cds-modal-footer,
cds-modal#approve-modal cds-modal-footer {
height: 6rem;
margin: -2rem 0 -2rem 0;
padding: 0 1rem 1rem 1rem !important;
}

cds-modal#reject-modal cds-modal-body.grouping-12 .grouping-02,
cds-modal#reject-modal cds-modal-body.grouping-12 .grouping-03 {
width: auto;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/forms/TextInputComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const selectValue = (event: any) => {
</script>

<template>
<div class="grouping-02" v-if="enabled">
<div v-if="enabled" class="grouping-02" :class="$attrs.class">
<div class="input-group">
<div class="cds--text-input__label-wrapper">
<label :id="id + 'Label'"
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/pages/SubmissionReviewPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ const matchingData = computed(() => {
</cds-modal-header>

<cds-modal-body>
<p>A new client number will be created and an email will be sent to the submitter.</p>
<p class="body-compact-01">A new client number will be created and an email will be sent to the submitter.</p>
</cds-modal-body>

<cds-modal-footer>
Expand Down Expand Up @@ -539,7 +539,7 @@ const matchingData = computed(() => {
</cds-modal-header>

<cds-modal-body class="grouping-12">
<p>This submission will be rejected and the submitter will receive an email notification. Please choose the reason below:</p>
<p class="body-compact-01">This submission will be rejected and the submitter will receive an email notification. Please choose the reason below:</p>
<multiselect-input-component
id="reject_reason_id"
label="Reason for rejection"
Expand All @@ -551,7 +551,7 @@ const matchingData = computed(() => {
@update:selected-value="event => selectedRejectReasons = event"
/>
<text-input-component
v-if="showClientNumberField"
:class="{invisible: !showClientNumberField}"
id="reject_reason_message"
label="Matching client number"
placeholder=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import ca.bc.gov.app.repository.SubmissionContactRepository;
import ca.bc.gov.app.repository.SubmissionDetailRepository;
import java.util.Map;
import java.util.Objects;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.integration.annotation.ServiceActivator;
Expand Down Expand Up @@ -91,7 +92,7 @@ public Mono<Message<EmailRequestDto>> sendNotification(Message<Integer> message)
"userName", submissionContact.getFirstName(),
"business", Map.of(
"name", details.getOrganizationName(),
"clientNumber", details.getClientNumber()
"clientNumber", Objects.toString(details.getClientNumber(), "")
)
)
)
Expand Down

0 comments on commit 60db9a8

Please sign in to comment.