From 3f88fb35ddaf5eedf650cda1150466d9f281d0c1 Mon Sep 17 00:00:00 2001 From: Jordan Bibla Date: Fri, 8 Dec 2017 14:39:58 -0800 Subject: [PATCH 01/14] minor improvements for launch --- app/src/renderer/components/common/NiFieldSeed.vue | 2 +- app/src/renderer/components/common/NiUserPane.vue | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/src/renderer/components/common/NiFieldSeed.vue b/app/src/renderer/components/common/NiFieldSeed.vue index 74f7bce038..98276d4d23 100644 --- a/app/src/renderer/components/common/NiFieldSeed.vue +++ b/app/src/renderer/components/common/NiFieldSeed.vue @@ -25,5 +25,5 @@ export default { @require '~variables' .ni-field.ni-field-seed - height 5rem + height 6rem diff --git a/app/src/renderer/components/common/NiUserPane.vue b/app/src/renderer/components/common/NiUserPane.vue index 74d4be764f..8dc713fd4e 100644 --- a/app/src/renderer/components/common/NiUserPane.vue +++ b/app/src/renderer/components/common/NiUserPane.vue @@ -6,12 +6,12 @@ list-item.ni-li-user( @click.native="close" icon="face" title="CosmosUser01") -div(v-else-if="user.signedIn") +div(v-else-if="user.signedIn") list-item.ni-li-user( type="link" - icon="mood" + icon="exit_to_app" @click.native="signOut" - title="Signed In (Sign Out)") + title="Sign Out") list-item.ni-li-user( v-else @click.native="openSession" @@ -59,4 +59,7 @@ export default { border-top px solid bc height 3rem + px cursor: pointer + + .ni-li-title + color link From 7362fd76832f6815005a3dfa261594777c85dd21 Mon Sep 17 00:00:00 2001 From: Jordan Bibla Date: Fri, 8 Dec 2017 15:11:18 -0800 Subject: [PATCH 02/14] changed tooltip colors --- app/src/renderer/components/common/NiToolBar.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/renderer/components/common/NiToolBar.vue b/app/src/renderer/components/common/NiToolBar.vue index b1a77f4da7..7564f3711f 100644 --- a/app/src/renderer/components/common/NiToolBar.vue +++ b/app/src/renderer/components/common/NiToolBar.vue @@ -52,14 +52,14 @@ export default { top 3rem right 0 - background hover + background bc border-radius 0.25rem line-height 2.5rem padding 0 0.75rem - color bright + color txt z-index 101 white-space nowrap @@ -76,7 +76,7 @@ export default { height 0 border-left 0.375rem solid transparent border-right 0.375rem solid transparent - border-bottom 0.375rem solid hover + border-bottom 0.375rem solid bc display block content '' From eaedc72f55d20beba57dc693e3c40082402fa535 Mon Sep 17 00:00:00 2001 From: Jordan Bibla Date: Fri, 8 Dec 2017 15:44:57 -0800 Subject: [PATCH 03/14] got rid of default account in favour of supporting multiple accounts --- .../components/common/NiSessionSignIn.vue | 17 +++++++++---- .../components/common/NiSessionSignUp.vue | 15 ++++++++--- .../components/common/NiSessionWelcome.vue | 7 ++++++ .../components/wallet/PageBalances.vue | 2 +- app/src/renderer/vuex/modules/user.js | 25 ++++++++----------- app/src/renderer/vuex/modules/wallet.js | 4 --- 6 files changed, 43 insertions(+), 27 deletions(-) diff --git a/app/src/renderer/components/common/NiSessionSignIn.vue b/app/src/renderer/components/common/NiSessionSignIn.vue index 8ca737e3f4..e4e77cf3ad 100644 --- a/app/src/renderer/components/common/NiSessionSignIn.vue +++ b/app/src/renderer/components/common/NiSessionSignIn.vue @@ -1,9 +1,16 @@ @@ -37,6 +42,7 @@ export default { }, data: () => ({ fields: { + signInName: '', signInPassword: '' } }), @@ -47,8 +53,8 @@ export default { this.$v.$touch() if (this.$v.$error) return try { - await this.$store.dispatch('testLogin', {password: this.fields.signInPassword}) - this.$store.dispatch('signIn', {password: this.fields.signInPassword}) + await this.$store.dispatch('testLogin', { password: this.fields.signInPassword, account: this.fields.signInName }) + this.$store.dispatch('signIn', { password: this.fields.signInPassword, account: this.fields.signInName }) this.$store.commit('setModalSession', false) this.$store.commit('notify', { title: 'Signed In', body: `You are now signed in to your Cosmos account.` }) } catch (err) { @@ -57,10 +63,11 @@ export default { } }, mounted () { - this.$el.querySelector('#sign-in-password').focus() + this.$el.querySelector('#sign-in-name').focus() }, validations: () => ({ fields: { + signInName: { required }, signInPassword: { required, minLength: minLength(10) } } }) diff --git a/app/src/renderer/components/common/NiSessionSignUp.vue b/app/src/renderer/components/common/NiSessionSignUp.vue index 15dd2446f8..701cf363ff 100644 --- a/app/src/renderer/components/common/NiSessionSignUp.vue +++ b/app/src/renderer/components/common/NiSessionSignUp.vue @@ -5,6 +5,13 @@ .ni-session-title Create Account a(@click="help"): i.material-icons help_outline .ni-session-main + form-group(field-id='sign-up-name' field-label='Account Name') + field#sign-up-name( + type="text" + placeholder="name your account" + v-model="fields.signUpName") + form-msg(name='Name' type='required' v-if='!$v.fields.signUpName.required') + form-group(field-id='sign-up-seed' field-label='Seed (write it down)') field-seed#sign-up-seed(v-model="fields.signUpSeed" disabled) form-msg(body='Please back up the seed phrase for this account. These words cannot be recovered!') @@ -63,6 +70,7 @@ export default { data: () => ({ creating: true, fields: { + signUpName: '', signUpSeed: 'Creating seed...', signInPassword: '', signUpWarning: false, @@ -75,16 +83,16 @@ export default { async onSubmit () { this.$v.$touch() if (this.$v.$error) return - let key = await this.$store.dispatch('createKey', { seedPhrase: this.fields.signUpSeed, password: this.fields.signInPassword }) + let key = await this.$store.dispatch('createKey', { seedPhrase: this.fields.signUpSeed, password: this.fields.signInPassword, name: this.fields.signUpName }) if (key) { this.$store.commit('setModalSession', false) this.$store.commit('notify', { title: 'Signed Up', body: 'Your account has been created.' }) - this.$store.dispatch('signIn', {password: this.fields.signInPassword}) + this.$store.dispatch('signIn', { password: this.fields.signInPassword, account: this.fields.signUpName }) } } }, mounted () { - this.$el.querySelector('#sign-up-warning').focus() + this.$el.querySelector('#sign-up-name').focus() this.$store.dispatch('createSeed') .then(seedPhrase => { this.creating = false @@ -93,6 +101,7 @@ export default { }, validations: () => ({ fields: { + signUpName: '', signInPassword: { required, minLength: minLength(10) }, signUpWarning: { required }, signUpBackup: { required } diff --git a/app/src/renderer/components/common/NiSessionWelcome.vue b/app/src/renderer/components/common/NiSessionWelcome.vue index 3496c64bc3..d48c3167d1 100644 --- a/app/src/renderer/components/common/NiSessionWelcome.vue +++ b/app/src/renderer/components/common/NiSessionWelcome.vue @@ -5,6 +5,12 @@ .ni-session-title Welcome to Cosmos! a(@click="help"): i.material-icons help_outline .ni-session-main + li-session( + v-if="accountExists" + @click.native="setState('sign-in')" + icon="lock" + title="Sign in with password" + subtitle="If you have an account, choose this option") li-session( @click.native="setState('sign-up')" icon="create" @@ -39,6 +45,7 @@ export default { }, methods: { help () { this.$store.commit('setModalHelp', true) }, + accountExists () { return !!this.$store.dispatch('accountExists') }, setState (value) { this.$store.commit('setModalSessionState', value) } } } diff --git a/app/src/renderer/components/wallet/PageBalances.vue b/app/src/renderer/components/wallet/PageBalances.vue index 58d3b24767..7d192b3305 100644 --- a/app/src/renderer/components/wallet/PageBalances.vue +++ b/app/src/renderer/components/wallet/PageBalances.vue @@ -19,7 +19,7 @@ page(title='Balance') :key="i.denom" :dt="i.denom.toUpperCase()" :dd="i.amount") - list-item(v-if='wallet.balances.length === 0' dt="N/A" dd="None Available") + list-item(v-if='wallet.denoms.length === 0' dt="N/A" dd="None Available")