mirror of
https://github.com/strapi/strapi.git
synced 2025-12-14 16:51:55 +00:00
Add required info into the plugin object and update plugin generator
Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
parent
8b883ba8b7
commit
ccc92b90a5
@ -14,6 +14,7 @@ export default strapi => {
|
|||||||
initializer: () => null,
|
initializer: () => null,
|
||||||
injectedComponents: [],
|
injectedComponents: [],
|
||||||
isReady: true,
|
isReady: true,
|
||||||
|
isRequired: pluginPkg.strapi.required || false,
|
||||||
leftMenuLinks: [],
|
leftMenuLinks: [],
|
||||||
leftMenuSections: [],
|
leftMenuSections: [],
|
||||||
mainComponent: null,
|
mainComponent: null,
|
||||||
|
|||||||
@ -0,0 +1,12 @@
|
|||||||
|
import styled from 'styled-components';
|
||||||
|
import { Container } from 'reactstrap';
|
||||||
|
|
||||||
|
const ContainerFluid = styled(Container)`
|
||||||
|
padding: 18px 30px !important;
|
||||||
|
`;
|
||||||
|
|
||||||
|
ContainerFluid.defaultProps = {
|
||||||
|
fluid: true,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ContainerFluid;
|
||||||
@ -25,7 +25,8 @@ import Header from '../../components/Header/index';
|
|||||||
import Logout from '../../components/Logout';
|
import Logout from '../../components/Logout';
|
||||||
import NavTopRightWrapper from '../../components/NavTopRightWrapper';
|
import NavTopRightWrapper from '../../components/NavTopRightWrapper';
|
||||||
import LeftMenu from '../LeftMenu';
|
import LeftMenu from '../LeftMenu';
|
||||||
import ListPluginsPage from '../ListPluginsPage';
|
// import ListPluginsPage from '../ListPluginsPage';
|
||||||
|
import ListPluginsPage from '../InstalledPluginsPage';
|
||||||
import LocaleToggle from '../LocaleToggle';
|
import LocaleToggle from '../LocaleToggle';
|
||||||
import HomePage from '../HomePage';
|
import HomePage from '../HomePage';
|
||||||
import MarketplacePage from '../MarketplacePage';
|
import MarketplacePage from '../MarketplacePage';
|
||||||
|
|||||||
@ -0,0 +1,78 @@
|
|||||||
|
import styled from 'styled-components';
|
||||||
|
|
||||||
|
const Wrapper = styled.div`
|
||||||
|
padding-top: 2rem;
|
||||||
|
background-color: #ffffff;
|
||||||
|
box-shadow: 0 2px 4px #e3e9f3;
|
||||||
|
|
||||||
|
.titleContainer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding-right: 1.8rem;
|
||||||
|
padding-left: 1.8rem;
|
||||||
|
font-size: 1.8rem;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ulContainer {
|
||||||
|
width: 100%;
|
||||||
|
padding-top: 1.5rem;
|
||||||
|
> ul {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
list-style: none;
|
||||||
|
> li {
|
||||||
|
height: 5.4rem !important;
|
||||||
|
line-height: 5.4rem !important;
|
||||||
|
padding-right: 3.2rem;
|
||||||
|
padding-left: 1.5rem;
|
||||||
|
> div:first-child {
|
||||||
|
margin: 0;
|
||||||
|
> div:first-child {
|
||||||
|
padding-left: 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
> li:last-child {
|
||||||
|
> div {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.pluginContent {
|
||||||
|
text-align: left !important;
|
||||||
|
> span:first-child {
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: 600;
|
||||||
|
letter-spacing: 0.7px;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
> span:last-child {
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.icoContainer {
|
||||||
|
width: 70px;
|
||||||
|
height: 36px;
|
||||||
|
margin: auto 0;
|
||||||
|
line-height: 36px;
|
||||||
|
text-align: center;
|
||||||
|
border: 1px solid rgba(28, 93, 231, 0.1);
|
||||||
|
border-radius: 3px;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.actionContainer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nameWrapper {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
export default Wrapper;
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
import { LoadingIndicatorPage, useGlobalContext } from 'strapi-helper-plugin';
|
||||||
|
import { Header } from '@buffetjs/custom';
|
||||||
|
import PageTitle from '../../components/PageTitle';
|
||||||
|
import useFetchPluginsFromMarketPlace from '../../hooks/useFetchPluginsFromMarketPlace';
|
||||||
|
import ContainerFluid from '../../components/ContainerFluid';
|
||||||
|
// import ListPlugins from '../../components/ListPlugins';
|
||||||
|
import ListWrapper from './ListWrapper';
|
||||||
|
|
||||||
|
const InstalledPluginsPage = ({ history }) => {
|
||||||
|
const { formatMessage, plugins } = useGlobalContext();
|
||||||
|
console.log(plugins);
|
||||||
|
const { error, isLoading, data } = useFetchPluginsFromMarketPlace();
|
||||||
|
|
||||||
|
if (isLoading || error) {
|
||||||
|
return <LoadingIndicatorPage />;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<PageTitle
|
||||||
|
title={formatMessage({
|
||||||
|
id: 'app.components.ListPluginsPage.helmet.title',
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<ContainerFluid>
|
||||||
|
<Header
|
||||||
|
title={{
|
||||||
|
label: formatMessage({
|
||||||
|
id: 'app.components.ListPluginsPage.title',
|
||||||
|
}),
|
||||||
|
}}
|
||||||
|
content={formatMessage({
|
||||||
|
id: 'app.components.ListPluginsPage.description',
|
||||||
|
})}
|
||||||
|
actions={[]}
|
||||||
|
/>
|
||||||
|
</ContainerFluid>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default InstalledPluginsPage;
|
||||||
@ -2,7 +2,7 @@ import styled from 'styled-components';
|
|||||||
|
|
||||||
const Wrapper = styled.div`
|
const Wrapper = styled.div`
|
||||||
padding: 18px 30px !important;
|
padding: 18px 30px !important;
|
||||||
overflow: hidden;
|
// overflow: hidden;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export default Wrapper;
|
export default Wrapper;
|
||||||
|
|||||||
@ -46,6 +46,8 @@ export class ListPluginsPage extends React.Component {
|
|||||||
return <LoadingIndicatorPage />;
|
return <LoadingIndicatorPage />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(this.props.plugins);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<FormattedMessage id="app.components.ListPluginsPage.helmet.title">
|
<FormattedMessage id="app.components.ListPluginsPage.helmet.title">
|
||||||
|
|||||||
@ -40,7 +40,7 @@ export function* pluginsGet() {
|
|||||||
call(request, '/admin/plugins', { method: 'GET' }),
|
call(request, '/admin/plugins', { method: 'GET' }),
|
||||||
]);
|
]);
|
||||||
const locale = yield select(selectLocale());
|
const locale = yield select(selectLocale());
|
||||||
|
console.log({ response });
|
||||||
const opts = {
|
const opts = {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
import ContainerFluid from '../../components/ContainerFluid';
|
||||||
|
|
||||||
const Wrapper = styled.div`
|
const Wrapper = styled(ContainerFluid)`
|
||||||
padding: 18px 30px !important;
|
|
||||||
> div:first-child {
|
> div:first-child {
|
||||||
margin-bottom: 11px;
|
margin-bottom: 11px;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,11 +6,10 @@ import {
|
|||||||
request,
|
request,
|
||||||
} from 'strapi-helper-plugin';
|
} from 'strapi-helper-plugin';
|
||||||
import { Header } from '@buffetjs/custom';
|
import { Header } from '@buffetjs/custom';
|
||||||
|
import useFetchPluginsFromMarketPlace from '../../hooks/useFetchPluginsFromMarketPlace';
|
||||||
import PageTitle from '../../components/PageTitle';
|
import PageTitle from '../../components/PageTitle';
|
||||||
import PluginCard from '../../components/PluginCard';
|
import PluginCard from '../../components/PluginCard';
|
||||||
import Wrapper from './Wrapper';
|
import Wrapper from './Wrapper';
|
||||||
import useFetchPluginsFromMarketPlace from '../../hooks/useFetchPluginsFromMarketPlace';
|
|
||||||
|
|
||||||
const MarketPlacePage = ({ history }) => {
|
const MarketPlacePage = ({ history }) => {
|
||||||
const {
|
const {
|
||||||
@ -66,7 +65,7 @@ const MarketPlacePage = ({ history }) => {
|
|||||||
id: 'app.components.InstallPluginPage.helmet',
|
id: 'app.components.InstallPluginPage.helmet',
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
<Wrapper className="container-fluid">
|
<Wrapper>
|
||||||
<Header
|
<Header
|
||||||
title={{
|
title={{
|
||||||
label: formatMessage({
|
label: formatMessage({
|
||||||
|
|||||||
@ -21,6 +21,7 @@ const plugin = {
|
|||||||
initializer: Initializer,
|
initializer: Initializer,
|
||||||
injectedComponents: [],
|
injectedComponents: [],
|
||||||
isReady: false,
|
isReady: false,
|
||||||
|
isRequired: pluginPkg.strapi.required || false,
|
||||||
layout: null,
|
layout: null,
|
||||||
lifecycles,
|
lifecycles,
|
||||||
leftMenuLinks: [],
|
leftMenuLinks: [],
|
||||||
|
|||||||
@ -18,6 +18,7 @@ export default strapi => {
|
|||||||
initializer: Initializer,
|
initializer: Initializer,
|
||||||
injectedComponents: [],
|
injectedComponents: [],
|
||||||
isReady: false,
|
isReady: false,
|
||||||
|
isRequired: pluginPkg.strapi.required || false,
|
||||||
layout: null,
|
layout: null,
|
||||||
lifecycles,
|
lifecycles,
|
||||||
leftMenuLinks: [],
|
leftMenuLinks: [],
|
||||||
|
|||||||
@ -38,6 +38,7 @@ export default strapi => {
|
|||||||
key: 'content-type-builder.form',
|
key: 'content-type-builder.form',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
isRequired: pluginPkg.strapi.required || false,
|
||||||
layout: null,
|
layout: null,
|
||||||
lifecycles,
|
lifecycles,
|
||||||
leftMenuLinks: [],
|
leftMenuLinks: [],
|
||||||
|
|||||||
@ -18,6 +18,7 @@ export default strapi => {
|
|||||||
initializer: Initializer,
|
initializer: Initializer,
|
||||||
injectedComponents: [],
|
injectedComponents: [],
|
||||||
isReady: false,
|
isReady: false,
|
||||||
|
isRequired: pluginPkg.strapi.required || false,
|
||||||
layout: null,
|
layout: null,
|
||||||
lifecycles,
|
lifecycles,
|
||||||
leftMenuLinks: [],
|
leftMenuLinks: [],
|
||||||
|
|||||||
@ -18,6 +18,7 @@ export default strapi => {
|
|||||||
id: pluginId,
|
id: pluginId,
|
||||||
initializer: Initializer,
|
initializer: Initializer,
|
||||||
injectedComponents: [],
|
injectedComponents: [],
|
||||||
|
isRequired: pluginPkg.strapi.required || false,
|
||||||
layout: null,
|
layout: null,
|
||||||
lifecycles,
|
lifecycles,
|
||||||
leftMenuLinks: [],
|
leftMenuLinks: [],
|
||||||
|
|||||||
@ -15,6 +15,7 @@ export default strapi => {
|
|||||||
isReady: true,
|
isReady: true,
|
||||||
initializer: () => null,
|
initializer: () => null,
|
||||||
injectedComponents: [],
|
injectedComponents: [],
|
||||||
|
isRequired: pluginPkg.strapi.required || false,
|
||||||
layout: null,
|
layout: null,
|
||||||
lifecycles: () => {},
|
lifecycles: () => {},
|
||||||
leftMenuLinks: [],
|
leftMenuLinks: [],
|
||||||
|
|||||||
@ -17,6 +17,7 @@ export default strapi => {
|
|||||||
id: pluginId,
|
id: pluginId,
|
||||||
initializer: Initializer,
|
initializer: Initializer,
|
||||||
injectedComponents: [],
|
injectedComponents: [],
|
||||||
|
isRequired: pluginPkg.strapi.required || false,
|
||||||
layout: null,
|
layout: null,
|
||||||
lifecycles,
|
lifecycles,
|
||||||
leftMenuLinks: [],
|
leftMenuLinks: [],
|
||||||
|
|||||||
@ -19,6 +19,7 @@ export default strapi => {
|
|||||||
id: pluginId,
|
id: pluginId,
|
||||||
initializer: Initializer,
|
initializer: Initializer,
|
||||||
injectedComponents: [],
|
injectedComponents: [],
|
||||||
|
isRequired: pluginPkg.strapi.required || false,
|
||||||
layout,
|
layout,
|
||||||
lifecycles,
|
lifecycles,
|
||||||
leftMenuLinks: [],
|
leftMenuLinks: [],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user