Skip to content

Commit

Permalink
Merge pull request #214 from xeptagondev/develop
Browse files Browse the repository at this point in the history
Sprint 43 deployments
  • Loading branch information
mbelinsky authored Nov 13, 2023
2 parents d1a6943 + fc9b8d2 commit 5b5e92b
Show file tree
Hide file tree
Showing 15 changed files with 192 additions and 81 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/frontend-deployment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,6 @@ jobs:
echo "Pushing image to ECR..."
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
- name: Build, tag, and push the QA-develop image to Amazon ECR
id: build-image-develop
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: carbon-web
IMAGE_TAG: develop
run: |
# Build a docker container and push it to ECR
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"
- name: Deploy docker image to Amazon EC2
if: github.ref == 'refs/heads/develop'
env:
Expand All @@ -91,3 +79,15 @@ jobs:
sudo docker rm carbon-registry-web-1 &&
sudo docker pull 302213478610.dkr.ecr.us-east-1.amazonaws.com/carbon-web:v1 &&
docker compose -f docker-compose-image.yml up -d web '
- name: Build, tag, and push the QA-develop image to Amazon ECR
id: build-image-develop
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: carbon-web
IMAGE_TAG: develop
run: |
# Build a docker container and push it to ECR
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"
4 changes: 2 additions & 2 deletions backend/services/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@
"@nestjs/swagger": "^6.1.3",
"@nestjs/typeorm": "^9.0.1",
"@undp/carbon-credit-calculator": "^1.0.0",
"@undp/carbon-services-lib": "^0.0.233",
"@undp/carbon-services-lib": "0.0.243",
"@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",
"carbon-services-lib": "0.0.231-CARBON-315.4",
"carbon-services-lib": "0.0.231-CARBON-323.2",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.0",
"dotenv-flow": "^3.2.0",
Expand Down
1 change: 1 addition & 0 deletions backend/services/src/setup/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ export const handler: Handler = async (event) => {
company.name = event["name"];
company.logo = event["logoBase64"];
company.companyRole = CompanyRole.GOVERNMENT;
company.taxId = `00000${event["systemCountryCode"]}`

const user = new UserDto();
user.email = event["rootEmail"];
Expand Down
52 changes: 26 additions & 26 deletions backend/services/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5544,10 +5544,10 @@
"@types/node" "^18.11.9"
convert-units "^2.3.4"

"@undp/carbon-services-lib@^0.0.233":
version "0.0.233"
resolved "https://registry.yarnpkg.com/@undp/carbon-services-lib/-/carbon-services-lib-0.0.233.tgz#0fdee32a5f6c1a3c70cf789180f0cd1b6c74339a"
integrity sha512-vZLGhU2fOwRpYjumWITKteM6WEEorrRaIYzajlU7OG2so1opN0XUtPWA87MLS7UlPwqPoMq5oBYIq0q33ubUjQ==
"@undp/[email protected].243":
version "0.0.243"
resolved "https://registry.yarnpkg.com/@undp/carbon-services-lib/-/carbon-services-lib-0.0.243.tgz#384b9d9e952f195b46e6b19e6322da7af75ba471"
integrity sha512-BioneoFADRehckXQVxtAJQOxHGc4g9bypJW+6XjMtYQlVCqokWpew1/2aFfqSjZQpDYMx0OUfHBXwRSbKFJnfw==
dependencies:
"@aws-sdk/client-qldb" "^3.408.0"
"@aws-sdk/client-qldb-session" "^3.408.0"
Expand Down Expand Up @@ -6479,7 +6479,7 @@ bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9:
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88"
integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==

bn.js@^5.0.0, bn.js@^5.1.1:
bn.js@^5.0.0, bn.js@^5.2.1:
version "5.2.1"
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70"
integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==
Expand Down Expand Up @@ -6628,7 +6628,7 @@ browserify-des@^1.0.0:
inherits "^2.0.1"
safe-buffer "^5.1.2"

browserify-rsa@^4.0.0, browserify-rsa@^4.0.1:
browserify-rsa@^4.0.0, browserify-rsa@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.1.0.tgz#b2fd06b5b75ae297f7ce2dc651f918f5be158c8d"
integrity sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==
Expand All @@ -6637,19 +6637,19 @@ browserify-rsa@^4.0.0, browserify-rsa@^4.0.1:
randombytes "^2.0.1"

browserify-sign@^4.0.0:
version "4.2.1"
resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.2.1.tgz#eaf4add46dd54be3bb3b36c0cf15abbeba7956c3"
integrity sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==
version "4.2.2"
resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.2.2.tgz#e78d4b69816d6e3dd1c747e64e9947f9ad79bc7e"
integrity sha512-1rudGyeYY42Dk6texmv7c4VcQ0EsvVbLwZkA+AQB7SxvXxmcD93jcHie8bzecJ+ChDlmAm2Qyu0+Ccg5uhZXCg==
dependencies:
bn.js "^5.1.1"
browserify-rsa "^4.0.1"
bn.js "^5.2.1"
browserify-rsa "^4.1.0"
create-hash "^1.2.0"
create-hmac "^1.1.7"
elliptic "^6.5.3"
elliptic "^6.5.4"
inherits "^2.0.4"
parse-asn1 "^5.1.5"
readable-stream "^3.6.0"
safe-buffer "^5.2.0"
parse-asn1 "^5.1.6"
readable-stream "^3.6.2"
safe-buffer "^5.2.1"

browserify-zlib@~0.2.0:
version "0.2.0"
Expand Down Expand Up @@ -6900,10 +6900,10 @@ caniuse-lite@^1.0.30001449:
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001474.tgz#13b6fe301a831fe666cce8ca4ef89352334133d5"
integrity sha512-iaIZ8gVrWfemh5DG3T9/YqarVZoYf0r188IjaGwx68j4Pf0SGY6CQkmJUIE+NZHkkecQGohzXmBGEwWDr9aM3Q==

[email protected]315.4:
version "0.0.231-CARBON-315.4"
resolved "https://registry.yarnpkg.com/carbon-services-lib/-/carbon-services-lib-0.0.231-CARBON-315.4.tgz#59aa18cd6d3c5d7c3152da5ee6651e001d01a638"
integrity sha512-FSl0BfrnjjmurDIT7brEpQWkoWmsRirHNdce1fu4xVmfbbuJtWMf05XQaenpNG5nzE94wiUwRujO38c5uW9Fqw==
[email protected]323.2:
version "0.0.231-CARBON-323.2"
resolved "https://registry.yarnpkg.com/carbon-services-lib/-/carbon-services-lib-0.0.231-CARBON-323.2.tgz#b4a33fc0955ef8839e5e4bf857c5215872df2f43"
integrity sha512-IR0d1s7T4jUneQ6eH1muqdXJNwHaIGVhDL66X7I1dJSIvQqQ1ajG1ZZMWyMvwk/SsQB+EWeQEFCwPVYTYBEjXQ==
dependencies:
"@aws-sdk/client-qldb" "^3.408.0"
"@aws-sdk/client-qldb-session" "^3.408.0"
Expand Down Expand Up @@ -7490,9 +7490,9 @@ crypto-browserify@^3.0.0:
randomfill "^1.0.3"

crypto-js@^4.0.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.1.1.tgz#9e485bcf03521041bd85844786b83fb7619736cf"
integrity sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==
version "4.2.0"
resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.2.0.tgz#4d931639ecdfd12ff80e8186dba6af2c2e856631"
integrity sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==

css-select@^5.1.0:
version "5.1.0"
Expand Down Expand Up @@ -7879,7 +7879,7 @@ electron-to-chromium@^1.4.284:
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.353.tgz#20e9cb4c83a08e35b3314d3fa8988764c105e6b7"
integrity sha512-IdJVpMHJoBT/nn0GQ02wPfbhogDVpd1ud95lP//FTf5l35wzxKJwibB4HBdY7Q+xKPA1nkZ0UDLOMyRj5U5IAQ==

elliptic@^6.5.3:
elliptic@^6.5.3, elliptic@^6.5.4:
version "6.5.4"
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb"
integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==
Expand Down Expand Up @@ -11332,7 +11332,7 @@ parents@^1.0.0, parents@^1.0.1:
dependencies:
path-platform "~0.11.15"

parse-asn1@^5.0.0, parse-asn1@^5.1.5:
parse-asn1@^5.0.0, parse-asn1@^5.1.6:
version "5.1.6"
resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.6.tgz#385080a3ec13cb62a62d39409cb3e88844cdaed4"
integrity sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==
Expand Down Expand Up @@ -11897,7 +11897,7 @@ readable-stream@^2.0.0, readable-stream@^2.0.2, readable-stream@^2.0.5, readable
string_decoder "~1.1.1"
util-deprecate "~1.0.1"

readable-stream@^3.0.0, readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0:
readable-stream@^3.0.0, readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0, readable-stream@^3.6.2:
version "3.6.2"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967"
integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==
Expand Down Expand Up @@ -12131,7 +12131,7 @@ rxjs@^7.2.0, rxjs@^7.5.5:
dependencies:
tslib "^2.1.0"

[email protected], safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0:
[email protected], safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0:
version "5.2.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
Expand Down
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ services:
name: "Antactic Region"
logoBase64: "sss"
IS_EMAIL_DISABLED: "true"
DISABLE_LOW_PRIORITY_EMAIL: "true"
LOCATION_SERVICE: OPENSTREET
ASYNC_OPERATIONS_TYPE: Database
HOST: "http://localhost:3030"
DOMAIN_MAP: "true"
EXPIRES_IN: "7200"
SYSTEM_TYPE: CARBON_REGISTRY_SYSTEM
SYSTEM_NAME: Carbon Registry
BACKEND_HOST: http://192.168.1.73:9000
volumes:
- filestore:/app/backend/services/public
- ./users.csv:/app/backend/services/users.csv
Expand Down Expand Up @@ -80,8 +82,10 @@ services:
RUN_MODULE: replicator,async-operations-handler
LOCATION_SERVICE: OPENSTREET
SMTP_ENDPOINT: email-smtp.us-east-1.amazonaws.com
SMTP_USERNAME: "AKIAUMXKTXDJLKSXTF3U"
SMTP_PASSWORD: ""
IS_EMAIL_DISABLED: "true"
DISABLE_LOW_PRIORITY_EMAIL: "true"
ASYNC_OPERATIONS_TYPE: Database
ITMO_API_KEY: ""
ITMO_EMAIL: ""
Expand All @@ -90,6 +94,8 @@ services:
SYNC_API_TOKEN: ''
SYNC_ENABLE: true
SYSTEM_TYPE: CARBON_REGISTRY_SYSTEM
HOST: "http://localhost:3030"
BACKEND_HOST: http://192.168.1.73:9000
# async-operations-handler:
# build:
# context: .
Expand Down
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@types/react-dom": "^18.0.8",
"@types/styled-components": "^5.1.26",
"@types/validator": "^13.7.13",
"@undp/carbon-library": "^1.0.134",
"@undp/carbon-library": "1.0.168",
"antd": "^4.24.1",
"apexcharts": "^3.36.3",
"axios": "^1.1.3",
Expand Down
3 changes: 2 additions & 1 deletion web/public/Assets/i18n/companyProfile/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
"adminDetailsHeading": "Organisation Admin Details",
"adminName": "Name",
"adminEmail": "Email",
"nationalSopValue": "National Share of Proceeds",
"adminPhone": "Phone"
}
}
4 changes: 3 additions & 1 deletion web/public/Assets/i18n/view/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,7 @@
"ministryLevel": "Ministry Level",
"creditEst": "Estimated Credits",
"carbonPriceUSDPerTon": "Minimum Carbon Price: USD per ton (assuming no other revenue)",
"environmentalAssessmentRegistrationNo": "Environmental Assessment Registration Number"
"environmentalAssessmentRegistrationNo": "Environmental Assessment Registration Number",
"verificationEl": "Verification",
"monitoringEl": "Monitoring"
}
2 changes: 1 addition & 1 deletion web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const App = () => {
element={<CustomLayout selectedKey="programmeManagement/viewAll" />}
>
<Route path="viewAll" element={<ProgrammeManagement />} />
<Route path="view" element={<ProgrammeView />} />
<Route path="view/:id" element={<ProgrammeView />} />
</Route>
<Route
path="/companyManagement"
Expand Down
3 changes: 2 additions & 1 deletion web/src/Pages/Company/addNewCompany.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useConnection } from '../../Context/ConnectionContext/connectionContext
import { useLocation, useNavigate } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import { useUserContext } from '../../Context/UserInformationContext/userInformationContext';
import { AddNewCompanyComponent } from '@undp/carbon-library';
import { AddNewCompanyComponent, CarbonSystemType } from '@undp/carbon-library';

const AddNewCompany = () => {
const navigate = useNavigate();
Expand All @@ -24,6 +24,7 @@ const AddNewCompany = () => {
useConnection={useConnection}
useUserContext={useUserContext}
useLocation={useLocation}
systemType={CarbonSystemType.REGISTRY}
></AddNewCompanyComponent>
);
};
Expand Down
2 changes: 1 addition & 1 deletion web/src/Pages/ProgrammeManagement/programmeManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const ProgrammeManagement = () => {
];

const onNavigateToProgrammeView = (record: any) => {
navigate('/programmeManagement/view', { state: { record } });
navigate(`/programmeManagement/view/${record.programmeId}`, { state: { record } });
};

return (
Expand Down
2 changes: 1 addition & 1 deletion web/src/Pages/ProgrammeView/programmeView.scss
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
}
.upcom-issue-step{
color: #000000;
background-color: rgba(#1e1f1f, 0.5);
background-color: rgba(#3A3541, 0.5);
}
.reject-step {
color: #ff9900;
Expand Down
Loading

0 comments on commit 5b5e92b

Please sign in to comment.