From 63493715bedacbd9f14682cf882efa46a884a294 Mon Sep 17 00:00:00 2001 From: Meskat Date: Thu, 25 Apr 2019 15:23:33 +0200 Subject: [PATCH] All currency codes and symbols should be environment based (#637) * PAN-382: Adjust targeting helpers for custom values and corner cases - add todo containing task id for future improvement * PAN-382: remove comment * Format chart values according to env values * Whole app should be based on env currencies * Format chart values according to environment values Whole app should be based on env currencies * Changelog --- CHANGELOG.md | 7 +++- .../finances/finances-settings.component.html | 4 +-- .../finances/finances-settings.component.ts | 2 ++ ...-campaign-basic-information.component.html | 8 ++--- ...it-campaign-basic-information.component.ts | 2 ++ .../chart-settings/chart-settings.helpers.ts | 5 +-- .../withdraw-funds-dialog.component.html | 2 +- .../withdraw-funds-dialog.component.ts | 32 +++++++++---------- 8 files changed, 36 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1b57fa11..f6d994d56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.6.6] - 2019-04-25 +### Added +- Values in custom currencies + ## [0.6.4] - 2019-04-24 ### Added - Custom currency support @@ -70,7 +74,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Advertiser features (Campaigns & Ads) - Publisher features (Sites & AdUnits) -[Unreleased]: https://github.com/adshares/adserver/compare/v0.6.4...develop +[Unreleased]: https://github.com/adshares/adserver/compare/v0.6.6...develop +[0.6.6]: https://github.com/adshares/adserver/compare/v0.6.4...v0.6.6 [0.6.4]: https://github.com/adshares/adserver/compare/v0.6.1...v0.6.4 [0.6.1]: https://github.com/adshares/adserver/compare/v0.6.0...v0.6.1 [0.6.0]: https://github.com/adshares/adserver/compare/v0.5.4...v0.6.0 diff --git a/src/app/admin/finances/finances-settings.component.html b/src/app/admin/finances/finances-settings.component.html index d6fa2232e..291e7d8ce 100644 --- a/src/app/admin/finances/finances-settings.component.html +++ b/src/app/admin/finances/finances-settings.component.html @@ -51,7 +51,7 @@

Cold [type]="'number'" [step]="10" [value]="settings.hotwalletMinValue" - [format]="'ADS'" + [format]="cryptoCode" helper="Set a minimum amount required to run operations. In case the amount drops below the specified threshold, you will be notified via e-mail" (valueChanged)="updateSettings($event, 'hotwalletMinValue')" @@ -63,7 +63,7 @@

Cold [type]="'number'" [step]="10" [value]="settings.hotwalletMaxValue" - [format]="'ADS'" + [format]="cryptoCode" helper="Set a maximum amount that can be stored on a hot wallet. All funds exceeding this amount will be automatically transferred to your cold wallet." (valueChanged)="updateSettings($event, 'hotwalletMaxValue')" diff --git a/src/app/admin/finances/finances-settings.component.ts b/src/app/admin/finances/finances-settings.component.ts index 1613f908e..1de3cfef6 100644 --- a/src/app/admin/finances/finances-settings.component.ts +++ b/src/app/admin/finances/finances-settings.component.ts @@ -4,6 +4,7 @@ import { AppState } from 'models/app-state.model'; import { HandleSubscription } from 'common/handle-subscription'; import { SetAdminSettings, SetAdminSettingsFailure } from "store/admin/admin.actions"; import { AdminSettings } from "models/settings.model"; +import { environment } from "environments/environment"; @Component({ selector: 'app-finances-settings', @@ -12,6 +13,7 @@ import { AdminSettings } from "models/settings.model"; host: {'class': 'app-finances'}, }) export class FinancesSettingsComponent extends HandleSubscription implements OnInit { + cryptoCode:string = environment.cryptoCode; settings: AdminSettings; canSubmit: boolean = false; diff --git a/src/app/advertiser/edit-campaign/edit-campaign-basic-info/edit-campaign-basic-information.component.html b/src/app/advertiser/edit-campaign/edit-campaign-basic-info/edit-campaign-basic-information.component.html index 327ca6797..cac7655cb 100644 --- a/src/app/advertiser/edit-campaign/edit-campaign-basic-info/edit-campaign-basic-information.component.html +++ b/src/app/advertiser/edit-campaign/edit-campaign-basic-info/edit-campaign-basic-information.component.html @@ -99,7 +99,7 @@ for="campaign-max-cpc" class="dwmth-form-label" > - Max CPC (USD) + Max CPC ({{currencyCode}}) - Max CPM (USD) + Max CPM ({{currencyCode}}) - Budget (USD / day) + Budget ({{currencyCode}} / day) - Budget (USD / hour) + Budget ({{currencyCode}} / hour) { const daysSpan = moment(values[values.length - 1]).diff(moment(values[0]), 'days'); @@ -41,7 +42,7 @@ export const adjustTooltipValueFormat = (value: string): string => { case options.RPM: case options.RPC: const val = parseInt(value); - return `${type}: ${val > 0 ? formatMoney(val, 4) : 0} USD`; + return `${type}: ${val > 0 ? formatMoney(val, 4) : 0} ${environment.currencyCode}`; default: return `${type}: ${value}`; } @@ -60,7 +61,7 @@ export const adjustYAxesTics = (value) => { case options.RPM: case options.RPC: const val = parseInt(value); - return `$${val > 0 ? formatMoney(val,4) : 0}`; + return `${environment.currencySymbol}${val > 0 ? formatMoney(val,4) : 0}`; default: return `${value}`; } diff --git a/src/app/common/dialog/withdraw-funds-dialog/withdraw-funds-dialog.component.html b/src/app/common/dialog/withdraw-funds-dialog/withdraw-funds-dialog.component.html index a2ebc98dc..2b7a66db7 100644 --- a/src/app/common/dialog/withdraw-funds-dialog/withdraw-funds-dialog.component.html +++ b/src/app/common/dialog/withdraw-funds-dialog/withdraw-funds-dialog.component.html @@ -90,7 +90,7 @@ for="amount" class="dwmth-form-label" > - Withdraw Amount (ADS) + Withdraw Amount ({{cryptoCode}})