Skip to content

Commit

Permalink
Merge pull request #219 from xeptagondev/develop
Browse files Browse the repository at this point in the history
Sprint 45 Change
  • Loading branch information
mbelinsky authored Nov 20, 2023
2 parents 591b5da + ce90c07 commit 16e6e19
Show file tree
Hide file tree
Showing 18 changed files with 570 additions and 245 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/frontend-deployment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
paths:
- web/**
- .github/workflows/frontend*
- docker-compose*

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
deploy_front_end:
Expand All @@ -19,6 +24,12 @@ jobs:
REACT_APP_MAP_TYPE : "Mapbox"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 5
- name: Check Docker variable changes
run: |
echo "docker-compose file Change...."
git diff HEAD~ -- HEAD -z ./docker-compose*
# - name: Cache modules
# uses: actions/cache@v1
# id: yarn-cache
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/server-deployments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
- backend/**
# - libs/**
- .github/workflows/server*
- docker-compose*

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand Down Expand Up @@ -94,6 +99,12 @@ jobs:
needs: [layer, check_dependency_change]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 5
- name: Check Docker variable changes
run: |
echo "docker-compose file Change...."
git diff HEAD~ -- HEAD -z ./docker-compose*
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v3
# with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-service-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f backend/services/Dockerfile .
echo "Pushing image to ECR..."
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
# automated-api-tests:
# runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-web-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ jobs:
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f web/Dockerfile . --build-arg PORT=3030 --build-arg REACT_APP_BACKEND=http://localhost:3000 --build-arg REACT_APP_STAT_URL=http://localhost:3100 --build-arg COUNTRY_NAME="CountryX" --build-arg COUNTRY_FLAG_URL="https://carbon-common-dev.s3.amazonaws.com/flag.png" --build-arg COUNTRY_CODE="NG" --build-arg REACT_APP_MAP_TYPE="Mapbox" --build-arg REACT_APP_MAPBOXGL_ACCESS_TOKEN=${{ secrets.MAPBOXGL_ACCESS_TOKEN }}
echo "Pushing image to ECR..."
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
6 changes: 3 additions & 3 deletions backend/services/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@
"@nestjs/platform-express": "^9.0.0",
"@nestjs/swagger": "^6.1.3",
"@nestjs/typeorm": "^9.0.1",
"@undp/carbon-credit-calculator": "^1.0.0",
"@undp/carbon-services-lib": "0.0.246",
"@undp/carbon-credit-calculator": "^1.1.1",
"@undp/carbon-services-lib": "0.0.250",
"@undp/serial-number-gen": "^1.0.0",
"amazon-qldb-driver-nodejs": "^3.0.1",
"aws-kinesis-agg": "^4.2.6",
"aws-lambda": "^1.0.7",
"aws-serverless-express": "^3.4.0",
"axios": "^1.2.4",
"axios": "^1.6.0",
"carbon-services-lib": "0.0.231-CARBON-323.2",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.0",
Expand Down
4 changes: 2 additions & 2 deletions backend/services/src/national-api/programme.controller.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Body, Controller, Get, Post, Put, Query, UseGuards, Request } from '@nestjs/common';
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
import { ProgrammeService, ApiKeyJwtAuthGuard, PoliciesGuard, CheckPolicies, AppAbility, Action, Programme, ProgrammeDto, ProgrammeDocumentRegistryDto, ProgrammeAcceptedDto, MitigationAddDto, OwnershipUpdateDto, PoliciesGuardEx, QueryDto, ConstantUpdateDto, ProgrammeApprove, ProgrammeIssue, ProgrammeReject, TransferFreezeGuard, ProgrammeTransferRequest, ProgrammeRetire, ProgrammeCertify, ProgrammeRevoke, ProgrammeTransferApprove, ProgrammeTransfer, ProgrammeTransferReject, ProgrammeTransferCancel } from '@undp/carbon-services-lib';
import { ProgrammeMitigationIssue,ProgrammeService, ApiKeyJwtAuthGuard, PoliciesGuard, CheckPolicies, AppAbility, Action, Programme, ProgrammeDto, ProgrammeDocumentRegistryDto, ProgrammeAcceptedDto, MitigationAddDto, OwnershipUpdateDto, PoliciesGuardEx, QueryDto, ConstantUpdateDto, ProgrammeApprove, ProgrammeIssue, ProgrammeReject, TransferFreezeGuard, ProgrammeTransferRequest, ProgrammeRetire, ProgrammeCertify, ProgrammeRevoke, ProgrammeTransferApprove, ProgrammeTransfer, ProgrammeTransferReject, ProgrammeTransferCancel } from '@undp/carbon-services-lib';

@ApiTags('Programme')
@ApiBearerAuth()
Expand Down Expand Up @@ -92,7 +92,7 @@ export class ProgrammeController {
@ApiBearerAuth()
@UseGuards(ApiKeyJwtAuthGuard, PoliciesGuardEx(true, Action.Update, Programme))
@Put('issue')
async programmeIssue(@Body() body: ProgrammeIssue, @Request() req) {
async programmeIssue(@Body() body: ProgrammeMitigationIssue, @Request() req) {
return this.programmeService.issueProgrammeCredit(body, req.user)
}

Expand Down
32 changes: 20 additions & 12 deletions backend/services/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5537,17 +5537,25 @@
"@ucast/core" "^1.4.1"

"@undp/carbon-credit-calculator@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@undp/carbon-credit-calculator/-/carbon-credit-calculator-1.0.0.tgz#fbdfbb606cb7bd402ed74887dfc1f0861cfca892"
integrity sha512-7wbGm7uEYdRBWlKzATKIhFLd9Zip8yxLCi3cfAcufb5kACw8ZKqtbn+08EyZQiJbDoPB3ouM6Dx8Dl+FnqqPVg==
version "1.1.2"
resolved "https://registry.yarnpkg.com/@undp/carbon-credit-calculator/-/carbon-credit-calculator-1.1.2.tgz#a72f7d632e88e2fe5b15148548b1c4145d68dbc8"
integrity sha512-8tFp3DkHDZb6HIKVsJd7QRtx2rH1gCvE5aDAq/IinJ4HLOAnufkfPBRCmXG2mfCL5LY2icXjU0X+4Nz/zteiMA==
dependencies:
"@types/node" "^18.11.9"
convert-units "^2.3.4"

"@undp/carbon-credit-calculator@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@undp/carbon-credit-calculator/-/carbon-credit-calculator-1.1.1.tgz#af3d295abf0ebb4af9d5be04f09067b9247197e5"
integrity sha512-H6AoaICkxQO+tbin1faZb4RbGVfQ9kbH228b5Vaz4Zomlo+AWIhYAPl/3CXE3tbdd465KH2RPczMzC+DeRnlFg==
dependencies:
"@types/node" "^18.11.9"
convert-units "^2.3.4"

"@undp/[email protected].246":
version "0.0.246"
resolved "https://registry.yarnpkg.com/@undp/carbon-services-lib/-/carbon-services-lib-0.0.246.tgz#d62349920bb7d6f7795c23430b8611c1cbc523d7"
integrity sha512-UhtY6QpHLlAwzde3D1XBVSdUs9i+uuumoWZQ5+yrRcyLAh8I/NNGBReRUFzvmObQrwwTyrnkSZlVwLaDm89ylw==
"@undp/[email protected].250":
version "0.0.250"
resolved "https://registry.yarnpkg.com/@undp/carbon-services-lib/-/carbon-services-lib-0.0.250.tgz#63d32af8fcbc91bd13439c8d5023dad3dd52124d"
integrity sha512-caGtfyDYUX+5GTcGQ/NEWXam2Wi4MavXRbfgu6EM5R1mCIGec515taeAPTtJ19jZTL+KaoZ+r5FAIfenDS7ZWw==
dependencies:
"@aws-sdk/client-qldb" "^3.408.0"
"@aws-sdk/client-qldb-session" "^3.408.0"
Expand All @@ -5563,7 +5571,7 @@
"@nestjs/platform-express" "^9.0.0"
"@nestjs/swagger" "^6.1.3"
"@nestjs/typeorm" "^9.0.1"
"@undp/carbon-credit-calculator" "^1.0.0"
"@undp/carbon-credit-calculator" "^1.1.1"
"@undp/serial-number-gen" "^1.0.0"
amazon-qldb-driver-nodejs "^3.0.1"
aws-kinesis-agg "^4.2.6"
Expand Down Expand Up @@ -6130,10 +6138,10 @@ axios@^0.21.1:
dependencies:
follow-redirects "^1.14.0"

axios@^1.2.4:
version "1.3.5"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.3.5.tgz#e07209b39a0d11848e3e341fa087acd71dadc542"
integrity sha512-glL/PvG/E+xCWwV8S6nCHcrfg1exGx7vxyUIivIA1iL7BIh6bePylCfVHwp6k13ao7SATxB6imau2kqY+I67kw==
axios@^1.2.4, axios@^1.6.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.0.tgz#f1e5292f26b2fd5c2e66876adc5b06cdbd7d2102"
integrity sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==
dependencies:
follow-redirects "^1.15.0"
form-data "^4.0.0"
Expand Down
8 changes: 4 additions & 4 deletions docker-compose-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ services:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
- data:/data/postgres
national:
image: 302213478610.dkr.ecr.us-east-1.amazonaws.com/carbon-services:CARBON-15
image: 302213478610.dkr.ecr.us-east-1.amazonaws.com/carbon-services:CARBON-329
# build:
# context: .
# dockerfile: ./backend/services/Dockerfile
Expand Down Expand Up @@ -53,7 +53,7 @@ services:
# build:
# context: .
# dockerfile: ./backend/services/Dockerfile
image: 302213478610.dkr.ecr.us-east-1.amazonaws.com/carbon-services:CARBON-15
image: 302213478610.dkr.ecr.us-east-1.amazonaws.com/carbon-services:CARBON-329
ports:
- "3100:3100"
depends_on:
Expand All @@ -67,7 +67,7 @@ services:
RUN_MODULE: analytics-api
DOMAIN_MAP: "true"
replicator:
image: 302213478610.dkr.ecr.us-east-1.amazonaws.com/carbon-services:CARBON-15
image: 302213478610.dkr.ecr.us-east-1.amazonaws.com/carbon-services:CARBON-329
# build:
# context: .
# dockerfile: ./backend/services/Dockerfile
Expand All @@ -93,7 +93,7 @@ services:
SYNC_ENABLE: true
SYSTEM_TYPE: CARBON_REGISTRY_SYSTEM
web:
image: 302213478610.dkr.ecr.us-east-1.amazonaws.com/carbon-web:CARBON-15
image: 302213478610.dkr.ecr.us-east-1.amazonaws.com/carbon-web:CARBON-329
# build:
# context: .
# dockerfile: ./web/Dockerfile
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ services:
DB_PASSWORD: "<ANY PASSWORD>"
# ,data-importer
RUN_MODULE: replicator,async-operations-handler
DATA_IMPORT_TYPES: ""
LOCATION_SERVICE: OPENSTREET
SMTP_ENDPOINT: email-smtp.us-east-1.amazonaws.com
SMTP_USERNAME: "AKIAUMXKTXDJLKSXTF3U"
Expand All @@ -95,7 +96,7 @@ services:
SYNC_ENABLE: true
SYSTEM_TYPE: CARBON_REGISTRY_SYSTEM
HOST: "http://localhost:3030"
BACKEND_HOST: http://192.168.1.73:9000
BACKEND_HOST: http://192.168.1.123:9000
# async-operations-handler:
# build:
# context: .
Expand Down
4 changes: 2 additions & 2 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"@types/react-dom": "^18.0.8",
"@types/styled-components": "^5.1.26",
"@types/validator": "^13.7.13",
"@undp/carbon-library": "1.0.169",
"@undp/carbon-library": "1.0.173",
"antd": "^4.24.1",
"apexcharts": "^3.36.3",
"axios": "^1.1.3",
"axios": "^1.6.0",
"bootstrap-icons": "^1.10.2",
"buffer": "^6.0.3",
"class-transformer": "^0.5.1",
Expand Down
8 changes: 7 additions & 1 deletion web/public/Assets/i18n/view/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"by": "By",
"programme": "Programme",
"issueCreditText": "Credits to be issued",
"issueCreditNdcIdText": "Action ID",
"authCreditText": "Credits to authorise",
"totalTransferCredit": "Total Amount",
"totalRetireCredit": "Retired Credit Amount",
Expand Down Expand Up @@ -89,7 +90,8 @@
"tlAuth": "Authorised",
"tlAuthDesc": "The programme was authorised for {} {} credits until {} with the Serial Number {} by {}",
"tlIssue": "Credits Issued",
"tlIssueDesc": "The programme was issued {} {} credits by {}",
"tlIssueDesc": "The programme was issued {} by {}",
"t1IssueNdcDesc": "{} {} credits for the NDC Action {}",
"tlReject": "Rejected",
"tlRejectDesc": "The programme was rejected by {}",
"tlTransfer": "Transferred",
Expand Down Expand Up @@ -118,6 +120,10 @@
"tlPending": "Pending",
"tlAuthorisation": "Authorisation",
"typeOfMitigation": "Type Of Mitigation",
"subTypeOfMitigation": "Sub Type Of Mitigation",
"numberOfDays": "Number of days",
"numberOfPeopleInHousehold": "Number of people in the household",
"weightInTons": "Tonnes (t) on dry basis",
"userEstimatedCredits": "User Estimated Credits",
"systemEstimatedCredits": "System Estimated Credits",
"actionId": "NDC ID",
Expand Down
Binary file added web/src/Assets/Images/forestnew.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 16e6e19

Please sign in to comment.