strapi-plugin-navigation 1.1.3 → 2.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -87
- package/admin/src/components/EmptyView/index.js +7 -16
- package/admin/src/components/Item/ItemCardBadge/index.js +8 -0
- package/admin/src/components/Item/ItemCardHeader/Wrapper.js +21 -0
- package/admin/src/components/Item/ItemCardHeader/index.js +59 -0
- package/admin/src/components/Item/Wrapper.js +39 -0
- package/admin/src/components/Item/index.js +78 -124
- package/admin/src/components/NavigationItemList/Wrapper.js +22 -0
- package/admin/src/components/NavigationItemList/index.js +56 -0
- package/admin/src/components/PluginIcon/index.js +6 -0
- package/admin/src/components/Search/index.js +46 -83
- package/admin/src/index.js +49 -45
- package/admin/src/pages/App/index.js +31 -0
- package/admin/src/{containers → pages}/DataManagerProvider/actions.js +0 -0
- package/admin/src/{containers → pages}/DataManagerProvider/index.js +77 -84
- package/admin/src/{containers → pages}/DataManagerProvider/init.js +0 -0
- package/admin/src/pages/DataManagerProvider/reducer.js +125 -0
- package/admin/src/pages/View/components/NavigationContentHeader/index.js +18 -0
- package/admin/src/pages/View/components/NavigationHeader/index.js +60 -0
- package/admin/src/pages/View/components/NavigationItemForm/index.js +403 -0
- package/admin/src/{containers → pages}/View/components/NavigationItemForm/utils/form.js +2 -2
- package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupFooter.js +40 -0
- package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupHeader.js +20 -0
- package/admin/src/{containers → pages}/View/components/NavigationItemPopup/index.js +16 -16
- package/admin/src/pages/View/index.js +221 -0
- package/admin/src/{containers → pages}/View/utils/enums.js +0 -0
- package/admin/src/{containers → pages}/View/utils/form.js +1 -1
- package/admin/src/{containers → pages}/View/utils/index.js +0 -0
- package/admin/src/{containers → pages}/View/utils/parsers.js +13 -12
- package/admin/src/pluginId.js +3 -2
- package/admin/src/translations/en.json +47 -38
- package/admin/src/translations/fr.json +7 -1
- package/admin/src/utils/getTrad.js +2 -2
- package/package.json +18 -7
- package/server/bootstrap.js +41 -0
- package/server/config/index.js +8 -0
- package/server/config.js +8 -0
- package/server/content-types/audience/index.js +9 -0
- package/{models/audience.js → server/content-types/audience/lifecycle.js} +0 -0
- package/{models/audience.settings.json → server/content-types/audience/schema.json} +4 -2
- package/server/content-types/index.js +13 -0
- package/server/content-types/navigation/index.js +9 -0
- package/{models/navigation.js → server/content-types/navigation/lifecycle.js} +0 -0
- package/server/content-types/navigation/schema.js +45 -0
- package/server/content-types/navigation-item/index.js +9 -0
- package/{models/navigationItem.js → server/content-types/navigation-item/lifecycle.js} +0 -0
- package/{models/navigationItem.settings.json → server/content-types/navigation-item/schema.json} +16 -12
- package/server/content-types/navigations-items-related/index.js +9 -0
- package/{models/navigations_items_related.js → server/content-types/navigations-items-related/lifecycle.js} +0 -0
- package/{models/navigations_items_related.settings.json → server/content-types/navigations-items-related/schema.json} +4 -2
- package/server/controllers/index.js +7 -0
- package/{controllers → server/controllers}/navigation.js +20 -31
- package/server/graphql/index.js +23 -0
- package/server/graphql/queries/index.js +17 -0
- package/server/graphql/queries/render-navigation-child.js +16 -0
- package/server/graphql/queries/render-navigation.js +15 -0
- package/server/graphql/resolvers-config.js +4 -0
- package/server/graphql/types/content-types-name-fields.js +8 -0
- package/server/graphql/types/content-types.js +16 -0
- package/server/graphql/types/create-navigation-item.js +17 -0
- package/server/graphql/types/create-navigation-related.js +8 -0
- package/server/graphql/types/create-navigation.js +7 -0
- package/server/graphql/types/index.js +15 -0
- package/server/graphql/types/navigation-config.js +9 -0
- package/server/graphql/types/navigation-details.js +10 -0
- package/server/graphql/types/navigation-item.js +29 -0
- package/server/graphql/types/navigation-related.js +23 -0
- package/server/graphql/types/navigation-render-type.js +4 -0
- package/server/graphql/types/navigation.js +9 -0
- package/server/register.js +5 -0
- package/server/routes/admin.js +38 -0
- package/server/routes/client.js +21 -0
- package/server/routes/index.js +4 -0
- package/{services → server/services}/__tests__/navigation.test.js +0 -0
- package/server/services/index.js +7 -0
- package/server/services/navigation.js +729 -0
- package/{services → server/services}/utils/constant.js +3 -1
- package/server/services/utils/functions.js +185 -0
- package/strapi-admin.js +1 -0
- package/strapi-server.js +20 -0
- package/__mocks__/helpers/another-plugin/blog-post.settings.json +0 -31
- package/__mocks__/helpers/another-plugin/pages.settings.json +0 -28
- package/__mocks__/helpers/blog-post.settings.json +0 -31
- package/__mocks__/helpers/home-page.settings.json +0 -4
- package/__mocks__/helpers/my-homepage.settings.json +0 -27
- package/__mocks__/helpers/pages.settings.json +0 -27
- package/__mocks__/helpers/strapi.js +0 -101
- package/admin/src/assets/images/icon-cross-blue.svg +0 -1
- package/admin/src/assets/images/icon_remove.svg +0 -19
- package/admin/src/components/Container/index.js +0 -7
- package/admin/src/components/Input/index.js +0 -41
- package/admin/src/components/Item/CardItem.js +0 -46
- package/admin/src/components/Item/CardItemLevelAdd.js +0 -41
- package/admin/src/components/Item/CardItemLevelWrapper.js +0 -27
- package/admin/src/components/Item/CardItemPath.js +0 -9
- package/admin/src/components/Item/CardItemRestore.js +0 -19
- package/admin/src/components/Item/CardItemTitle.js +0 -5
- package/admin/src/components/Item/CardWrapper.js +0 -78
- package/admin/src/components/ItemFooter/CardItemError.js +0 -11
- package/admin/src/components/ItemFooter/CardItemRelation.js +0 -18
- package/admin/src/components/ItemFooter/CardItemRelationStatus.js +0 -17
- package/admin/src/components/ItemFooter/CardItemType.js +0 -18
- package/admin/src/components/ItemFooter/Wrapper.js +0 -26
- package/admin/src/components/ItemFooter/index.js +0 -66
- package/admin/src/components/ItemOrdering/CardOrderingButton.js +0 -24
- package/admin/src/components/ItemOrdering/Wrapper.js +0 -24
- package/admin/src/components/ItemOrdering/index.js +0 -36
- package/admin/src/components/List/Container.js +0 -34
- package/admin/src/components/List/ListLevelRoot.js +0 -18
- package/admin/src/components/List/index.js +0 -81
- package/admin/src/components/Option/OptionButton.js +0 -18
- package/admin/src/components/Option/OptionSet.js +0 -14
- package/admin/src/components/Option/Wrapper.js +0 -15
- package/admin/src/components/Option/index.js +0 -47
- package/admin/src/components/Select/ClearIndicator.js +0 -15
- package/admin/src/components/Select/DropdownIndicator.js +0 -39
- package/admin/src/components/Select/ErrorMessage.js +0 -10
- package/admin/src/components/Select/IndicatorSeparator.js +0 -3
- package/admin/src/components/Select/MultiValueContainer.js +0 -43
- package/admin/src/components/Select/StyledOption.js +0 -11
- package/admin/src/components/Select/index.js +0 -68
- package/admin/src/components/Select/utils/styles.js +0 -92
- package/admin/src/containers/App/Wrapper.js +0 -14
- package/admin/src/containers/App/index.js +0 -34
- package/admin/src/containers/DataManagerProvider/reducer.js +0 -136
- package/admin/src/containers/DetailsView/Wrapper.js +0 -21
- package/admin/src/containers/DetailsView/index.js +0 -111
- package/admin/src/containers/Initializer/index.js +0 -26
- package/admin/src/containers/ListView/Footer.js +0 -56
- package/admin/src/containers/ListView/components.js +0 -138
- package/admin/src/containers/ListView/index.js +0 -54
- package/admin/src/containers/View/FadedWrapper.js +0 -51
- package/admin/src/containers/View/HeaderForm.js +0 -9
- package/admin/src/containers/View/HeaderFormCell.js +0 -25
- package/admin/src/containers/View/Wrapper.js +0 -17
- package/admin/src/containers/View/components/NavigationItemForm/ModalFooter.js +0 -45
- package/admin/src/containers/View/components/NavigationItemForm/index.js +0 -427
- package/admin/src/containers/View/components/NavigationItemPopup/MediumPopup.js +0 -6
- package/admin/src/containers/View/index.js +0 -240
- package/admin/src/lifecycles.js +0 -3
- package/admin/src/permissions.js +0 -14
- package/config/functions/bootstrap.js +0 -138
- package/config/routes.json +0 -60
- package/config/schema.graphql.js +0 -209
- package/examples/audit-log-integrations.js.md +0 -38
- package/models/navigation.settings.json +0 -43
- package/public/assets/preview.png +0 -0
- package/services/navigation.js +0 -732
- package/services/utils/functions.js +0 -186
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
import { Button, FilterIcon as Filter } from "strapi-helper-plugin";
|
|
3
|
-
import RemoveIcon from "../../assets/images/icon-cross-blue.svg";
|
|
4
|
-
|
|
5
|
-
const Wrapper = styled.div`
|
|
6
|
-
padding-top: 1px;
|
|
7
|
-
`;
|
|
8
|
-
|
|
9
|
-
const FilterIcon = styled(Filter)`
|
|
10
|
-
padding: 0 !important;
|
|
11
|
-
margin: auto !important;
|
|
12
|
-
> g {
|
|
13
|
-
stroke: #282b2c;
|
|
14
|
-
}
|
|
15
|
-
`;
|
|
16
|
-
|
|
17
|
-
const AddFilterCta = styled(Button)`
|
|
18
|
-
display: flex;
|
|
19
|
-
height: 30px;
|
|
20
|
-
margin-right: 10px;
|
|
21
|
-
padding: 0 10px;
|
|
22
|
-
text-align: center;
|
|
23
|
-
background-color: #ffffff;
|
|
24
|
-
border: 1px solid #e3e9f3;
|
|
25
|
-
border-radius: 2px;
|
|
26
|
-
line-height: 28px;
|
|
27
|
-
font-size: 13px;
|
|
28
|
-
font-weight: 500;
|
|
29
|
-
font-family: Lato;
|
|
30
|
-
-webkit-font-smoothing: antialiased;
|
|
31
|
-
cursor: pointer;
|
|
32
|
-
&:hover {
|
|
33
|
-
background: #f7f8f8;
|
|
34
|
-
}
|
|
35
|
-
&:focus,
|
|
36
|
-
&:active {
|
|
37
|
-
outline: 0;
|
|
38
|
-
}
|
|
39
|
-
> span {
|
|
40
|
-
margin-left: 10px;
|
|
41
|
-
}
|
|
42
|
-
`;
|
|
43
|
-
|
|
44
|
-
const Img = styled.img`
|
|
45
|
-
height: 7px;
|
|
46
|
-
margin: auto;
|
|
47
|
-
margin-right: 0px;
|
|
48
|
-
font-size: 12px;
|
|
49
|
-
`;
|
|
50
|
-
|
|
51
|
-
const FooterWrapper = styled.div`
|
|
52
|
-
padding-top: 3rem;
|
|
53
|
-
`;
|
|
54
|
-
|
|
55
|
-
const Label = styled.label`
|
|
56
|
-
display: inline-block;
|
|
57
|
-
height: 32px;
|
|
58
|
-
margin-left: 10px;
|
|
59
|
-
line-height: 32px;
|
|
60
|
-
color: #787e8f;
|
|
61
|
-
font-size: 13px;
|
|
62
|
-
font-style: italic;
|
|
63
|
-
`;
|
|
64
|
-
|
|
65
|
-
const SelectWrapper = styled.div`
|
|
66
|
-
display: flex;
|
|
67
|
-
`;
|
|
68
|
-
|
|
69
|
-
const FilterWrapper = styled.div`
|
|
70
|
-
display: inline-block;
|
|
71
|
-
height: 30px;
|
|
72
|
-
margin-bottom: 6px;
|
|
73
|
-
margin-right: 10px;
|
|
74
|
-
padding: 0 10px;
|
|
75
|
-
background: rgba(0, 126, 255, 0.08);
|
|
76
|
-
border: 1px solid rgba(0, 126, 255, 0.24);
|
|
77
|
-
border-radius: 2px;
|
|
78
|
-
line-height: 28px;
|
|
79
|
-
color: #007eff;
|
|
80
|
-
font-size: 13px;
|
|
81
|
-
|
|
82
|
-
> span {
|
|
83
|
-
display: inline-block;
|
|
84
|
-
margin-top: -1px;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
> span:nth-child(2) {
|
|
88
|
-
font-weight: 700;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
> span:nth-child(3) {
|
|
92
|
-
cursor: pointer;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
-webkit-font-smoothing: antialiased;
|
|
96
|
-
`;
|
|
97
|
-
|
|
98
|
-
const Separator = styled.span`
|
|
99
|
-
height: 30px;
|
|
100
|
-
margin-left: 10px;
|
|
101
|
-
margin-right: 10px;
|
|
102
|
-
line-height: 30px;
|
|
103
|
-
&:after {
|
|
104
|
-
content: "";
|
|
105
|
-
height: 15px;
|
|
106
|
-
border-left: 1px solid #007eff;
|
|
107
|
-
opacity: 0.1;
|
|
108
|
-
}
|
|
109
|
-
`;
|
|
110
|
-
|
|
111
|
-
const Remove = styled.span`
|
|
112
|
-
height: 28px;
|
|
113
|
-
cursor: pointer;
|
|
114
|
-
vertical-align: middle;
|
|
115
|
-
|
|
116
|
-
&:after {
|
|
117
|
-
display: inline-block;
|
|
118
|
-
content: "";
|
|
119
|
-
width: 8px;
|
|
120
|
-
height: 8px;
|
|
121
|
-
margin: auto;
|
|
122
|
-
margin-top: -3px;
|
|
123
|
-
background-image: url(${RemoveIcon});
|
|
124
|
-
}
|
|
125
|
-
`;
|
|
126
|
-
|
|
127
|
-
export {
|
|
128
|
-
AddFilterCta,
|
|
129
|
-
FilterIcon,
|
|
130
|
-
FooterWrapper,
|
|
131
|
-
Img,
|
|
132
|
-
Label,
|
|
133
|
-
SelectWrapper,
|
|
134
|
-
FilterWrapper,
|
|
135
|
-
Separator,
|
|
136
|
-
Remove,
|
|
137
|
-
Wrapper,
|
|
138
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
*
|
|
3
|
-
* ListView
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React from "react";
|
|
8
|
-
import { useGlobalContext, LoadingIndicatorPage } from "strapi-helper-plugin";
|
|
9
|
-
import { FormattedMessage } from "react-intl";
|
|
10
|
-
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
11
|
-
import { faSearch } from "@fortawesome/free-solid-svg-icons";
|
|
12
|
-
import useDataManager from "../../hooks/useDataManager";
|
|
13
|
-
import { isEmpty } from "lodash";
|
|
14
|
-
import { Header } from "@buffetjs/custom";
|
|
15
|
-
import Footer from "./Footer";
|
|
16
|
-
import Wrapper from "../View/Wrapper";
|
|
17
|
-
import FadedWrapper from "../View/FadedWrapper";
|
|
18
|
-
import List from "../../components/List";
|
|
19
|
-
import EmptyView from "../../components/EmptyView";
|
|
20
|
-
import { getTrad, getTradId } from "../../translations";
|
|
21
|
-
|
|
22
|
-
const ListView = () => {
|
|
23
|
-
const { items, isLoadingForDataToBeSet } = useDataManager();
|
|
24
|
-
|
|
25
|
-
const { formatMessage } = useGlobalContext();
|
|
26
|
-
const newItemsCount = items.filter((_) => _.isNew).length;
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<Wrapper className="col-md-4">
|
|
30
|
-
<Header
|
|
31
|
-
title={{
|
|
32
|
-
label: formatMessage(getTrad('list.header.title')),
|
|
33
|
-
}}
|
|
34
|
-
content={formatMessage(
|
|
35
|
-
getTrad('list.header.description'),
|
|
36
|
-
{ count: newItemsCount },
|
|
37
|
-
)}
|
|
38
|
-
/>
|
|
39
|
-
{isLoadingForDataToBeSet && <LoadingIndicatorPage />}
|
|
40
|
-
<FadedWrapper>
|
|
41
|
-
{isEmpty(items) && (
|
|
42
|
-
<EmptyView>
|
|
43
|
-
<FontAwesomeIcon icon={faSearch} size="5x" />
|
|
44
|
-
<FormattedMessage id={getTradId('list.content.empty')} />
|
|
45
|
-
</EmptyView>
|
|
46
|
-
)}
|
|
47
|
-
{!isEmpty(items) && <List items={[...items]} />}
|
|
48
|
-
</FadedWrapper>
|
|
49
|
-
<Footer />
|
|
50
|
-
</Wrapper>
|
|
51
|
-
);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export default ListView;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
|
|
3
|
-
import { sizes } from "strapi-helper-plugin";
|
|
4
|
-
|
|
5
|
-
const FadedWrapper = styled.div`
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
flex-grow: 1;
|
|
9
|
-
padding: 0;
|
|
10
|
-
margin: ${-2 * sizes.margin}px;
|
|
11
|
-
padding-left: ${ 2 * sizes.margin}px;
|
|
12
|
-
|
|
13
|
-
position: relative;
|
|
14
|
-
z-index: 0;
|
|
15
|
-
|
|
16
|
-
overflow: hidden;
|
|
17
|
-
|
|
18
|
-
&:before,
|
|
19
|
-
&:after {
|
|
20
|
-
display: block;
|
|
21
|
-
content: "";
|
|
22
|
-
height: ${4 * sizes.margin}px;
|
|
23
|
-
|
|
24
|
-
position: absolute;
|
|
25
|
-
left: 0;
|
|
26
|
-
right: 0;
|
|
27
|
-
z-index: 1;
|
|
28
|
-
|
|
29
|
-
background: #ffffff;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
&:before {
|
|
33
|
-
top: 0;
|
|
34
|
-
background: linear-gradient(
|
|
35
|
-
180deg,
|
|
36
|
-
rgba(250, 250, 251, 1) 0%,
|
|
37
|
-
rgba(250, 250, 251, 0) 100%
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
&:after {
|
|
42
|
-
bottom: 0;
|
|
43
|
-
background: linear-gradient(
|
|
44
|
-
0deg,
|
|
45
|
-
rgba(250, 250, 251, 1) 0%,
|
|
46
|
-
rgba(250, 250, 251, 0) 100%
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
`;
|
|
50
|
-
|
|
51
|
-
export default FadedWrapper;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
import { Header, HeaderActions } from "@buffetjs/styles";
|
|
3
|
-
|
|
4
|
-
const HeaderFormCell = styled.div`
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: ${(props) =>
|
|
8
|
-
props.align === "right" ? "flex-end" : "flex-start"};
|
|
9
|
-
justify-content: center;
|
|
10
|
-
flex-grow: ${(props) => (props.fill ? 1 : "unset")};
|
|
11
|
-
|
|
12
|
-
${Header} {
|
|
13
|
-
margin-bottom: 0;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
${HeaderActions} {
|
|
17
|
-
padding-top: 0;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.header-title {
|
|
21
|
-
max-width: 100%;
|
|
22
|
-
}
|
|
23
|
-
`;
|
|
24
|
-
|
|
25
|
-
export default HeaderFormCell;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
|
|
3
|
-
import { sizes } from "strapi-helper-plugin";
|
|
4
|
-
|
|
5
|
-
const Wrapper = styled.div`
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
width: 100%;
|
|
9
|
-
height: calc(100vh - ${sizes.header.height});
|
|
10
|
-
min-height: calc(100vh - ${sizes.header.height});
|
|
11
|
-
max-height: calc(100vh - ${sizes.header.height});
|
|
12
|
-
padding-top: 1.8rem;
|
|
13
|
-
padding-left: 2rem;
|
|
14
|
-
padding-right: 2rem;
|
|
15
|
-
`;
|
|
16
|
-
|
|
17
|
-
export default Wrapper;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import styled from "styled-components";
|
|
3
|
-
import { ModalFooter as StrapiModalFooter, colors } from "strapi-helper-plugin";
|
|
4
|
-
|
|
5
|
-
const ModalFooter = styled(StrapiModalFooter)`
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: row;
|
|
8
|
-
|
|
9
|
-
section {
|
|
10
|
-
justify-content: flex-start;
|
|
11
|
-
flex-grow: 1;
|
|
12
|
-
|
|
13
|
-
background-color: ${colors.brightGrey};
|
|
14
|
-
|
|
15
|
-
&:last-of-type {
|
|
16
|
-
justify-content: flex-end;
|
|
17
|
-
|
|
18
|
-
background-color: ${colors.brightGrey};
|
|
19
|
-
|
|
20
|
-
button {
|
|
21
|
-
margin-left: 1rem;
|
|
22
|
-
margin-right: 0;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
label {
|
|
27
|
-
display: flex;
|
|
28
|
-
flex-direction: row;
|
|
29
|
-
align-items: center;
|
|
30
|
-
justify-content: center;
|
|
31
|
-
padding: 0;
|
|
32
|
-
margin: 0;
|
|
33
|
-
|
|
34
|
-
color: ${colors.leftMenu.darkGrey};
|
|
35
|
-
font-weight: 600;
|
|
36
|
-
font-style: italic;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
button {
|
|
40
|
-
margin-right: 1rem;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
`;
|
|
44
|
-
|
|
45
|
-
export default ModalFooter;
|