Repository navigation
feat(website): link each workshop app to its GitHub repository #19313
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
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
be05fd4
feat(website): link each workshop app to its GitHub repository
mariana953 feda46f
refactor(website): keep app repos with the other external links
mariana953 1a02b50
test(website): cover the GitHub placeholder on both app pages
mariana953 5e08167
test(website): expect exactly one GitHub placeholder per app page
mariana953 46412ec
Merge remote-tracking branch 'origin/main' into mariana/app-repo-link
mariana953 1500db3
Merge remote-tracking branch 'origin/main' into mariana/app-repo-link
mariana953 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
apps/website/src/components/workshop/cinematic-studio/AppRepoLink.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import { render, screen } from '@testing-library/vue' | ||
| import { describe, expect, it } from 'vitest' | ||
|
|
||
| import AppRepoLink from './AppRepoLink.vue' | ||
|
|
||
| describe('AppRepoLink', () => { | ||
| it('opens the app repository on GitHub in a new tab', () => { | ||
| render(AppRepoLink, { | ||
| props: { repo: 'https://github.com/Comfy-Org/comfy-examples' } | ||
| }) | ||
|
|
||
| const link = screen.getByRole('link', { name: 'View on GitHub' }) | ||
| expect(link).toHaveAttribute( | ||
| 'href', | ||
| 'https://github.com/Comfy-Org/comfy-examples' | ||
| ) | ||
| expect(link).toHaveAttribute('target', '_blank') | ||
| expect(link).toHaveAttribute('rel', 'noopener noreferrer') | ||
| }) | ||
|
|
||
| it('renders no link until the repository exists', () => { | ||
| render(AppRepoLink) | ||
|
|
||
| expect(screen.getByText(/GitHub/)).toBeInTheDocument() | ||
| expect(screen.queryByRole('link')).toBeNull() | ||
| }) | ||
| }) |
37 changes: 37 additions & 0 deletions
37
apps/website/src/components/workshop/cinematic-studio/AppRepoLink.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| <script setup lang="ts"> | ||
| import { ArrowUpRight } from '@lucide/vue' | ||
|
|
||
| import { cn } from '@comfyorg/tailwind-utils' | ||
|
|
||
| import type { Locale } from '../../../i18n/translations' | ||
| import { tc } from '../../../lib/workshop/cinematic-studio/copy' | ||
|
|
||
| const { repo, locale = 'en' } = defineProps<{ | ||
| repo?: string | ||
| locale?: Locale | ||
| }>() | ||
| </script> | ||
|
|
||
| <template> | ||
| <component | ||
| :is="repo ? 'a' : 'span'" | ||
| :href="repo" | ||
| :target="repo && '_blank'" | ||
| :rel="repo && 'noopener noreferrer'" | ||
| :class=" | ||
| cn( | ||
| 'inline-flex h-9 shrink-0 items-center gap-2 rounded-xl border px-3.5 text-sm font-medium', | ||
| repo | ||
| ? 'border-transparency-white-t20 bg-transparency-white-t4 text-primary-warm-white transition hover:border-primary-comfy-yellow hover:text-primary-comfy-yellow focus-visible:ring-3 focus-visible:ring-primary-comfy-yellow/50 focus-visible:outline-none' | ||
| : 'border-transparency-white-t8 text-primary-warm-gray' | ||
| ) | ||
| " | ||
| > | ||
| <span | ||
| class="size-4 icon-mask mask-[url('/icons/social/github.svg')]" | ||
| aria-hidden="true" | ||
| /> | ||
| {{ tc(repo ? 'cinematic.repo.view' : 'cinematic.repo.soon', locale) }} | ||
| <ArrowUpRight v-if="repo" class="size-3.5" aria-hidden="true" /> | ||
| </component> | ||
| </template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 14 additions & 5 deletions
19
apps/website/src/components/workshop/cinematic-studio/reshoot/ReshootHeader.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.