parent
9fef93d67e
commit
b73bb97891
@ -0,0 +1,18 @@
|
|||||||
|
/**
|
||||||
|
* This file was automatically generated by Strapi.
|
||||||
|
* Any modifications made will be discarded.
|
||||||
|
*/
|
||||||
|
import i18N from "@strapi/plugin-i18n/strapi-admin";
|
||||||
|
import usersPermissions from "@strapi/plugin-users-permissions/strapi-admin";
|
||||||
|
import importExportEntries from "strapi-plugin-import-export-entries/strapi-admin";
|
||||||
|
import menus from "strapi-plugin-menus/strapi-admin";
|
||||||
|
import { renderAdmin } from "@strapi/strapi/admin";
|
||||||
|
|
||||||
|
renderAdmin(document.getElementById("strapi"), {
|
||||||
|
plugins: {
|
||||||
|
i18n: i18N,
|
||||||
|
"users-permissions": usersPermissions,
|
||||||
|
"import-export-entries": importExportEntries,
|
||||||
|
menus: menus,
|
||||||
|
},
|
||||||
|
});
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<!--
|
||||||
|
This file was automatically generated by Strapi.
|
||||||
|
Any modifications made will be discarded.
|
||||||
|
-->
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta
|
||||||
|
name="viewport"
|
||||||
|
content="width=device-width, initial-scale=1, viewport-fit=cover"
|
||||||
|
/>
|
||||||
|
<meta name="robots" content="noindex" />
|
||||||
|
<meta name="referrer" content="same-origin" />
|
||||||
|
<title>Strapi Admin</title>
|
||||||
|
<style>
|
||||||
|
html,
|
||||||
|
body,
|
||||||
|
#strapi {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="strapi"></div>
|
||||||
|
<noscript
|
||||||
|
><div class="strapi--root">
|
||||||
|
<div class="strapi--no-js">
|
||||||
|
<style type="text/css">
|
||||||
|
.strapi--root {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.strapi--no-js {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
text-align: center;
|
||||||
|
font-family: helvetica, arial, sans-serif;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<h1>JavaScript disabled</h1>
|
||||||
|
<p>
|
||||||
|
Please
|
||||||
|
<a href="https://www.enable-javascript.com/">enable JavaScript</a>
|
||||||
|
in your browser and reload the page to proceed.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div></noscript
|
||||||
|
>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -1,3 +0,0 @@
|
|||||||
# Strapi plugin vendors
|
|
||||||
|
|
||||||
A quick description of vendors.
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
import {request} from "@strapi/helper-plugin";
|
|
||||||
import {get, has, isEmpty, pickBy, set} from "lodash";
|
|
||||||
import {auth} from '@strapi/helper-plugin';
|
|
||||||
|
|
||||||
const productsRequests = {
|
|
||||||
getProducts: async () => {
|
|
||||||
try {
|
|
||||||
const response = await request("/vendors/products/list", {method: "GET", headers: {
|
|
||||||
Authorization: `Bearer ${auth.getToken()}`
|
|
||||||
}});
|
|
||||||
|
|
||||||
return response;
|
|
||||||
} catch (e) {
|
|
||||||
return {
|
|
||||||
error: true,
|
|
||||||
message: e
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return [];
|
|
||||||
},
|
|
||||||
};
|
|
||||||
export default productsRequests;
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
/**
|
|
||||||
*
|
|
||||||
* Initializer
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { useEffect, useRef } from 'react';
|
|
||||||
import pluginId from '../../pluginId';
|
|
||||||
|
|
||||||
type InitializerProps = {
|
|
||||||
setPlugin: (id: string) => void;
|
|
||||||
};
|
|
||||||
|
|
||||||
const Initializer = ({ setPlugin }: InitializerProps) => {
|
|
||||||
const ref = useRef(setPlugin);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
ref.current(pluginId);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return null;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Initializer;
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
/**
|
|
||||||
*
|
|
||||||
* PluginIcon
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import { Puzzle } from '@strapi/icons';
|
|
||||||
|
|
||||||
const PluginIcon = () => <Puzzle />;
|
|
||||||
|
|
||||||
export default PluginIcon;
|
|
||||||
@ -1,141 +0,0 @@
|
|||||||
/**
|
|
||||||
*
|
|
||||||
* This component is the skeleton around the actual pages, and should only
|
|
||||||
* contain code that should be seen on all pages. (e.g. navigation bar)
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React, {useState} from 'react';
|
|
||||||
import {
|
|
||||||
SubNavLink,
|
|
||||||
SubNav,
|
|
||||||
SubNavHeader,
|
|
||||||
SubNavSections,
|
|
||||||
SubNavSection,
|
|
||||||
TextButton,
|
|
||||||
SubNavLinkSection,
|
|
||||||
Box
|
|
||||||
} from '@strapi/design-system';
|
|
||||||
import {Apps, ExclamationMarkCircle, Plus} from "@strapi/icons";
|
|
||||||
|
|
||||||
import './index.css';
|
|
||||||
import getPluginRoute from "../../utils/base-route";
|
|
||||||
import {ROUTES} from "../../utils/constants";
|
|
||||||
|
|
||||||
const SubMenu = () => {
|
|
||||||
const [search, setSearch] = useState('');
|
|
||||||
const catalog = [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
label: 'Products',
|
|
||||||
icon: <ExclamationMarkCircle/>,
|
|
||||||
to: `${getPluginRoute()}${ROUTES.CatalogProducts}`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
label: 'Categories',
|
|
||||||
to: `${getPluginRoute()}${ROUTES.CatalogCategories}`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
label: 'Filters',
|
|
||||||
to: `${getPluginRoute()}${ROUTES.CatalogFilters}`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
const customers = [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
label: 'Orders',
|
|
||||||
icon: <ExclamationMarkCircle/>,
|
|
||||||
to: `${getPluginRoute()}${ROUTES.CustomersOrders}`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
label: 'Coupons',
|
|
||||||
to: `${getPluginRoute()}${ROUTES.CustomersCoupons}`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
const parameters = [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
label: 'General',
|
|
||||||
icon: <ExclamationMarkCircle/>,
|
|
||||||
to: `${getPluginRoute()}${ROUTES.ParametersGeneral}`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
label: 'Products',
|
|
||||||
to: `${getPluginRoute()}${ROUTES.ParametersProducts}`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
label: 'Shipping',
|
|
||||||
icon: <Apps/>,
|
|
||||||
to: `${getPluginRoute()}${ROUTES.ParametersShipping}`,
|
|
||||||
active: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
label: 'Payments',
|
|
||||||
to: `${getPluginRoute()}${ROUTES.ParametersPayments}`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
label: 'Accounts & Privacy',
|
|
||||||
to: `${getPluginRoute()}${ROUTES.ParametersAccounts}`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
label: 'Emails',
|
|
||||||
to: `${getPluginRoute()}${ROUTES.ParametersEmails}`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
label: 'Integration',
|
|
||||||
to: `${getPluginRoute()}${ROUTES.ParametersIntegration}`,
|
|
||||||
active: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
label: 'Advanced',
|
|
||||||
to: `${getPluginRoute()}${ROUTES.ParametersAdvanced}`,
|
|
||||||
active: false,
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
return (
|
|
||||||
<SubNav ariaLabel="Builder sub nav">
|
|
||||||
<SubNavHeader searchable value={search} onClear={() => setSearch('')}
|
|
||||||
onChange={e => setSearch(e.target.value)} label="Vendors admin" searchLabel="Search..."/>
|
|
||||||
<SubNavSections>
|
|
||||||
<SubNavSection label="Catalog" collapsable badgeLabel={catalog.length.toString()}>
|
|
||||||
{catalog.map(link => <SubNavLink to={link.to} active={link.active} key={link.id}>
|
|
||||||
{link.label}
|
|
||||||
</SubNavLink>)}
|
|
||||||
</SubNavSection>
|
|
||||||
<SubNavSection label="Customers" collapsable badgeLabel={customers.length.toString()}>
|
|
||||||
{customers.map(link => <SubNavLink to={link.to} active={link.active} key={link.id}>
|
|
||||||
{link.label}
|
|
||||||
</SubNavLink>)}
|
|
||||||
</SubNavSection>
|
|
||||||
<SubNavSection label="Parameters" collapsable badgeLabel={parameters.length.toString()}>
|
|
||||||
{parameters.map(link => <SubNavLink to={link.to} key={link.id}>
|
|
||||||
{link.label}
|
|
||||||
</SubNavLink>)}
|
|
||||||
</SubNavSection>
|
|
||||||
</SubNavSections>
|
|
||||||
</SubNav>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default SubMenu;
|
|
||||||
@ -1,69 +0,0 @@
|
|||||||
import {prefixPluginTranslations} from '@strapi/helper-plugin';
|
|
||||||
|
|
||||||
import pluginPkg from '../../package.json';
|
|
||||||
import pluginId from './pluginId';
|
|
||||||
import Initializer from './components/Initializer';
|
|
||||||
import PluginIcon from './components/PluginIcon';
|
|
||||||
import {PERMISSION} from "./utils/constants";
|
|
||||||
|
|
||||||
const name = pluginPkg.strapi.name;
|
|
||||||
|
|
||||||
export default {
|
|
||||||
register(app: any) {
|
|
||||||
app.addMenuLink({
|
|
||||||
to: `/plugins/${pluginId}`,
|
|
||||||
icon: PluginIcon,
|
|
||||||
intlLabel: {
|
|
||||||
id: `${pluginId}.plugin.name`,
|
|
||||||
defaultMessage: name,
|
|
||||||
},
|
|
||||||
Component: async () => {
|
|
||||||
const component = await import(/* webpackChunkName: "[request]" */ './pages/App');
|
|
||||||
|
|
||||||
return component;
|
|
||||||
},
|
|
||||||
permissions: [
|
|
||||||
// Uncomment to set the permissions of the plugin here
|
|
||||||
// {
|
|
||||||
// action: '', // the action name should be plugin::plugin-name.actionType
|
|
||||||
// subject: null,
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
});
|
|
||||||
const plugin = {
|
|
||||||
id: pluginId,
|
|
||||||
initializer: Initializer,
|
|
||||||
isReady: false,
|
|
||||||
name,
|
|
||||||
};
|
|
||||||
|
|
||||||
app.registerPlugin(plugin);
|
|
||||||
},
|
|
||||||
|
|
||||||
bootstrap(app: any) {
|
|
||||||
},
|
|
||||||
|
|
||||||
async registerTrads(app: any) {
|
|
||||||
const {locales} = app;
|
|
||||||
|
|
||||||
const importedTrads = await Promise.all(
|
|
||||||
(locales as any[]).map((locale) => {
|
|
||||||
return import(`./translations/${locale}.json`)
|
|
||||||
.then(({default: data}) => {
|
|
||||||
return {
|
|
||||||
data: prefixPluginTranslations(data, pluginId),
|
|
||||||
locale,
|
|
||||||
};
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
return {
|
|
||||||
data: {},
|
|
||||||
locale,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
return Promise.resolve(importedTrads);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
.vendors-container {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 14.5rem 1fr;
|
|
||||||
grid-template-rows: 1fr;
|
|
||||||
}
|
|
||||||
|
|
||||||
.vendors-container .vendors-section {
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
/**
|
|
||||||
*
|
|
||||||
* This component is the skeleton around the actual pages, and should only
|
|
||||||
* contain code that should be seen on all pages. (e.g. navigation bar)
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
import React from 'react';
|
|
||||||
import {Switch, Route} from 'react-router-dom';
|
|
||||||
import {AnErrorOccurred} from '@strapi/helper-plugin';
|
|
||||||
|
|
||||||
import getPluginRoute from "../../utils/base-route";
|
|
||||||
import {ROUTES} from "../../utils/constants";
|
|
||||||
import SubMenu from "../../components/SubMenu";
|
|
||||||
|
|
||||||
import CatalogProductsPage from "../Catalog/Products";
|
|
||||||
|
|
||||||
import HomePage from '../HomePage';
|
|
||||||
|
|
||||||
import './index.css';
|
|
||||||
|
|
||||||
const App = () => {
|
|
||||||
return (
|
|
||||||
<div className='vendors-container'>
|
|
||||||
<aside>
|
|
||||||
<SubMenu/>
|
|
||||||
</aside>
|
|
||||||
<section className='vendors-section'>
|
|
||||||
<Switch>
|
|
||||||
<Route path={getPluginRoute()} component={HomePage} exact/>
|
|
||||||
<Route path={`${getPluginRoute()}${ROUTES.CatalogProducts}`} component={CatalogProductsPage} exact/>
|
|
||||||
<Route component={AnErrorOccurred}/>
|
|
||||||
</Switch>
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default App;
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* HomePage
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import pluginId from '../../../pluginId';
|
|
||||||
|
|
||||||
const CatalogCategoriesPage = () => {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<h1>{pluginId}'s Category's Page</h1>
|
|
||||||
<p>Happy coding</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CatalogCategoriesPage;
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* HomePage
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import pluginId from '../../../pluginId';
|
|
||||||
|
|
||||||
const CatalogFiltersPage = () => {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<h1>{pluginId}'s Filter's Page</h1>
|
|
||||||
<p>Happy coding</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CatalogFiltersPage;
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* HomePage
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import { EmptyStateLayout, Button } from '@strapi/design-system';
|
|
||||||
import {Cross, Plus} from "@strapi/icons";
|
|
||||||
|
|
||||||
const CatalogProductEmpty = () => {
|
|
||||||
return (
|
|
||||||
<EmptyStateLayout content="You don't have any content yet..." action={<Button variant="secondary" startIcon={<Plus />}>
|
|
||||||
Create your first product
|
|
||||||
</Button>} />
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CatalogProductEmpty;
|
|
||||||
@ -1,26 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* HomePage
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React, {useState} from 'react';
|
|
||||||
import {HeaderLayout, Button, Link} from '@strapi/design-system';
|
|
||||||
import {ArrowLeft, Pencil, Plus} from "@strapi/icons";
|
|
||||||
import getPluginRoute from "../../../../utils/base-route";
|
|
||||||
|
|
||||||
const CatalogProductHeader = ({total}) => {
|
|
||||||
const [isVisible, setIsVisible] = useState(false);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<HeaderLayout navigationAction={<Link startIcon={<ArrowLeft/>} to={getPluginRoute()}>
|
|
||||||
Go back
|
|
||||||
</Link>} primaryAction={<Button startIcon={<Plus/>} onClick={() => setIsVisible(true)}>
|
|
||||||
Add an entry
|
|
||||||
</Button>} secondaryAction={<Button variant="tertiary" startIcon={<Pencil/>}>
|
|
||||||
Edit
|
|
||||||
</Button>} title="Products" subtitle={total + " entries found"} as="h2"/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CatalogProductHeader;
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* HomePage
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import {Pagination, PreviousLink, PageLink, NextLink} from '@strapi/design-system';
|
|
||||||
import {NavLink} from 'react-router-dom';
|
|
||||||
|
|
||||||
const CatalogProductPagination = () => {
|
|
||||||
|
|
||||||
const buildUrlWithPageParams = (page: number) => {
|
|
||||||
const url = new URL(window.location.href);
|
|
||||||
const searchParams = new URLSearchParams(url.searchParams);
|
|
||||||
searchParams.set("page", page.toString());
|
|
||||||
return `${url.pathname.replace('admin/', '')}?${searchParams.toString()}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Pagination>
|
|
||||||
<PreviousLink as={NavLink} to={buildUrlWithPageParams(1)}>
|
|
||||||
Previous
|
|
||||||
</PreviousLink>
|
|
||||||
<PageLink as={NavLink} to={buildUrlWithPageParams(1)}>
|
|
||||||
1
|
|
||||||
</PageLink>
|
|
||||||
<PageLink as={NavLink} to={buildUrlWithPageParams(2)}>
|
|
||||||
2
|
|
||||||
</PageLink>
|
|
||||||
<NextLink as={NavLink} to={buildUrlWithPageParams(2)}>
|
|
||||||
Next page
|
|
||||||
</NextLink>
|
|
||||||
</Pagination>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CatalogProductPagination;
|
|
||||||
@ -1,97 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* HomePage
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import {
|
|
||||||
Table,
|
|
||||||
Thead,
|
|
||||||
Tbody,
|
|
||||||
Tr,
|
|
||||||
Td,
|
|
||||||
Th,
|
|
||||||
BaseCheckbox,
|
|
||||||
Typography,
|
|
||||||
Avatar,
|
|
||||||
Flex,
|
|
||||||
IconButton,
|
|
||||||
VisuallyHidden,
|
|
||||||
Box
|
|
||||||
} from '@strapi/design-system';
|
|
||||||
import {Pencil, Plus, Trash} from "@strapi/icons";
|
|
||||||
|
|
||||||
const CatalogProductTable = ({items}) => {
|
|
||||||
const ROW_COUNT = 6;
|
|
||||||
const COL_COUNT = 10;
|
|
||||||
|
|
||||||
const entry = {
|
|
||||||
cover: 'https://avatars.githubusercontent.com/u/3874873?v=4',
|
|
||||||
description: 'Chez Léon is a human sized Parisian',
|
|
||||||
category: 'French cuisine',
|
|
||||||
contact: 'Leon Lafrite'
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Table colCount={COL_COUNT} rowCount={ROW_COUNT}>
|
|
||||||
<Thead>
|
|
||||||
<Tr>
|
|
||||||
<Th>
|
|
||||||
<BaseCheckbox aria-label="Select all entries"/>
|
|
||||||
</Th>
|
|
||||||
<Th>
|
|
||||||
<Typography variant="sigma">ID</Typography>
|
|
||||||
</Th>
|
|
||||||
<Th>
|
|
||||||
<Typography variant="sigma">Cover</Typography>
|
|
||||||
</Th>
|
|
||||||
<Th>
|
|
||||||
<Typography variant="sigma">Description</Typography>
|
|
||||||
</Th>
|
|
||||||
<Th>
|
|
||||||
<Typography variant="sigma">Categories</Typography>
|
|
||||||
</Th>
|
|
||||||
<Th>
|
|
||||||
<Typography variant="sigma">Contact</Typography>
|
|
||||||
</Th>
|
|
||||||
<Th>
|
|
||||||
<VisuallyHidden>Actions</VisuallyHidden>
|
|
||||||
</Th>
|
|
||||||
</Tr>
|
|
||||||
</Thead>
|
|
||||||
<Tbody>
|
|
||||||
{items.map(entry => <Tr key={entry.id}>
|
|
||||||
<Td>
|
|
||||||
<BaseCheckbox aria-label={`Select ${entry.contact}`}/>
|
|
||||||
</Td>
|
|
||||||
<Td>
|
|
||||||
<Typography textColor="neutral800">{entry.id}</Typography>
|
|
||||||
</Td>
|
|
||||||
<Td>
|
|
||||||
<Avatar src={entry.cover} alt={entry.contact}/>
|
|
||||||
</Td>
|
|
||||||
<Td>
|
|
||||||
<Typography textColor="neutral800">{entry.description}</Typography>
|
|
||||||
</Td>
|
|
||||||
<Td>
|
|
||||||
<Typography textColor="neutral800">{entry.category}</Typography>
|
|
||||||
</Td>
|
|
||||||
<Td>
|
|
||||||
<Typography textColor="neutral800">{entry.contact}</Typography>
|
|
||||||
</Td>
|
|
||||||
<Td>
|
|
||||||
<Flex>
|
|
||||||
<IconButton onClick={() => console.log('edit')} label="Edit" noBorder icon={<Pencil/>}/>
|
|
||||||
<Box paddingLeft={1}>
|
|
||||||
<IconButton onClick={() => console.log('delete')} label="Delete" noBorder icon={<Trash/>}/>
|
|
||||||
</Box>
|
|
||||||
</Flex>
|
|
||||||
</Td>
|
|
||||||
</Tr>)}
|
|
||||||
</Tbody>
|
|
||||||
</Table>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CatalogProductTable;
|
|
||||||
@ -1,50 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* HomePage
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
import React, {useEffect, useState} from 'react';
|
|
||||||
import {Box, Typography} from '@strapi/design-system';
|
|
||||||
import {LoadingIndicatorPage, auth} from '@strapi/helper-plugin';
|
|
||||||
|
|
||||||
import productsRequests from "../../../api/products.api";
|
|
||||||
|
|
||||||
import CatalogProductTable from "./ProductTable";
|
|
||||||
import CatalogProductPagination from "./ProductPagination";
|
|
||||||
import CatalogProductEmpty from "./ProductEmpty";
|
|
||||||
import CatalogProductHeader from "./ProductHeader";
|
|
||||||
|
|
||||||
const CatalogProductsPage = () => {
|
|
||||||
const [isLoading, setIsLoading] = useState(true);
|
|
||||||
const [products, setProducts] = useState([]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
productsRequests.getProducts().then((products) => {
|
|
||||||
console.log(products);
|
|
||||||
console.log(auth.getUserInfo());
|
|
||||||
setProducts(products);
|
|
||||||
setIsLoading(false);
|
|
||||||
});
|
|
||||||
}, [setProducts]);
|
|
||||||
|
|
||||||
const hasProducts = () => products.length > 0;
|
|
||||||
|
|
||||||
if (isLoading) return <LoadingIndicatorPage/>;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Box background={'#f6f6f9'}>
|
|
||||||
<CatalogProductHeader total={products.length}/>
|
|
||||||
|
|
||||||
{!hasProducts() && (<Box paddingLeft={10} paddingRight={10}>
|
|
||||||
<CatalogProductEmpty/>
|
|
||||||
</Box>)}
|
|
||||||
|
|
||||||
{hasProducts() && (<Box paddingLeft={10} paddingRight={10}>
|
|
||||||
<CatalogProductTable items={products}/>
|
|
||||||
<CatalogProductPagination/>
|
|
||||||
</Box>)}
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CatalogProductsPage;
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* HomePage
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import pluginId from '../../../pluginId';
|
|
||||||
|
|
||||||
const CustomersCouponsPage = () => {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<h1>{pluginId}'s Coupon's page</h1>
|
|
||||||
<p>Happy coding</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CustomersCouponsPage;
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* HomePage
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import pluginId from '../../../pluginId';
|
|
||||||
|
|
||||||
const CustomersOrdersPage = () => {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<h1>{pluginId}'s Order's Page</h1>
|
|
||||||
<p>Happy coding</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CustomersOrdersPage;
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* HomePage
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import pluginId from '../../pluginId';
|
|
||||||
|
|
||||||
const HomePage = () => {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<h1>{pluginId}'s HomePage</h1>
|
|
||||||
<p>Happy coding</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default HomePage;
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* HomePage
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import pluginId from '../../../pluginId';
|
|
||||||
|
|
||||||
const ParametersAccountsPage = () => {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<h1>{pluginId}'s Shipping's parameter Page</h1>
|
|
||||||
<p>Happy coding</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default ParametersAccountsPage;
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* HomePage
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import pluginId from '../../../pluginId';
|
|
||||||
|
|
||||||
const ParametersAdvancedPage = () => {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<h1>{pluginId}'s Shipping's parameter Page</h1>
|
|
||||||
<p>Happy coding</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default ParametersAdvancedPage;
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* HomePage
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import pluginId from '../../../pluginId';
|
|
||||||
|
|
||||||
const ParametersEmailsPage = () => {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<h1>{pluginId}'s Shipping's parameter Page</h1>
|
|
||||||
<p>Happy coding</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default ParametersEmailsPage;
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* HomePage
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import pluginId from '../../../pluginId';
|
|
||||||
|
|
||||||
const ParametersGeneralPage = () => {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<h1>{pluginId}'s General's parameter Page</h1>
|
|
||||||
<p>Happy coding</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default ParametersGeneralPage;
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* HomePage
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import pluginId from '../../../pluginId';
|
|
||||||
|
|
||||||
const ParametersIntegrationPage = () => {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<h1>{pluginId}'s Shipping's parameter Page</h1>
|
|
||||||
<p>Happy coding</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default ParametersIntegrationPage;
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* HomePage
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import pluginId from '../../../pluginId';
|
|
||||||
|
|
||||||
const ParametersPaymentsPage = () => {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<h1>{pluginId}'s Shipping's parameter Page</h1>
|
|
||||||
<p>Happy coding</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default ParametersPaymentsPage;
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* HomePage
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import pluginId from '../../../pluginId';
|
|
||||||
|
|
||||||
const ParametersProductsPage = () => {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<h1>{pluginId}'s Product's parameter Page</h1>
|
|
||||||
<p>Happy coding</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default ParametersProductsPage;
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* HomePage
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import pluginId from '../../../pluginId';
|
|
||||||
|
|
||||||
const ParametersShippingPage = () => {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<h1>{pluginId}'s Shipping's parameter Page</h1>
|
|
||||||
<p>Happy coding</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default ParametersShippingPage;
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
import pluginPkg from '../../package.json';
|
|
||||||
|
|
||||||
const pluginId = pluginPkg.name.replace(/^(@[^-,.][\w,-]+\/|strapi-)plugin-/i, '');
|
|
||||||
|
|
||||||
export default pluginId;
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"vendors.plugin.name": "Vendors Admin"
|
|
||||||
}
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"vendors.plugin.name": "Boutique Admin"
|
|
||||||
}
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
const PLUGIN_ROUTE = '/plugins/vendors';
|
|
||||||
|
|
||||||
export default function getPluginRoute() {
|
|
||||||
return PLUGIN_ROUTE;
|
|
||||||
}
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
export enum ROUTES {
|
|
||||||
CatalogProducts = '/catalog/products',
|
|
||||||
CatalogCategories = '/catalog/categories',
|
|
||||||
CatalogFilters = '/catalog/filters',
|
|
||||||
CustomersOrders = '/customers/orders',
|
|
||||||
CustomersCoupons = '/customers/coupons',
|
|
||||||
ParametersGeneral = '/settings/general',
|
|
||||||
ParametersProducts = '/settings/products',
|
|
||||||
ParametersShipping = '/settings/shipping',
|
|
||||||
ParametersPayments = '/settings/payments',
|
|
||||||
ParametersAccounts = '/settings/accounts',
|
|
||||||
ParametersEmails = '/settings/emails',
|
|
||||||
ParametersIntegration = '/settings/integration',
|
|
||||||
ParametersAdvanced = '/settings/advanced',
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum PERMISSION {
|
|
||||||
CatalogProductsRead = 'plugin::vendors.read'
|
|
||||||
}
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
import pluginId from '../pluginId';
|
|
||||||
|
|
||||||
const getTrad = (id: string) => `${pluginId}.${id}`;
|
|
||||||
|
|
||||||
export default getTrad;
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
declare module '@strapi/design-system/*';
|
|
||||||
declare module '@strapi/design-system';
|
|
||||||
declare module '@strapi/icons';
|
|
||||||
declare module '@strapi/icons/*';
|
|
||||||
declare module '@strapi/helper-plugin';
|
|
||||||
@ -1,52 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "vendors",
|
|
||||||
"version": "0.0.0",
|
|
||||||
"description": "This is the description of the plugin.",
|
|
||||||
"strapi": {
|
|
||||||
"name": "vendors",
|
|
||||||
"description": "Description of vendors plugin",
|
|
||||||
"kind": "plugin"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@strapi/design-system": "^1.6.3",
|
|
||||||
"@strapi/helper-plugin": "^4.10.5",
|
|
||||||
"@strapi/icons": "^1.6.3",
|
|
||||||
"prop-types": "^15.7.2",
|
|
||||||
"strapi-helper-plugin": "^3.6.11"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@strapi/typescript-utils": "^4.6.0",
|
|
||||||
"@types/react": "^17.0.53",
|
|
||||||
"@types/react-dom": "^17.0.18",
|
|
||||||
"@types/react-router-dom": "^5.3.3",
|
|
||||||
"@types/styled-components": "^5.1.26",
|
|
||||||
"react": "^17.0.2",
|
|
||||||
"react-dom": "^17.0.2",
|
|
||||||
"react-router-dom": "^5.3.4",
|
|
||||||
"styled-components": "^5.3.6",
|
|
||||||
"typescript": "5.0.4"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"react": "^17.0.2",
|
|
||||||
"react-dom": "^17.0.2",
|
|
||||||
"react-router-dom": "^5.3.4",
|
|
||||||
"styled-components": "^5.3.6"
|
|
||||||
},
|
|
||||||
"author": {
|
|
||||||
"name": "A Strapi developer"
|
|
||||||
},
|
|
||||||
"maintainers": [
|
|
||||||
{
|
|
||||||
"name": "A Strapi developer"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.19.1 <=18.x.x",
|
|
||||||
"npm": ">=6.0.0"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"develop": "tsc -p tsconfig.server.json -w",
|
|
||||||
"build": "tsc -p tsconfig.server.json"
|
|
||||||
},
|
|
||||||
"license": "MIT"
|
|
||||||
}
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
import { Strapi } from '@strapi/strapi';
|
|
||||||
|
|
||||||
const RBAC_ACTIONS = [
|
|
||||||
{
|
|
||||||
section: 'plugins',
|
|
||||||
displayName: `Access to vendor's administration page`,
|
|
||||||
uid: 'read',
|
|
||||||
pluginName: 'vendors',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export default async ({ strapi }: { strapi: any }) => {
|
|
||||||
await strapi.admin.services.permission.actionProvider.registerMany(RBAC_ACTIONS);
|
|
||||||
|
|
||||||
strapi.store({
|
|
||||||
environment: '',
|
|
||||||
type: 'plugin',
|
|
||||||
name: 'vendors',
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
export default {
|
|
||||||
default: {},
|
|
||||||
validator() {},
|
|
||||||
};
|
|
||||||
@ -1 +0,0 @@
|
|||||||
export default {};
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
import products from './products';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
products,
|
|
||||||
};
|
|
||||||
@ -1,28 +0,0 @@
|
|||||||
import {Strapi} from '@strapi/strapi';
|
|
||||||
import {string} from "prop-types";
|
|
||||||
|
|
||||||
export default ({strapi}: { strapi: Strapi }) => ({
|
|
||||||
index(ctx) {
|
|
||||||
ctx.body = strapi
|
|
||||||
.plugin('vendors')
|
|
||||||
.service('vendors')
|
|
||||||
.getWelcomeMessage();
|
|
||||||
},
|
|
||||||
async list(ctx) {
|
|
||||||
const user = ctx.state.user;
|
|
||||||
strapi.log.debug(JSON.stringify(user));
|
|
||||||
const vendor = await strapi.plugin('vendors')
|
|
||||||
.service('vendors')
|
|
||||||
.get(user.roles.code);
|
|
||||||
|
|
||||||
if (!vendor) {
|
|
||||||
strapi.log.error('No vendor found');
|
|
||||||
}
|
|
||||||
|
|
||||||
strapi.log.debug(JSON.stringify(vendor));
|
|
||||||
|
|
||||||
ctx.body = await strapi.plugin('vendors')
|
|
||||||
.service('products')
|
|
||||||
.list(vendor.id);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
import { Strapi } from '@strapi/strapi';
|
|
||||||
|
|
||||||
export default ({ strapi }: { strapi: Strapi }) => {
|
|
||||||
// destroy phase
|
|
||||||
};
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
import register from './register';
|
|
||||||
import bootstrap from './bootstrap';
|
|
||||||
import destroy from './destroy';
|
|
||||||
import config from './config';
|
|
||||||
import contentTypes from './content-types';
|
|
||||||
import controllers from './controllers';
|
|
||||||
import routes from './routes';
|
|
||||||
import middlewares from './middlewares';
|
|
||||||
import policies from './policies';
|
|
||||||
import services from './services';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
register,
|
|
||||||
bootstrap,
|
|
||||||
destroy,
|
|
||||||
config,
|
|
||||||
controllers,
|
|
||||||
routes,
|
|
||||||
services,
|
|
||||||
contentTypes,
|
|
||||||
policies,
|
|
||||||
middlewares,
|
|
||||||
};
|
|
||||||
@ -1 +0,0 @@
|
|||||||
export default {};
|
|
||||||
@ -1 +0,0 @@
|
|||||||
export default {};
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
import { Strapi } from '@strapi/strapi';
|
|
||||||
|
|
||||||
export default ({ strapi }: { strapi: Strapi }) => {
|
|
||||||
// registeration phase
|
|
||||||
};
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
export default [
|
|
||||||
{
|
|
||||||
method: 'GET',
|
|
||||||
path: '/',
|
|
||||||
handler: 'products.index',
|
|
||||||
config: {
|
|
||||||
policies: [],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
method: 'GET',
|
|
||||||
path: '/products/list',
|
|
||||||
handler: 'products.list',
|
|
||||||
config: {
|
|
||||||
policies: [],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
import products from './products';
|
|
||||||
import vendors from './vendors';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
products,
|
|
||||||
vendors
|
|
||||||
};
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
import {Strapi} from '@strapi/strapi';
|
|
||||||
|
|
||||||
export default ({strapi}: { strapi: Strapi }) => ({
|
|
||||||
getWelcomeMessage() {
|
|
||||||
return 'Welcome to Strapi 🚀';
|
|
||||||
},
|
|
||||||
async list(vendorId: string) {
|
|
||||||
console.log(vendorId);
|
|
||||||
return await strapi.query('api::product.product').findMany({
|
|
||||||
where: {
|
|
||||||
vendors: {
|
|
||||||
id: vendorId
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
import {Strapi} from '@strapi/strapi';
|
|
||||||
|
|
||||||
export default ({strapi}: { strapi: Strapi }) => ({
|
|
||||||
getWelcomeMessage() {
|
|
||||||
return 'Welcome to Strapi 🚀';
|
|
||||||
},
|
|
||||||
async get(roleName: string) {
|
|
||||||
return await strapi.query('api::vendor.vendor').findOne({
|
|
||||||
where: {
|
|
||||||
slug: roleName
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
module.exports = require('./admin/src').default;
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
module.exports = require('./dist/server');
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "@strapi/typescript-utils/tsconfigs/admin",
|
|
||||||
|
|
||||||
"compilerOptions": {
|
|
||||||
"target": "ESNext",
|
|
||||||
"strict": true
|
|
||||||
},
|
|
||||||
|
|
||||||
"include": ["admin", "custom.d.ts"],
|
|
||||||
|
|
||||||
"exclude": [
|
|
||||||
"node_modules/",
|
|
||||||
"dist/",
|
|
||||||
|
|
||||||
// Do not include server files in the server compilation
|
|
||||||
"server/",
|
|
||||||
// Do not include test files
|
|
||||||
"**/*.test.ts"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "@strapi/typescript-utils/tsconfigs/server",
|
|
||||||
|
|
||||||
"compilerOptions": {
|
|
||||||
"outDir": "dist",
|
|
||||||
"rootDir": "."
|
|
||||||
},
|
|
||||||
|
|
||||||
"include": [
|
|
||||||
// Include the root directory
|
|
||||||
"server",
|
|
||||||
// Force the JSON files in the src folder to be included
|
|
||||||
"server/**/*.json"
|
|
||||||
],
|
|
||||||
|
|
||||||
"exclude": [
|
|
||||||
"node_modules/",
|
|
||||||
"dist/",
|
|
||||||
|
|
||||||
// Do not include admin files in the server compilation
|
|
||||||
"admin/",
|
|
||||||
// Do not include test files
|
|
||||||
"**/*.test.ts"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,177 @@
|
|||||||
|
import type { Schema, Attribute } from '@strapi/strapi';
|
||||||
|
|
||||||
|
export interface ActionsButton extends Schema.Component {
|
||||||
|
collectionName: 'components_actions_buttons';
|
||||||
|
info: {
|
||||||
|
displayName: 'button';
|
||||||
|
};
|
||||||
|
attributes: {
|
||||||
|
title: Attribute.String;
|
||||||
|
path: Attribute.String;
|
||||||
|
type: Attribute.Enumeration<['primary', 'secondary']>;
|
||||||
|
source: Attribute.Enumeration<['external', 'internal']>;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ContentCarousel extends Schema.Component {
|
||||||
|
collectionName: 'components_content_carousels';
|
||||||
|
info: {
|
||||||
|
displayName: 'carousel';
|
||||||
|
description: '';
|
||||||
|
};
|
||||||
|
attributes: {
|
||||||
|
title: Attribute.String;
|
||||||
|
items: Attribute.Component<'media.carousel-item', true>;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ContentTextBox extends Schema.Component {
|
||||||
|
collectionName: 'components_content_text_boxes';
|
||||||
|
info: {
|
||||||
|
displayName: 'Text Box';
|
||||||
|
};
|
||||||
|
attributes: {
|
||||||
|
title: Attribute.String;
|
||||||
|
content: Attribute.RichText;
|
||||||
|
imageLeft: Attribute.Media;
|
||||||
|
imageRight: Attribute.Media;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MediaCarouselImage extends Schema.Component {
|
||||||
|
collectionName: 'components_media_carousel_images';
|
||||||
|
info: {
|
||||||
|
displayName: 'carousel image';
|
||||||
|
description: '';
|
||||||
|
};
|
||||||
|
attributes: {
|
||||||
|
orientation: Attribute.Enumeration<['rightside', 'leftside']>;
|
||||||
|
cover: Attribute.Media;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MediaCarouselItem extends Schema.Component {
|
||||||
|
collectionName: 'components_media_carousel_items';
|
||||||
|
info: {
|
||||||
|
displayName: 'carousel item';
|
||||||
|
description: '';
|
||||||
|
};
|
||||||
|
attributes: {
|
||||||
|
title: Attribute.String;
|
||||||
|
subtitle: Attribute.String;
|
||||||
|
illustration: Attribute.Component<'media.carousel-image'>;
|
||||||
|
actions: Attribute.Component<'actions.button', true>;
|
||||||
|
columns: Attribute.Enumeration<['one', 'two']>;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MediaMosaicItem extends Schema.Component {
|
||||||
|
collectionName: 'components_media_mosaic_items';
|
||||||
|
info: {
|
||||||
|
displayName: 'Mosaic item';
|
||||||
|
};
|
||||||
|
attributes: {
|
||||||
|
icon: Attribute.String;
|
||||||
|
title: Attribute.String;
|
||||||
|
description: Attribute.String;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MediaMosaic extends Schema.Component {
|
||||||
|
collectionName: 'components_media_mosaics';
|
||||||
|
info: {
|
||||||
|
displayName: 'mosaic';
|
||||||
|
description: '';
|
||||||
|
};
|
||||||
|
attributes: {
|
||||||
|
title: Attribute.String;
|
||||||
|
subtitle: Attribute.String;
|
||||||
|
items: Attribute.Component<'media.mosaic-item', true>;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MediaVideoBox extends Schema.Component {
|
||||||
|
collectionName: 'components_media_video_boxes';
|
||||||
|
info: {
|
||||||
|
displayName: 'Video Box';
|
||||||
|
};
|
||||||
|
attributes: {
|
||||||
|
title: Attribute.String;
|
||||||
|
description: Attribute.RichText;
|
||||||
|
video: Attribute.Media;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MetaMeta extends Schema.Component {
|
||||||
|
collectionName: 'components_meta_metas';
|
||||||
|
info: {
|
||||||
|
displayName: 'meta';
|
||||||
|
icon: 'network-wired';
|
||||||
|
};
|
||||||
|
attributes: {
|
||||||
|
property: Attribute.String;
|
||||||
|
content: Attribute.String;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SharedSeo extends Schema.Component {
|
||||||
|
collectionName: 'components_shared_seos';
|
||||||
|
info: {
|
||||||
|
displayName: 'Seo';
|
||||||
|
icon: 'book';
|
||||||
|
description: '';
|
||||||
|
};
|
||||||
|
attributes: {
|
||||||
|
metaTitle: Attribute.String;
|
||||||
|
metaDescription: Attribute.Text;
|
||||||
|
SharedImage: Attribute.Component<'shared.shared-image'>;
|
||||||
|
preventIndexing: Attribute.Boolean & Attribute.DefaultTo<false>;
|
||||||
|
structuredData: Attribute.JSON;
|
||||||
|
metaType: Attribute.Enumeration<
|
||||||
|
['article', 'website', 'profile', 'video', 'music', 'book']
|
||||||
|
>;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SharedSharedImage extends Schema.Component {
|
||||||
|
collectionName: 'components_shared_shared_images';
|
||||||
|
info: {
|
||||||
|
displayName: 'SharedImage';
|
||||||
|
icon: 'file-image';
|
||||||
|
description: '';
|
||||||
|
};
|
||||||
|
attributes: {
|
||||||
|
alt: Attribute.String;
|
||||||
|
media: Attribute.Media;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UtilsNavigate extends Schema.Component {
|
||||||
|
collectionName: 'components_utils_navigates';
|
||||||
|
info: {
|
||||||
|
displayName: 'Navigate';
|
||||||
|
};
|
||||||
|
attributes: {
|
||||||
|
path: Attribute.String;
|
||||||
|
source: Attribute.Enumeration<['external', 'internal']>;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module '@strapi/types' {
|
||||||
|
export module Shared {
|
||||||
|
export interface Components {
|
||||||
|
'actions.button': ActionsButton;
|
||||||
|
'content.carousel': ContentCarousel;
|
||||||
|
'content.text-box': ContentTextBox;
|
||||||
|
'media.carousel-image': MediaCarouselImage;
|
||||||
|
'media.carousel-item': MediaCarouselItem;
|
||||||
|
'media.mosaic-item': MediaMosaicItem;
|
||||||
|
'media.mosaic': MediaMosaic;
|
||||||
|
'media.video-box': MediaVideoBox;
|
||||||
|
'meta.meta': MetaMeta;
|
||||||
|
'shared.seo': SharedSeo;
|
||||||
|
'shared.shared-image': SharedSharedImage;
|
||||||
|
'utils.navigate': UtilsNavigate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue