-
Notifications
You must be signed in to change notification settings - Fork 638
New bottom button and badges #8603
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
Changes from 24 commits
d0cfb15
a17436b
19dae0e
a1147e2
ff40bfd
38bc520
2236888
0dafeff
482c5c0
8591f25
b3ab82e
c45ed2f
ffcfd01
374875e
fcb6c6d
52b91e7
48ce8f8
afed8cb
dde1f88
3357656
85dcf99
8f6aa9d
2a735f6
039cef1
a2ed617
190b93d
3495e1d
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 |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| <script setup lang="ts"> | ||
| import Button from '@/components/ui/button/Button.vue' | ||
| import { useCopyToClipboard } from '@/composables/useCopyToClipboard' | ||
| import { t } from '@/i18n' | ||
|
Contributor
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. Fix: Use This import is flagged by the linter ( 🔧 Proposed fix-import { t } from '@/i18n'And in the template: - {{ t('g.copy') }}
+ {{ $t('g.copy') }}🧰 Tools🪛 ESLint[error] 4-4: 't' import from '@/i18n' is restricted. In Vue components, use (no-restricted-imports) 🪛 GitHub Actions: CI: Lint Format[error] 4-4: no-restricted-imports: 't' import from '@/i18n' is restricted. In Vue components, use 'const { t } = useI18n()' instead of importing from '@/i18n' 🪛 GitHub Check: lint-and-format[failure] 4-4: 🤖 Prompt for AI Agents
Contributor
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. @coderabbitai. Recommend vue-i18n's composable instead.
Contributor
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.
The fix should be: Remove: import { t } from '@/i18n'Add: import { useI18n } from 'vue-i18n'
const { t } = useI18n()Then keep the template usage as This follows the ESLint rule and the composition API pattern used throughout the codebase. I notice I have a learning (ID: 8a55639a-69b7-4e92-939e-931c51888c8a) that suggests using 🧠 Learnings used |
||
| import type { NodeError } from '@/schemas/apiSchema' | ||
| defineProps<{ | ||
| errors: NodeError[] | ||
| }>() | ||
| const { copyToClipboard } = useCopyToClipboard() | ||
| </script> | ||
| <template> | ||
| <div class="m-4"> | ||
| <Button class="w-full" @click="copyToClipboard(JSON.stringify(errors))"> | ||
| {{ t('g.copy') }} | ||
| <i class="icon-[lucide--copy] size-4" /> | ||
| </Button> | ||
| </div> | ||
| <div | ||
| v-for="(error, index) in errors.flatMap((ne) => ne.errors)" | ||
| :key="index" | ||
| class="px-2" | ||
| > | ||
| <h3 class="text-error" v-text="error.message" /> | ||
| <div class="text-muted-foreground" v-text="error.details" /> | ||
| </div> | ||
| </template> | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -36,7 +36,9 @@ export const usePriceBadge = () => { | |||||
| return badges | ||||||
| } | ||||||
|
|
||||||
| function isCreditsBadge(badge: LGraphBadge | (() => LGraphBadge)): boolean { | ||||||
| function isCreditsBadge( | ||||||
| badge: Partial<LGraphBadge> | (() => LGraphBadge) | ||||||
|
Contributor
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. Should we setup our own utility like MaybeRefOrGetter but without Ref?
Suggested change
Collaborator
Author
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. Will keep an eye on it. It probably makes for better code if we just accept
Contributor
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. I'm for it. |
||||||
| ): boolean { | ||||||
| const badgeInstance = typeof badge === 'function' ? badge() : badge | ||||||
| return badgeInstance.icon?.image === componentIconSvg | ||||||
| } | ||||||
|
|
@@ -61,6 +63,7 @@ export const usePriceBadge = () => { | |||||
| } | ||||||
| return { | ||||||
| getCreditsBadge, | ||||||
| isCreditsBadge, | ||||||
| updateSubgraphCredits | ||||||
| } | ||||||
| } | ||||||
Uh oh!
There was an error while loading. Please reload this page.