@paris-ias/trees 2.0.16 → 2.0.18

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 (61) hide show
  1. package/dist/form/actions.cjs.js +47 -9
  2. package/dist/form/actions.js +47 -9
  3. package/dist/form/affiliations.cjs.js +47 -9
  4. package/dist/form/affiliations.js +47 -9
  5. package/dist/form/apps.cjs.js +47 -9
  6. package/dist/form/apps.js +47 -9
  7. package/dist/form/disciplines.cjs.js +47 -9
  8. package/dist/form/disciplines.js +47 -9
  9. package/dist/form/events.cjs.js +47 -9
  10. package/dist/form/events.js +47 -9
  11. package/dist/form/fellowships.cjs.js +53 -664
  12. package/dist/form/fellowships.js +53 -664
  13. package/dist/form/files.cjs.js +47 -9
  14. package/dist/form/files.js +47 -9
  15. package/dist/form/mailing.cjs.js +47 -9
  16. package/dist/form/mailing.js +47 -9
  17. package/dist/form/news.cjs.js +47 -9
  18. package/dist/form/news.js +47 -9
  19. package/dist/form/people.cjs.js +47 -9
  20. package/dist/form/people.js +47 -9
  21. package/dist/form/projects.cjs.js +47 -9
  22. package/dist/form/projects.js +47 -9
  23. package/dist/form/publications.cjs.js +47 -9
  24. package/dist/form/publications.js +47 -9
  25. package/dist/form/tags.cjs.js +47 -9
  26. package/dist/form/tags.js +47 -9
  27. package/dist/form/users.cjs.js +47 -9
  28. package/dist/form/users.js +47 -9
  29. package/dist/graphql/client/misc/apex.mutations.delete.gql +3 -0
  30. package/dist/graphql/client/misc/apex.mutations.upsert.gql +8 -0
  31. package/dist/graphql/schemas/apex-resolvers-list.json +2 -0
  32. package/dist/graphql/schemas/schema.apex.graphql +2 -0
  33. package/dist/list/actions.cjs.js +49 -10
  34. package/dist/list/actions.js +49 -10
  35. package/dist/list/affiliations.cjs.js +49 -10
  36. package/dist/list/affiliations.js +49 -10
  37. package/dist/list/apps.cjs.js +49 -10
  38. package/dist/list/apps.js +49 -10
  39. package/dist/list/disciplines.cjs.js +49 -10
  40. package/dist/list/disciplines.js +49 -10
  41. package/dist/list/events.cjs.js +65 -18
  42. package/dist/list/events.js +65 -18
  43. package/dist/list/fellowships.cjs.js +55 -13
  44. package/dist/list/fellowships.js +55 -13
  45. package/dist/list/files.cjs.js +49 -10
  46. package/dist/list/files.js +49 -10
  47. package/dist/list/mailing.cjs.js +49 -10
  48. package/dist/list/mailing.js +49 -10
  49. package/dist/list/news.cjs.js +51 -11
  50. package/dist/list/news.js +51 -11
  51. package/dist/list/people.cjs.js +57 -14
  52. package/dist/list/people.js +57 -14
  53. package/dist/list/projects.cjs.js +51 -11
  54. package/dist/list/projects.js +51 -11
  55. package/dist/list/publications.cjs.js +55 -13
  56. package/dist/list/publications.js +55 -13
  57. package/dist/list/tags.cjs.js +49 -10
  58. package/dist/list/tags.js +49 -10
  59. package/dist/list/users.cjs.js +57 -14
  60. package/dist/list/users.js +57 -14
  61. package/package.json +1 -1
@@ -1,15 +1,53 @@
1
1
  // Deep freeze utility to make exports immutable
2
- const deepFreeze = (obj) => {
3
- Object.freeze(obj);
4
- Object.getOwnPropertyNames(obj).forEach(prop => {
5
- if (obj[prop] !== null
6
- && (typeof obj[prop] === "object" || typeof obj[prop] === "function")
7
- && !Object.isFrozen(obj[prop])) {
8
- deepFreeze(obj[prop]);
2
+ const lockAllBut = (obj, mutableKeys = []) => {
3
+ for (const key of Object.getOwnPropertyNames(obj)) {
4
+ if (mutableKeys.includes(key)) continue;
5
+
6
+ const desc = Object.getOwnPropertyDescriptor(obj, key);
7
+ if (!desc) continue;
8
+
9
+ if ("value" in desc) {
10
+ Object.defineProperty(obj, key, {
11
+ ...desc,
12
+ writable: false,
13
+ configurable: false,
14
+ });
15
+ } else {
16
+ Object.defineProperty(obj, key, {
17
+ ...desc,
18
+ configurable: false,
19
+ });
9
20
  }
10
- });
21
+ }
22
+ Object.preventExtensions(obj);
11
23
  return obj;
12
24
  };
25
+ const selectiveDeepFreeze = (obj, path = []) => {
26
+ if (obj === null || typeof obj !== "object") return obj;
27
+
28
+ if (Array.isArray(obj)) {
29
+ obj.forEach((v, i) => selectiveDeepFreeze(v, path.concat(String(i))));
30
+ return Object.freeze(obj);
31
+ }
32
+
33
+ const parentKey = path.length >= 1 ? path[path.length - 1] : null;
34
+ const grandParentKey = path.length >= 2 ? path[path.length - 2] : null;
35
+
36
+ const isFilterEntry = grandParentKey === "filters";
37
+
38
+ if (isFilterEntry) {
39
+ for (const k of Object.getOwnPropertyNames(obj)) {
40
+ if (k === "value") continue; // laisser value libre
41
+ selectiveDeepFreeze(obj[k], path.concat(parentKey, k));
42
+ }
43
+ return lockAllBut(obj, ["value"]);
44
+ }
45
+
46
+ for (const prop of Object.getOwnPropertyNames(obj)) {
47
+ selectiveDeepFreeze(obj[prop], path.concat(prop));
48
+ }
49
+ return Object.freeze(obj);
50
+ };
13
51
 
14
52
  const data = {
15
53
  "_defaults": {
@@ -95,99 +133,7 @@ const data = {
95
133
  },
96
134
  "fellows": [
97
135
  {
98
- "firstname": "",
99
- "lastname": "",
100
- "biography": {
101
- "en": "",
102
- "fr": ""
103
- },
104
- "image": "",
105
- "experiences": [
106
- {
107
- "experiences": {
108
- "affiliations": "",
109
- "positions": [
110
- {
111
- "positions": {
112
- "role": "",
113
- "department": "",
114
- "start": "",
115
- "stop": ""
116
- }
117
- }
118
- ]
119
- }
120
- }
121
- ],
122
- "socials": {
123
- "website": "",
124
- "wikipedia": "",
125
- "orcid": "",
126
- "scholar": "",
127
- "researchgate": "",
128
- "mendeley": "",
129
- "idRef": "",
130
- "twitter": "",
131
- "linkedin": "",
132
- "bluesky": "",
133
- "instagram": "",
134
- "youtube": ""
135
- },
136
- "disciplines": "",
137
- "video": [
138
- {
139
- "video": {
140
- "url": "",
141
- "caption": {
142
- "en": "",
143
- "fr": ""
144
- },
145
- "alt": {
146
- "en": "",
147
- "fr": ""
148
- },
149
- "copyright": "Free of rights",
150
- "licence": "",
151
- "licenseUrl": "",
152
- "backgroundColor": ""
153
- }
154
- }
155
- ],
156
- "related": {
157
- "events": "",
158
- "news": "",
159
- "people": "",
160
- "publications": "",
161
- "projects": "",
162
- "fellowships": ""
163
- },
164
- "consent": {
165
- "data": false,
166
- "record": false,
167
- "diffusion": false,
168
- "publication": false,
169
- "email": false,
170
- "newsletter": false,
171
- "fellowshipnewsletter": false
172
- },
173
- "groups": {
174
- "team": false,
175
- "sab": false,
176
- "board": false,
177
- "fellows": false,
178
- "sponsor": false,
179
- "vintage": [
180
- {
181
- "name": "",
182
- "year": "",
183
- "theme": {
184
- "en": "",
185
- "fr": ""
186
- },
187
- "url": ""
188
- }
189
- ]
190
- }
136
+ "fellows": ""
191
137
  }
192
138
  ],
193
139
  "gallery": "",
@@ -585,573 +531,16 @@ const data = {
585
531
  "label": "fellows",
586
532
  "component": "CollectionContainerPanel",
587
533
  "type": "ARRAY",
588
- "rules": {
589
- "required": true,
590
- "min": 5,
591
- "max": 200
592
- },
593
- "meta": "fellows",
594
534
  "items": {
595
- "firstname": {
596
- "label": "firstname",
597
- "component": "TextField",
598
- "type": "PRIMITIVE",
599
- "rules": {
600
- "required": true,
601
- "min": 1,
602
- "max": 200
603
- },
604
- "meta": "firstname"
605
- },
606
- "lastname": {
607
- "label": "lastname",
608
- "component": "TextField",
609
- "type": "PRIMITIVE",
610
- "rules": {
611
- "required": true,
612
- "min": 1,
613
- "max": 200
614
- },
615
- "meta": "lastname"
616
- },
617
- "biography": {
618
- "label": "biography",
619
- "component": "TextArea",
620
- "i18n": true,
621
- "type": "PRIMITIVE",
622
- "rules": {
623
- "required": true,
624
- "min": 5,
625
- "max": 500
626
- },
627
- "meta": "biography",
628
- "transformers": [
629
- "CANDIDATES"
630
- ]
631
- },
632
- "image": {
633
- "label": "image",
634
- "component": "ImagePicker",
635
- "type": "DOCUMENT",
636
- "meta": "image",
637
- "default": ""
638
- },
639
- "experiences": {
640
- "label": "experiences",
641
- "component": "CollectionContainerPanel",
642
- "type": "ARRAY",
643
- "items": {
644
- "experiences": {
645
- "label": "experiences",
646
- "component": "ObjectContainerPanel",
647
- "type": "OBJECT",
648
- "meta": "experiences",
649
- "items": {
650
- "affiliations": {
651
- "label": "affiliations",
652
- "component": "DocumentPicker",
653
- "type": "DOCUMENT",
654
- "meta": "affiliations",
655
- "rules": {
656
- "required": true
657
- },
658
- "default": ""
659
- },
660
- "positions": {
661
- "label": "positions",
662
- "component": "CollectionContainerPanel",
663
- "type": "ARRAY",
664
- "meta": "positions",
665
- "items": {
666
- "positions": {
667
- "label": "position",
668
- "component": "ObjectContainerPanel",
669
- "type": "OBJECT",
670
- "meta": "position",
671
- "items": {
672
- "role": {
673
- "label": "role",
674
- "component": "TextField",
675
- "type": "PRIMITIVE",
676
- "rules": {
677
- "required": true,
678
- "min": 2,
679
- "max": 200
680
- },
681
- "meta": "role"
682
- },
683
- "department": {
684
- "label": "department",
685
- "component": "TextField",
686
- "type": "PRIMITIVE",
687
- "rules": {
688
- "required": true,
689
- "min": 3,
690
- "max": 200
691
- },
692
- "meta": "department"
693
- },
694
- "start": {
695
- "label": "start",
696
- "component": "DatePicker",
697
- "type": "PRIMITIVE",
698
- "rules": {
699
- "required": true,
700
- "date": true
701
- },
702
- "meta": "start"
703
- },
704
- "stop": {
705
- "label": "stop",
706
- "component": "DatePicker",
707
- "type": "PRIMITIVE",
708
- "hint": "Leave empty if this is an ongoing position",
709
- "rules": {
710
- "date": true
711
- },
712
- "meta": "stop"
713
- }
714
- }
715
- }
716
- }
717
- }
718
- }
719
- }
720
- }
721
- },
722
- "socials": {
723
- "label": "socials",
724
- "component": "ObjectKeyPairContainer",
725
- "type": "OBJECT",
726
- "meta": "socials",
727
- "items": {
728
- "website": {
729
- "label": "website",
730
- "type": "PRIMITIVE",
731
- "component": "TextField",
732
- "rules": {
733
- "url": true
734
- },
735
- "meta": "website"
736
- },
737
- "wikipedia": {
738
- "label": "wikipedia",
739
- "type": "PRIMITIVE",
740
- "component": "TextField",
741
- "rules": {
742
- "url": true
743
- },
744
- "meta": "wikipedia"
745
- },
746
- "orcid": {
747
- "label": "orcid",
748
- "type": "PRIMITIVE",
749
- "component": "TextField",
750
- "rules": {
751
- "orcid": true
752
- },
753
- "meta": "orcid"
754
- },
755
- "scholar": {
756
- "label": "scholar",
757
- "type": "PRIMITIVE",
758
- "component": "TextField",
759
- "rules": {
760
- "url": true
761
- },
762
- "meta": "scholar"
763
- },
764
- "researchgate": {
765
- "label": "researchgate",
766
- "type": "PRIMITIVE",
767
- "component": "TextField",
768
- "rules": {
769
- "url": true
770
- },
771
- "meta": "researchgate"
772
- },
773
- "mendeley": {
774
- "label": "mendeley",
775
- "type": "PRIMITIVE",
776
- "component": "TextField",
777
- "rules": {
778
- "url": true
779
- },
780
- "meta": "mendeley"
781
- },
782
- "idRef": {
783
- "label": "idRef",
784
- "type": "PRIMITIVE",
785
- "component": "TextField",
786
- "rules": {
787
- "url": true
788
- },
789
- "meta": "idRef"
790
- },
791
- "twitter": {
792
- "label": "twitter",
793
- "type": "PRIMITIVE",
794
- "component": "TextField",
795
- "rules": {
796
- "url": true
797
- },
798
- "meta": "twitter"
799
- },
800
- "linkedin": {
801
- "label": "linkedin",
802
- "type": "PRIMITIVE",
803
- "component": "TextField",
804
- "rules": {
805
- "url": true
806
- },
807
- "meta": "linkedin"
808
- },
809
- "bluesky": {
810
- "label": "bluesky",
811
- "type": "PRIMITIVE",
812
- "component": "TextField",
813
- "rules": {
814
- "url": true
815
- },
816
- "meta": "bluesky"
817
- },
818
- "instagram": {
819
- "label": "instagram",
820
- "type": "PRIMITIVE",
821
- "component": "TextField",
822
- "rules": {
823
- "url": true
824
- },
825
- "meta": "instagram"
826
- },
827
- "youtube": {
828
- "label": "youtube",
829
- "type": "PRIMITIVE",
830
- "component": "TextField",
831
- "rules": {
832
- "url": true
833
- },
834
- "meta": "youtube"
835
- }
836
- }
837
- },
838
- "disciplines": {
839
- "label": "disciplines",
535
+ "fellows": {
536
+ "label": "fellow",
840
537
  "component": "DocumentPicker",
841
538
  "type": "DOCUMENT",
842
- "meta": "disciplines",
539
+ "meta": "fellow",
843
540
  "default": ""
844
- },
845
- "video": {
846
- "label": "videos",
847
- "component": "CollectionContainerPanel",
848
- "type": "ARRAY",
849
- "meta": "video",
850
- "items": {
851
- "video": {
852
- "label": "video",
853
- "component": "ObjectCollapsiblePanel",
854
- "type": "OBJECT",
855
- "meta": "video",
856
- "items": {
857
- "url": {
858
- "type": "PRIMITIVE",
859
- "component": "TextField",
860
- "label": "url",
861
- "description": "The url where the image is fetched from",
862
- "rules": {
863
- "required": true,
864
- "url": true,
865
- "max": 2048
866
- },
867
- "meta": "url"
868
- },
869
- "caption": {
870
- "label": "caption",
871
- "type": "PRIMITIVE",
872
- "component": "TextField",
873
- "i18n": true,
874
- "rules": {
875
- "required": true,
876
- "min": 2,
877
- "max": 100
878
- },
879
- "meta": "caption"
880
- },
881
- "alt": {
882
- "label": "alt",
883
- "type": "PRIMITIVE",
884
- "i18n": true,
885
- "component": "TextField",
886
- "description": "Displayed if the image cannot be loaded",
887
- "rules": {
888
- "max": 200
889
- },
890
- "meta": "alt"
891
- },
892
- "copyright": {
893
- "label": "copyright",
894
- "type": "PRIMITIVE",
895
- "component": "TextField",
896
- "default": "Free of rights",
897
- "description": "Owner of the image copyright",
898
- "meta": "copyright"
899
- },
900
- "licence": {
901
- "label": "licence",
902
- "type": "PRIMITIVE",
903
- "component": "TextField",
904
- "default": null,
905
- "description": "The licence of the video",
906
- "meta": "licence"
907
- },
908
- "licenseUrl": {
909
- "label": "licenseUrl",
910
- "type": "PRIMITIVE",
911
- "component": "TextField",
912
- "default": null,
913
- "description": "The caption of the video",
914
- "rules": {
915
- "url": true
916
- },
917
- "show": {
918
- "default": false,
919
- "switchIf": [],
920
- "disjonctive": false
921
- },
922
- "meta": "licenseUrl"
923
- },
924
- "backgroundColor": {
925
- "label": "backgroundColor",
926
- "type": "PRIMITIVE",
927
- "component": "ColorPicker",
928
- "default": null,
929
- "rules": {
930
- "color": true
931
- },
932
- "show": {
933
- "default": false,
934
- "switchIf": [],
935
- "disjonctive": false
936
- },
937
- "meta": "backgroundColor"
938
- }
939
- }
940
- }
941
- }
942
- },
943
- "related": {
944
- "label": "related",
945
- "component": "ObjectContainerPanel",
946
- "type": "OBJECT",
947
- "rules": {
948
- "required": true,
949
- "min": 5,
950
- "max": 200
951
- },
952
- "meta": "related",
953
- "items": {
954
- "events": {
955
- "label": "relatedEvent",
956
- "component": "DocumentPicker",
957
- "type": "DOCUMENT",
958
- "meta": "event",
959
- "default": ""
960
- },
961
- "news": {
962
- "label": "relatedNews",
963
- "component": "DocumentPicker",
964
- "type": "DOCUMENT",
965
- "meta": "news",
966
- "default": ""
967
- },
968
- "people": {
969
- "label": "relatedPeople",
970
- "component": "DocumentPicker",
971
- "type": "DOCUMENT",
972
- "meta": "people",
973
- "default": ""
974
- },
975
- "publications": {
976
- "label": "relatedPublication",
977
- "component": "DocumentPicker",
978
- "type": "DOCUMENT",
979
- "meta": "publication",
980
- "default": ""
981
- },
982
- "projects": {
983
- "label": "relatedProject",
984
- "component": "DocumentPicker",
985
- "type": "DOCUMENT",
986
- "meta": "project",
987
- "default": ""
988
- },
989
- "fellowships": {
990
- "label": "relatedFellowships",
991
- "component": "DocumentPicker",
992
- "type": "DOCUMENT",
993
- "meta": "fellowship",
994
- "default": ""
995
- }
996
- }
997
- },
998
- "consent": {
999
- "label": "consent",
1000
- "component": "ObjectContainerPanel",
1001
- "type": "OBJECT",
1002
- "meta": "consent",
1003
- "items": {
1004
- "data": {
1005
- "label": "data",
1006
- "component": "Checkbox",
1007
- "type": "PRIMITIVE",
1008
- "default": false,
1009
- "hint": "My profile will be showcased on the Paris IAS websites",
1010
- "meta": "data"
1011
- },
1012
- "record": {
1013
- "label": "record",
1014
- "component": "Checkbox",
1015
- "type": "PRIMITIVE",
1016
- "default": false,
1017
- "hint": "Necessary if you appear in a video or audio recording",
1018
- "meta": "record"
1019
- },
1020
- "diffusion": {
1021
- "label": "diffusion",
1022
- "component": "Checkbox",
1023
- "type": "PRIMITIVE",
1024
- "default": false,
1025
- "hint": "To make available my video and audio recordings in publicaitons, news, events...",
1026
- "meta": "diffusion"
1027
- },
1028
- "publication": {
1029
- "label": "publication",
1030
- "component": "Checkbox",
1031
- "type": "PRIMITIVE",
1032
- "default": false,
1033
- "hint": "To be officially published as an academic author and provide your content with a DOI",
1034
- "meta": "publication"
1035
- },
1036
- "email": {
1037
- "label": "email",
1038
- "component": "Checkbox",
1039
- "type": "PRIMITIVE",
1040
- "default": false,
1041
- "hint": "To allow us to send you email communications in general (including newsletter)",
1042
- "meta": "email"
1043
- },
1044
- "newsletter": {
1045
- "label": "newsletter",
1046
- "component": "Checkbox",
1047
- "type": "PRIMITIVE",
1048
- "default": false,
1049
- "meta": "newsletter"
1050
- },
1051
- "fellowshipnewsletter": {
1052
- "label": "fellowshipnewsletter",
1053
- "component": "Checkbox",
1054
- "type": "PRIMITIVE",
1055
- "default": false,
1056
- "meta": "fellowshipnewsletter"
1057
- }
1058
- }
1059
- },
1060
- "groups": {
1061
- "label": "groups",
1062
- "groups": [
1063
- "ADMIN"
1064
- ],
1065
- "component": "ObjectContainerPanel",
1066
- "type": "OBJECT",
1067
- "meta": "groups",
1068
- "items": {
1069
- "team": {
1070
- "label": "team",
1071
- "component": "Checkbox",
1072
- "type": "PRIMITIVE",
1073
- "meta": "team"
1074
- },
1075
- "sab": {
1076
- "label": "sab",
1077
- "component": "Checkbox",
1078
- "type": "PRIMITIVE",
1079
- "meta": "sab"
1080
- },
1081
- "board": {
1082
- "label": "board",
1083
- "component": "Checkbox",
1084
- "type": "PRIMITIVE",
1085
- "meta": "board"
1086
- },
1087
- "fellows": {
1088
- "label": "fellows",
1089
- "component": "Checkbox",
1090
- "type": "PRIMITIVE",
1091
- "meta": "fellow"
1092
- },
1093
- "sponsor": {
1094
- "label": "sponsor",
1095
- "component": "Checkbox",
1096
- "type": "PRIMITIVE",
1097
- "meta": "sponsor"
1098
- },
1099
- "vintage": {
1100
- "label": "vintage",
1101
- "component": "CollectionContainerPanel",
1102
- "type": "ARRAY",
1103
- "meta": "vintage",
1104
- "items": {
1105
- "name": {
1106
- "label": "name",
1107
- "type": "PRIMITIVE",
1108
- "component": "TextField",
1109
- "rules": {
1110
- "required": true,
1111
- "min": 2,
1112
- "max": 100
1113
- },
1114
- "meta": "name"
1115
- },
1116
- "year": {
1117
- "label": "year",
1118
- "type": "PRIMITIVE",
1119
- "component": "TextField",
1120
- "rules": {
1121
- "required": true,
1122
- "min": 2,
1123
- "max": 100
1124
- },
1125
- "meta": "year"
1126
- },
1127
- "theme": {
1128
- "label": "theme",
1129
- "type": "PRIMITIVE",
1130
- "component": "TextField",
1131
- "i18n": true,
1132
- "rules": {
1133
- "required": true,
1134
- "min": 2,
1135
- "max": 100
1136
- },
1137
- "meta": "theme"
1138
- },
1139
- "url": {
1140
- "type": "PRIMITIVE",
1141
- "component": "TextField",
1142
- "label": "url",
1143
- "rules": {
1144
- "required": true,
1145
- "url": true,
1146
- "max": 2048
1147
- },
1148
- "meta": "url"
1149
- }
1150
- }
1151
- }
1152
- }
1153
541
  }
1154
- }
542
+ },
543
+ "meta": "fellows"
1155
544
  },
1156
545
  "gallery": {
1157
546
  "label": "gallery",
@@ -1319,6 +708,6 @@ const data = {
1319
708
  }
1320
709
  };
1321
710
 
1322
- var fellowships = deepFreeze(data);
711
+ var fellowships = selectiveDeepFreeze(data);
1323
712
 
1324
713
  export { fellowships as default };