Skip to content

Commit

Permalink
refactor/Change names in the app
Browse files Browse the repository at this point in the history
  • Loading branch information
constantine2nd committed Oct 5, 2021
1 parent 0975f11 commit 41fa7d0
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 38 deletions.
6 changes: 3 additions & 3 deletions src/main/resources/i18n/lift-core.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ bank_name = Bank name
account_label = Account label
income_description = Income description
income_amount = Income amount
outcome_description = Outcome description
outcome_amount = Outcome amount
payment_description = payment description
payment_amount = payment amount
income = Income
outcome = Outcome
payment = Expenditure
6 changes: 3 additions & 3 deletions src/main/resources/i18n/lift-core_en_GB.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ bank_name = Bank name
account_label = Account label
income_description = Income description
income_amount = Income amount
outcome_description = Outcome description
outcome_amount = Outcome amount
payment_description = payment description
payment_amount = payment amount
income = Income
outcome = Outcome
payment = Expenditure
6 changes: 3 additions & 3 deletions src/main/resources/i18n/lift-core_it_IT.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ bank_name = nome della banca
account_label = Etichetta dell'account
income_description = Income description
income_amount = Income amount
outcome_description = Outcome description
outcome_amount = Outcome amount
payment_description = payment description
payment_amount = payment amount
income = Income
outcome = Outcome
payment = payment
12 changes: 6 additions & 6 deletions src/main/resources/props/sample.props.template
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ display_twitter_link=true
# Set Locale
language_tag = en-GB

# Income account
income.bank_id=FILL_ME_IN
income.account_id=FILL_ME_IN
# Incoming account
incoming.bank_id=FILL_ME_IN
incoming.account_id=FILL_ME_IN

# Outcome account
outcome.bank_id=FILL_ME_IN
outcome.account_id=FILL_ME_IN
# Outgoing account
outgoing.bank_id=FILL_ME_IN
outgoing.account_id=FILL_ME_IN
2 changes: 1 addition & 1 deletion src/main/scala/bootstrap/liftweb/Boot.scala
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ class Boot extends MdcLoggable{
Menu.params[List[BankJson400]]("CreateBankAccount", "Create bank account", getBanks _, x => List("")) / "banks" / * / "accounts" / "create-bank-account",

Menu.params[List[String]]("CreateIncome", "Create Income", getAccountSettings _, x => List("")) / "banks" / * / "accounts" / * / "create-income",
Menu.params[List[String]]("CreateOutcome", "Create Outcome", getAccountSettings _, x => List("")) / "banks" / * / "accounts" / * / "create-outcome",
Menu.params[List[String]]("CreateExpenditure", "Create Expenditure", getAccountSettings _, x => List("")) / "banks" / * / "accounts" / * / "create-expenditure",

Menu.params[ViewsDataJSON]("Views","Views Overview", getCompleteAccountViews _ , x => List("")) / "banks" / * / "accounts" / * / "views" / "list",

Expand Down
8 changes: 4 additions & 4 deletions src/main/scala/code/lib/ObpAPI.scala
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ object ObpAPI {
ObpPost(s"/$versionOfApi/banks/" + urlEncode(bankId) + "/accounts", Extraction.decompose(json))
}
def createIncome(bankId: String, accountId: String, incomeDescription: String, incomeAmount: String, incomeCurrency: String): Box[JValue] = {
val incomeBankId = Props.get("income.bank_id", "")
val incomeAccountId = Props.get("income.account_id", "")
val incomeBankId = Props.get("incoming.bank_id", "")
val incomeAccountId = Props.get("incoming.account_id", "")
val utcZoneId = ZoneId.of("UTC")
val zonedDateTime = ZonedDateTime.now
val utcDateTime = zonedDateTime.withZoneSameInstant(utcZoneId)
Expand All @@ -191,8 +191,8 @@ object ObpAPI {
}

def createOutcome(bankId: String, accountId: String, outcomeDescription: String, outcomeAmount: String, outcomeCurrency: String): Box[JValue] = {
val outcomeBankId = Props.get("outcome.bank_id", "outcome.bank_id")
val outcomeAccountId = Props.get("outcome.account_id", "outcome.account_id")
val outcomeBankId = Props.get("outgoing.bank_id", "outgoing.bank_id")
val outcomeAccountId = Props.get("outgoing.account_id", "outgoing.account_id")
val utcZoneId = ZoneId.of("UTC")
val zonedDateTime = ZonedDateTime.now
val utcDateTime = zonedDateTime.withZoneSameInstant(utcZoneId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import net.liftweb.util.Helpers._
import scala.xml.{NodeSeq, Text}


class CreateOutcome(params: List[String]) extends MdcLoggable {
class CreateExpenditure(params: List[String]) extends MdcLoggable {
val bankId = params(0)
val accountId = params(1)
val accountJson = getAccount(bankId, accountId, CUSTOM_OWNER_VIEW_ID).openOrThrowException("Could not open accountJson")
def accountTitle = ".account-title *" #> getAccountTitle(accountJson)

//set up ajax handlers to edit account label
def addOutcome(xhtml: NodeSeq): NodeSeq = {
def addPayment(xhtml: NodeSeq): NodeSeq = {
var outcomeDescription = ""
var outcomeAmount = "0"

Expand All @@ -37,10 +37,10 @@ class CreateOutcome(params: List[String]) extends MdcLoggable {
}

(
"@outcome_description" #> SHtml.text("", s => outcomeDescription = s) &
"@outcome_amount" #> SHtml.text("", s => outcomeAmount = s) &
"@payment_description" #> SHtml.text("", s => outcomeDescription = s) &
"@payment_amount" #> SHtml.text("", s => outcomeAmount = s) &
// Replace the type=submit with Javascript that makes the ajax call.
"type=submit" #> SHtml.ajaxSubmit("Add outcome", process)
"type=submit" #> SHtml.ajaxSubmit("Add payment", process)
).apply(xhtml)
}
}
4 changes: 2 additions & 2 deletions src/main/scala/code/snippet/Nav.scala
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ class Nav {
// Menu for adding an income
def outcomeSettings : CssSel = {
if (hasManagementAccess) {
val addIncomeUrl = "/banks/" + url(2) + "/accounts/" + url(4) + "/create-outcome"
val addIncomeUrl = "/banks/" + url(2) + "/accounts/" + url(4) + "/create-expenditure"
".navlink [href]" #> { addIncomeUrl } &
".navlink *" #> "Create outcome" &
".navlink *" #> "Create expenditure" &
".navlink [class+]" #> markIfSelected(addIncomeUrl)
} else eraseMenu
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<div id="create-income" data-lift="surround?with=default;at=content">

<section class="home-viewing">
<h4 class="home-viewing__headline"><span class="lift:Loc.outcome">outcome</span></h4>
<h4 class="home-viewing__headline"><span class="lift:Loc.payment">payment</span></h4>
</section>

<!-- account-info section_start -->
Expand All @@ -46,22 +46,22 @@ <h3 id="account-title" class="account-info__box-headline account-title">ACCOUNT<
<div data-lift="embed?what=_nav_account_settings"></div>
</div>

<div class="create-income-section" data-lift="CreateOutcome.addOutcome">
<h4><span class="lift:Loc.outcome">Outcome</span></h4>
<div class="create-income-section" data-lift="CreateExpenditure.addPayment">
<h4><span class="lift:Loc.payment">Payment</span></h4>
<form data-lift="form.ajax">
<div>
<label for="outcome_description">
<h4><span class="lift:Loc.outcome_description">Outcome description</span></h4>
<label for="payment_description">
<h4><span class="lift:Loc.payment_description">Payment description</span></h4>
</label>
<input type="text" id="outcome_description" name="outcome_description"/>
<label for="outcome_amount">
<h4><span class="lift:Loc.outcome_amount">Outcome amount</span></h4>
<input type="text" id="payment_description" name="payment_description"/>
<label for="payment_amount">
<h4><span class="lift:Loc.payment_amount">payment amount</span></h4>
</label>
<input type="text" id="outcome_amount" name="outcome_amount"/>
<input type="text" id="payment_amount" name="payment_amount"/>
</div>
<br>
<div>
<input type="submit" value="Add outcome"/>
<input type="submit" value="Add payment"/>
<input type="reset" value="Cancel"/>
</div>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<a href="#" class="navlink">Add income</a>
</li>
<li class="navitem" data-lift="Nav.outcomeSettings">
<a href="#" class="navlink">Add outcome</a>
<a href="#" class="navlink">Add payment</a>
</li>
</ul>
</div>
Expand Down

0 comments on commit 41fa7d0

Please sign in to comment.