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

misc: add CTA footer to launchpad framework dropdown #25831

Merged
merged 7 commits into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 4 additions & 1 deletion packages/frontend-shared/src/components/Select.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ describe('<Select />', () => {
'item-suffix': () => <IconHeart data-testid="item-suffix"></IconHeart>,
'selected': () => 'Selected',
'input-prefix': () => <IconHeart data-testid="input-prefix"></IconHeart>,
'input-suffix': () => <IconHeart data-testid="input-suffix"></IconHeart>,
'input-suffix': () => <IconHeart data-testid="input-suffix">suffix</IconHeart>,
'footer': () => <div>This is the footer</div>,
}

mountSelect({ vSlots })
Expand All @@ -219,6 +220,8 @@ describe('<Select />', () => {
// Choose an option
.then(selectFirstOption)

cy.contains('This is the footer').should('be.visible')

// The options list should be closed
cy.get(optionsSelector).should('not.exist')
.get(inputSelector).should('have.text', 'Selected')
Expand Down
1 change: 1 addition & 0 deletions packages/frontend-shared/src/components/Select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
</span>
</li>
</ListboxOption>
<slot name="footer" />
</ListboxOptions>
</transition>
</div>
Expand Down
4 changes: 3 additions & 1 deletion packages/frontend-shared/src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,9 @@
"bundlerPlaceholder": "Pick a bundler",
"languageLabel": "Language",
"configFileLanguageLabel": "Cypress config file",
"detected": "(detected)"
"detected": "(detected)",
"frameworkNotListed": "If your framework is not listed above,",
"browseIntegrations": "browse the list of third-party integrations"
},
"step": {
"continue": "Continue",
Expand Down
5 changes: 5 additions & 0 deletions packages/launchpad/src/setup/EnvironmentSetup.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ describe('<EnvironmentSetup />', { viewportWidth: 800 }, () => {

cy.findByRole('button', { name: 'Next step' })
.should('have.disabled')

cy.contains('If your framework is not listed above').should('be.visible')
cy.findByRole('link', { name: 'browse the list of third-party integrations' }).should('have.attr', 'href', 'https://on.cypress.io/component-integrations')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will get you this link within 24h


cy.percySnapshot()
})

it('renders the detected flag', () => {
Expand Down
30 changes: 30 additions & 0 deletions packages/launchpad/src/setup/FrameworkOptionsFooter.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<template>
<div class="flex bg-gray-50 h-65px py-12px px-17px text-gray-800 items-center">
astone123 marked this conversation as resolved.
Show resolved Hide resolved
<div>
<Icon
astone123 marked this conversation as resolved.
Show resolved Hide resolved
name="general-grid-2x2"
size="16"
/>
</div>
<div class="ml-15px">
{{ t("setupPage.projectSetup.frameworkNotListed") }}
<ExternalLink
href="https://on.cypress.io/component-integrations"
astone123 marked this conversation as resolved.
Show resolved Hide resolved
class="text-indigo-500 block hocus-link-default group"
>
{{ t('setupPage.projectSetup.browseIntegrations') }}<i-cy-arrow-right_x16
class="ml-4px transform transition-transform ease-in -translate-y-1px duration-200 inline-block icon-dark-current group-hocus:translate-x-2px"
/>
</ExternalLink>
</div>
</div>
</template>

<script lang="ts" setup>
import { useI18n } from '@cy/i18n'
import ExternalLink from '@packages/frontend-shared/src/gql-components/ExternalLink.vue'
import Icon from '@cypress-design/vue-icon'

const { t } = useI18n()

</script>
7 changes: 7 additions & 0 deletions packages/launchpad/src/setup/SelectFwOrBundler.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@
v-html="itemValue.icon"
/>
</template>
<template
astone123 marked this conversation as resolved.
Show resolved Hide resolved
v-if="selectorType === 'framework'"
#footer
>
<FrameworkOptionsFooter />
</template>
</Select>
</template>

Expand All @@ -88,6 +94,7 @@ import type {
import { useI18n } from '@cy/i18n'
import AlphaLabel from './AlphaLabel.vue'
import CommunityLabel from './CommunityLabel.vue'
import FrameworkOptionsFooter from './FrameworkOptionsFooter.vue'

const { t } = useI18n()

Expand Down