Skip to content

Commit

Permalink
added revamped design
Browse files Browse the repository at this point in the history
  • Loading branch information
duplixx committed Nov 13, 2024
1 parent afd1fa6 commit 323a0c7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 7 additions & 4 deletions src/components/AddOn/core/AddOnStore/AddOnStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ function addOnStore(): JSX.Element {
const { data, loading } = useQuery<{ getPlugins: InterfacePluginHelper[] }>(
PLUGIN_GET,
);
console.log(data);

const { orgId } = useParams<{ orgId: string }>();

Expand All @@ -71,8 +70,8 @@ function addOnStore(): JSX.Element {
* Sets the list of installed plugins in the component's state.
*/
/* istanbul ignore next */
const getInstalledPlugins: () => any = () => {
setDataList(data);
const getInstalledPlugins: () => void = () => {
setDataList(data?.getPlugins ?? []);
};

/**
Expand All @@ -83,7 +82,11 @@ function addOnStore(): JSX.Element {
const updateSelectedTab = (tab: any): void => {
setIsStore(tab === 'available');
/* istanbul ignore next */
isStore ? getStorePlugins() : getInstalledPlugins();
if (isStore) {
getStorePlugins();
} else {
getInstalledPlugins();
}
};

/**
Expand Down
6 changes: 3 additions & 3 deletions src/components/AddOn/support/services/Plugin.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class PluginHelper {
*/
fetchInstalled = async (): Promise<any> => {
const result = await fetch(`http://localhost:3005/installed`);
return (await result.json()) as InterfacePluginHelper[];
return await result.json();
};

/**
Expand All @@ -31,8 +31,8 @@ class PluginHelper {
*/
generateLinks = (plugins: any[]): { name: string; url: string }[] => {
return plugins
.filter((plugin) => plugin.enabled)
.map((installedPlugin) => {
.filter((plugin: any) => plugin.enabled)
.map((installedPlugin: any) => {
return {
name: installedPlugin.name,
url: `/plugin/${installedPlugin.component.toLowerCase()}`,
Expand Down

0 comments on commit 323a0c7

Please sign in to comment.