Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jordan/1785 preferences #1874

Merged
merged 5 commits into from
Jan 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- [\#1815](https://github.com/cosmos/voyager/pull/1815) Fixed getters for proposals denominator, reverted to 945803d586b83d65547cd16f4cd5994eac2957ea until interfaces are ready @sabau
- Fixed build process @ƒaboweb
- Fixed error locations sucked up by Sentry @faboweb
- - [\#1815](https://github.com/cosmos/voyager/pull/1785) Fixed small bug on preferences page @jbibla
faboweb marked this conversation as resolved.
Show resolved Hide resolved

## [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