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

Add Community tag to plugins #2982

Merged
merged 1 commit into from
Jan 19, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
13 changes: 13 additions & 0 deletions frontend/src/scenes/plugins/CommunityPluginTag.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react'
import { Tag } from 'antd'

export function CommunityPluginTag({ isCommunity }: { isCommunity?: boolean }): JSX.Element {
return (
<Tag
color={isCommunity ? 'green' : 'blue'}
style={{ maxWidth: '30%', position: 'absolute', right: 15, top: 15 }}
>
{isCommunity ? 'Community' : 'Core Team'}
</Tag>
)
}
1 change: 1 addition & 0 deletions frontend/src/scenes/plugins/InstalledPlugins.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export function InstalledPlugins(): JSX.Element {
pluginType={plugin.plugin_type}
pluginConfig={plugin.pluginConfig}
error={plugin.error}
maintainer={plugin.maintainer || 'community'}
/>
)
})}
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/scenes/plugins/PluginCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { PluginError } from 'scenes/plugins/PluginError'
import { LocalPluginTag } from 'scenes/plugins/LocalPluginTag'
import { PluginInstallationType } from 'scenes/plugins/types'
import { SourcePluginTag } from 'scenes/plugins/SourcePluginTag'
import { CommunityPluginTag } from './CommunityPluginTag'

interface PluginCardProps {
name: string
Expand All @@ -20,6 +21,7 @@ interface PluginCardProps {
pluginType?: PluginInstallationType
pluginId?: number
error?: PluginErrorType
maintainer: string
}

export function PluginCard({
Expand All @@ -30,6 +32,7 @@ export function PluginCard({
pluginConfig,
pluginId,
error,
maintainer,
}: PluginCardProps): JSX.Element {
const { editPlugin, toggleEnabled, installPlugin, resetPluginConfigError } = useActions(pluginsLogic)
const { loading } = useValues(pluginsLogic)
Expand Down Expand Up @@ -60,6 +63,7 @@ export function PluginCard({
style={{ height: '100%', display: 'flex', marginBottom: 20 }}
bodyStyle={{ display: 'flex', flexDirection: 'column', flexGrow: 1 }}
>
{!pluginId && <CommunityPluginTag isCommunity={maintainer === 'community'} />}
{pluginType === 'source' ? (
<SourcePluginTag style={{ position: 'absolute', top: 10, left: 10, cursor: 'pointer' }} />
) : null}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/scenes/plugins/Repository.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export function Repository(): JSX.Element {
name={plugin.name}
url={plugin.url}
description={plugin.description}
maintainer={plugin.maintainer}
/>
)
})}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ export interface PluginType {
config_schema: Record<string, PluginConfigSchema> | PluginConfigSchema[]
source?: string
error?: PluginErrorType
maintainer?: string
}

export interface PluginConfigType {
Expand Down