From cf057d93cdbc9168df3c6dae29609ca45706783c Mon Sep 17 00:00:00 2001
From: Benoit Lavenier <benoit.lavenier@e-is.pro>
Date: Wed, 11 Mar 2020 19:30:07 +0100
Subject: [PATCH] [enh] Mobile: move logout button into last menu item [fix]
Home: fix locale flag path [fix] Fix cleanCache when changing ES node
---
dist/desktop | 2 +-
doc/development_guide.md | 2 +-
doc/fr/development_tutorial-03-android.md | 4 +-
hooks/before_prepare/02_jshint.js | 15 +++++--
.../gradle/wrapper/gradle-wrapper.properties | 2 +-
scss/ionic.app.scss | 36 +++++++++++++++--
www/css/style.css | 4 +-
www/i18n/locale-en.json | 1 +
www/i18n/locale-fr-FR.json | 1 +
www/plugins/es/js/services/http-services.js | 2 +-
www/templates/api/home.html | 8 ++--
www/templates/home/home.html | 13 +++----
www/templates/home/locales_popover.html | 15 +++++++
www/templates/menu.html | 39 ++++++++++++-------
www/templates/wallet/view_wallet.html | 19 +++------
15 files changed, 108 insertions(+), 55 deletions(-)
create mode 100644 www/templates/home/locales_popover.html
diff --git a/dist/desktop b/dist/desktop
index 2667bc6e..d3566be2 160000
--- a/dist/desktop
+++ b/dist/desktop
@@ -1 +1 @@
-Subproject commit 2667bc6efab8ae2393ab57f330c33f7dedf99fe2
+Subproject commit d3566be2a5ef91861237252626305221bde1d7a8
diff --git a/doc/development_guide.md b/doc/development_guide.md
index 6f53040b..2eb30905 100644
--- a/doc/development_guide.md
+++ b/doc/development_guide.md
@@ -39,7 +39,7 @@ If you are using fish shell, there is a [dedicated plugin](https://github.com/jo
- Installing Cordova plugins (need for platforms specific builds)
```
- ionic state restore
+ ionic cordova preapre
```
- This should create a new directory `platforms/android`
diff --git a/doc/fr/development_tutorial-03-android.md b/doc/fr/development_tutorial-03-android.md
index 779fc024..84e076dd 100644
--- a/doc/fr/development_tutorial-03-android.md
+++ b/doc/fr/development_tutorial-03-android.md
@@ -119,14 +119,14 @@ node --version
Si vous n'êtes pas sur une v6, utilisez la commande
```
-nvm use 6
+nvm use 10
```
Vous pouvez maintenant lancer l'instalaltion du projet Cesium pour Android :
```
-ionic state restore
+ionic cordova prepare
```
Normalement, cette commande devrait initialiser (entre autre) un répertoire `platforms/android`.
diff --git a/hooks/before_prepare/02_jshint.js b/hooks/before_prepare/02_jshint.js
index bb78f766..e25f6875 100755
--- a/hooks/before_prepare/02_jshint.js
+++ b/hooks/before_prepare/02_jshint.js
@@ -15,20 +15,22 @@ const jsFolders = glob.sync("www/**/*.js", {nonull: true})
.map(file => file.substring(0, file.lastIndexOf('/')))
// Reduce to a map of folders
.reduce((res, folder) => {
-
if (folder.indexOf('www/dist/') !== -1 || // Exclude dist js
folder.indexOf('/plugins/rml') !== -1 || // Exclude plugin tutorial
- folder.indexOf('/vendor') // exclude vendor libs
- ) return res;
+ folder.indexOf('www/js/vendor') || // exclude vendor libs
+ folder.indexOf('www/lib') // exclude www/lib
+ ) {
+ return res;
+ }
res[folder] = res[folder] || true;
return res;
}, {});
// Process each folder with Js file
Object.keys(jsFolders).forEach(folder => processFiles(folder));
-
function processFiles(dir) {
let errorCount = 0;
+ log(colors.grey('Processing folder ' + folder + '...'));
fs.readdir(dir, function(err, list) {
if (err) {
log(colors.red('processFiles err: ' + err));
@@ -36,6 +38,7 @@ function processFiles(dir) {
}
async.eachSeries(list, function(file, innercallback) {
file = dir + '/' + file;
+ log(colors.grey('Processing file ' + file + '...'));
fs.stat(file, function(err, stat) {
if(!stat.isDirectory()) {
if(path.extname(file) === ".js") {
@@ -54,8 +57,12 @@ function processFiles(dir) {
});
}, function(error) {
if(errorCount > 0) {
+ log(colors.red('KO Error '));
process.exit(1);
}
+ else {
+ log(colors.red('OK NO Error '));
+ }
});
});
}
diff --git a/resources/android/build/gradle/wrapper/gradle-wrapper.properties b/resources/android/build/gradle/wrapper/gradle-wrapper.properties
index 4cde7d5f..ddb3e102 100644
--- a/resources/android/build/gradle/wrapper/gradle-wrapper.properties
+++ b/resources/android/build/gradle/wrapper/gradle-wrapper.properties
@@ -1 +1 @@
-distributionUrl=https://services.gradle.org/distributions/gradle-4.1-all.zip
+distributionUrl=https://services.gradle.org/distributions/gradle-4.10.3-all.zip
diff --git a/scss/ionic.app.scss b/scss/ionic.app.scss
index c0761620..823a5c7b 100644
--- a/scss/ionic.app.scss
+++ b/scss/ionic.app.scss
@@ -196,6 +196,9 @@ $screen-menu: $screen-sm;
.button.hidden-sm {
display: flex;
}
+ .button.button-icon.hidden-sm {
+ display: inline-block;
+ }
.pull-right,
.pull-left {
.button.hidden-sm {
@@ -417,7 +420,7 @@ $screen-menu: $screen-sm;
}
.item-actions {
- min-height: 47px !important;
+ min-height: 65px !important;
}
.item-closeable:hover {
@@ -846,7 +849,7 @@ html, body {
.bar.bar-header {
padding-right: 5px !important;
- .buttons-right span {
+ .buttons-right .right-buttons {
margin-left: 0 !important;
}
}
@@ -2195,7 +2198,7 @@ $ionicon-var-badge-editable: $ionicon-var-edit + "\00a0";
height: 35px;
width: 35px;
position: relative;
- left: 0;
+ left: 4px;
top: 4px;
border: solid 1px #D9D9D9;
}
@@ -2211,6 +2214,33 @@ $ionicon-var-badge-editable: $ionicon-var-edit + "\00a0";
left: 0;
top: 6px;
}
+
+}
+
+.bar-header .button-clear.button-peer {
+ display: block;
+ height: 44px;
+ padding-top: 6px;
+ padding-bottom: 6px;
+ margin: 0;
+
+ * {
+ height: 32px;
+ line-height: 32px;
+ }
+}
+
+// Locale flags
+.bar-header .button.flag {
+ height: 44px;
+ padding-top: 6px;
+ padding-bottom: 6px;
+ img {
+ position: relative;
+ bottom: 0;
+ width: 32px !important;
+ height: 32px !important;
+ }
}
.list {
diff --git a/www/css/style.css b/www/css/style.css
index 7f6bd56b..2f51cd6b 100644
--- a/www/css/style.css
+++ b/www/css/style.css
@@ -38,7 +38,9 @@
min-width: 44px !important;
max-width: 90px !important;
}
-.bar .button.button-clear:first-child {
+
+.bar.bar-header .left-buttons > .button.button-clear:first-child,
+.bar.bar-header > .button.button-clear:first-child {
margin-left: 5px;
}
diff --git a/www/i18n/locale-en.json b/www/i18n/locale-en.json
index 3e9c1021..a9abc03c 100644
--- a/www/i18n/locale-en.json
+++ b/www/i18n/locale-en.json
@@ -146,6 +146,7 @@
"USE_WALLETS_ENCRYPTION": "Secure the list",
"USE_WALLETS_ENCRYPTION_HELP": "Enables you to encrypt the list of your wallets. Authentication required to access it.",
"ENABLE_HELPTIP": "Enable contextual help tips",
+ "DISABLE_HELPTIP": "Disable contextual help tips",
"ENABLE_UI_EFFECTS": "Enable visual effects",
"HISTORY_SETTINGS": "Account operations",
"DISPLAY_UD_HISTORY": "Display produced dividends?",
diff --git a/www/i18n/locale-fr-FR.json b/www/i18n/locale-fr-FR.json
index ba308cb3..7c541cba 100644
--- a/www/i18n/locale-fr-FR.json
+++ b/www/i18n/locale-fr-FR.json
@@ -146,6 +146,7 @@
"USE_WALLETS_ENCRYPTION": "Sécuriser la liste ?",
"USE_WALLETS_ENCRYPTION_HELP": "Permet de sécuriser la liste de vos portefeuilles (par chiffrement), en exigeant une authentification pour y accéder.",
"ENABLE_HELPTIP": "Activer les bulles d'aide contextuelles",
+ "DISABLE_HELPTIP": "Désactiver les bulles d'aide contextuelles",
"ENABLE_UI_EFFECTS": "Activer les effets visuels",
"HISTORY_SETTINGS": "Mes opérations",
"DISPLAY_UD_HISTORY": "Afficher les dividendes produits ?",
diff --git a/www/plugins/es/js/services/http-services.js b/www/plugins/es/js/services/http-services.js
index 2513603e..883138c6 100644
--- a/www/plugins/es/js/services/http-services.js
+++ b/www/plugins/es/js/services/http-services.js
@@ -296,7 +296,7 @@ angular.module('cesium.es.http.services', ['ngResource', 'ngApi', 'cesium.servic
.then(function (confirm) {
if (!confirm) return false; // stop the loop
- that.clearAllCache();
+ that.cleanCache();
that.init(fallbackNode.host, fallbackNode.port, fallbackNode.useSsl || fallbackNode.port == 443);
diff --git a/www/templates/api/home.html b/www/templates/api/home.html
index f838f502..017cf794 100644
--- a/www/templates/api/home.html
+++ b/www/templates/api/home.html
@@ -5,12 +5,10 @@
<ion-nav-buttons side="right">
<!-- locales -->
- <button class="button button-clear hidden-xs hidden-sm gray"
+ <button class="button button-clear hidden-xs hidden-sm flag"
ng-click="showLocalesPopover($event)" style="align-content: center">
- <img ng-if="$root.settings.locale.country"
- ng-src="https://www.countryflags.io/{{$root.settings.locale.country}}/shiny/32.png">
- <span ng-if="!$root.settings.locale.country">{{$root.settings.locale.label}} </span>
- <small class="ion-arrow-down-b"></small>
+ <img ng-src="../img/flag-{{$root.settings.locale.flag}}.png"/>
+ <b class="icon-secondary ion-arrow-down-b gray"></b>
</button>
</ion-nav-buttons>
diff --git a/www/templates/home/home.html b/www/templates/home/home.html
index 8b9ae2a9..eef204bc 100644
--- a/www/templates/home/home.html
+++ b/www/templates/home/home.html
@@ -1,13 +1,13 @@
-<ion-view id="home" class="">
+<ion-view id="home">
<!-- no title -->
<ion-nav-title></ion-nav-title>
<ion-nav-buttons side="secondary" >
<!-- locales -->
- <button class="button button-icon button-clear hidden-xs hidden-sm gray"
+ <button class="button button-clear hidden-xs hidden-sm flag"
ng-click="showLocalesPopover($event)" style="align-content: center">
- <img ng-src="img/flag-{{:locale:$root.settings.locale.flag}}.png"/>
- <small class="ion-arrow-down-b"></small>
+ <img ng-src="./img/flag-{{$root.settings.locale.flag}}.png"/>
+ <b class="ion-arrow-down-b gray"></b>
</button>
</ion-nav-buttons>
@@ -82,7 +82,7 @@
<span ng-bind-html="'HOME.NOT_YOUR_ACCOUNT_QUESTION'|translate:{pubkey: walletData.pubkey}"></span>
<br/>
<b>
- <a class="assertive hidden-xs hidden-sm" ng-click="logout()" translate>
+ <a class="assertive" ng-click="logout({askConfirm: true})" translate>
HOME.BTN_CHANGE_ACCOUNT
</a>
</b>
@@ -91,9 +91,6 @@
<button type="button"
class="button button-block button-stable button-raised ink visible-xs visible-sm"
ui-sref="app.view_wallet" ng-if="!login" translate>COMMON.BTN_LOGIN</button>
- <button type="button"
- class="button button-block button-assertive button-raised icon icon-left ion-log-out ink-dark visible-xs visible-sm"
- ng-click="logout()" ng-if="login" translate>COMMON.BTN_LOGOUT</button>
<div class="text-center no-padding visible-xs stable">
diff --git a/www/templates/home/locales_popover.html b/www/templates/home/locales_popover.html
new file mode 100644
index 00000000..bda9e04d
--- /dev/null
+++ b/www/templates/home/locales_popover.html
@@ -0,0 +1,15 @@
+<ion-popover-view class="fit popover-locales" style="height: {{locales.length*48}}px;">
+ <ion-content scroll="false">
+ <div class="list item-text-wrap block">
+
+ <a ng-repeat="l in locales track by l.id"
+ class="item item-icon-left ink"
+ ng-click="changeLanguage(l.id)">
+ <i class="item-image avatar"
+ style="background-image: url(./img/flag-{{l.flag}}.png)"></i>
+ {{l.label | translate}}
+ </a>
+
+ </div>
+ </ion-content>
+</ion-popover-view>
diff --git a/www/templates/menu.html b/www/templates/menu.html
index 1b0a5e77..14b32ceb 100644
--- a/www/templates/menu.html
+++ b/www/templates/menu.html
@@ -7,20 +7,24 @@
</ion-nav-back-button>
<ion-nav-buttons side="left">
- <button class="button button-icon button-clear icon ion-navicon visible-nomenu" menu-toggle="left" ></button>
+ <button class="button button-clear visible-nomenu " menu-toggle="left" >
+ <i class="icon ion-navicon"></i>
+ </button>
</ion-nav-buttons>
<ion-nav-buttons side="right" >
<!-- current node info -->
- <button class="button button-clear hidden-xs hidden-sm gray icon-left"
+ <button class="button button-clear button-peer hidden-xs hidden-sm gray"
ng-if="$root.settings.expertMode"
style="max-width: 450px !important;"
ng-click="showPeerInfoPopover($event)">
- <small class="ion-locked" ng-if=":peer:$root.currency.node.useSsl"> </small>
- {{:peer:$root.currency.node.host}}{{:peer:$root.currency.node.port != 80 && $root.currency.node.port != 443 ? ':'+$root.currency.node.port : ''}}
- <small> </small>
- <small class="ion-arrow-down-b"></small>
+ <span style="display: inline-flex;">
+ <small class="ion-locked" ng-if=":peer:$root.currency.node.useSsl"> </small>
+ {{:peer:$root.currency.node.host}}{{:peer:$root.currency.node.port != 80 && $root.currency.node.port != 443 ? ':'+$root.currency.node.port : ''}}
+ <small> </small>
+ <small class="ion-arrow-down-b"></small>
+ </span>
</button>
<!-- Allow extension here -->
@@ -78,10 +82,6 @@
</h4>
<cs-extension-point name="menu-profile-user"></cs-extension-point>
</div>
- <!-- logout -->
- <a ng-if="login" class="button-icon" ng-click="logout({askConfirm: true})" style="position: absolute; top: 5px; left: 5px; z-index: 999;">
- <i class="icon light ion-android-exit"></i>
- </a>
<!-- removeIf(device) -->
<!-- Fullscreen button -->
@@ -191,13 +191,13 @@
<!-- Help tour (NOT ready yet for small device) -->
<a class="item item-icon-left item-closeable hidden-xs hidden-sm"
- ng-show="!login || $root.settings.helptip.enable"
+ ng-show="$root.settings.helptip.enable"
+ title="{{:locale:'SETTINGS.DISABLE_HELPTIP'|translate}}"
ng-click="startHelpTour($event)">
<i class="icon ion-easel"></i>
{{:locale:'COMMON.BTN_HELP_TOUR'|translate}}
<span class="close"
- ng-if="login"
ng-click="disableHelpTour($event)"></span>
</a>
@@ -243,8 +243,7 @@
<div class="item item-divider visible-xs visible-sm"></div>
- <a menu-close
- class="item item-icon-left visible-xs visible-sm"
+ <a class="item item-icon-left visible-xs visible-sm"
active-link="active"
active-link-path-prefix="#/app/settings"
ui-sref="app.settings">
@@ -254,6 +253,18 @@
<a id="helptip-menu-btn-settings"></a>
+ <!-- logout -->
+ <div class="item item-divider visible-xs visible-sm margin-top" ng-if="login"></div>
+ <a menu-close
+ ng-if="login"
+ class="item item-icon-left visible-xs visible-sm"
+ ng-click="logout({askConfirm: true})">
+ <i class="icon ion-log-out assertive"></i>
+ <span class="assertive" translate> {{:locale:'COMMON.BTN_LOGOUT'|translate}}</span>
+ </a>
+<!-- <a ng-if="login" class="button-icon" ng-click="logout({askConfirm: true})" style="position: absolute; top: 5px; left: 5px; z-index: 999;">-->
+<!-- <i class="icon light ion-log-out"></i>-->
+<!-- </a>-->
</ion-list>
diff --git a/www/templates/wallet/view_wallet.html b/www/templates/wallet/view_wallet.html
index dc99fab9..cebf4049 100644
--- a/www/templates/wallet/view_wallet.html
+++ b/www/templates/wallet/view_wallet.html
@@ -116,21 +116,12 @@
</div>
</div>
- <div class="visible-xs visible-sm padding text-center" ng-if="!loading">
- <button class="button button-assertive button-small-padding ink"
- ng-if="isDefaultWallet"
- ng-click="logout({askConfirm: true})">
- <i class="icon ion-log-out"></i>
- {{'COMMON.BTN_LOGOUT' | translate}}
+ <div class="visible-xs visible-sm padding text-center" ng-if="!loading && formData.requirements.needRenew">
+ <button class="button button-raised icon-left button-stable button-small-padding ink"
+ ng-click="renewMembership()">
+ <i class="icon ion-loop assertive"></i>
+ <span class="assertive">{{:locale:'ACCOUNT.BTN_MEMBERSHIP_RENEW' | translate}}</span>
</button>
- <div ng-if="formData.requirements.needRenew">
- <br/>
- <button class="button button-raised icon-left button-stable button-small-padding ink"
- ng-click="renewMembership()">
- <i class="icon ion-loop assertive"></i>
- <span class="assertive">{{:locale:'ACCOUNT.BTN_MEMBERSHIP_RENEW' | translate}}</span>
- </button>
- </div>
</div>
<div class="row no-padding">
--
GitLab