Skip to content
This repository has been archived by the owner on Oct 8, 2019. It is now read-only.

Commit

Permalink
Merge pull request #1490 from blockchain/maintenance
Browse files Browse the repository at this point in the history
Maintenance Banner
  • Loading branch information
plondon authored Apr 16, 2018
2 parents ed76d67 + f16d9b1 commit 72c4f01
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 7 deletions.
6 changes: 3 additions & 3 deletions app/partials/login.pug
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
.item
label(translate="UID" for="UID_input")
div
input#UID_input.form-control(type="text" ng-model="uid" name="UID_input" focus-when="!uidAvailable" ng-change="errors.uid = null" required)
input#UID_input.form-control(type="text" ng-model="uid" name="UID_input" focus-when="!uidAvailable" ng-change="errors.uid = null" ng-disabled="underMaintenance" required)
.help-block.mbn.alt-font.f-14(ng-show="errors.uid" ui-sref="public.reminder")
span(translate="{{ errors.uid }}")
.help-block.mbn.alt-font.f-14.hidden-xs
Expand All @@ -27,7 +27,7 @@
.item
label(translate="PASSWORD" for="pass_input")
div
input#pass_input.form-control(type="password" name="pass_input" ng-model="password" focus-when="uidAvailable" required)
input#pass_input.form-control(type="password" name="pass_input" ng-model="password" focus-when="uidAvailable" ng-disabled="underMaintenance" required)
.help-block.mbn.alt-font.f-14
span(translate="{{ errors.password }}")
.group.mb-15(ng-show="settings.needs2FA" ng-class="{'has-error': errors.twoFactor || settings.twoFactorMethod == 3}")
Expand All @@ -50,7 +50,7 @@
type="submit"
ui-ladda="status.busy"
ladda-translate="LOG_IN"
ng-disabled="loginForm.$invalid")
ng-disabled="loginForm.$invalid || underMaintenance")
.ptl.flex-between
div
a(ng-show="showMobileLogin" ui-sref="public.mobile-login" translate="MOBILE_LOGIN.TITLE")
Expand Down
1 change: 1 addition & 0 deletions app/partials/public.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.login-pg(ng-class="{'display-block': isUIOverflow}")
include ./bc-logo-header
testnet-warning
maintenance-warning
.overflow-scroll.flex-justify.flex-center
.flex-center.flex-justify.flex-column
.flex.flex-justify
Expand Down
7 changes: 5 additions & 2 deletions app/partials/signup.pug
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ form.bc-form.form-horizontal.mt-30(
type="email"
ng-model="fields.email"
required
focus-when="!fields.email.length")
focus-when="!fields.email.length"
ng-disabled="underMaintenance")
span.error(ng-show="signupForm.email.$touched")
span(ng-show="signupForm.email.$error.required" translate="EMAIL_ADDRESS_REQUIRED")
span(ng-show="signupForm.email.$error.email" translate="EMAIL_ADDRESS_INVALID")
Expand All @@ -43,6 +44,7 @@ form.bc-form.form-horizontal.mt-30(
min-entropy="25"
focus-when="fields.emailIsFromState"
ng-change="fields.confirmation = ''"
ng-disabled="underMaintenance"
required)
span.error(ng-show="signupForm.password.$touched")
span(ng-show="signupForm.password.$error.minEntropy && fields.password != undefined" translate="TOO_WEAK")
Expand All @@ -57,6 +59,7 @@ form.bc-form.form-horizontal.mt-30(
type="password"
ng-model="fields.confirmation"
is-valid="fields.confirmation == fields.password"
ng-disabled="underMaintenance"
required)
span.error(ng-show="signupForm.confirmation.$touched")
span(ng-show="signupForm.confirmation.$error.isValid" translate="NO_MATCH")
Expand All @@ -71,6 +74,6 @@ form.bc-form.form-horizontal.mt-30(
.group.mb-15.full
button.button-primary.button-heavy(
type="submit"
ng-disabled="signupForm.$invalid || !currency_guess"
ng-disabled="signupForm.$invalid || !currency_guess || underMaintenance"
ladda-translate="CONTINUE"
ui-ladda="working")
10 changes: 10 additions & 0 deletions assets/css/modules/_signin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ div.login-form {
top: 100px;
position: relative;
}
maintenance-warning {
top: 100px;
position: relative;
i {
color: $dandelion;
}
> div {
background-color: $moccasin;
}
}
nav {
position: fixed;
width: 100%;
Expand Down
14 changes: 14 additions & 0 deletions assets/js/components/maintenance-warning.component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
angular
.module('walletApp')
.component('maintenanceWarning', {
template: (
'<div class="ph-40 flex-center pv-10 f-16 bg-warning" ng-if="$ctrl.showBanner">' +
'<i class="icon-alert f-24"></i><span class="ml-10" translate="DOWN_FOR_MAINTENANCE"></span>' +
'</div>'
),
controller (Env) {
Env.then(env => {
this.showBanner = env.maintenance;
});
}
});
1 change: 1 addition & 0 deletions assets/js/controllers/login.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ function LoginCtrl ($scope, $rootScope, $window, localStorageService, $state, $s
}

Env.then((env) => {
$scope.underMaintenance = env.maintenance;
$scope.showMobileLogin = env.showMobileLogin;
});
}
1 change: 1 addition & 0 deletions assets/js/controllers/signup.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ function SignupCtrl ($scope, $state, localStorageService, $filter, $timeout, $tr
$scope.language_guess = language_guess;

Env.then(env => {
$scope.underMaintenance = env.maintenance;
// Get country code from server:
$http.get(env.rootURL + 'wallet/browser-info')
.success(data => {
Expand Down
2 changes: 1 addition & 1 deletion assets/js/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ function AppRouter ($stateProvider, $urlRouterProvider) {
accounts ($injector, $q) {
let MyWallet = $injector.has('MyWallet') && $injector.get('MyWallet');
let sfox = MyWallet.wallet && MyWallet.wallet.external && MyWallet.wallet.external.sfox;

return sfox && sfox.hasAccount
? $q.resolve([])
.then(() => sfox.getBuyMethods()).catch(console.log)
Expand Down
2 changes: 2 additions & 0 deletions assets/js/sharedServices/env.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ function Env ($rootScope, $location, $q, $http) {

env.webHardFork = res.webHardFork || {};

env.maintenance = res.maintenance;

defer.resolve(env);
}
);
Expand Down
1 change: 1 addition & 0 deletions locales/en-human.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"NEW_ACCOUNT": "Add +",
"MY_TRANSACTIONS": "Transactions",
"ALL": "All",
"DOWN_FOR_MAINTENANCE": "Our systems are currently down for planned maintenance. We'll be back shortly and apologize for the inconvenience.",
"SEND_FEEDBACK": "Send Feedback",
"BUYSELL": "Buy/Sell",
"FEEDBACK_SUBMIT_FAILED" : "Something went wrong, please try again.",
Expand Down
3 changes: 2 additions & 1 deletion rootApp/Resources/wallet-options.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,6 @@
}
},
"showMobileLogin": true,
"network": "bitcoin"
"network": "bitcoin",
"maintenance": false
}

0 comments on commit 72c4f01

Please sign in to comment.