Skip to content

Commit

Permalink
Frontend improvements (#400)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
Paulo Gomes da Cruz Junior committed Mar 16, 2023
1 parent 55d65db commit 29d730e
Show file tree
Hide file tree
Showing 77 changed files with 1,289 additions and 2,129 deletions.
91 changes: 84 additions & 7 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,14 @@ jobs:
packages: write
strategy:
matrix:
package: [backend, database, frontend,legacy]
include:
- package: backend
triggers: ('backend/')
package: [database, frontend, common]
include:
- package: database
triggers: ('database/')
- package: common
triggers: ('common/')
- package: frontend
triggers: ('frontend/')
- package: legacy
triggers: ('legacy/')
triggers: ('frontend/')
steps:
- uses: actions/checkout@v3

Expand All @@ -119,10 +117,88 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
triggers: ${{ matrix.triggers }}

build-backend:
name: Backend Image Build
env:
COMPONENT: backend
ZONE: ${{ github.event.number }}
NAME: ghcr.io/${{ github.repository }}/backend:${{ github.event.number }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3

- uses: graalvm/setup-graalvm@v1
with:
version: '22.3.0'
java-version: '17'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build App
run: |
cd backend
chmod +x ./mvnw
./mvnw -Pnative clean spring-boot:build-image \
-Dspring-boot.build-image.imageName="${{ env.NAME }}" \
-Doci.revision=${{ github.event.number }} -q
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pushing
run: docker push ${{ env.NAME }}
build-legacy:
name: Legacy Image Build
env:
COMPONENT: legacy
ZONE: ${{ github.event.number }}
NAME: ghcr.io/${{ github.repository }}/legacy:${{ github.event.number }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3

- uses: graalvm/setup-graalvm@v1
with:
version: '22.3.0'
java-version: '17'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build App
run: |
cd legacy
chmod +x ./mvnw
./mvnw -Pnative clean spring-boot:build-image \
-Dspring-boot.build-image.imageName="${{ env.NAME }}" \
-Doci.revision=${{ github.event.number }} -q
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pushing
run: docker push ${{ env.NAME }}

deploy-init:
name: Deploy Init
needs:
- builds
- build-backend
environment: dev
runs-on: ubuntu-22.04
steps:
Expand Down Expand Up @@ -235,6 +311,7 @@ jobs:
-p ORACLEDB_HOST=${{ secrets.ORACLEDB_HOST }}
-p ORACLEDB_SERVICENAME=${{ secrets.ORACLEDB_SERVICENAME }}
-p FOREST_API_URL=https://${{ github.event.repository.name }}-${{ github.event.number }}-backend.apps.silver.devops.gov.bc.ca
-p ORACLEDB_SECRET=${{ secrets.ORACLEDB_SECRET }}

deploy-frontend:
name: Deploy Frontend
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,40 @@ jobs:
-Dsonar.organization=bcgov-sonarcloud
-Dsonar.projectKey=forest-client-backend
sonar_project_token: ${{ secrets.SONAR_TOKEN_BACKEND }}
- name: Archive CycloneDX
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: cyclone-backend
path: target/bom.json
retention-days: 5

- name: Use Checkstyle report
continue-on-error: true
uses: jwgmeligmeyling/checkstyle-github-action@master
with:
path: 'backend/**/checkstyle-result.xml'

- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
continue-on-error: true
if: success() || failure() # always run even if the previous step fails
with:
report_paths: 'backend/target/**/TEST-*.xml'
commit: ${{ github.event.pull_request.head.sha }}
summary: Pull Request Tests Backend
detailed_summary: true
job_name: Backend Tests

- name: Add coverage to PR
id: jacoco
continue-on-error: true
uses: madrapps/[email protected]
with:
paths: backend/target/coverage-reports/merged-test-report/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 75
min-coverage-changed-files: 75

tests-legacy:
name: Legacy Unit Tests
Expand All @@ -54,6 +88,40 @@ jobs:
-Dsonar.organization=bcgov-sonarcloud
-Dsonar.projectKey=forest-client-legacy
sonar_project_token: ${{ secrets.SONAR_TOKEN_LEGACY }}
- name: Archive CycloneDX
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: cyclone-legacy
path: target/bom.json
retention-days: 5

- name: Use Checkstyle report
continue-on-error: true
uses: jwgmeligmeyling/checkstyle-github-action@master
with:
path: 'legacy/**/checkstyle-result.xml'

- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
continue-on-error: true
if: success() || failure() # always run even if the previous step fails
with:
report_paths: 'legacy/target/**/TEST-*.xml'
commit: ${{ github.event.pull_request.head.sha }}
summary: Pull Request Tests Legacy
detailed_summary: true
job_name: Legacy Tests

- name: Add coverage to PR
id: jacoco
continue-on-error: true
uses: madrapps/[email protected]
with:
paths: legacy/target/coverage-reports/merged-test-report/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 75
min-coverage-changed-files: 75

tests-frontend:
name: Frontend Unit Tests
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ snyk.sarif
# Dist
**/dist/**

# IntelliJ
.idea/**
**/*.iml

### Eclipse ###
backend/.metadata
Expand Down
26 changes: 26 additions & 0 deletions backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@

<junit-jupiter-api.version>5.9.1</junit-jupiter-api.version>
<junit-platform.version>1.9.1</junit-platform.version>
<oci.revision>${project.version}</oci.revision>
</properties>

<dependencies>
Expand Down Expand Up @@ -193,6 +194,10 @@

<build>
<plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
Expand All @@ -203,6 +208,27 @@
<artifactId>lombok</artifactId>
</exclude>
</excludes>
<image>
<buildpacks>
<buildpack>gcr.io/paketo-buildpacks/graalvm</buildpack>
<buildpack>gcr.io/paketo-buildpacks/java-native-image</buildpack>
<buildpack>gcr.io/paketo-buildpacks/image-labels</buildpack>
</buildpacks>
<env>
<BP_JVM_VERSION>19.0.2</BP_JVM_VERSION>
<BP_OCI_SOURCE>https://github.com/bcgov/nr-forest-client</BP_OCI_SOURCE>
<BP_OCI_VERSION>${project.version}</BP_OCI_VERSION>
<BP_OCI_DESCRIPTION>${project.description}</BP_OCI_DESCRIPTION>
<BP_OCI_LICENSES>Apache License, Version 2.0</BP_OCI_LICENSES>
<BP_OCI_REVISION>${oci.revision}</BP_OCI_REVISION>
<BP_OCI_TITLE>${project.name}</BP_OCI_TITLE>
<BP_OCI_CREATED>${timestamp}</BP_OCI_CREATED>
<BP_NATIVE_IMAGE>true</BP_NATIVE_IMAGE>
</env>
</image>
<layers>
<includeLayerTools>false</includeLayerTools>
</layers>
</configuration>
</plugin>

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ca.bc.gov.app.handlers;
package ca.bc.gov.app.controller;

import ca.bc.gov.app.exception.InvalidRequestObjectException;
import java.util.function.Function;
Expand All @@ -8,12 +8,11 @@
import org.springframework.context.support.DefaultMessageSourceResolvable;
import org.springframework.validation.BeanPropertyBindingResult;
import org.springframework.validation.Errors;
import org.springframework.validation.FieldError;
import org.springframework.validation.Validator;

@RequiredArgsConstructor
@Slf4j
public class AbstractHandler<T, V extends Validator> {
public class AbstractController<T, V extends Validator> {

protected final Class<T> contentClass;
private final V validator;
Expand All @@ -32,7 +31,6 @@ private static Function<Errors, String> getErrorMessages() {
errors
.getAllErrors()
.stream()
.map(FieldError.class::cast)
.map(DefaultMessageSourceResolvable::getCode)
.reduce(StringUtils.EMPTY,
(message1, message2) -> String.join(",", message1, message2));
Expand Down
Loading

0 comments on commit 29d730e

Please sign in to comment.