Skip to content

Commit

Permalink
Frontend redesign (CymbalBank) (#410)
Browse files Browse the repository at this point in the history
Default UI reflects Cymbal UI elements and color scheme. Cymbal Logo is toggle-able, and disabled by default.  Default UI still uses `bank-name` (default: bank of anthos) in the header.
  • Loading branch information
askmeegs authored Dec 8, 2020
1 parent 29ef812 commit 1c9d8c9
Show file tree
Hide file tree
Showing 12 changed files with 689 additions and 384 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ui-tests/cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"error": "Error: Could Not Load Transactions"
},
"deposit": {
"success": "Deposit accepted",
"success": "Deposit successful",
"error": "Deposit failed",
"errRoutingNum": "invalid routing number"
},
"transfer": {
"success": "Payment initiated",
"success": "Payment successful",
"error": "Payment failed",
"errSelf": "may not add yourself to contacts"
},
Expand All @@ -42,11 +42,11 @@
{
"accountNum": "1033623433",
"name": "Alice"
},
},
{
"accountNum": "1055757655",
"name": "Bob"
},
},
{
"accountNum": "1077441377",
"name": "Eve"
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ui-tests/cypress/integration/deposit_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe('Authenticated default user', function () {
const depositAmount = validPayment()

cy.deposit(externalAccount, depositAmount)
cy.get('.alert').contains(depositMsgs.success)
cy.get('#alert-message').contains(depositMsgs.success)
})

it('can see balance update after deposit', function () {
Expand All @@ -95,7 +95,7 @@ describe('Authenticated default user', function () {
.split('.')[0]

cy.deposit(externalAccount, depositAmount)
cy.get('.alert').contains(depositMsgs.success)
cy.get('#alert-message').contains(depositMsgs.success)
})
cy.visit('/home')
cy.get('#current-balance').then(($span) => {
Expand All @@ -109,7 +109,7 @@ describe('Authenticated default user', function () {
const depositAmount = validPayment()

cy.deposit(externalAccount, depositAmount)
cy.get('.alert').contains(depositMsgs.success)
cy.get('#alert-message').contains(depositMsgs.success)

cy.visit('/home')

Expand All @@ -131,7 +131,7 @@ describe('Authenticated default user', function () {
const paymentAmount = validPayment()

cy.depositToNewAccount(newExternalAccount, paymentAmount)
cy.get('.alert').contains(depositMsgs.success)
cy.get('#alert-message').contains(depositMsgs.success)

cy.reload()
cy.get('#depositSpan').click()
Expand Down Expand Up @@ -178,7 +178,7 @@ describe('Deposit is unsuccessful with invalid data', function () {

it('cannot reference invalid routing number', function () {
const invalidExternalAccount = {
accountNum: validAccountNum(),
accountNum: validAccountNum(),
routingNum: randomInt(100,100000),
contactLabel: `testcontact invalid ${this.accountNum}`
}
Expand All @@ -200,7 +200,7 @@ describe('Deposit is unsuccessful with invalid data', function () {
const paymentAmount = validPayment()

cy.depositToNewAccount(invalidExternalAccount, paymentAmount)
cy.get('.alert').contains(depositMsgs.error)
cy.get('.alert').contains(depositMsgs.errRoutingNum)
cy.get('#alert-message').contains(depositMsgs.error)
cy.get('#alert-message').contains(depositMsgs.errRoutingNum)
})
})
10 changes: 5 additions & 5 deletions .github/workflows/ui-tests/cypress/integration/transfer_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe('Authenticated default user', function () {
const paymentAmount = validPayment()

cy.transfer(recipient, paymentAmount)
cy.get('.alert').contains(transferMsgs.success)
cy.get('#alert-message').contains(transferMsgs.success)
})

it('see balance update after transfer', function () {
Expand All @@ -110,7 +110,7 @@ describe('Authenticated default user', function () {
.split('.')[0]

cy.transfer(recipient, paymentAmount)
cy.get('.alert').contains(transferMsgs.success)
cy.get('#alert-message').contains(transferMsgs.success)
})
cy.visit('/home')
cy.get('#current-balance').then(($span) => {
Expand Down Expand Up @@ -144,7 +144,7 @@ describe('Authenticated default user', function () {
const paymentAmount = validPayment()

cy.transferToNewContact(newRecipient, paymentAmount)
cy.get('.alert').contains(transferMsgs.success)
cy.get('#alert-message').contains(transferMsgs.success)
cy.get('#paymentSpan').click()
cy.get('#payment-accounts').contains(newRecipient.contactLabel)
cy.get('#payment-accounts').contains(newRecipient.accountNum)
Expand Down Expand Up @@ -223,8 +223,8 @@ describe('Transfer is unsuccessful with invalid data', function () {
const paymentAmount = validPayment()

cy.transferToNewContact(self, paymentAmount)
cy.get('.alert').contains(transferMsgs.error)
cy.get('.alert').contains(transferMsgs.errSelf)
cy.get('#alert-message').contains(transferMsgs.error)
cy.get('#alert-message').contains(transferMsgs.errSelf)
})

})
6 changes: 6 additions & 0 deletions dev-kubernetes-manifests/frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ spec:
# Valid levels are debug, info, warning, error, critical. If no valid level is set, gunicorn will default to info.
- name: LOG_LEVEL
value: "info"
# Set to "true" to enable the CymbalBank logo + title
# - name: CYMBAL_LOGO
# value: "false"
# Customize the bank name used in the header. Defaults to 'Bank of Anthos' - when CYMBAL_LOGO is true, uses 'CymbalBank'
# - name: BANK_NAME
# value: ""
- name: DEFAULT_USERNAME
valueFrom:
configMapKeyRef:
Expand Down
7 changes: 5 additions & 2 deletions src/frontend/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def home():
_populate_contact_labels(account_id, transaction_list, contacts)

return render_template('index.html',
cymbal_logo=os.getenv('CYMBAL_LOGO', 'false'),
history=transaction_list,
balance=balance,
name=display_name,
Expand Down Expand Up @@ -203,7 +204,7 @@ def payment():
_submit_transaction(transaction_data)
app.logger.info('Payment initiated successfully.')
return redirect(url_for('home',
msg='Payment initiated',
msg='Payment successful',
_external=True,
_scheme=app.config['SCHEME']))

Expand Down Expand Up @@ -266,7 +267,7 @@ def deposit():
_submit_transaction(transaction_data)
app.logger.info('Deposit submitted successfully.')
return redirect(url_for('home',
msg='Deposit accepted',
msg='Deposit successful',
_external=True,
_scheme=app.config['SCHEME']))

Expand Down Expand Up @@ -342,6 +343,7 @@ def login_page():
_scheme=app.config['SCHEME']))

return render_template('login.html',
cymbal_logo=os.getenv('CYMBAL_LOGO', 'false'),
message=request.args.get('msg', None),
default_user=os.getenv('DEFAULT_USERNAME', ''),
default_password=os.getenv('DEFAULT_PASSWORD', ''),
Expand Down Expand Up @@ -397,6 +399,7 @@ def signup_page():
_external=True,
_scheme=app.config['SCHEME']))
return render_template('signup.html',
cymbal_logo=os.getenv('CYMBAL_LOGO', 'false'),
bank_name=os.getenv('BANK_NAME', 'Bank of Anthos'))


Expand Down
15 changes: 15 additions & 0 deletions src/frontend/static/img/cymbal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/frontend/static/img/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1c9d8c9

Please sign in to comment.