strapi-plugin-navigation 3.0.2 → 3.0.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.
- package/README.md +16 -24
- package/dist/admin/index.js +14 -12
- package/dist/admin/index.mjs +14 -12
- package/dist/server/index.js +2 -11
- package/dist/server/index.mjs +2 -11
- package/dist/server/src/dtos/navigation-item.d.ts +5 -4
- package/package.json +1 -1
- package/dist/server/src/graphql/types/navigation-item-related-data.d.ts +0 -2
package/README.md
CHANGED
|
@@ -571,16 +571,14 @@ query {
|
|
|
571
571
|
path
|
|
572
572
|
related {
|
|
573
573
|
id
|
|
574
|
-
|
|
575
|
-
__typename
|
|
574
|
+
__typename
|
|
576
575
|
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
576
|
+
... on Page {
|
|
577
|
+
Title
|
|
578
|
+
}
|
|
580
579
|
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
}
|
|
580
|
+
... on WithFlowType {
|
|
581
|
+
Name
|
|
584
582
|
}
|
|
585
583
|
}
|
|
586
584
|
items {
|
|
@@ -589,16 +587,14 @@ query {
|
|
|
589
587
|
path
|
|
590
588
|
related {
|
|
591
589
|
id
|
|
592
|
-
|
|
593
|
-
__typename
|
|
590
|
+
__typename
|
|
594
591
|
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
592
|
+
... on Page {
|
|
593
|
+
Title
|
|
594
|
+
}
|
|
598
595
|
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
}
|
|
596
|
+
... on WithFlowType {
|
|
597
|
+
Name
|
|
602
598
|
}
|
|
603
599
|
}
|
|
604
600
|
}
|
|
@@ -618,10 +614,8 @@ query {
|
|
|
618
614
|
"path": "/test-path",
|
|
619
615
|
"related": {
|
|
620
616
|
"id": 3,
|
|
621
|
-
"
|
|
622
|
-
|
|
623
|
-
"Name": "Test"
|
|
624
|
-
}
|
|
617
|
+
"__typename": "WithFlowType",
|
|
618
|
+
"Name": "Test"
|
|
625
619
|
},
|
|
626
620
|
"items": [
|
|
627
621
|
{
|
|
@@ -630,10 +624,8 @@ query {
|
|
|
630
624
|
"path": "/test-path/nested-one",
|
|
631
625
|
"related": {
|
|
632
626
|
"id": 1,
|
|
633
|
-
"
|
|
634
|
-
|
|
635
|
-
"Title": "Eg. Page title"
|
|
636
|
-
}
|
|
627
|
+
"__typename": "Page",
|
|
628
|
+
"Title": "Eg. Page title"
|
|
637
629
|
}
|
|
638
630
|
}
|
|
639
631
|
]
|
package/dist/admin/index.js
CHANGED
|
@@ -53557,7 +53557,8 @@ const NavigationItemForm = ({
|
|
|
53557
53557
|
},
|
|
53558
53558
|
[contentTypeItemsQuery.data, configQuery.data, contentTypes]
|
|
53559
53559
|
);
|
|
53560
|
-
const
|
|
53560
|
+
const availableNavigationItemTypeOptions = !configQuery.data?.contentTypes.length ? ["EXTERNAL", "WRAPPER"] : ["INTERNAL", "EXTERNAL", "WRAPPER"];
|
|
53561
|
+
const navigationItemTypeOptions = availableNavigationItemTypeOptions.map((key) => {
|
|
53561
53562
|
return {
|
|
53562
53563
|
key,
|
|
53563
53564
|
value: key,
|
|
@@ -53739,7 +53740,7 @@ const NavigationItemForm = ({
|
|
|
53739
53740
|
onChange: (eventOrPath) => handleChange("type", eventOrPath, onChange),
|
|
53740
53741
|
value: values.type,
|
|
53741
53742
|
name: "type",
|
|
53742
|
-
disabled: !
|
|
53743
|
+
disabled: !canUpdate,
|
|
53743
53744
|
width: "100%",
|
|
53744
53745
|
children: navigationItemTypeOptions.map(({ key, label, value }) => /* @__PURE__ */ jsxRuntime.jsx(SingleSelectOption, { value, children: label }, key))
|
|
53745
53746
|
}
|
|
@@ -54957,24 +54958,25 @@ const CustomFieldTable = ({
|
|
|
54957
54958
|
children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { textColor: "neutral800", children: customField.required ? /* @__PURE__ */ jsxRuntime.jsx(ForwardRef$4x, {}) : /* @__PURE__ */ jsxRuntime.jsx(ForwardRef$1Z, {}) })
|
|
54958
54959
|
}
|
|
54959
54960
|
) }),
|
|
54960
|
-
/* @__PURE__ */ jsxRuntime.jsx(Td, { children: /* @__PURE__ */ jsxRuntime.
|
|
54961
|
+
/* @__PURE__ */ jsxRuntime.jsx(Td, { children: /* @__PURE__ */ jsxRuntime.jsx(Flex, { width: "100%", justifyContent: "flex-end", alignItems: "center", children: /* @__PURE__ */ jsxRuntime.jsxs(IconButtonGroup, { children: [
|
|
54961
54962
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
54962
54963
|
IconButton$1,
|
|
54963
54964
|
{
|
|
54964
|
-
onClick: () =>
|
|
54965
|
-
label: formatMessage(
|
|
54966
|
-
|
|
54965
|
+
onClick: () => onToggleCustomField(customField),
|
|
54966
|
+
label: formatMessage(
|
|
54967
|
+
getTrad(`${tradPrefix}${customField.enabled ? "disable" : "enable"}`)
|
|
54968
|
+
),
|
|
54969
|
+
variant: customField.enabled ? "success-light" : "tertiary",
|
|
54970
|
+
children: customField.enabled ? /* @__PURE__ */ jsxRuntime.jsx(ForwardRef$3x, {}) : /* @__PURE__ */ jsxRuntime.jsx(ForwardRef$3v, {}),
|
|
54967
54971
|
style: { minWidth: 50 }
|
|
54968
54972
|
}
|
|
54969
54973
|
),
|
|
54970
54974
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
54971
54975
|
IconButton$1,
|
|
54972
54976
|
{
|
|
54973
|
-
onClick: () =>
|
|
54974
|
-
label: formatMessage(
|
|
54975
|
-
|
|
54976
|
-
),
|
|
54977
|
-
children: customField.enabled ? /* @__PURE__ */ jsxRuntime.jsx(ForwardRef$3x, {}) : /* @__PURE__ */ jsxRuntime.jsx(ForwardRef$3v, {}),
|
|
54977
|
+
onClick: () => onOpenModal(customField),
|
|
54978
|
+
label: formatMessage(getTrad(`${tradPrefix}edit`)),
|
|
54979
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ForwardRef$1r, {}),
|
|
54978
54980
|
style: { minWidth: 50 }
|
|
54979
54981
|
}
|
|
54980
54982
|
),
|
|
@@ -54987,7 +54989,7 @@ const CustomFieldTable = ({
|
|
|
54987
54989
|
style: { minWidth: 50 }
|
|
54988
54990
|
}
|
|
54989
54991
|
)
|
|
54990
|
-
] }) })
|
|
54992
|
+
] }) }) })
|
|
54991
54993
|
] }, customField.name) : null
|
|
54992
54994
|
) })
|
|
54993
54995
|
]
|
package/dist/admin/index.mjs
CHANGED
|
@@ -53537,7 +53537,8 @@ const NavigationItemForm = ({
|
|
|
53537
53537
|
},
|
|
53538
53538
|
[contentTypeItemsQuery.data, configQuery.data, contentTypes]
|
|
53539
53539
|
);
|
|
53540
|
-
const
|
|
53540
|
+
const availableNavigationItemTypeOptions = !configQuery.data?.contentTypes.length ? ["EXTERNAL", "WRAPPER"] : ["INTERNAL", "EXTERNAL", "WRAPPER"];
|
|
53541
|
+
const navigationItemTypeOptions = availableNavigationItemTypeOptions.map((key) => {
|
|
53541
53542
|
return {
|
|
53542
53543
|
key,
|
|
53543
53544
|
value: key,
|
|
@@ -53719,7 +53720,7 @@ const NavigationItemForm = ({
|
|
|
53719
53720
|
onChange: (eventOrPath) => handleChange("type", eventOrPath, onChange),
|
|
53720
53721
|
value: values.type,
|
|
53721
53722
|
name: "type",
|
|
53722
|
-
disabled: !
|
|
53723
|
+
disabled: !canUpdate,
|
|
53723
53724
|
width: "100%",
|
|
53724
53725
|
children: navigationItemTypeOptions.map(({ key, label, value }) => /* @__PURE__ */ jsx(SingleSelectOption, { value, children: label }, key))
|
|
53725
53726
|
}
|
|
@@ -54937,24 +54938,25 @@ const CustomFieldTable = ({
|
|
|
54937
54938
|
children: /* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children: customField.required ? /* @__PURE__ */ jsx(ForwardRef$4x, {}) : /* @__PURE__ */ jsx(ForwardRef$1Z, {}) })
|
|
54938
54939
|
}
|
|
54939
54940
|
) }),
|
|
54940
|
-
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */
|
|
54941
|
+
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(Flex, { width: "100%", justifyContent: "flex-end", alignItems: "center", children: /* @__PURE__ */ jsxs(IconButtonGroup, { children: [
|
|
54941
54942
|
/* @__PURE__ */ jsx(
|
|
54942
54943
|
IconButton$1,
|
|
54943
54944
|
{
|
|
54944
|
-
onClick: () =>
|
|
54945
|
-
label: formatMessage(
|
|
54946
|
-
|
|
54945
|
+
onClick: () => onToggleCustomField(customField),
|
|
54946
|
+
label: formatMessage(
|
|
54947
|
+
getTrad(`${tradPrefix}${customField.enabled ? "disable" : "enable"}`)
|
|
54948
|
+
),
|
|
54949
|
+
variant: customField.enabled ? "success-light" : "tertiary",
|
|
54950
|
+
children: customField.enabled ? /* @__PURE__ */ jsx(ForwardRef$3x, {}) : /* @__PURE__ */ jsx(ForwardRef$3v, {}),
|
|
54947
54951
|
style: { minWidth: 50 }
|
|
54948
54952
|
}
|
|
54949
54953
|
),
|
|
54950
54954
|
/* @__PURE__ */ jsx(
|
|
54951
54955
|
IconButton$1,
|
|
54952
54956
|
{
|
|
54953
|
-
onClick: () =>
|
|
54954
|
-
label: formatMessage(
|
|
54955
|
-
|
|
54956
|
-
),
|
|
54957
|
-
children: customField.enabled ? /* @__PURE__ */ jsx(ForwardRef$3x, {}) : /* @__PURE__ */ jsx(ForwardRef$3v, {}),
|
|
54957
|
+
onClick: () => onOpenModal(customField),
|
|
54958
|
+
label: formatMessage(getTrad(`${tradPrefix}edit`)),
|
|
54959
|
+
children: /* @__PURE__ */ jsx(ForwardRef$1r, {}),
|
|
54958
54960
|
style: { minWidth: 50 }
|
|
54959
54961
|
}
|
|
54960
54962
|
),
|
|
@@ -54967,7 +54969,7 @@ const CustomFieldTable = ({
|
|
|
54967
54969
|
style: { minWidth: 50 }
|
|
54968
54970
|
}
|
|
54969
54971
|
)
|
|
54970
|
-
] }) })
|
|
54972
|
+
] }) }) })
|
|
54971
54973
|
] }, customField.name) : null
|
|
54972
54974
|
) })
|
|
54973
54975
|
]
|
package/dist/server/index.js
CHANGED
|
@@ -846,7 +846,7 @@ const navigationItem$1 = ({ nexus, config: config2 }) => nexus.objectType({
|
|
|
846
846
|
t.field("parent", { type: "NavigationItem" });
|
|
847
847
|
t.string("master");
|
|
848
848
|
t.list.field("items", { type: "NavigationItem" });
|
|
849
|
-
t.field("related", { type: "
|
|
849
|
+
t.field("related", { type: "NavigationItemRelated" });
|
|
850
850
|
if (config2.additionalFields.find((field) => field === "audience")) {
|
|
851
851
|
t.list.string("audience");
|
|
852
852
|
}
|
|
@@ -912,7 +912,7 @@ const navigationItemRelated = ({ strapi: strapi2, nexus, config: config2 }) => {
|
|
|
912
912
|
t.members(...related);
|
|
913
913
|
},
|
|
914
914
|
resolveType: (item) => {
|
|
915
|
-
return strapi2.contentTypes[item.
|
|
915
|
+
return strapi2.contentTypes[item.__type]?.globalId;
|
|
916
916
|
}
|
|
917
917
|
});
|
|
918
918
|
}
|
|
@@ -926,14 +926,6 @@ const navigationItemRelated = ({ strapi: strapi2, nexus, config: config2 }) => {
|
|
|
926
926
|
}
|
|
927
927
|
});
|
|
928
928
|
};
|
|
929
|
-
const navigationItemRelatedData = ({ nexus }) => nexus.objectType({
|
|
930
|
-
name: "NavigationItemRelatedData",
|
|
931
|
-
definition(t) {
|
|
932
|
-
t.int("id");
|
|
933
|
-
t.nonNull.string("documentId");
|
|
934
|
-
t.field("attributes", { type: "NavigationItemRelated" });
|
|
935
|
-
}
|
|
936
|
-
});
|
|
937
929
|
const renderType = ({ nexus }) => nexus.enumType({
|
|
938
930
|
name: "NavigationRenderType",
|
|
939
931
|
members: ["FLAT", "TREE"]
|
|
@@ -942,7 +934,6 @@ const typesFactories = [
|
|
|
942
934
|
navigationItemAdditionalFieldMedia,
|
|
943
935
|
navigationItemAdditionalFields,
|
|
944
936
|
navigationItemRelated,
|
|
945
|
-
navigationItemRelatedData,
|
|
946
937
|
navigationItem$1,
|
|
947
938
|
renderType,
|
|
948
939
|
navigation$1,
|
package/dist/server/index.mjs
CHANGED
|
@@ -808,7 +808,7 @@ const navigationItem$1 = ({ nexus, config: config2 }) => nexus.objectType({
|
|
|
808
808
|
t.field("parent", { type: "NavigationItem" });
|
|
809
809
|
t.string("master");
|
|
810
810
|
t.list.field("items", { type: "NavigationItem" });
|
|
811
|
-
t.field("related", { type: "
|
|
811
|
+
t.field("related", { type: "NavigationItemRelated" });
|
|
812
812
|
if (config2.additionalFields.find((field) => field === "audience")) {
|
|
813
813
|
t.list.string("audience");
|
|
814
814
|
}
|
|
@@ -874,7 +874,7 @@ const navigationItemRelated = ({ strapi: strapi2, nexus, config: config2 }) => {
|
|
|
874
874
|
t.members(...related);
|
|
875
875
|
},
|
|
876
876
|
resolveType: (item) => {
|
|
877
|
-
return strapi2.contentTypes[item.
|
|
877
|
+
return strapi2.contentTypes[item.__type]?.globalId;
|
|
878
878
|
}
|
|
879
879
|
});
|
|
880
880
|
}
|
|
@@ -888,14 +888,6 @@ const navigationItemRelated = ({ strapi: strapi2, nexus, config: config2 }) => {
|
|
|
888
888
|
}
|
|
889
889
|
});
|
|
890
890
|
};
|
|
891
|
-
const navigationItemRelatedData = ({ nexus }) => nexus.objectType({
|
|
892
|
-
name: "NavigationItemRelatedData",
|
|
893
|
-
definition(t) {
|
|
894
|
-
t.int("id");
|
|
895
|
-
t.nonNull.string("documentId");
|
|
896
|
-
t.field("attributes", { type: "NavigationItemRelated" });
|
|
897
|
-
}
|
|
898
|
-
});
|
|
899
891
|
const renderType = ({ nexus }) => nexus.enumType({
|
|
900
892
|
name: "NavigationRenderType",
|
|
901
893
|
members: ["FLAT", "TREE"]
|
|
@@ -904,7 +896,6 @@ const typesFactories = [
|
|
|
904
896
|
navigationItemAdditionalFieldMedia,
|
|
905
897
|
navigationItemAdditionalFields,
|
|
906
898
|
navigationItemRelated,
|
|
907
|
-
navigationItemRelatedData,
|
|
908
899
|
navigationItem$1,
|
|
909
900
|
renderType,
|
|
910
901
|
navigation$1,
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { NavigationItemDBSchema, NavigationItemType } from '../schemas';
|
|
2
2
|
import { NavigationDTO } from './navigation';
|
|
3
3
|
export type NavigationItemDTO = Omit<NavigationItemDBSchema, 'related' | 'items' | 'master' | 'parent'> & {
|
|
4
|
-
related?:
|
|
5
|
-
__type: string;
|
|
6
|
-
documentId: string;
|
|
7
|
-
} | null;
|
|
4
|
+
related?: NavigationItemRelatedDTO | null;
|
|
8
5
|
items?: NavigationItemDTO[];
|
|
9
6
|
master?: NavigationDTO;
|
|
10
7
|
parent?: NavigationItemDTO | null;
|
|
11
8
|
order?: number;
|
|
12
9
|
};
|
|
10
|
+
export type NavigationItemRelatedDTO = {
|
|
11
|
+
__type: string;
|
|
12
|
+
documentId: string;
|
|
13
|
+
};
|
|
13
14
|
export type CreateBranchNavigationItemDTO = Omit<NavigationItemDBSchema, 'id' | 'documentId' | 'items'> & {
|
|
14
15
|
id?: number;
|
|
15
16
|
documentId?: string;
|
package/package.json
CHANGED