Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1889 from OpenBazaar/brian.supereconomy
Browse files Browse the repository at this point in the history
Add Super Economic Fee Level
  • Loading branch information
hoffmabc authored May 6, 2020
2 parents f307bea + ebe5fa2 commit 6d1cc70
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
4 changes: 3 additions & 1 deletion js/languages/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"feeLevels": {
"PRIORITY": "Priority",
"NORMAL": "Normal",
"ECONOMIC": "Economic"
"ECONOMIC": "Economic",
"SUPER_ECONOMIC": "Super Economic"
},
"feeChangeWidget": {
"btnChange": "change",
Expand Down Expand Up @@ -650,6 +651,7 @@
"sectionName": "Transactions",
"saveMetadata": "Save Metadata",
"defaultFee": "Network Fee",
"superlow": "Super Economic",
"low": "Economic",
"medium": "Normal",
"high": "Priority"
Expand Down
1 change: 1 addition & 0 deletions js/models/wallet/Spend.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class Spend extends BaseModel {
'PRIORITY',
'NORMAL',
'ECONOMIC',
'SUPER_ECONOMIC',
];
}

Expand Down
10 changes: 10 additions & 0 deletions js/templates/modals/settings/advanced/advanced.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ <h2 class="h4 clrT"><%= ob.polyT('settings.advancedTab.transaction.sectionName')
<div class="col9">
<% if (ob.errors['defaultTransactionFee']) print(ob.formErrorTmpl({ errors: ob.errors['defaultTransactionFee'] })) %>
<div class="btnStrip">
<div class="btnRadio clrBr">
<input type="radio"
data-persistence-location="local"
name="defaultTransactionFee"
value="SUPER_ECONOMIC"
id="defaultTransactionFeeSuperLow"
data-var-type="string"
<% if(ob.defaultTransactionFee == "SUPER_ECONOMIC") { %>checked<% } %>>
<label for="defaultTransactionFeeSuperLow"><%= ob.polyT('settings.advancedTab.transaction.superlow') %></label>
</div>
<div class="btnRadio clrBr">
<input type="radio"
data-persistence-location="local"
Expand Down
3 changes: 2 additions & 1 deletion js/templates/userPage/categoryFilter.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@

<%
ob.categories.slice(0, ob.maxInitiallyVisibleCats - 1).forEach((cat, index) => {
valueCat = cat.replace(/&/g, '&amp;');
var flatCat = cat.replace(/\s/g, '-'); // remove spaces
%>
<div class="btnRadio">
<input type="radio"
name="filterShippingCategory"
value="<%= cat %>"
value="<%= valueCat %>"
id="<%= `filterShippingCategory${flatCat}` %>"
<% if (ob.selected === cat) print('checked') %>>
<label for="<%= `filterShippingCategory${flatCat}` %>"><%= cat %></label>
Expand Down
7 changes: 7 additions & 0 deletions js/utils/fees.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const feeLevels = [
'PRIORITY',
'NORMAL',
'ECONOMIC',
'SUPER_ECONOMIC',
];

const cacheExpires = 1000 * 60 * 5;
Expand Down Expand Up @@ -190,11 +191,16 @@ export function getFees(coinType) {

$.get(app.getServerUrl(`wallet/fees/${coinType}`))
.done(data => {
let superEconomic;
let economic;
let normal;
let priority;

try {
superEconomic = integerToDecimal(
data.superEconomic.amount,
data.superEconomic.currency.divisibility
);
economic = integerToDecimal(
data.economic.amount,
data.economic.currency.divisibility
Expand All @@ -213,6 +219,7 @@ export function getFees(coinType) {
}

deferred.resolve({
superEconomic,
economic,
normal,
priority,
Expand Down

0 comments on commit 6d1cc70

Please sign in to comment.