From 1520543fe4a39abeaab0f3fc8b8526b324b12d16 Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Thu, 16 May 2019 04:59:03 +0200 Subject: [PATCH 01/18] Notification: Call resolve once --- src/components/Notification.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Notification.vue b/src/components/Notification.vue index bb36e1a81..99f856e32 100644 --- a/src/components/Notification.vue +++ b/src/components/Notification.vue @@ -22,7 +22,7 @@ export default { text: { type: String, default: '' }, }, mounted() { - setInterval(() => this.resolve(), 5000); + setTimeout(() => this.resolve(), 5000); }, }; From e51c1b19385436590a18256b8993c4c2e818b923 Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Thu, 16 May 2019 05:01:14 +0200 Subject: [PATCH 02/18] Add stories with notifications --- src/stories/notifications.stories.js | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/stories/notifications.stories.js diff --git a/src/stories/notifications.stories.js b/src/stories/notifications.stories.js new file mode 100644 index 000000000..fb7ffab03 --- /dev/null +++ b/src/stories/notifications.stories.js @@ -0,0 +1,39 @@ +/* eslint-disable import/no-extraneous-dependencies */ +import { storiesOf } from '@storybook/vue'; +import { action } from '@storybook/addon-actions'; +import Notification from '../components/Notification.vue'; +import NotificationSpend from '../components/NotificationSpend.vue'; +import { amount } from './mock-data'; + +const methods = { resolve: action('resolve') }; + +storiesOf('notifications', module) + .add('Notification', () => ({ + components: { Notification }, + template: ` + `, + methods, + })) + .add('long text', () => ({ + components: { Notification }, + template: ` + `, + methods, + })) + .add('NotificationSpend', () => ({ + components: { NotificationSpend }, + template: ` + `, + data: () => ({ amount }), + methods, + })); From ae16682f2c40eff2921d41d9c0d420582998a0b1 Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Thu, 16 May 2019 05:09:25 +0200 Subject: [PATCH 03/18] Notification: Increase vertical paddings --- src/components/Notification.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Notification.vue b/src/components/Notification.vue index 99f856e32..82cb43502 100644 --- a/src/components/Notification.vue +++ b/src/components/Notification.vue @@ -52,11 +52,15 @@ export default { .content { overflow-wrap: break-word; - padding: rem(6px) rem(16px); + padding: rem(20px) rem(16px); /deep/ .list-item { padding-left: 0; padding-right: 0; + + .content { + height: rem(40px); + } } } From 57c1f425c253967762d7ba1241dcd262556135a1 Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Thu, 16 May 2019 05:28:22 +0200 Subject: [PATCH 04/18] Notification: Set max width --- src/components/Notification.vue | 3 +++ src/pages/desktop/Send.vue | 6 ------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/components/Notification.vue b/src/components/Notification.vue index 82cb43502..a143b103c 100644 --- a/src/components/Notification.vue +++ b/src/components/Notification.vue @@ -36,6 +36,9 @@ export default { top: 0; left: rem(10px); right: rem(10px); + max-width: rem(520px); + margin-left: auto; + margin-right: auto; padding-top: env(safe-area-inset-top); border-radius: 0 0 rem(8px) rem(8px); background-color: $color-neutral-maximum; diff --git a/src/pages/desktop/Send.vue b/src/pages/desktop/Send.vue index f482ad974..a2512a2be 100644 --- a/src/pages/desktop/Send.vue +++ b/src/pages/desktop/Send.vue @@ -104,11 +104,5 @@ export default { margin-left: auto; margin-right: auto; } - - .transfer-notification { - left: auto; - right: auto; - width: rem(520px); - } } From 59562b12191a94d9c14838f5f09c990c7d471ef0 Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Sun, 19 May 2019 09:27:16 +0200 Subject: [PATCH 05/18] Refactor Jenkinsfile --- Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1e10734ac..544a379e1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,8 +4,7 @@ pipeline { filename 'Dockerfile.ci' args '-v /etc/group:/etc/group:ro ' + '-v /etc/passwd:/etc/passwd:ro ' + - '-v /var/lib/jenkins:/var/lib/jenkins ' - + '-v /var/lib/jenkins:/var/lib/jenkins' } } From ccf2f459ef47ddf62b050003e06726c1bc11d619 Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Sun, 19 May 2019 14:47:45 +0200 Subject: [PATCH 06/18] travis: Build Android --- .travis.yml | 40 +++++++++++++------ Dockerfile.ci | 29 -------------- Jenkinsfile | 19 --------- .../{before-deploy.sh => build-cordova.sh} | 8 +++- scripts/deploy.sh | 8 ++-- scripts/install.sh | 10 +++-- scripts/script.sh | 12 ------ scripts/test.sh | 10 +++++ 8 files changed, 56 insertions(+), 80 deletions(-) delete mode 100644 Dockerfile.ci delete mode 100644 Jenkinsfile rename scripts/{before-deploy.sh => build-cordova.sh} (50%) delete mode 100755 scripts/script.sh create mode 100755 scripts/test.sh diff --git a/.travis.yml b/.travis.yml index f7e7d580e..5ff25ce8c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,20 +1,34 @@ -language: node_js -os: - - linux - - osx -osx_image: xcode10.2 -node_js: - - '10' +matrix: + include: + - language: node_js + node_js: '10' + script: scripts/test.sh + + - language: android + android: + components: + - build-tools-28.0.3 + - android-28 + before_install: + - yes | sdkmanager "platforms;android-28" + - nvm install 10 + script: scripts/build-cordova.sh + + - language: objective-c + os: osx + osx_image: xcode10.2 + before_install: nvm install 10 + script: scripts/build-cordova.sh + cache: directories: - node_modules - platforms - plugins - /home/travis/.cache/Cypress -install: - - travis_wait 30 scripts/install.sh -script: scripts/script.sh -before_deploy: scripts/before-deploy.sh + +install: travis_wait 30 scripts/install.sh + deploy: - provider: script skip_cleanup: true @@ -23,7 +37,9 @@ deploy: all_branches: true - provider: releases api_key: $GITHUB_TOKEN - file: aeternity.app.tar.gz + file: + - aeternity.apk + - aeternity.app.tar.gz skip_cleanup: true on: condition: $TRAVIS_OS_NAME = osx diff --git a/Dockerfile.ci b/Dockerfile.ci deleted file mode 100644 index 9fdd743f7..000000000 --- a/Dockerfile.ci +++ /dev/null @@ -1,29 +0,0 @@ -FROM tamasbarta/docker-android-sdk:28.0.3 - -ENV NODEJS_VERSION=10.15.3 \ - PATH=$PATH:/opt/node/bin - -RUN apt-get update && \ - apt-get install -y python \ - build-essential \ - libfontconfig \ - curl \ - gradle \ - imagemagick &&\ - curl -sL https://nodejs.org/dist/v${NODEJS_VERSION}/node-v${NODEJS_VERSION}-linux-x64.tar.gz | tar xz --strip-components=1 &&\ - rm -rf /var/lib/apt/lists/* - -ENV GRADLE_OPTS=${GRADLE_OPTS}\ -Dorg.gradle.daemon=false - -RUN mkdir app -WORKDIR /app - -COPY package*.json ./ -RUN npm install && npx cordova telemetry off - -# As cordova changes global modules when adding a platform, we have to build the apk already during the docker build process -COPY . . -RUN npm run build:cordova -RUN npx cordova prepare android -RUN npm run gen:cordova-resources -RUN npx cordova build android -- --gradleArg=--no-daemon diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 544a379e1..000000000 --- a/Jenkinsfile +++ /dev/null @@ -1,19 +0,0 @@ -pipeline { - agent { - dockerfile { - filename 'Dockerfile.ci' - args '-v /etc/group:/etc/group:ro ' + - '-v /etc/passwd:/etc/passwd:ro ' + - '-v /var/lib/jenkins:/var/lib/jenkins' - } - } - - stages { - stage('Archive Artifacts') { - steps { - sh 'cp /app/platforms/android/app/build/outputs/apk/debug/app-debug.apk $WORKSPACE/android-debug.apk' - archiveArtifacts artifacts: 'android-debug.apk', fingerprint: true - } - } - } -} diff --git a/scripts/before-deploy.sh b/scripts/build-cordova.sh similarity index 50% rename from scripts/before-deploy.sh rename to scripts/build-cordova.sh index 93c334501..01e1662e9 100755 --- a/scripts/before-deploy.sh +++ b/scripts/build-cordova.sh @@ -1,9 +1,13 @@ #!/bin/bash set -e +npm run build:cordova +npm run gen:cordova-resources + if [[ $TRAVIS_OS_NAME == "osx" ]]; then - npm run build:cordova - npm run gen:cordova-resources npx cordova build ios tar -czvf aeternity.app.tar.gz -C platforms/ios/build/emulator Base\ æpp.app +else + npx cordova build android + mv platforms/android/app/build/outputs/apk/debug/app-debug.apk ./aeternity.apk fi diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 02e3759c1..7d6491b43 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -24,8 +24,10 @@ case $TRAVIS_BRANCH in ;; esac -if [[ $TRAVIS_OS_NAME != "osx" ]]; then - rsync -r --delete-after -v $TRAVIS_BUILD_DIR/dist/* deploy@139.59.142.164:/var/www/html/$UPLOAD_PATH -else +if [[ $TRAVIS_OS_NAME == "osx" ]]; then rsync -r --delete-after -v $TRAVIS_BUILD_DIR/aeternity.app.tar.gz deploy@139.59.142.164:/var/www/html/$UPLOAD_PATH +elif [[ $ANDROID_HOME != "" ]]; then + rsync -r --delete-after -v $TRAVIS_BUILD_DIR/aeternity.apk deploy@139.59.142.164:/var/www/html/$UPLOAD_PATH/aeternity.apk +else + rsync -r --delete-after -v $TRAVIS_BUILD_DIR/dist/* deploy@139.59.142.164:/var/www/html/$UPLOAD_PATH fi diff --git a/scripts/install.sh b/scripts/install.sh index b87866597..385789309 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -3,8 +3,12 @@ set -e npm ci -if [[ $TRAVIS_OS_NAME == "osx" ]]; then - HOMEBREW_NO_AUTO_UPDATE=1 brew install imagemagick +if [[ $ANDROID_HOME != "" || $TRAVIS_OS_NAME == "osx" ]]; then mkdir www - npx cordova prepare ios + + if [[ $TRAVIS_OS_NAME == "osx" ]]; then + npx cordova prepare ios + else + npx cordova prepare android + fi fi diff --git a/scripts/script.sh b/scripts/script.sh deleted file mode 100755 index ae715e5ff..000000000 --- a/scripts/script.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -e - -if [[ $TRAVIS_OS_NAME != "osx" ]]; then - npm run lint - npm run test:unit - npm run build -- --report - - npx serve --single dist & - trap "kill $!" EXIT - npm run test:e2e -- --headless --url http://localhost:5000 -fi diff --git a/scripts/test.sh b/scripts/test.sh new file mode 100755 index 000000000..1f48c4950 --- /dev/null +++ b/scripts/test.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -e + +npm run lint +npm run test:unit +npm run build -- --report + +npx serve --single dist & +trap "kill $!" EXIT +npm run test:e2e -- --headless --url http://localhost:5000 From 266ba91f84e959015b66c10abf4f5067ef1999b6 Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Thu, 16 May 2019 06:36:20 +0200 Subject: [PATCH 07/18] Remove unused icons --- src/assets/icons/aepps/transfer.svg | 6 ------ src/assets/icons/grid-black.svg | 8 -------- src/assets/icons/grid.svg | 8 -------- src/assets/icons/plus.svg | 8 -------- src/assets/icons/remote-connect.svg | 6 ------ 5 files changed, 36 deletions(-) delete mode 100644 src/assets/icons/aepps/transfer.svg delete mode 100644 src/assets/icons/grid-black.svg delete mode 100644 src/assets/icons/grid.svg delete mode 100644 src/assets/icons/plus.svg delete mode 100644 src/assets/icons/remote-connect.svg diff --git a/src/assets/icons/aepps/transfer.svg b/src/assets/icons/aepps/transfer.svg deleted file mode 100644 index f46b4ee98..000000000 --- a/src/assets/icons/aepps/transfer.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/assets/icons/grid-black.svg b/src/assets/icons/grid-black.svg deleted file mode 100644 index fbdf7d798..000000000 --- a/src/assets/icons/grid-black.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/assets/icons/grid.svg b/src/assets/icons/grid.svg deleted file mode 100644 index f417e0f47..000000000 --- a/src/assets/icons/grid.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/assets/icons/plus.svg b/src/assets/icons/plus.svg deleted file mode 100644 index b669cb998..000000000 --- a/src/assets/icons/plus.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/assets/icons/remote-connect.svg b/src/assets/icons/remote-connect.svg deleted file mode 100644 index bc5150bc5..000000000 --- a/src/assets/icons/remote-connect.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - From a41a33d9a9b190fa1fb8d002ce0342a57003c055 Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Thu, 16 May 2019 07:29:55 +0200 Subject: [PATCH 08/18] Optimise svg loading --- package-lock.json | 10 ++++++++++ package.json | 3 +++ vue.config.js | 13 ++++++++++++- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index a8513aa7a..caf4db04f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20435,6 +20435,16 @@ "util.promisify": "~1.0.0" } }, + "svgo-loader": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/svgo-loader/-/svgo-loader-2.2.0.tgz", + "integrity": "sha512-AtIy4kmUQc1zo+QK3ZFvRrULRZAhUC63cLJxdVo1cONZ9WeYAkySUlaB05uZKKcYpsTb/9tDsBSXMab3/0QWtw==", + "dev": true, + "requires": { + "js-yaml": "^3.12.0", + "loader-utils": "^1.0.3" + } + }, "symbol-observable": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz", diff --git a/package.json b/package.json index 915e42e54..2f3713bb3 100644 --- a/package.json +++ b/package.json @@ -77,6 +77,9 @@ "node-sass": "^4.12.0", "sass-loader": "^7.0.3", "serve": "^11.0.0", + "svg-url-loader": "^2.3.2", + "svgo": "^1.2.2", + "svgo-loader": "^2.2.0", "vue-cli-plugin-storybook": "^0.5.2", "vue-template-compiler": "^2.6.7" }, diff --git a/vue.config.js b/vue.config.js index 40964670c..936a32499 100644 --- a/vue.config.js +++ b/vue.config.js @@ -33,7 +33,18 @@ module.exports = { } return [definitions]; - }), + }).end() + .module.rule('svg') + .use('file-loader') + .loader('svg-url-loader') + .options({ + limit: 4096, + name: 'img/[name].[hash:8].[ext]', + }) + .end() + .use('svgo-loader') + .loader('svgo-loader') + .end(), pwa: { workboxPluginMode: 'InjectManifest', workboxOptions: { From 9a6669d36b7b85bc6fcb10e8c9ed997ff57a2981 Mon Sep 17 00:00:00 2001 From: Dmitry Kostin Date: Mon, 20 May 2019 20:42:06 +1000 Subject: [PATCH 09/18] NotFound page: Update text, add button --- src/pages/NotFound.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/pages/NotFound.vue b/src/pages/NotFound.vue index f0e80f531..da94bd751 100644 --- a/src/pages/NotFound.vue +++ b/src/pages/NotFound.vue @@ -4,15 +4,25 @@ class="not-found" :hide-tab-bar="!loggedIn" > - Page not found + It looks like the page you are looking for was not found. + + + Go home +