Skip to content

Commit a2f9806

Browse files
fix: zenml exception(#316)
1 parent 4e37c60 commit a2f9806

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ const ListPlugins: React.FC = () => {
187187
}}
188188
>
189189
<span title={`${p.author}/${p.name}`}>
190-
{p.author}/{p.name}
190+
{p.author === 'ZenML' ? '' : `${p.author}/`}
191+
{p.name}
191192
</span>
192193
</H4>
193194

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

Lines changed: 15 additions & 18 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 PluginFallbackImage from "../../../assets/plugin-fallback.svg"
38+
import PluginFallbackImage from '../../../assets/plugin-fallback.svg';
3939
import { OverviewTab } from './OverviewTab';
4040

4141
export const translate = getTranslateByScope('ui.layouts.Plugins.list');
@@ -60,7 +60,9 @@ const PluginDetail: React.FC = () => {
6060

6161
const isOwner = hubUser?.id === plugin?.user.id;
6262
const installationCommand = plugin
63-
? `zenml hub install ${plugin.user.username}/${plugin.name}:${plugin.version}`
63+
? `zenml hub install ${
64+
plugin.author === 'ZenML' ? '' : `${plugin.author}/`
65+
}${plugin.name}:${plugin.version}`
6466
: '';
6567
const installCommand = !plugin ? '' : installationCommand;
6668

@@ -440,10 +442,7 @@ const PluginDetail: React.FC = () => {
440442
<Paragraph style={{ marginBottom: '8px' }}>
441443
ZenML install
442444
</Paragraph>
443-
<Paragraph
444-
size="tiny"
445-
style={{ marginBottom: '8px' }}
446-
>
445+
<Paragraph style={{ marginBottom: '8px' }}>
447446
The easiest way to install this plugin is to use
448447
our ZenML CLI tool.
449448
</Paragraph>
@@ -455,10 +454,7 @@ const PluginDetail: React.FC = () => {
455454
<Paragraph style={{ marginBottom: '8px' }}>
456455
Pip install
457456
</Paragraph>
458-
<Paragraph
459-
size="tiny"
460-
style={{ marginBottom: '8px' }}
461-
>
457+
<Paragraph style={{ marginBottom: '8px' }}>
462458
You can also install this plugin directly from
463459
pip with these commands.
464460
</Paragraph>
@@ -477,16 +473,17 @@ const PluginDetail: React.FC = () => {
477473
<Paragraph style={{ marginBottom: '8px' }}>
478474
Usage
479475
</Paragraph>
480-
<Paragraph
481-
size="tiny"
482-
style={{ marginBottom: '8px' }}
483-
>
476+
<Paragraph style={{ marginBottom: '8px' }}>
484477
{
485478
"Once you've installed the plugin, import it as a Python library"
486479
}
487480
</Paragraph>
488481
<DisplayCode
489-
code={`from zenml.hub.${plugin.user.username}.${plugin.name} import *`}
482+
code={`from zenml.hub.${
483+
plugin.author === 'ZenML'
484+
? ''
485+
: `${plugin.author}.`
486+
}${plugin.name} import *`}
490487
/>
491488
</Box>
492489
</Box>
@@ -655,11 +652,11 @@ const PluginDetail: React.FC = () => {
655652
<a
656653
href={
657654
routePaths.plugins.list(selectedWorkspace) +
658-
`?author=${plugin.user.username}`
655+
`?author=${plugin.author}`
659656
}
660657
style={{ color: 'inherit' }}
661658
>
662-
{plugin.user.username}
659+
{plugin.author}
663660
</a>
664661
</Paragraph>
665662
</Box>
@@ -715,7 +712,7 @@ const PluginDetail: React.FC = () => {
715712
<a
716713
href={
717714
routePaths.plugins.list(selectedWorkspace) +
718-
`?author=${plugin.user.username}`
715+
`?author=${plugin.author}`
719716
}
720717
style={{ color: 'inherit' }}
721718
>

0 commit comments

Comments
 (0)