strapi-plugin-navigation 3.0.2 → 3.0.3-beta.1
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/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