Skip to content

Commit

Permalink
Merge pull request #1874 from cosmos/jordan/1785-preferences
Browse files Browse the repository at this point in the history
Jordan/1785 preferences
  • Loading branch information
faboweb authored Jan 23, 2019
2 parents f3bcdf6 + a1134e8 commit adfe7d4
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 167 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed build process @ƒaboweb
- [\#1818](https://github.com/cosmos/voyager/issues/1818) Fixed error on validator loading showing as no validators @faboweb
- Fixed error locations sucked up by Sentry @faboweb
- - [\#1815](https://github.com/cosmos/voyager/pull/1785) Fixed small bug on preferences page @jbibla

## [0.10.7] - 2018-10-10

Expand Down
22 changes: 2 additions & 20 deletions app/src/renderer/components/common/PagePreferences.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@
<tm-balance />
<tool-bar />
</template>
<tm-part title="Settings">
<tm-list-item type="field" title="Node IP">
<tm-btn :value="nodeURL" icon="exit_to_app" type="button" />
</tm-list-item>
<tm-part>
<tm-list-item type="field" title="Node IP">{{ nodeURL }}</tm-list-item>
<tm-list-item type="field" title="View tutorial for Voyager">
<tm-btn
id="toggle-onboarding"
value="Launch Tutorial"
icon="open_in_new"
@click.native="setOnboarding()"
/>
</tm-list-item>
Expand All @@ -33,17 +30,6 @@
/>
</tm-list-item>
</tm-part>
<tm-part title="Account">
<tm-list-item type="field" title="Switch account">
<tm-btn
id="signOut-btn"
icon="exit_to_app"
type="button"
value="Sign Out"
@click.native="signOut()"
/>
</tm-list-item>
</tm-part>
</tm-page>
</template>

Expand Down Expand Up @@ -90,10 +76,6 @@ export default {
this.themeSelectActive = this.themes.active
},
methods: {
signOut({ $store } = this) {
$store.dispatch(`signOut`)
$store.commit(`notifySignOut`)
},
setAppTheme({ $store, themes } = this) {
if (themes.active === `dark`) {
$store.commit(`setTheme`, `light`)
Expand Down
2 changes: 1 addition & 1 deletion app/src/renderer/components/common/TmPageHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default {
.tm-page-header-container {
min-height: 4.22rem;
flex-wrap: wrap;
border-bottom: px solid var(--bc);
border-bottom: 1px solid var(--bc-dim);
display: flex;
padding: 0 1rem 0 1rem;
}
Expand Down
3 changes: 2 additions & 1 deletion app/src/renderer/components/common/ToolBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
</a>
<router-link
v-tooltip.bottom="'Preferences'"
v-if="config.devMode"
id="settings"
to="/preferences"
>
Expand All @@ -58,7 +59,7 @@ export default {
}
},
computed: {
...mapGetters([`user`, `lastPage`]),
...mapGetters([`user`, `lastPage`, `config`]),
searchEnabled() {
return !!this.searching
},
Expand Down
3 changes: 1 addition & 2 deletions test/e2e/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ test(`preferences`, async function(t) {
await navigateToPreferences(app)

t.test(`shows preferences`, async function(t) {
t.ok(await $(`div*=Settings`).waitForExist(), `shows Settings`)
t.ok(await $(`div*=Account`).waitForExist(), `shows Account`)
t.ok(await $(`div*=Node IP`).waitForExist(), `shows Node IP`)
t.end()
})

Expand Down
9 changes: 1 addition & 8 deletions test/unit/specs/components/common/PagePreferences.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,9 @@ describe(`PagePreferences`, () => {
it(`has the expected html structure if connected`, async () => {
store.commit(`setStakingParameters`, stakingParameters.parameters)
expect(wrapper.vm.$el).toMatchSnapshot()
expect(wrapper.vm.$el.outerHTML).toContain(`Node IP`)
expect(wrapper.vm.$el.outerHTML).toContain(`View tutorial`)
expect(wrapper.vm.$el.outerHTML).toContain(`Automatically send`)
expect(wrapper.vm.$el.outerHTML).toContain(`Switch account`)
expect(wrapper.vm.$el.outerHTML).toContain(`Sign Out`)
})

it(`should sign the user out`, async () => {
wrapper.vm.signOut()
expect(store.dispatch).toHaveBeenCalledWith(`signOut`)
expect(store.commit).toHaveBeenCalledWith(`notifySignOut`)
})

it(`should set the error collection opt in`, async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,23 +172,7 @@ exports[`PagePreferences has the expected html structure if connected 1`] = `
<div
class="tm-part-container"
>
<header
class="tm-part-header"
>
<div
class="tm-part-header-container"
>
<div
class="tm-part-title h5"
>
Settings
</div>
<menu
class="tm-part-menu"
/>
</div>
</header>
<!---->
<main
class="tm-part-main"
Expand Down Expand Up @@ -224,22 +208,7 @@ exports[`PagePreferences has the expected html structure if connected 1`] = `
<div
class="tm-li-input"
>
<button
class="tm-btn"
type="button"
>
<span
class="tm-btn__container"
>
<i
aria-hidden="true"
class="tm-btn__icon material-icons"
>
exit_to_app
</i>
<!---->
</span>
</button>
</div>
</div>
</div>
Expand Down Expand Up @@ -282,12 +251,7 @@ exports[`PagePreferences has the expected html structure if connected 1`] = `
<span
class="tm-btn__container"
>
<i
aria-hidden="true"
class="tm-btn__icon material-icons"
>
open_in_new
</i>
<!---->
<span
class="tm-btn__value"
>
Expand Down Expand Up @@ -373,92 +337,6 @@ exports[`PagePreferences has the expected html structure if connected 1`] = `
</main>
</div>
</section>
<section
class="tm-part"
>
<div
class="tm-part-container"
>
<header
class="tm-part-header"
>
<div
class="tm-part-header-container"
>
<div
class="tm-part-title h5"
>
Account
</div>
<menu
class="tm-part-menu"
/>
</div>
</header>
<main
class="tm-part-main"
>
<div
class="tm-li tm-li-field"
>
<div
class="tm-li-container"
>
<div
class="tm-li-thumb"
>
<!---->
</div>
<div
class="tm-li-label"
>
<div
class="tm-li-title"
>
Switch account
</div>
<div
class="tm-li-subtitle"
>
</div>
</div>
<div
class="tm-li-input"
>
<button
class="tm-btn"
id="signOut-btn"
type="button"
>
<span
class="tm-btn__container"
>
<i
aria-hidden="true"
class="tm-btn__icon material-icons"
>
exit_to_app
</i>
<span
class="tm-btn__value"
>
Sign Out
</span>
</span>
</button>
</div>
</div>
</div>
</main>
</div>
</section>
</main>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -1185,16 +1185,7 @@ exports[`PageValidator shows an error if the validator couldn't be found 1`] = `
</i>
</a>
<router-link-stub
id="settings"
to="/preferences"
>
<i
class="material-icons"
>
settings
</i>
</router-link-stub>
<!---->
<a
id="signOut-btn"
Expand Down

0 comments on commit adfe7d4

Please sign in to comment.