-
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 all 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 |
---|---|---|
|
@@ -36,23 +36,25 @@ | |
</div> | ||
<hr class="border-gray-100"> | ||
<p class="mx-auto font-light text-center text-gray-500 max-w-500px text-16px leading-24px"> | ||
{{ t('settingsPage.footer.text') }} | ||
{{ footerText }} | ||
</p> | ||
<Button | ||
class="mx-auto group" | ||
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> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
|
||
import { computed } from 'vue' | ||
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,19 +63,19 @@ 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 | ||
} | ||
` | ||
const footerText = computed(() => { | ||
return t('settingsPage.footer.text', | ||
{ testingType: props.gql.currentProject?.currentTestingType === 'component' | ||
? 'component' | ||
: 'E2E' }) | ||
}) | ||
|
||
gql` | ||
fragment SettingsContainer on Query { | ||
|
@@ -91,9 +93,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.