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