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

feat(unify): add growth prompts #18626

Merged
merged 61 commits into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
ba09ea5
wip Install Dependencies styles
marktnoonan Oct 20, 2021
4e68fc7
add clipboard icon
marktnoonan Oct 20, 2021
463b81f
add tertiary Button variant from figma
marktnoonan Oct 20, 2021
3901440
position button
marktnoonan Oct 20, 2021
4d7598b
change copy button to script setup, use button for status message
marktnoonan Oct 20, 2021
3881d2c
additional styling
marktnoonan Oct 20, 2021
84425e8
wrap up install dependencies style
marktnoonan Oct 20, 2021
6d6525f
restore cypress.json
marktnoonan Oct 20, 2021
3386440
update test for new expectations
marktnoonan Oct 20, 2021
f7e05e8
move TranisitionQuickFade to frontend shared
marktnoonan Oct 20, 2021
9ae6eb1
fix width measurement
marktnoonan Oct 20, 2021
9b73f7b
Merge branch 'unified-desktop-gui' into UNIFY-355-install-dependencie…
marktnoonan Oct 20, 2021
dbaf910
remove example generated plugins file
marktnoonan Oct 20, 2021
e905bd5
Merge branch 'unified-desktop-gui' into UNIFY-355-install-dependencie…
marktnoonan Oct 20, 2021
fc01b0c
Add Fira Mono font and use for monospace font-family
marktnoonan Oct 21, 2021
bd33d99
use useClipboard for copy button
marktnoonan Oct 21, 2021
f0a924f
fix testing type button
marktnoonan Oct 21, 2021
e0644e5
dial in font for monospace
marktnoonan Oct 21, 2021
29a1c10
Merge branch 'unified-desktop-gui' into UNIFY-355-install-dependencie…
marktnoonan Oct 21, 2021
5bf4e2a
style tweak
marktnoonan Oct 21, 2021
f038787
remove unused tabindex attr
marktnoonan Oct 21, 2021
cb92ec0
switch to Fira Code instead of Fira Mono
marktnoonan Oct 21, 2021
2fcaa7f
remove unusued component
marktnoonan Oct 21, 2021
843f07d
tweak some sizes around copy button
marktnoonan Oct 21, 2021
8267d1a
remove PackagesList fragment
marktnoonan Oct 21, 2021
fd6f2bb
some setup to get prompt info exposed in gql
marktnoonan Oct 21, 2021
7ee3c69
some mock data for prompts
marktnoonan Oct 22, 2021
c196170
remove prompts wip
marktnoonan Oct 22, 2021
8c8b173
Merge branch 'unified-desktop-gui' into UNIFY-355-install-dependencie…
marktnoonan Oct 22, 2021
ef62e59
line break
marktnoonan Oct 22, 2021
de8faf3
add empty growth modal component
marktnoonan Oct 22, 2021
0b10629
wip swapping content docs menu for growth links
marktnoonan Oct 22, 2021
0ac72ef
wip swapping content docs menu for growth links
marktnoonan Oct 22, 2021
a627fd7
add CI provider logos
marktnoonan Oct 22, 2021
202cfb1
get basic growth menu CI details populating
marktnoonan Oct 22, 2021
29f3f62
flesh out UI for configure CI growth popup
marktnoonan Oct 22, 2021
fbfc897
remove unused import
marktnoonan Oct 22, 2021
32ca376
allow button to render as link if it receives a "href" prop
marktnoonan Oct 24, 2021
2dab6a5
get basic orchestration content rendering
marktnoonan Oct 24, 2021
3291a27
split up display in of growth popups
marktnoonan Oct 24, 2021
14b88da
add logic to avoid rendering empty slot wrapper
marktnoonan Oct 24, 2021
d591d52
add lightning icon
marktnoonan Oct 24, 2021
02abe25
UI cleanup & i18n
marktnoonan Oct 24, 2021
9dd990b
add target to link-button
marktnoonan Oct 24, 2021
9fad2a8
basic component test
marktnoonan Oct 25, 2021
bf237ee
convert ci buttons to use Button
marktnoonan Oct 25, 2021
092b82a
reset prompts as needed
marktnoonan Oct 25, 2021
c6897fb
Merge branch 'unified-desktop-gui' into UNIFY-406-growth-modal
marktnoonan Oct 25, 2021
926beff
split out url helper
marktnoonan Oct 25, 2021
89fe039
split out docs menu content from topnav
marktnoonan Oct 25, 2021
2ca33b2
split out docs menu content from topnav
marktnoonan Oct 25, 2021
c12f3b9
use url helper to add params
marktnoonan Oct 25, 2021
a7f1aec
only show growth prompts when a project has been chosen
marktnoonan Oct 25, 2021
327744f
cleanup
marktnoonan Oct 25, 2021
3d23aea
update test
marktnoonan Oct 25, 2021
b2f7575
fix .ts imports
marktnoonan Oct 25, 2021
2225e1d
finish up params in growth prompts
marktnoonan Oct 25, 2021
73a34b3
add animation
marktnoonan Oct 25, 2021
66aa495
docs menu link styles
marktnoonan Oct 25, 2021
a86e69b
add aria live region
marktnoonan Oct 25, 2021
20434c5
feat: removing style tag and using tailwind for animation
JessicaSachs Oct 25, 2021
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/frontend-shared/src/assets/icons/lightning_x16.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions packages/frontend-shared/src/assets/logos/aws-codebuild.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/frontend-shared/src/assets/logos/bitbucket.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions packages/frontend-shared/src/assets/logos/circleci.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/frontend-shared/src/assets/logos/github-actions.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions packages/frontend-shared/src/assets/logos/gitlab.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
93 changes: 68 additions & 25 deletions packages/frontend-shared/src/components/Button.vue
Original file line number Diff line number Diff line change
@@ -1,39 +1,80 @@
<template>
<button
v-if="!href"
style="width: fit-content"
class="flex select-none items-center border rounded gap-8px outline-none"
:class="classes"
>
<span
v-if="prefixIcon || $slots.prefix"
class="justify-self-start flex items-center"
>
<slot name="prefix">
<component
:is="prefixIcon"
:class="prefixIconClass"
/>
</slot>
</span>
<span class="flex-grow">
<slot />
</span>
<span
v-if="suffixIcon || $slots.suffix"
class="justify-self-start flex items-center"
>
<slot name="suffix">
<component
:is="suffixIcon"
:class="suffixIconClass"
/>
</slot>
</span>
<ButtonInternals>
<template
v-if="prefixIcon || $slots.prefix"
#prefix
>
<slot name="prefix">
<component
:is="prefixIcon"
:class="prefixIconClass"
/>
</slot>
</template>
<template #default>
<slot />
</template>
<template
v-if="suffixIcon || $slots.suffix"
#suffix
>
<slot name="suffix">
<component
:is="suffixIcon"
:class="suffixIconClass"
/>
</slot>
</template>
</ButtonInternals>
</button>
<a
v-else
:href="href"
style="width: fit-content"
class="flex select-none items-center border rounded gap-8px outline-none"
:class="classes"
:target="internalLink ? '' : '_blank'"
>
<ButtonInternals>
<template
v-if="prefixIcon || $slots.prefix"
#prefix
>
<slot name="prefix">
<component
:is="prefixIcon"
:class="prefixIconClass"
/>
</slot>
</template>
<template #default>
<slot />
</template>
<template #suffix>
<slot
v-if="suffixIcon || $slots.suffix"
name="suffix"
>
<component
:is="suffixIcon"
:class="suffixIconClass"
/>
</slot>
</template>

</ButtonInternals>
</a>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import ButtonInternals from './ButtonInternals.vue'

export default defineComponent({
inheritAttrs: true,
Expand Down Expand Up @@ -71,6 +112,8 @@ const props = defineProps<{
variant?: 'primary' | 'tertiary' | 'outline' | 'link' | 'text' | 'pending'
prefixIconClass?: string
suffixIconClass?: string
href?: string // will cause the button to render as link element with button styles
internalLink?: boolean
}>()

const attrs = useAttrs() as ButtonHTMLAttributes
Expand Down
49 changes: 49 additions & 0 deletions packages/frontend-shared/src/components/ButtonInternals.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<template>
<span
v-if="prefixIcon || $slots.prefix"
class="justify-self-start flex items-center"
>
<slot name="prefix">
<component
:is="prefixIcon"
:class="prefixIconClass"
/>
</slot>
</span>
<span class="flex-grow">
<slot />
</span>
<span
v-if="suffixIcon || $slots.suffix"
class="justify-self-start flex items-center"
>
<slot name="suffix">
<component
:is="suffixIcon"
:class="suffixIconClass"
/>
</slot>
</span>
</template>

<script lang="ts">
import { defineComponent } from 'vue'

export default defineComponent({
inheritAttrs: true,
})
</script>

<script lang="ts" setup>

// eslint-disable-next-line no-duplicate-imports
import type { FunctionalComponent, SVGAttributes } from 'vue'

const props = defineProps<{
prefixIcon?: FunctionalComponent<SVGAttributes>
suffixIcon?: FunctionalComponent<SVGAttributes>
prefixIconClass?: string
suffixIconClass?: string
}>()

</script>
23 changes: 22 additions & 1 deletion packages/frontend-shared/src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,28 @@
"ciTitle": "Run in CI/CD",
"ciSetup": "Set up CI",
"fasterTests": "Run tests faster",
"smartOrchestration": "Smart Orchestration"
"smartOrchestration": "Smart Orchestration",
"prompts": {
"ci": {
"title": "Configure CI",
"description": "Optimize your tests in CI by following these guides.",
"seeOtherGuides": "See Other Guides",
"intro": "Introduction to CI",
"learnTheBasics": "Learn the basics of running Cypress in CI."
},
"orchestration": {
"title": "Run tests faster in CI",
"parallelTime": "5 mins",
"noParallelTime": "12 mins",
"withParallelization": "with Parallelization",
"withoutParallelization": "without Parallelization",
"intro": " With Smart Orchestration, you’ll be able to:",
"bullet1": "Run spec files in parallel",
"bullet2": "Prioritize failed specs to run first",
"bullet3": "Cancel CI runs on test failure",
"learnMore": "Learn more"
}
}
},
"login": {
"bodyInitial": "Logging in gives you access to the {0}. You can set up projects to be recorded and see test data from your project.",
Expand Down
14 changes: 14 additions & 0 deletions packages/frontend-shared/src/utils/getUrlWithParams.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export type LinkWithParams = {
url: string
params: { [key: string]: string }
}

export const getUrlWithParams = (link: LinkWithParams) => {
let result = link.url

if (link.params) {
result += `?${new URLSearchParams(link.params).toString()}`
}

return result
}
Loading