Skip to content

Commit

Permalink
plugin-catalog: Fix format/linting issues
Browse files Browse the repository at this point in the history
With npm run lint -- --fix.

Signed-off-by: Joaquim Rocha <joaquim.rocha@microsoft.com>
  • Loading branch information
joaquimrocha committed Jul 25, 2024
1 parent c7489a0 commit 1559c8e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 32 deletions.
37 changes: 14 additions & 23 deletions plugin-catalog/src/components/plugins/Detail.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { PluginManager, Router } from '@kinvolk/headlamp-plugin/lib';
import {
ActionButton,
Link as HeadlampLink,
Loader,
NameValueTable,
SectionBox,
SectionHeader,
Link as HeadlampLink,
} from '@kinvolk/headlamp-plugin/lib/components/common';
import { Button, CardMedia, Link, Snackbar, Tooltip, Typography } from '@mui/material';
import Markdown from 'markdown-to-jsx';
Expand Down Expand Up @@ -141,8 +141,7 @@ export function PurePluginDetail({
`${artifactHubURLBase}&repo=${pluginDetail.repository.name}`,
`${artifactHubURLBase}&org=${pluginDetail.repository.organization_name}`,
];
},
[pluginDetail]);
}, [pluginDetail]);

return (
<>
Expand Down Expand Up @@ -181,18 +180,14 @@ export function PurePluginDetail({
}}
component="img"
/>
)
),
]}
actions={[
currentAction === null ? (
pluginDetail ? (
pluginDetail.isInstalled ? (
<>
<HeadlampLink
routeName='plugins'
>
Settings
</HeadlampLink>
<HeadlampLink routeName="plugins">Settings</HeadlampLink>
{pluginDetail.updateAvailable && (
<ActionButton
description="Update"
Expand Down Expand Up @@ -256,23 +251,19 @@ export function PurePluginDetail({
},
{
name: 'Repository',
value: (
repoUrl && (
<Link href={repoUrl} target="_blank">
{pluginDetail.repository.display_name}
</Link>
)
)
value: repoUrl && (
<Link href={repoUrl} target="_blank">
{pluginDetail.repository.display_name}
</Link>
),
},
{
name: 'Author',
value: (
orgUrl && (
<Link href={orgUrl} target="_blank">
{pluginDetail.repository.organization_display_name}
</Link>
)
)
value: orgUrl && (
<Link href={orgUrl} target="_blank">
{pluginDetail.repository.organization_display_name}
</Link>
),
},
]}
/>
Expand Down
2 changes: 1 addition & 1 deletion plugin-catalog/src/components/plugins/InstalledList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function PurePluginInstalledList({ installedPlugins, error }: PurePluginI
getter: plugin => plugin.author,
},
]}
emptyMessage='No plugins installed'
emptyMessage="No plugins installed"
data={installedPlugins || []}
/>
)}
Expand Down
15 changes: 8 additions & 7 deletions plugin-catalog/src/components/plugins/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ async function processPlugins() {
let pluginData = [];
try {
pluginData = await PluginManager.list();
} catch(err) {
} catch (err) {
console.log('plugin-catalog: Failed to list plugins', err);
}
const installedPlugins = pluginData.map((plugin: any) => plugin.folderName);
Expand All @@ -131,12 +131,13 @@ async function processPlugins() {
new Map(mergedPlugins.map(plugin => [plugin.package_id, plugin])).values()
);

const pluginsWithInstallStatus = uniquePlugins.map((pkg: PluginPackage) => ({
...pkg,
isInstalled: installedPlugins.includes(pkg.name),
}))
// Reorder so plugins with logos show first.
.sort((a, b) => (!!b.logo_image_id ? 1 : 0) - (!!a.logo_image_id ? 1 : 0));
const pluginsWithInstallStatus = uniquePlugins
.map((pkg: PluginPackage) => ({
...pkg,
isInstalled: installedPlugins.includes(pkg.name),
}))
// Reorder so plugins with logos show first.
.sort((a, b) => (!!b.logo_image_id ? 1 : 0) - (!!a.logo_image_id ? 1 : 0));

const totalPages = Math.ceil(pluginsWithInstallStatus.length / PAGE_SIZE);

Expand Down
2 changes: 1 addition & 1 deletion plugin-catalog/src/components/plugins/PluginCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface PluginCardProps {
}

export function PluginCard(props: PluginCardProps) {
const {plugin} = props;
const { plugin } = props;

return (
<Box maxWidth="30%" width="400px" m={1}>
Expand Down

0 comments on commit 1559c8e

Please sign in to comment.