@paris-ias/trees 1.8.56

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 (202) hide show
  1. package/LICENSE +679 -0
  2. package/dist/form/action.js +83 -0
  3. package/dist/form/affiliation.js +178 -0
  4. package/dist/form/apps.js +132 -0
  5. package/dist/form/disciplines.js +30 -0
  6. package/dist/form/events.js +836 -0
  7. package/dist/form/fellowships.js +1307 -0
  8. package/dist/form/files.js +30 -0
  9. package/dist/form/mailing.js +43 -0
  10. package/dist/form/news.js +252 -0
  11. package/dist/form/people.js +658 -0
  12. package/dist/form/projects.js +338 -0
  13. package/dist/form/publications.js +364 -0
  14. package/dist/form/tags.js +38 -0
  15. package/dist/form/users.js +576 -0
  16. package/dist/graphql/client/action/query.get.action.gql +22 -0
  17. package/dist/graphql/client/action/query.list.action.gql +32 -0
  18. package/dist/graphql/client/affiliation/query.get.affiliations.gql +37 -0
  19. package/dist/graphql/client/affiliation/query.list.affiliations.gql +43 -0
  20. package/dist/graphql/client/apps/query.get.apps.gql +33 -0
  21. package/dist/graphql/client/apps/query.list.apps.gql +43 -0
  22. package/dist/graphql/client/events/query.get.events.gql +119 -0
  23. package/dist/graphql/client/events/query.list.events.gql +40 -0
  24. package/dist/graphql/client/fellowships/query.get.fellowships.gql +163 -0
  25. package/dist/graphql/client/fellowships/query.list.fellowships.gql +49 -0
  26. package/dist/graphql/client/files/query.get.files.gql +24 -0
  27. package/dist/graphql/client/files/query.list.files.gql +37 -0
  28. package/dist/graphql/client/mailing/query.get.mailing.gql +24 -0
  29. package/dist/graphql/client/mailing/query.list.mailing.gql +23 -0
  30. package/dist/graphql/client/misc/apex.mutations.delete.gql +0 -0
  31. package/dist/graphql/client/misc/apex.mutations.upsert.gql +0 -0
  32. package/dist/graphql/client/misc/apex.queries.login.gql +0 -0
  33. package/dist/graphql/client/misc/query.get.disciplines.gql +17 -0
  34. package/dist/graphql/client/misc/query.get.tags.gql +13 -0
  35. package/dist/graphql/client/misc/query.list.disciplines.gql +23 -0
  36. package/dist/graphql/client/misc/query.list.tags.gql +23 -0
  37. package/dist/graphql/client/news/query.get.news.gql +128 -0
  38. package/dist/graphql/client/news/query.list.news.gql +35 -0
  39. package/dist/graphql/client/people/query.get.people.gql +173 -0
  40. package/dist/graphql/client/people/query.get.users.gql +0 -0
  41. package/dist/graphql/client/people/query.list.people.gql +55 -0
  42. package/dist/graphql/client/people/query.list.users.gql +31 -0
  43. package/dist/graphql/client/projects/query.get.projects.gql +166 -0
  44. package/dist/graphql/client/projects/query.list.projects.gql +33 -0
  45. package/dist/graphql/client/publications/query.get.publications.gql +169 -0
  46. package/dist/graphql/client/publications/query.list.publications.gql +35 -0
  47. package/dist/graphql/schemas/apex-resolvers-list.json +45 -0
  48. package/dist/graphql/schemas/schema.apex.graphql +946 -0
  49. package/dist/graphql/schemas/schema.website.graphql +794 -0
  50. package/dist/graphql/schemas/website-resolvers-list.json +22 -0
  51. package/dist/list/action.js +133 -0
  52. package/dist/list/affiliation.js +133 -0
  53. package/dist/list/apps.js +133 -0
  54. package/dist/list/disciplines.js +132 -0
  55. package/dist/list/events.js +186 -0
  56. package/dist/list/fellowships.js +149 -0
  57. package/dist/list/files.js +132 -0
  58. package/dist/list/mailing.js +132 -0
  59. package/dist/list/news.js +135 -0
  60. package/dist/list/people.js +176 -0
  61. package/dist/list/projects.js +135 -0
  62. package/dist/list/publications.js +152 -0
  63. package/dist/list/tags.js +133 -0
  64. package/dist/list/users.js +176 -0
  65. package/index.ts +63 -0
  66. package/lib/README.md +206 -0
  67. package/lib/buildClientGraphQL.ts +342 -0
  68. package/lib/buildDefaults.ts +0 -0
  69. package/lib/buildSchemas.ts +109 -0
  70. package/lib/generate.ts +505 -0
  71. package/lib/generateAll.ts +231 -0
  72. package/lib/utils.ts +24 -0
  73. package/package.json +34 -0
  74. package/readme.md +116 -0
  75. package/src/LICENSE +661 -0
  76. package/src/action/graphql/client/query.get.action.gql +22 -0
  77. package/src/action/graphql/client/query.list.action.gql +32 -0
  78. package/src/action/graphql/server/apex.types.action.graphql +15 -0
  79. package/src/action/models/action.ts +147 -0
  80. package/src/affiliation/graphql/client/query.get.affiliations.gql +37 -0
  81. package/src/affiliation/graphql/client/query.list.affiliations.gql +43 -0
  82. package/src/affiliation/graphql/server/shared.types.affiliations.graphql +20 -0
  83. package/src/affiliation/models/affiliation.ts +130 -0
  84. package/src/affiliation/models/member.ts +11 -0
  85. package/src/affiliation/models/partner.ts +9 -0
  86. package/src/apps/graphql/client/query.get.apps.gql +33 -0
  87. package/src/apps/graphql/client/query.list.apps.gql +43 -0
  88. package/src/apps/models/apps.ts +195 -0
  89. package/src/events/graphql/client/query.get.events.gql +119 -0
  90. package/src/events/graphql/client/query.list.events.gql +40 -0
  91. package/src/events/graphql/server/shared.inputs.events.graphql +24 -0
  92. package/src/events/models/eventSlot.ts +73 -0
  93. package/src/events/models/events.ts +569 -0
  94. package/src/fellowships/graphql/client/query.get.fellowships.gql +163 -0
  95. package/src/fellowships/graphql/client/query.list.fellowships.gql +49 -0
  96. package/src/fellowships/graphql/server/apex.inputs.fellowshipDetails.graphql +13 -0
  97. package/src/fellowships/graphql/server/shared.types.fellowshipDetails.graphql +13 -0
  98. package/src/fellowships/graphql/server/shared.types.fellowships.graphql +38 -0
  99. package/src/fellowships/models/fellowshipDetails.ts +145 -0
  100. package/src/fellowships/models/fellowships.ts +341 -0
  101. package/src/files/graphql/client/query.get.files.gql +24 -0
  102. package/src/files/graphql/client/query.list.files.gql +37 -0
  103. package/src/files/graphql/server/apex.inputs.files.graphql +7 -0
  104. package/src/files/graphql/server/apex.inputs.video.graphql +9 -0
  105. package/src/files/graphql/server/apex.types.files.graphql +4 -0
  106. package/src/files/graphql/server/shared.inputs.image.graphql +9 -0
  107. package/src/files/graphql/server/shared.types.files.graphql +15 -0
  108. package/src/files/graphql/server/shared.types.image.graphql +9 -0
  109. package/src/files/graphql/server/shared.types.video.graphql +9 -0
  110. package/src/files/models/files.ts +113 -0
  111. package/src/files/models/gallery.ts +11 -0
  112. package/src/files/models/image.ts +159 -0
  113. package/src/files/models/video.ts +166 -0
  114. package/src/form.ts +52 -0
  115. package/src/index.ts +98 -0
  116. package/src/list.ts +34 -0
  117. package/src/mailing/graphql/client/query.get.mailing.gql +24 -0
  118. package/src/mailing/graphql/client/query.list.mailing.gql +23 -0
  119. package/src/mailing/graphql/server/apex.types.mailing.graphql +13 -0
  120. package/src/mailing/models/mailing.ts +123 -0
  121. package/src/misc/graphql/client/apex.mutations.delete.gql +0 -0
  122. package/src/misc/graphql/client/apex.mutations.upsert.gql +0 -0
  123. package/src/misc/graphql/client/apex.queries.login.gql +0 -0
  124. package/src/misc/graphql/client/query.get.disciplines.gql +17 -0
  125. package/src/misc/graphql/client/query.get.tags.gql +13 -0
  126. package/src/misc/graphql/client/query.list.disciplines.gql +23 -0
  127. package/src/misc/graphql/client/query.list.tags.gql +23 -0
  128. package/src/misc/graphql/server/apex.inputs.misc.graphql +13 -0
  129. package/src/misc/graphql/server/apex.inputs.socials.graphql +12 -0
  130. package/src/misc/graphql/server/apex.mutations.graphql +23 -0
  131. package/src/misc/graphql/server/apex.queries.graphql +36 -0
  132. package/src/misc/graphql/server/apex.types.disciplines.graphql +4 -0
  133. package/src/misc/graphql/server/apex.types.tags.graphql +4 -0
  134. package/src/misc/graphql/server/shared.enums.graphql +112 -0
  135. package/src/misc/graphql/server/shared.inputs.misc.graphql +101 -0
  136. package/src/misc/graphql/server/shared.queries.graphql +35 -0
  137. package/src/misc/graphql/server/shared.types.disciplines.graphql +8 -0
  138. package/src/misc/graphql/server/shared.types.events.graphql +39 -0
  139. package/src/misc/graphql/server/shared.types.location.graphql +17 -0
  140. package/src/misc/graphql/server/shared.types.misc.graphql +120 -0
  141. package/src/misc/graphql/server/shared.types.related.graphql +10 -0
  142. package/src/misc/graphql/server/shared.types.relatedAffiliation.graphql +7 -0
  143. package/src/misc/graphql/server/shared.types.relatedEvent.graphql +7 -0
  144. package/src/misc/graphql/server/shared.types.relatedFellowships.graphql +7 -0
  145. package/src/misc/graphql/server/shared.types.relatedNews.graphql +7 -0
  146. package/src/misc/graphql/server/shared.types.relatedPeople.graphql +6 -0
  147. package/src/misc/graphql/server/shared.types.relatedProject.graphql +7 -0
  148. package/src/misc/graphql/server/shared.types.relatedPublications.graphql +6 -0
  149. package/src/misc/graphql/server/shared.types.socials.graphql +22 -0
  150. package/src/misc/graphql/server/shared.types.tags.graphql +11 -0
  151. package/src/misc/graphql/server/website.mutations.graphql +4 -0
  152. package/src/misc/models/disciplines.ts +116 -0
  153. package/src/misc/models/location.ts +136 -0
  154. package/src/misc/models/organizers.ts +13 -0
  155. package/src/misc/models/related.ts +123 -0
  156. package/src/misc/models/relatedEvents.ts +16 -0
  157. package/src/misc/models/relatedFellowships.ts +7 -0
  158. package/src/misc/models/relatedNews.ts +13 -0
  159. package/src/misc/models/relatedPeople.ts +8 -0
  160. package/src/misc/models/relatedProject.ts +14 -0
  161. package/src/misc/models/relatedPublications.ts +14 -0
  162. package/src/misc/models/socials.ts +133 -0
  163. package/src/misc/models/sponsor.ts +13 -0
  164. package/src/misc/models/tags.ts +116 -0
  165. package/src/misc/models/taxonomy.ts +1 -0
  166. package/src/model.ts +7 -0
  167. package/src/news/graphql/client/query.get.news.gql +128 -0
  168. package/src/news/graphql/client/query.list.news.gql +35 -0
  169. package/src/news/graphql/server/share.types.news.graphql +27 -0
  170. package/src/news/models/news.ts +257 -0
  171. package/src/people/graphql/client/query.get.people.gql +173 -0
  172. package/src/people/graphql/client/query.get.users.gql +0 -0
  173. package/src/people/graphql/client/query.list.people.gql +55 -0
  174. package/src/people/graphql/client/query.list.users.gql +31 -0
  175. package/src/people/graphql/server/apex.inputs.consent.graphql +9 -0
  176. package/src/people/graphql/server/apex.inputs.groups.graphql +8 -0
  177. package/src/people/graphql/server/apex.inputs.vintage.graphql +6 -0
  178. package/src/people/graphql/server/shared.types.consent.graphql +9 -0
  179. package/src/people/graphql/server/shared.types.groups.graphql +8 -0
  180. package/src/people/graphql/server/shared.types.people.graphql +29 -0
  181. package/src/people/graphql/server/shared.types.position.graphql +6 -0
  182. package/src/people/graphql/server/shared.types.users.graphql +17 -0
  183. package/src/people/graphql/server/shared.types.vintage.graphql +6 -0
  184. package/src/people/models/consent.ts +82 -0
  185. package/src/people/models/discussants.ts +9 -0
  186. package/src/people/models/experiences.ts +38 -0
  187. package/src/people/models/fellows.ts +12 -0
  188. package/src/people/models/groups.ts +58 -0
  189. package/src/people/models/people.ts +244 -0
  190. package/src/people/models/position.ts +62 -0
  191. package/src/people/models/speakers.ts +9 -0
  192. package/src/people/models/users.ts +252 -0
  193. package/src/people/models/vintage.ts +124 -0
  194. package/src/projects/graphql/client/query.get.projects.gql +166 -0
  195. package/src/projects/graphql/client/query.list.projects.gql +33 -0
  196. package/src/projects/graphql/server/shared.types.projects.graphql +29 -0
  197. package/src/projects/models/projects.ts +249 -0
  198. package/src/publications/graphql/client/query.get.publications.gql +169 -0
  199. package/src/publications/graphql/client/query.list.publications.gql +35 -0
  200. package/src/publications/graphql/server/shared.types.publications.graphql +34 -0
  201. package/src/publications/models/article.ts +262 -0
  202. package/src/publications/models/publications.ts +306 -0
@@ -0,0 +1,244 @@
1
+ import { Affiliation } from "../../affiliation/models/affiliation"
2
+ import { Image } from "../../files/models/image"
3
+ import { Socials } from "../../misc/models/socials"
4
+ import { Position } from "./position"
5
+ import { Consent } from "./consent"
6
+ import { Groups } from "./groups"
7
+ import { Disciplines } from "../../misc/models/disciplines"
8
+ import { Video } from "../../files/models/video"
9
+ import Model from "../../model"
10
+ import { Related } from "../../misc/models/related"
11
+ import { formType, Transformers } from "../../form"
12
+ import { userRole } from "./users"
13
+
14
+ export interface People {
15
+ name: string
16
+ firstname: string
17
+ lastname: string
18
+ affiliations?: [{ affiliation: Affiliation; positions: [Position] }]
19
+ image?: Image
20
+ socials?: Socials
21
+ biography?: string
22
+ consent: Consent
23
+ groups: Groups
24
+ lang: string
25
+ disciplines?: Disciplines[]
26
+ related?: Related[]
27
+ video?: Video[]
28
+ }
29
+
30
+ const defaultConfig: Model = {
31
+ source: "gql",
32
+ list: {
33
+ create: true, // allow to create new items
34
+
35
+ filters: {
36
+ groups: {
37
+ type: "Select",
38
+ },
39
+ vintage: {
40
+ type: "Select",
41
+ show: {
42
+ default: false, // same as hidden = true
43
+ switchIf: [{ groups: "fellows" }], // array of conditions to switch the show, each condition will be assessed as a boolean
44
+ disjonctive: false, //TODO: implement. if true, show only if one of the if is true, if false, show only if all of the if are true
45
+ },
46
+ multiple: true,
47
+ },
48
+ programs: {
49
+ type: "Select",
50
+ show: {
51
+ default: false, // same as hidden = true
52
+ switchIf: [{ groups: "fellows" }], // array of conditions to switch the show, each condition will be assessed as a boolean
53
+ disjonctive: false, //TODO: implement. if true, show only if one of the if is true, if false, show only if all of the if are true
54
+ },
55
+ multiple: true,
56
+ },
57
+ disciplines: {
58
+ type: "Select",
59
+ show: {
60
+ default: false, // same as hidden = true
61
+ switchIf: [{ groups: "fellows" }], // array of conditions to switch the show, each condition will be assessed as a boolean
62
+ disjonctive: false, //TODO: implement. if true, show only if one of the if is true, if false, show only if all of the if are true
63
+ },
64
+ multiple: true,
65
+ },
66
+ member: {
67
+ type: "Select",
68
+ show: {
69
+ default: false, // same as hidden = true
70
+ switchIf: [{ groups: "fellows" }], // array of conditions to switch the show, each condition will be assessed as a boolean
71
+ disjonctive: false, //TODO: implement. if true, show only if one of the if is true, if false, show only if all of the if are true
72
+ },
73
+ multiple: true,
74
+ },
75
+ },
76
+ sort: {
77
+ // sort options
78
+ nameasc: {
79
+ // by name from a to z
80
+ icon: "sort-alphabetical-ascending",
81
+ text: "by-name-from-a-to-z",
82
+ value: ["lastname", 1],
83
+ },
84
+ namedesc: {
85
+ // by name from z to a
86
+ icon: "sort-alphabetical-descending",
87
+ text: "by-name-from-z-to-a",
88
+ value: ["lastname", -1],
89
+ },
90
+ vintagedesc: {
91
+ // by name from z to a
92
+ icon: "sort-calendar-descending",
93
+ text: "by-vintage-from-old-to-recent",
94
+ value: ["groups.vintage.year", 1],
95
+ },
96
+ vintageasc: {
97
+ // by name from z to a
98
+ icon: "sort-calendar-descending",
99
+ text: "by-vintage-from-recent-to-old",
100
+ value: ["groups.vintage.year", -1],
101
+ default: true,
102
+ },
103
+ },
104
+ views: {
105
+ rows: {
106
+ name: "rows",
107
+ icon: "view-list",
108
+ perPage: {
109
+ options: [9, 12, 16],
110
+ default: 9,
111
+ },
112
+ },
113
+ dense: {
114
+ default: true,
115
+ name: "dense",
116
+ icon: "land-rows-horizontal",
117
+ perPage: {
118
+ options: [20, 40, 60, 80, 100],
119
+ default: 20,
120
+ },
121
+ },
122
+ /* expanded: {
123
+ name: "expanded",
124
+ icon: "arrow-expand-vertical",
125
+ }, */
126
+ },
127
+ },
128
+ form: {
129
+ firstname: {
130
+ label: "firstname",
131
+ component: "TextField",
132
+ type: formType.Primitive,
133
+ rules: {
134
+ required: true,
135
+ min: 1,
136
+ max: 200,
137
+ },
138
+ meta: "firstname", // item type on schema.org
139
+ },
140
+ lastname: {
141
+ label: "lastname",
142
+ component: "TextField",
143
+ type: formType.Primitive,
144
+ rules: {
145
+ required: true,
146
+ min: 1,
147
+ max: 200,
148
+ },
149
+ meta: "lastname", // item type on schema.org
150
+ },
151
+ biography: {
152
+ label: "biography",
153
+ component: "TextArea",
154
+ i18n: true,
155
+ type: formType.Primitive,
156
+ rules: {
157
+ required: true,
158
+ min: 5,
159
+ max: 500,
160
+ },
161
+ meta: "biography",
162
+ transformers: [Transformers.Options],
163
+ },
164
+ image: {
165
+ label: "image",
166
+ component: "ImagePicker",
167
+ type: formType.Document,
168
+ meta: "image",
169
+ },
170
+ experiences: {
171
+ label: "experiences",
172
+ component: "CollectionContainerPanel",
173
+ type: formType.Array,
174
+ items: {
175
+ label: "experiences",
176
+ component: "ObjectContainerPanel",
177
+ type: formType.Template,
178
+ meta: "experiences",
179
+ },
180
+ },
181
+
182
+ socials: {
183
+ label: "socials",
184
+ component: "ObjectKeyPairContainer",
185
+ type: formType.Template,
186
+ meta: "socials",
187
+ },
188
+ disciplines: {
189
+ label: "disciplines",
190
+ component: "DocumentPicker",
191
+ type: formType.Document,
192
+ meta: "disciplines",
193
+ },
194
+ video: {
195
+ label: "videos",
196
+ component: "CollectionContainerPanel",
197
+ type: formType.Array,
198
+ meta: "video",
199
+ items: {
200
+ label: "video",
201
+ component: "ObjectCollapsiblePanel",
202
+ type: formType.Template,
203
+ meta: "video",
204
+ },
205
+ },
206
+
207
+ related: {
208
+ label: "related",
209
+ component: "ObjectContainerPanel",
210
+ type: formType.Template,
211
+ rules: {
212
+ required: true,
213
+ min: 5,
214
+ max: 200,
215
+ },
216
+ meta: "related",
217
+ },
218
+ consent: {
219
+ label: "consent",
220
+ component: "ObjectContainerPanel",
221
+ type: formType.Template,
222
+ meta: "consent",
223
+ },
224
+ groups: {
225
+ label: "groups",
226
+ groups: [userRole.Admin], // restrict to some groups
227
+ component: "ObjectContainerPanel",
228
+ type: formType.Template,
229
+ meta: "groups",
230
+ },
231
+ /* lang: {
232
+ label: "lang",
233
+ component: "Select",
234
+ type: formType.Primitive,
235
+ rules: {
236
+ required: true,
237
+ },
238
+ // items: langs, // TODO add language enum
239
+ meta: "lang",
240
+ }, */
241
+ },
242
+ }
243
+
244
+ export default defaultConfig
@@ -0,0 +1,62 @@
1
+ import { Form, formType } from "../../form"
2
+
3
+ export interface Position {
4
+ role: string
5
+ department?: string
6
+ start?: Date
7
+ stop?: Date
8
+ }
9
+
10
+ export interface PositionForm {
11
+ form: Record<string, Form>
12
+ }
13
+ const defaultConfig: PositionForm = {
14
+ form: {
15
+ role: {
16
+ label: "role",
17
+ component: "TextField",
18
+ type: formType.Primitive,
19
+ rules: {
20
+ required: true,
21
+ min: 2,
22
+ max: 200,
23
+ },
24
+ meta: "role",
25
+ },
26
+ department: {
27
+ label: "department",
28
+ component: "TextField",
29
+ type: formType.Primitive,
30
+
31
+ rules: {
32
+ required: true,
33
+ min: 3,
34
+ max: 200,
35
+ },
36
+ meta: "department",
37
+ },
38
+ start: {
39
+ label: "start",
40
+ component: "DatePicker",
41
+ type: formType.Primitive,
42
+
43
+ rules: {
44
+ required: true,
45
+ date: true,
46
+ },
47
+ meta: "start",
48
+ },
49
+ stop: {
50
+ label: "stop",
51
+ component: "DatePicker",
52
+ type: formType.Primitive,
53
+ hint: "Leave empty if this is an ongoing position",
54
+ rules: {
55
+ date: true,
56
+ },
57
+ meta: "stop",
58
+ },
59
+ },
60
+ }
61
+
62
+ export default defaultConfig
@@ -0,0 +1,9 @@
1
+ import configPeople, { People } from "./people"
2
+ import Model from "../../model"
3
+
4
+ export interface Sponsor extends People {}
5
+ const defaultConfig: Model = {
6
+ aliases: ["people"],
7
+ ...configPeople,
8
+ }
9
+ export default defaultConfig
@@ -0,0 +1,252 @@
1
+ import Model from "../../model"
2
+ import configPeople, { People } from "./people"
3
+ import { formType } from "../../form"
4
+
5
+ type Settings = {
6
+ lang: String
7
+ }
8
+ export enum userStatus {
9
+ Active = "ACTIVE",
10
+ Pending = "PENDING",
11
+ Blocked = "BLOCKED",
12
+ Deleted = "DELETED",
13
+ }
14
+ export enum userRole {
15
+ Admin = "ADMIN",
16
+ Editor = "EDITOR",
17
+ Contributor = "CONTRIBUTOR",
18
+ Viewer = "VIEWER",
19
+ Fellow = "FELLOW",
20
+ Member = "MEMBER",
21
+ Guest = "GUEST",
22
+ }
23
+ export interface Users extends People {
24
+ admin: Boolean
25
+ apps: [AppRole]
26
+ email: String
27
+ settings: Settings
28
+ status: userStatus
29
+ }
30
+ type AppRole = {
31
+ appId: String
32
+ roles: userRole[]
33
+ }
34
+ const userConfig: Model = {
35
+ source: "gql",
36
+ list: {
37
+ create: true, // allow to create new items
38
+ filters: {
39
+ groups: {
40
+ type: "Select",
41
+ },
42
+ vintage: {
43
+ type: "Select",
44
+ show: {
45
+ default: false, // same as hidden = true
46
+ switchIf: [{ groups: "fellows" }], // array of conditions to switch the show, each condition will be assessed as a boolean
47
+ disjonctive: false, //TODO: implement. if true, show only if one of the if is true, if false, show only if all of the if are true
48
+ },
49
+ multiple: true,
50
+ },
51
+ programs: {
52
+ type: "Select",
53
+ show: {
54
+ default: false, // same as hidden = true
55
+ switchIf: [{ groups: "fellows" }], // array of conditions to switch the show, each condition will be assessed as a boolean
56
+ disjonctive: false, //TODO: implement. if true, show only if one of the if is true, if false, show only if all of the if are true
57
+ },
58
+ multiple: true,
59
+ },
60
+ disciplines: {
61
+ type: "Select",
62
+ show: {
63
+ default: false, // same as hidden = true
64
+ switchIf: [{ groups: "fellows" }], // array of conditions to switch the show, each condition will be assessed as a boolean
65
+ disjonctive: false, //TODO: implement. if true, show only if one of the if is true, if false, show only if all of the if are true
66
+ },
67
+ multiple: true,
68
+ },
69
+ member: {
70
+ type: "Select",
71
+ show: {
72
+ default: false, // same as hidden = true
73
+ switchIf: [{ groups: "fellows" }], // array of conditions to switch the show, each condition will be assessed as a boolean
74
+ disjonctive: false, //TODO: implement. if true, show only if one of the if is true, if false, show only if all of the if are true
75
+ },
76
+ multiple: true,
77
+ },
78
+ },
79
+ sort: {
80
+ // sort options
81
+ nameasc: {
82
+ // by name from a to z
83
+ icon: "sort-alphabetical-ascending",
84
+ text: "by-name-from-a-to-z",
85
+ value: ["lastname", 1],
86
+ },
87
+ namedesc: {
88
+ // by name from z to a
89
+ icon: "sort-alphabetical-descending",
90
+ text: "by-name-from-z-to-a",
91
+ value: ["lastname", -1],
92
+ },
93
+ vintagedesc: {
94
+ // by name from z to a
95
+ icon: "sort-calendar-descending",
96
+ text: "by-vintage-from-old-to-recent",
97
+ value: ["groups.vintage.year", -1],
98
+ },
99
+ vintageasc: {
100
+ // by name from z to a
101
+ icon: "sort-calendar-descending",
102
+ text: "by-vintage-from-recent-to-old",
103
+ value: ["groups.vintage.year", 1],
104
+ default: true,
105
+ },
106
+ },
107
+ views: {
108
+ rows: {
109
+ name: "rows",
110
+ icon: "view-list",
111
+ perPage: {
112
+ options: [9, 12, 16],
113
+ default: 9,
114
+ },
115
+ },
116
+ dense: {
117
+ default: true,
118
+ name: "dense",
119
+ icon: "land-rows-horizontal",
120
+ perPage: {
121
+ options: [20, 40, 60, 80, 100],
122
+ default: 20,
123
+ },
124
+ },
125
+ /* expanded: {
126
+ name: "expanded",
127
+ icon: "arrow-expand-vertical",
128
+ }, */
129
+ },
130
+ },
131
+ form: {
132
+ firstname: {
133
+ label: "firstname",
134
+ component: "TextField",
135
+ type: formType.Primitive,
136
+
137
+ rules: {
138
+ required: true,
139
+ min: 1,
140
+ max: 200,
141
+ },
142
+ meta: "firstname", // item type on schema.org
143
+ },
144
+ lastname: {
145
+ label: "lastname",
146
+ component: "TextField",
147
+ type: formType.Primitive,
148
+
149
+ rules: {
150
+ required: true,
151
+ min: 1,
152
+ max: 200,
153
+ },
154
+ meta: "lastname", // item type on schema.org
155
+ },
156
+ affiliations: {
157
+ label: "affiliations",
158
+ component: "AffiliationPicker",
159
+ type: formType.Document,
160
+
161
+ meta: "affiliations",
162
+ },
163
+ image: {
164
+ label: "image",
165
+ component: "ImagePicker",
166
+ type: formType.Document,
167
+
168
+ meta: "image",
169
+ },
170
+ socials: {
171
+ label: "socials",
172
+ component: "ObjectContainerPanel",
173
+ type: formType.Template,
174
+ meta: "socials",
175
+ },
176
+ disciplines: {
177
+ label: "disciplines",
178
+ component: "DisciplinePicker",
179
+ type: formType.Document,
180
+ meta: "disciplines",
181
+ },
182
+ video: {
183
+ label: "video",
184
+ component: "CollectionContainerPanel",
185
+ type: formType.Array,
186
+ meta: "video",
187
+ items: {
188
+ label: "video",
189
+ component: "ObjectContainerPanel",
190
+ type: formType.Template,
191
+ meta: "video",
192
+ },
193
+ },
194
+ biography: {
195
+ label: "biography",
196
+ component: "TextArea",
197
+ i18n: true,
198
+ type: formType.Primitive,
199
+ rules: {
200
+ required: true,
201
+ min: 5,
202
+ max: 2000,
203
+ },
204
+ meta: "biography",
205
+ },
206
+ related: {
207
+ label: "related",
208
+ component: "ObjectContainerPanel",
209
+ type: formType.Template,
210
+ rules: {
211
+ required: true,
212
+ min: 5,
213
+ max: 200,
214
+ },
215
+ meta: "related",
216
+ },
217
+ consent: {
218
+ label: "consent",
219
+ component: "ObjectContainerPanel",
220
+ type: formType.Template,
221
+ rules: {
222
+ required: true,
223
+ },
224
+ meta: "consent",
225
+ },
226
+ groups: {
227
+ label: "groups",
228
+ component: "ObjectContainerPanel",
229
+ type: formType.Template,
230
+ rules: {
231
+ required: true,
232
+ },
233
+ // items: Groups // TODO: make groups enum
234
+ meta: "groups",
235
+ },
236
+ lang: {
237
+ label: "lang",
238
+ component: "AutoComplete",
239
+ type: formType.Primitive,
240
+ rules: {
241
+ required: true,
242
+ },
243
+ meta: "lang",
244
+ },
245
+ },
246
+ }
247
+ const defaultConfig: Model = {
248
+ aliases: ["people"],
249
+ ...configPeople,
250
+ ...userConfig,
251
+ }
252
+ export default defaultConfig
@@ -0,0 +1,124 @@
1
+ import { formType } from "../../form"
2
+ import Model from "../../model"
3
+
4
+ export interface Vintage {
5
+ name: string
6
+ year: number
7
+ theme?: string
8
+ url?: URL
9
+ }
10
+
11
+ const defaultConfig: Model = {
12
+ list: {
13
+ create: true, // allow to create new items
14
+ filters: {
15
+ year: {
16
+ type: "Select",
17
+ },
18
+ },
19
+ sort: {
20
+ // sort options
21
+ nameasc: {
22
+ // by name from a to z
23
+ icon: "sort-alphabetical-ascending",
24
+ text: "by-name-from-a-to-z",
25
+ value: ["article_title", 1],
26
+ },
27
+ namedesc: {
28
+ // by name from z to a
29
+ icon: "sort-alphabetical-descending",
30
+ text: "by-name-from-z-to-a",
31
+ value: ["article_title", -1],
32
+ },
33
+ dateasc: {
34
+ // by date from most recent to oldest
35
+ icon: "sort-calendar-descending",
36
+ text: "by-date-most-recent-first",
37
+ value: ["date", -1],
38
+ default: true,
39
+ },
40
+ datedesc: {
41
+ // by date from oldest to most recent
42
+ icon: "sort-calendar-ascending",
43
+ text: "by-date-oldest-first",
44
+ value: ["date", 1],
45
+ },
46
+ },
47
+ views: {
48
+ rows: {
49
+ name: "rows",
50
+ icon: "view-list",
51
+ perPage: {
52
+ options: [9, 12, 16],
53
+ default: 9,
54
+ },
55
+ },
56
+ dense: {
57
+ default: true,
58
+ name: "dense",
59
+ icon: "land-rows-horizontal",
60
+ perPage: {
61
+ options: [20, 40, 60, 80, 100],
62
+ default: 20,
63
+ },
64
+ },
65
+ tiles: {
66
+ name: "tiles",
67
+ icon: "view-quilt",
68
+ },
69
+ grid: {
70
+ name: "grid",
71
+ icon: "view-day",
72
+ },
73
+ },
74
+ },
75
+ form: {
76
+ name: {
77
+ label: "name",
78
+ type: formType.Primitive,
79
+ component: "TextField",
80
+ rules: {
81
+ required: true,
82
+ min: 2,
83
+ max: 100,
84
+ },
85
+ meta: "name", // item type on schema.org
86
+ },
87
+ year: {
88
+ label: "year",
89
+ type: formType.Primitive,
90
+ component: "TextField",
91
+ rules: {
92
+ required: true,
93
+ min: 2,
94
+ max: 100,
95
+ },
96
+ meta: "year",
97
+ },
98
+ theme: {
99
+ label: "theme",
100
+ type: formType.Primitive,
101
+ component: "TextField",
102
+ i18n: true,
103
+ rules: {
104
+ required: true,
105
+ min: 2,
106
+ max: 100,
107
+ },
108
+ meta: "theme",
109
+ },
110
+ url: {
111
+ type: formType.Primitive,
112
+ component: "TextField",
113
+ label: "url",
114
+ rules: {
115
+ required: true,
116
+ url: true,
117
+ max: 2048,
118
+ },
119
+ meta: "url", // item type on schema.org
120
+ },
121
+ },
122
+ }
123
+
124
+ export default defaultConfig