From 3e42c55ae4bc5e6f58d8313735d6dc813f1885f8 Mon Sep 17 00:00:00 2001 From: Maria Martinez <77364706+mamartinezmejia@users.noreply.github.com> Date: Wed, 15 Mar 2023 10:01:16 -0700 Subject: [PATCH] Frontend improvements (#400) * no message * feat(fe): - First draft of the FE without JSON schema * feat(fe): - Draft of the FE without JSON schema #2 * feat(fe/be): - Draft of the FE without JSON schema #3 - Changed data model * feat(fe/be): - Draft of the FE without JSON schema #4 * feat(fe/be): - Draft of the FE without JSON schema #5 * feat(fe/be): - Draft of the FE without JSON schema #5 - Completed Autocomplete - Renamed some files * feat(fe/be): - Draft of the FE without JSON schema #6 * fix(fe/be): - Fixed some issues in the SQL scripts and the unit test * feat(fe/be): - Draft of the FE without JSON schema #7 - Added missing validation components * Dropped example * fix(fe): - Fixed some issues in the unit test * feat(fe): - Draft of the FE without JSON schema #8 - Improved code and made code reviews * fix: fixing tests * feat(fe): - Cleaned up code - Improved code and made code reviews * feat(fe): - Cleaned up code - Improved code and made code reviews - Changed some names as per naming conventions * no message * feat(be): - Dropped and added some columns * Fixed typo * feat(fe): - Added missing logic to add the incorporation number * fix(be): - Fixed unit tests after recent changes * fix: adding missing field to the database * feat(fe): - Aligned id names to dto keys for validations practicity * feat(fe): - Added the vue mask library * feat(fe): - Removed unneeded column - Added responsiveness in the table - Beautified code * fix(fe): - Fixed some issues in the unit test * fix(fe): - Fixed some issues in the unit test --------- Co-authored-by: Paulo Gomes da Cruz Junior --- .../bc/gov/app/dto/client/ClientAddressDto.java | 1 - .../java/ca/bc/gov/app/util/ClientMapper.java | 3 +-- .../db/migration/V1__initializing_data.sql | 1 - .../client/ClientHandlerIntegrationTest.java | 1 - frontend/package-lock.json | 11 +++++++++++ frontend/package.json | 1 + frontend/src/main.ts | 2 ++ .../applyclientnumber/ApplyClientNumberPage.vue | 4 ++-- .../ContactSectionComponent.vue | 17 ++++++++++------- 9 files changed, 27 insertions(+), 14 deletions(-) diff --git a/backend/src/main/java/ca/bc/gov/app/dto/client/ClientAddressDto.java b/backend/src/main/java/ca/bc/gov/app/dto/client/ClientAddressDto.java index 37265f81f2..d79d3e2ee0 100644 --- a/backend/src/main/java/ca/bc/gov/app/dto/client/ClientAddressDto.java +++ b/backend/src/main/java/ca/bc/gov/app/dto/client/ClientAddressDto.java @@ -9,7 +9,6 @@ public record ClientAddressDto( String city, String postalCode, String businessPhone, - String email, int index, List clientContactDtoList ) { diff --git a/backend/src/main/java/ca/bc/gov/app/util/ClientMapper.java b/backend/src/main/java/ca/bc/gov/app/util/ClientMapper.java index fd388a0b59..af056b278d 100644 --- a/backend/src/main/java/ca/bc/gov/app/util/ClientMapper.java +++ b/backend/src/main/java/ca/bc/gov/app/util/ClientMapper.java @@ -40,8 +40,7 @@ public static SubmissionLocationEntity mapToSubmissionLocationEntity( .withCountryCode(clientAddressDto.country()) .withProvinceCode(clientAddressDto.province()) .withCityName(clientAddressDto.city()) - .withPostalCode(clientAddressDto.postalCode()) - .withEmailAddress(clientAddressDto.email()); + .withPostalCode(clientAddressDto.postalCode()); } public static SubmissionLocationContactEntity mapToSubmissionLocationContactEntity( diff --git a/backend/src/main/resources/db/migration/V1__initializing_data.sql b/backend/src/main/resources/db/migration/V1__initializing_data.sql index 62f2657b63..be018b4399 100644 --- a/backend/src/main/resources/db/migration/V1__initializing_data.sql +++ b/backend/src/main/resources/db/migration/V1__initializing_data.sql @@ -126,7 +126,6 @@ create table if not exists nrfc.submission_location ( city_name varchar(100) not null, postal_code varchar(10) not null, main_address_ind varchar(1) not null default 'N', - email_address varchar(50) not null, constraint submission_location_id_pk primary key (submission_location_id), constraint submission_id_fk foreign key (submission_id) references nrfc.submission(submission_id), constraint submission_location_country_code_fk foreign key (country_code) references nrfc.country_code(country_code), diff --git a/backend/src/test/java/ca/bc/gov/app/endpoints/client/ClientHandlerIntegrationTest.java b/backend/src/test/java/ca/bc/gov/app/endpoints/client/ClientHandlerIntegrationTest.java index ecf0a8efba..7d6bb7ea99 100644 --- a/backend/src/test/java/ca/bc/gov/app/endpoints/client/ClientHandlerIntegrationTest.java +++ b/backend/src/test/java/ca/bc/gov/app/endpoints/client/ClientHandlerIntegrationTest.java @@ -198,7 +198,6 @@ void shouldSubmitClientData() { "Las Vegas", "89109", "007", - "bond_james_bond@007.com", 0, List.of( new ClientContactDto( diff --git a/frontend/package-lock.json b/frontend/package-lock.json index e9c4753d16..10ae383771 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -28,6 +28,7 @@ "vite": "^2.8.6", "vue": "^3.2.47", "vue-axios": "^3.4.1", + "vue-the-mask": "^0.11.1", "vue-tsc": "^1.1.5" }, "devDependencies": { @@ -8536,6 +8537,11 @@ "he": "^1.2.0" } }, + "node_modules/vue-the-mask": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/vue-the-mask/-/vue-the-mask-0.11.1.tgz", + "integrity": "sha512-UquSfnSWejD0zAfcD+3jJ1chUAkOAyoxya9Lxh9acCRtrlmGcAIvd0cQYraWqKenbuZJUdum+S174atv2AuEHQ==" + }, "node_modules/vue-tsc": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-1.1.5.tgz", @@ -14859,6 +14865,11 @@ "he": "^1.2.0" } }, + "vue-the-mask": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/vue-the-mask/-/vue-the-mask-0.11.1.tgz", + "integrity": "sha512-UquSfnSWejD0zAfcD+3jJ1chUAkOAyoxya9Lxh9acCRtrlmGcAIvd0cQYraWqKenbuZJUdum+S174atv2AuEHQ==" + }, "vue-tsc": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-1.1.5.tgz", diff --git a/frontend/package.json b/frontend/package.json index c1ee679cde..785a5cf484 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -51,6 +51,7 @@ "vite": "^2.8.6", "vue": "^3.2.47", "vue-axios": "^3.4.1", + "vue-the-mask": "^0.11.1", "vue-tsc": "^1.1.5" }, "devDependencies": { diff --git a/frontend/src/main.ts b/frontend/src/main.ts index 613bf1a610..6923f17fa5 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -1,4 +1,5 @@ import { createApp } from "vue"; +import VueTheMask from 'vue-the-mask'; import App from "./App.vue"; import VueKeycloakJs from "@dsb-norge/vue-keycloak-js"; import type { KeycloakInstance } from "keycloak-js"; @@ -10,6 +11,7 @@ import "bootstrap/dist/css/bootstrap.css"; import "bootstrap-vue-3/dist/bootstrap-vue-3.css"; const app = createApp(App); +app.use(VueTheMask); if (nodeEnv && nodeEnv == "openshift-dev") { // disable the login authentication for the deployment in the openshift dev namespace diff --git a/frontend/src/pages/applyclientnumber/ApplyClientNumberPage.vue b/frontend/src/pages/applyclientnumber/ApplyClientNumberPage.vue index 56f8eaec75..82da9ff630 100644 --- a/frontend/src/pages/applyclientnumber/ApplyClientNumberPage.vue +++ b/frontend/src/pages/applyclientnumber/ApplyClientNumberPage.vue @@ -154,8 +154,8 @@ const displayCommonSections = computed(() => { else { if (null !== formData.value.businessType.clientType && null !== formData.value.businessInformation && - null !== formData.value.businessInformation.businessName && - "" !== formData.value.businessInformation.businessName) { + null !== formData.value.businessInformation.incorporationNumber && + "" !== formData.value.businessInformation.incorporationNumber) { return true; } else { diff --git a/frontend/src/pages/applyclientnumber/ContactSectionComponent.vue b/frontend/src/pages/applyclientnumber/ContactSectionComponent.vue index 0d098b0ac1..01c1e0fbe0 100644 --- a/frontend/src/pages/applyclientnumber/ContactSectionComponent.vue +++ b/frontend/src/pages/applyclientnumber/ContactSectionComponent.vue @@ -1,4 +1,5 @@