mirror of
https://github.com/langgenius/dify.git
synced 2026-05-03 08:58:09 +08:00
feat: public type
This commit is contained in:
@ -220,6 +220,16 @@ describe('TemplateCard', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('Creator Link', () => {
|
||||
it('should append publisher_type query to creator link', () => {
|
||||
const template = createMockTemplate({ publisher_type: 'organization' })
|
||||
const { getByText } = render(<TemplateCard template={template} />)
|
||||
|
||||
const creatorLink = getByText('test-publisher').closest('a')
|
||||
expect(creatorLink).toHaveAttribute('href', '/creators/test-publisher?publisher_type=organization')
|
||||
})
|
||||
})
|
||||
|
||||
describe('Deps Plugins', () => {
|
||||
it('should render dep plugin icons', () => {
|
||||
const template = createMockTemplate({
|
||||
|
||||
@ -29,7 +29,7 @@ const TemplateCardComponent = ({
|
||||
const locale = useLocale()
|
||||
const { t } = useTranslation()
|
||||
const { theme } = useTheme()
|
||||
const { id, template_name, overview, icon, publisher_handle, usage_count, icon_background, deps_plugins, kind } = template
|
||||
const { id, template_name, overview, icon, publisher_handle, publisher_type, usage_count, icon_background, deps_plugins, kind } = template
|
||||
const isSandbox = kind === 'sandboxed'
|
||||
const iconUrl = getTemplateIconUrl(template)
|
||||
|
||||
@ -74,7 +74,7 @@ const TemplateCardComponent = ({
|
||||
<span className="flex shrink-0 items-center gap-1">
|
||||
<span className="shrink-0">{t('marketplace.templateCard.by', { ns: 'plugin' })}</span>
|
||||
<Link
|
||||
href={`/creators/${publisher_handle}`}
|
||||
href={`/creators/${publisher_handle}?publisher_type=${encodeURIComponent(publisher_type || 'individual')}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="truncate hover:text-text-secondary hover:underline"
|
||||
|
||||
Reference in New Issue
Block a user