Skip to content

Commit 2f52a4f

Browse files
authored
Merge pull request #315 from Cahllagerfeld/cahllagerfeld/adjustments
Updates
2 parents 3a4b3f3 + f9c0cce commit 2f52a4f

File tree

7 files changed

+26
-27
lines changed

7 files changed

+26
-27
lines changed

src/ui/assets/plugin-fallback.svg

Lines changed: 6 additions & 0 deletions
Loading

src/ui/layouts/plugins/ListPlugins/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { DEFAULT_WORKSPACE_NAME, iconColors } from '../../../../constants';
2121
import { debounce } from '../../../../utils/memo';
2222
import { PluginsLayout } from '../shared/Layout';
2323
import { useHubToken, useHubUser } from '../../../hooks/auth';
24-
import ZenMLLogo from '../../../assets/logo.svg';
24+
import PluginFallbackImage from '../../../assets/plugin-fallback.svg';
2525
import { getPlugins, getStarredPlugins, starPlugin } from '../api';
2626
import { hubConnectionPromptActionTypes } from '../../../../redux/actionTypes';
2727
import { Filters } from './Filters';
@@ -161,7 +161,7 @@ const ListPlugins: React.FC = () => {
161161
)}
162162
{/* logo */}
163163
<img
164-
src={p.logo_url || ZenMLLogo}
164+
src={p.logo_url || PluginFallbackImage}
165165
alt={`${p.name} logo`}
166166
style={{
167167
height: '80px',

src/ui/layouts/plugins/PluginDetail/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import {
3535
// deletePlugin,
3636
} from '../api';
3737
import { hubConnectionPromptActionTypes } from '../../../../redux/actionTypes';
38-
import ZenMLLogo from '../../../assets/logo.svg';
38+
import PluginFallbackImage from "../../../assets/plugin-fallback.svg"
3939
import { OverviewTab } from './OverviewTab';
4040

4141
export const translate = getTranslateByScope('ui.layouts.Plugins.list');
@@ -133,7 +133,7 @@ const PluginDetail: React.FC = () => {
133133
}}
134134
>
135135
<img
136-
src={plugin.logo_url || ZenMLLogo}
136+
src={plugin.logo_url || PluginFallbackImage}
137137
alt={`${plugin.name} logo`}
138138
style={{
139139
height: '80px',

src/ui/layouts/plugins/UpdatePlugin/index.tsx

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const UpdatePlugin: React.FC = () => {
4949
const [releaseNotes, setReleaseNotes] = useState('');
5050

5151
useEffect(() => {
52-
getPlugin(pluginId).then((p) => {
52+
getPlugin(pluginId, false).then((p) => {
5353
setPlugin(p);
5454
if (!repositoryUrl) setRepositoryUrl(p.repository_url);
5555
if (!repositoryBranch && p.repository_branch)
@@ -214,20 +214,6 @@ const UpdatePlugin: React.FC = () => {
214214
/>
215215
</Box>
216216

217-
{/* logo URL */}
218-
<Box marginBottom="lg">
219-
<InputWithLabel
220-
label="Logo URL (optional)"
221-
InputComponent={
222-
<TextInput
223-
value={logoUrl}
224-
onChangeText={setLogoUrl}
225-
placeholder="Logo URL"
226-
/>
227-
}
228-
/>
229-
</Box>
230-
231217
{/* release notes */}
232218
<Box marginBottom="lg">
233219
<InputWithLabel

src/ui/layouts/plugins/api.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,16 @@ const addCanonicalUrl = <X extends TPluginDetail | TPluginVersion>(
2424
return plugin;
2525
};
2626

27-
export const getPlugin = async (pluginId: string): Promise<TPluginDetail> => {
27+
export const getPlugin = async (
28+
pluginId: string,
29+
available = true,
30+
): Promise<TPluginDetail> => {
2831
const plugin = (
29-
await axios.get(`${HUB_API_URL}/plugins/${pluginId}?status=available`)
32+
await axios.get(
33+
`${HUB_API_URL}/plugins/${pluginId}${
34+
available ? '?status=available' : ''
35+
}`,
36+
)
3037
).data as TPluginDetail;
3138
return addCanonicalUrl(plugin);
3239
};

src/ui/layouts/settings/PluginCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import { useHistory } from 'react-router-dom';
33

44
import { Box, LinkBox, Paragraph } from '../../components';
5-
import ZenMLLogo from '../../assets/logo.svg';
5+
import PluginFallbackImage from '../../assets/plugin-fallback.svg';
66

77
export const PluginCard: React.FC<{
88
title: string;
@@ -34,7 +34,7 @@ export const PluginCard: React.FC<{
3434
>
3535
<div>
3636
<img
37-
src={logoUrl ?? ZenMLLogo}
37+
src={logoUrl ?? PluginFallbackImage}
3838
alt={`${title} logo`}
3939
style={{
4040
maxWidth: '60%',

src/ui/layouts/settings/Plugins.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { HUB_API_URL } from '../../../api/constants';
2121
import { useHubToken } from '../../hooks/auth';
2222
import { useHistory, useToaster } from '../../hooks';
2323
import { EmptyState } from '../common/EmptyState';
24-
import ZenMLLogo from '../../assets/logo.svg';
24+
import PluginFallbackImage from '../../assets/plugin-fallback.svg';
2525
import { hubConnectionPromptActionTypes } from '../../../redux/actionTypes';
2626

2727
type AugmentedPluginVersion = TPluginVersion & {
@@ -134,7 +134,7 @@ export const Plugins: React.FC = () => {
134134
>
135135
{/* image */}
136136
<img
137-
src={p.logo_url || ZenMLLogo}
137+
src={p.logo_url || PluginFallbackImage}
138138
alt={`${p.name} logo`}
139139
style={{
140140
width: '80px',
@@ -214,7 +214,7 @@ export const Plugins: React.FC = () => {
214214
{m.plugins.map((p, i) => (
215215
<PluginCard
216216
key={i}
217-
logoUrl={p.logo_url || ZenMLLogo}
217+
logoUrl={p.logo_url || PluginFallbackImage}
218218
title={p.name}
219219
description={`${p.version}: ${
220220
p.description ?? 'No plugin description'
@@ -249,7 +249,7 @@ export const Plugins: React.FC = () => {
249249
{m.plugins.map((p, i) => (
250250
<PluginCard
251251
key={i}
252-
logoUrl={p.logo_url || ZenMLLogo}
252+
logoUrl={p.logo_url || PluginFallbackImage}
253253
title={p.name}
254254
description={`${p.version}: ${
255255
p.description ?? 'No plugin description'

0 commit comments

Comments
 (0)