strapi-plugin-navigation 1.1.1 → 2.0.0-beta.3

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.
Files changed (129) hide show
  1. package/README.md +36 -15
  2. package/admin/src/components/EmptyView/index.js +7 -16
  3. package/admin/src/components/Item/ItemCardBadge/index.js +8 -0
  4. package/admin/src/components/Item/ItemCardHeader/Wrapper.js +21 -0
  5. package/admin/src/components/Item/ItemCardHeader/index.js +59 -0
  6. package/admin/src/components/Item/Wrapper.js +39 -0
  7. package/admin/src/components/Item/index.js +76 -124
  8. package/admin/src/components/NavigationItemList/Wrapper.js +22 -0
  9. package/admin/src/components/NavigationItemList/index.js +54 -0
  10. package/admin/src/components/PluginIcon/index.js +6 -0
  11. package/admin/src/index.js +49 -45
  12. package/admin/src/pages/App/index.js +31 -0
  13. package/admin/src/{containers → pages}/DataManagerProvider/actions.js +0 -0
  14. package/admin/src/{containers → pages}/DataManagerProvider/index.js +77 -84
  15. package/admin/src/{containers → pages}/DataManagerProvider/init.js +0 -0
  16. package/admin/src/pages/DataManagerProvider/reducer.js +125 -0
  17. package/admin/src/pages/View/components/NavigationContentHeader/index.js +18 -0
  18. package/admin/src/pages/View/components/NavigationHeader/index.js +60 -0
  19. package/admin/src/pages/View/components/NavigationItemForm/index.js +403 -0
  20. package/admin/src/{containers → pages}/View/components/NavigationItemForm/utils/form.js +2 -2
  21. package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupFooter.js +40 -0
  22. package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupHeader.js +20 -0
  23. package/admin/src/{containers → pages}/View/components/NavigationItemPopup/index.js +16 -16
  24. package/admin/src/pages/View/index.js +209 -0
  25. package/admin/src/{containers → pages}/View/utils/enums.js +0 -0
  26. package/admin/src/{containers → pages}/View/utils/form.js +1 -1
  27. package/admin/src/{containers → pages}/View/utils/index.js +0 -0
  28. package/admin/src/{containers → pages}/View/utils/parsers.js +13 -12
  29. package/admin/src/pluginId.js +3 -2
  30. package/admin/src/translations/en.json +47 -38
  31. package/admin/src/translations/fr.json +7 -1
  32. package/admin/src/utils/getTrad.js +2 -2
  33. package/package.json +14 -6
  34. package/server/bootstrap.js +41 -0
  35. package/server/config.js +8 -0
  36. package/server/content-types/audience/index.js +9 -0
  37. package/{models/audience.js → server/content-types/audience/lifecycle.js} +0 -0
  38. package/{models/audience.settings.json → server/content-types/audience/schema.json} +4 -2
  39. package/server/content-types/index.js +13 -0
  40. package/server/content-types/navigation/index.js +9 -0
  41. package/{models/navigation.js → server/content-types/navigation/lifecycle.js} +0 -0
  42. package/server/content-types/navigation/schema.js +45 -0
  43. package/server/content-types/navigation-item/index.js +9 -0
  44. package/{models/navigationItem.js → server/content-types/navigation-item/lifecycle.js} +0 -0
  45. package/{models/navigationItem.settings.json → server/content-types/navigation-item/schema.json} +16 -12
  46. package/server/content-types/navigations-items-related/index.js +9 -0
  47. package/{models/navigations_items_related.js → server/content-types/navigations-items-related/lifecycle.js} +0 -0
  48. package/{models/navigations_items_related.settings.json → server/content-types/navigations-items-related/schema.json} +4 -2
  49. package/server/controllers/index.js +7 -0
  50. package/{controllers → server/controllers}/navigation.js +7 -39
  51. package/server/routes/admin.js +38 -0
  52. package/server/routes/index.js +3 -0
  53. package/{services → server/services}/__tests__/navigation.test.js +0 -0
  54. package/server/services/index.js +7 -0
  55. package/server/services/navigation.js +463 -0
  56. package/{services → server/services}/utils/constant.js +3 -1
  57. package/server/services/utils/functions.js +103 -0
  58. package/strapi-admin.js +1 -0
  59. package/strapi-server.js +18 -0
  60. package/__mocks__/helpers/another-plugin/blog-post.settings.json +0 -31
  61. package/__mocks__/helpers/another-plugin/pages.settings.json +0 -28
  62. package/__mocks__/helpers/blog-post.settings.json +0 -31
  63. package/__mocks__/helpers/home-page.settings.json +0 -4
  64. package/__mocks__/helpers/my-homepage.settings.json +0 -27
  65. package/__mocks__/helpers/pages.settings.json +0 -27
  66. package/__mocks__/helpers/strapi.js +0 -101
  67. package/admin/src/assets/images/icon-cross-blue.svg +0 -1
  68. package/admin/src/assets/images/icon_remove.svg +0 -19
  69. package/admin/src/components/Container/index.js +0 -7
  70. package/admin/src/components/Input/index.js +0 -41
  71. package/admin/src/components/Item/CardItem.js +0 -46
  72. package/admin/src/components/Item/CardItemLevelAdd.js +0 -41
  73. package/admin/src/components/Item/CardItemLevelWrapper.js +0 -27
  74. package/admin/src/components/Item/CardItemPath.js +0 -9
  75. package/admin/src/components/Item/CardItemRestore.js +0 -19
  76. package/admin/src/components/Item/CardItemTitle.js +0 -5
  77. package/admin/src/components/Item/CardWrapper.js +0 -78
  78. package/admin/src/components/ItemFooter/CardItemError.js +0 -11
  79. package/admin/src/components/ItemFooter/CardItemRelation.js +0 -18
  80. package/admin/src/components/ItemFooter/CardItemRelationStatus.js +0 -17
  81. package/admin/src/components/ItemFooter/CardItemType.js +0 -18
  82. package/admin/src/components/ItemFooter/Wrapper.js +0 -26
  83. package/admin/src/components/ItemFooter/index.js +0 -66
  84. package/admin/src/components/ItemOrdering/CardOrderingButton.js +0 -24
  85. package/admin/src/components/ItemOrdering/Wrapper.js +0 -24
  86. package/admin/src/components/ItemOrdering/index.js +0 -36
  87. package/admin/src/components/List/Container.js +0 -34
  88. package/admin/src/components/List/ListLevelRoot.js +0 -18
  89. package/admin/src/components/List/index.js +0 -81
  90. package/admin/src/components/Option/OptionButton.js +0 -18
  91. package/admin/src/components/Option/OptionSet.js +0 -14
  92. package/admin/src/components/Option/Wrapper.js +0 -15
  93. package/admin/src/components/Option/index.js +0 -47
  94. package/admin/src/components/Search/index.js +0 -86
  95. package/admin/src/components/Select/ClearIndicator.js +0 -15
  96. package/admin/src/components/Select/DropdownIndicator.js +0 -39
  97. package/admin/src/components/Select/ErrorMessage.js +0 -10
  98. package/admin/src/components/Select/IndicatorSeparator.js +0 -3
  99. package/admin/src/components/Select/MultiValueContainer.js +0 -43
  100. package/admin/src/components/Select/StyledOption.js +0 -11
  101. package/admin/src/components/Select/index.js +0 -68
  102. package/admin/src/components/Select/utils/styles.js +0 -92
  103. package/admin/src/containers/App/Wrapper.js +0 -14
  104. package/admin/src/containers/App/index.js +0 -34
  105. package/admin/src/containers/DataManagerProvider/reducer.js +0 -136
  106. package/admin/src/containers/DetailsView/Wrapper.js +0 -21
  107. package/admin/src/containers/DetailsView/index.js +0 -111
  108. package/admin/src/containers/Initializer/index.js +0 -26
  109. package/admin/src/containers/ListView/Footer.js +0 -56
  110. package/admin/src/containers/ListView/components.js +0 -138
  111. package/admin/src/containers/ListView/index.js +0 -54
  112. package/admin/src/containers/View/FadedWrapper.js +0 -51
  113. package/admin/src/containers/View/HeaderForm.js +0 -9
  114. package/admin/src/containers/View/HeaderFormCell.js +0 -25
  115. package/admin/src/containers/View/Wrapper.js +0 -17
  116. package/admin/src/containers/View/components/NavigationItemForm/ModalFooter.js +0 -45
  117. package/admin/src/containers/View/components/NavigationItemForm/index.js +0 -427
  118. package/admin/src/containers/View/components/NavigationItemPopup/MediumPopup.js +0 -6
  119. package/admin/src/containers/View/index.js +0 -240
  120. package/admin/src/lifecycles.js +0 -3
  121. package/admin/src/permissions.js +0 -14
  122. package/config/functions/bootstrap.js +0 -138
  123. package/config/routes.json +0 -60
  124. package/config/schema.graphql.js +0 -204
  125. package/examples/audit-log-integrations.js.md +0 -38
  126. package/models/navigation.settings.json +0 -43
  127. package/public/assets/preview.png +0 -0
  128. package/services/navigation.js +0 -730
  129. 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,9 +0,0 @@
1
- import styled from "styled-components";
2
-
3
- const HeaderForm = styled.div`
4
- display: flex;
5
- flex-direction: row;
6
- margin-bottom: 3rem;
7
- `;
8
-
9
- export default HeaderForm;
@@ -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;