Skip to content

Commit

Permalink
Merge pull request #70 from undp/develop
Browse files Browse the repository at this point in the history
Fix READMD frontend build issue
  • Loading branch information
mbelinsky authored Apr 20, 2023
2 parents 3195f2b + 5fc6172 commit 9f811b3
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 24 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![GitHub last commit](https://img.shields.io/github/last-commit/undp/carbon-registry)
![Uptime](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/undp/carbon-registry-status/master/api/carbon-registry/uptime.json)
![GitHub Workflow Status (with branch)](https://img.shields.io/github/actions/workflow/status/undp/carbon-registry/server-deployments.yml?branch=main&label=server%20build)
![GitHub Workflow Status (with branch)](https://img.shields.io/github/actions/workflow/status/undp/carbon-registry/frontend-deployment.yml?branch=main&label=frontend%20build)
![GitHub Workflow Status (with branch)](https://img.shields.io/github/actions/workflow/status/undp/carbon-registry/frontend-deployment-prod.yml?branch=main&label=frontend%20build)
[![](https://img.shields.io/badge/chat-SparkBlue-blue)](https://www.sparkblue.org/group/keeping-track-digital-public-goods-paris-agreement)
[![](https://img.shields.io/badge/Digital%20Public%20Good-Certified-blueviolet)](https://app.digitalpublicgoods.net/a/10403)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ export class ITMOSystemImporter implements ImporterInterface {
SectoralScope.Agriculture,
TypeOfMitigation.AGRICULTURE
]
case "energy-industries":
return [
Sector.Energy,
SectoralScope.EnergyIndustry,
TypeOfMitigation.EE_INDUSTRY
]
default:
return [
Sector.Other,
Expand Down
2 changes: 2 additions & 0 deletions backend/services/src/shared/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export class AuthService {
}

async forgotPassword(email: any) {
const hostAddress = this.configService.get("host");
const userDetails = await this.userService.findOne(email);
if (userDetails) {
console.table(userDetails);
Expand All @@ -99,6 +100,7 @@ export class AuthService {
const templateData = {
name: userDetails.name,
requestId: requestId,
home: hostAddress,
countryName: this.configService.get("systemCountryName"),
};

Expand Down
3 changes: 3 additions & 0 deletions backend/services/src/shared/casl/casl-ability.factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ export class CaslAbilityFactory {
cannot([Action.Update], Company, {
companyId: { $ne: user.companyId },
});
cannot([Action.Update, Action.Delete], User, {
companyId: { $ne: user.companyId },
});
} else if (
user.role == Role.Admin &&
user.companyRole == CompanyRole.GOVERNMENT
Expand Down
2 changes: 1 addition & 1 deletion backend/services/src/shared/email-helper/email.template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export const EmailTemplates = {
Use the link below to set a new password for your account. This password reset is only valid for the next hour.
<br><br>
<a href="http://www-test-carbon.s3-website-us-east-1.amazonaws.com/resetPassword/{{requestId}}">Click here to reset the password</a>
<a href="{{home}}/resetPassword/{{requestId}}">Click here to reset the password</a>
<br><br>
If you do not use {{countryName}} Carbon Credit Registry or did not request a password reset, please ignore this email or
Expand Down
48 changes: 26 additions & 22 deletions web/src/Pages/ProgrammeView/programmeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1247,32 +1247,36 @@ const ProgrammeView = () => {
let calculations: any = {};
if (data.typeOfMitigation === TypeOfMitigation.AGRICULTURE) {
calculations = data.agricultureProperties;
if (calculations.landAreaUnit) {
calculations.landArea = new UnitField(
data.agricultureProperties.landAreaUnit,
addCommSep(data.agricultureProperties.landArea)
);
// addCommSep(data.agricultureProperties.landArea) +
// ' ' +
// data.agricultureProperties.landAreaUnit;
if (calculations) {
if (calculations.landAreaUnit) {
calculations.landArea = new UnitField(
data.agricultureProperties.landAreaUnit,
addCommSep(data.agricultureProperties.landArea)
);
// addCommSep(data.agricultureProperties.landArea) +
// ' ' +
// data.agricultureProperties.landAreaUnit;
}
delete calculations.landAreaUnit;
}
delete calculations.landAreaUnit;
} else if (data.typeOfMitigation === TypeOfMitigation.SOLAR) {
calculations = data.solarProperties;
if (calculations.energyGenerationUnit) {
calculations.energyGeneration = new UnitField(
data.solarProperties.energyGenerationUnit,
addCommSep(data.solarProperties.energyGeneration)
);
// addCommSep(data.solarProperties.energyGeneration) +
// ' ' +
// data.solarProperties.energyGenerationUnit;
} else if (calculations.consumerGroup && typeof calculations.consumerGroup === 'string') {
calculations.consumerGroup = (
<Tag color={'processing'}>{addSpaces(calculations.consumerGroup)}</Tag>
);
if (calculations) {
if (calculations.energyGenerationUnit) {
calculations.energyGeneration = new UnitField(
data.solarProperties.energyGenerationUnit,
addCommSep(data.solarProperties.energyGeneration)
);
// addCommSep(data.solarProperties.energyGeneration) +
// ' ' +
// data.solarProperties.energyGenerationUnit;
} else if (calculations.consumerGroup && typeof calculations.consumerGroup === 'string') {
calculations.consumerGroup = (
<Tag color={'processing'}>{addSpaces(calculations.consumerGroup)}</Tag>
);
}
delete calculations.energyGenerationUnit;
}
delete calculations.energyGenerationUnit;
}

calculations.constantVersion = data.constantVersion;
Expand Down

0 comments on commit 9f811b3

Please sign in to comment.