-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
feat: replace reconfigure button on settings page with link to config doc #21077
Changes from 7 commits
97f252e
0539a5b
e9745e9
eb71453
fe0de9e
a94af13
6c5a252
9e0cea7
99d58c0
56d6049
8cf3375
ed1ee3b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -50,4 +50,11 @@ describe('<SettingsContainer />', { viewportHeight: 800, viewportWidth: 900 }, ( | |||||
|
||||||
cy.findByText(defaultMessages.settingsPage.projectId.title).should('not.exist') | ||||||
}) | ||||||
|
||||||
it('renders footer with CTA button', () => { | ||||||
mountSettingsContainer() | ||||||
cy.contains('p', defaultMessages.settingsPage.footer.text) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
cy.contains('a', defaultMessages.settingsPage.footer.button) | ||||||
.should('have.attr', 'href', defaultMessages.settingsPage.footer.buttonLink) | ||||||
}) | ||||||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,7 @@ | |
variant="outline" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Above for the
Then you can render There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great callout! |
||
:prefix-icon="SettingsIcon" | ||
prefix-icon-class="icon-dark-gray-500 icon-light-gray-50 group-hocus:icon-dark-indigo-400 group-hocus:icon-light-indigo-50" | ||
@click="reconfigure" | ||
:href="t('settingsPage.footer.buttonLink')" | ||
> | ||
{{ t('settingsPage.footer.button') }} | ||
</Button> | ||
|
@@ -52,7 +52,7 @@ | |
|
||
<script lang="ts" setup> | ||
import { useI18n } from '@cy/i18n' | ||
import { gql, useMutation } from '@urql/vue' | ||
import { gql } from '@urql/vue' | ||
import Button from '@cy/components/Button.vue' | ||
import ExternalEditorSettings from './device/ExternalEditorSettings.vue' | ||
import ProxySettings from './device/ProxySettings.vue' | ||
|
@@ -61,20 +61,13 @@ import ProjectSettings from './project/ProjectSettings.vue' | |
import CloudSettings from '../settings/project/CloudSettings.vue' | ||
import TestingPreferences from './device/TestingPreferences.vue' | ||
import type { SettingsContainerFragment } from '../generated/graphql' | ||
import { SettingsContainer_ReconfigureProjectDocument } from '../generated/graphql' | ||
import IconLaptop from '~icons/cy/laptop_x24.svg' | ||
import IconOdometer from '~icons/cy/object-odometer_x24.svg' | ||
import IconFolder from '~icons/cy/folder-outline_x24.svg' | ||
import SettingsIcon from '~icons/cy/settings_x16.svg' | ||
|
||
const { t } = useI18n() | ||
|
||
gql` | ||
mutation SettingsContainer_ReconfigureProject { | ||
reconfigureProject | ||
} | ||
` | ||
|
||
gql` | ||
fragment SettingsContainer on Query { | ||
...TestingPreferences | ||
|
@@ -91,9 +84,4 @@ const props = defineProps<{ | |
gql: SettingsContainerFragment | ||
}>() | ||
|
||
const openElectron = useMutation(SettingsContainer_ReconfigureProjectDocument) | ||
|
||
function reconfigure () { | ||
openElectron.executeMutation({}) | ||
} | ||
</script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used a component test instead of an e2e test to get some experience with CT 😄 in general, when both approaches are equal, do we have a preference for one or the other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For verifying text content I prefer to keep it in the component tests.