Skip to content

Commit

Permalink
Merge branch '10.0-release' into elevatebart/fix/nav-bar
Browse files Browse the repository at this point in the history
  • Loading branch information
elevatebart committed Dec 8, 2021
2 parents 9ec2c69 + e6cbee4 commit 3afc118
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 51 deletions.
44 changes: 13 additions & 31 deletions packages/app/src/settings/device/TestingPreferences.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,18 @@
<div
class="rounded border border-gray-100 px-16px divide-y divide-gray-200"
>
<div
v-for="pref in prefs"
:key="pref.id"
class="py-16px"
>
<div class="py-16px">
<h4 class="text-gray-800 text-size-16px leading-24px flex items-center">
{{ pref.title }}
{{ autoScrollingPreference.title }}
<Switch
class="mx-8px"
:value="props.gql.localSettings.preferences[pref.id] ?? false"
:name="pref.title"
@update="(value) => updatePref(pref.id, value)"
:value="props.gql.localSettings.preferences[autoScrollingPreference.id] ?? false"
:name="autoScrollingPreference.title"
@update="(value) => updatePref(value)"
/>
</h4>
<p class="text-size-14px leading-24px text-gray-600">
{{ pref.description }}
{{ autoScrollingPreference.description }}
</p>
</div>
</div>
Expand All @@ -48,8 +44,6 @@ fragment TestingPreferences on Query {
localSettings {
preferences {
autoScrollingEnabled
useDarkSidebar
watchForSpecChange
}
}
}
Expand All @@ -62,27 +56,15 @@ mutation SetTestingPreferences($value: String!) {
const setPreferences = useMutation(SetTestingPreferencesDocument)
const prefs = [
{
id: 'autoScrollingEnabled',
title: t('settingsPage.testingPreferences.autoScrollingEnabled.title'),
description: t('settingsPage.testingPreferences.autoScrollingEnabled.description'),
},
{
id: 'useDarkSidebar',
title: t('settingsPage.testingPreferences.useDarkSidebar.title'),
description: t('settingsPage.testingPreferences.useDarkSidebar.description'),
},
{
id: 'watchForSpecChange',
title: t('settingsPage.testingPreferences.watchForSpecChange.title'),
description: t('settingsPage.testingPreferences.watchForSpecChange.description'),
},
] as const
const autoScrollingPreference = {
id: 'autoScrollingEnabled',
title: t('settingsPage.testingPreferences.autoScrollingEnabled.title'),
description: t('settingsPage.testingPreferences.autoScrollingEnabled.description'),
} as const
function updatePref (preferenceId: typeof prefs[number]['id'], value: boolean) {
function updatePref (value: boolean) {
setPreferences.executeMutation({
value: JSON.stringify({ [preferenceId]: value }),
value: JSON.stringify({ [autoScrollingPreference.id]: value }),
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ export function makeClientTestContext (): ClientTestContext {
preferences: {
__typename: 'LocalSettingsPreferences',
autoScrollingEnabled: true,
useDarkSidebar: true,
watchForSpecChange: true,
},
availableEditors: [
{
Expand Down
8 changes: 0 additions & 8 deletions packages/frontend-shared/src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -358,14 +358,6 @@
"autoScrollingEnabled": {
"title": "Auto Scrolling Enabled",
"description": "Scroll behavior when running tests."
},
"watchForSpecChange": {
"title": "Watch for Spec Change",
"description": "Re-run specs when a file changes."
},
"useDarkSidebar": {
"title": "Dark sidebar",
"description": "Select the color theme of the app sidebar."
}
},
"footer": {
Expand Down
2 changes: 0 additions & 2 deletions packages/graphql/schemas/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,6 @@ type LocalSettingsPreferences {
preferredEditorBinary: String
proxyBypass: String
proxyServer: String
useDarkSidebar: Boolean
watchForSpecChange: Boolean
}

type Mutation {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ export const LocalSettingsPreferences = objectType({
description: 'local setting preferences',
definition (t) {
t.boolean('autoScrollingEnabled')
t.boolean('watchForSpecChange')
t.boolean('useDarkSidebar')
t.string('preferredEditorBinary')
t.boolean('isSpecsListOpen')
t.string('proxyServer', {
Expand Down
6 changes: 0 additions & 6 deletions packages/types/src/preferences.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import type { Editor } from '.'

export const defaultPreferences: AllowedState = {
watchForSpecChange: true,
useDarkSidebar: true,
autoScrollingEnabled: true,
isSpecsListOpen: true,
}
Expand Down Expand Up @@ -32,8 +30,6 @@ export const allowedKeys: Readonly<Array<keyof AllowedState>> = [
'firstOpened',
'lastOpened',
'promptsShown',
'watchForSpecChange',
'useDarkSidebar',
'preferredEditorBinary',
] as const

Expand Down Expand Up @@ -64,7 +60,5 @@ export type AllowedState = Partial<{
firstOpened: Maybe<number>
lastOpened: Maybe<number>
promptsShown: Maybe<object>
watchForSpecChange: Maybe<boolean>
useDarkSidebar: Maybe<boolean>
preferredEditorBinary: Maybe<string>
}>

0 comments on commit 3afc118

Please sign in to comment.