codeapp-js 0.3.0 → 1.0.0
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/AI/codeapp.agent.md +105 -0
- package/AI/skills/connections/SKILL.md +47 -0
- package/AI/skills/dataverse/SKILL.md +99 -0
- package/AI/skills/environment-variables/SKILL.md +89 -0
- package/AI/skills/frontend-design/SKILL.md +34 -0
- package/AI/skills/jira/SKILL.md +81 -0
- package/AI/skills/office365-groups/SKILL.md +61 -0
- package/AI/skills/office365-outlook/SKILL.md +52 -0
- package/AI/skills/office365-users/SKILL.md +78 -0
- package/AI/skills/sharepoint/SKILL.md +77 -0
- package/AI/skills/sql/SKILL.md +85 -0
- package/AI/skills/start/SKILL.md +46 -0
- package/AI/skills/teams/SKILL.md +55 -0
- package/{examples/combined demo/.power/schemas/office365groups/office365groups.Schema.json → codeApp/.power/schemas/office365groups/office365groups.Schema.json} +2203 -2203
- package/codeApp/dist/codeapp.js +95 -1792
- package/codeApp/dist/connectors/azureKeyvault.js +459 -0
- package/codeApp/dist/connectors/jira.js +1247 -0
- package/codeApp/dist/connectors/office365groups.js +642 -0
- package/codeApp/dist/connectors/office365users.js +513 -0
- package/codeApp/dist/connectors/outlook.js +1393 -0
- package/{dev files/sharepoint.js → codeApp/dist/connectors/sharepoint.js} +239 -112
- package/codeApp/dist/connectors/sql.js +149 -0
- package/codeApp/dist/connectors/teams.js +280 -0
- package/codeApp/dist/power-apps-data.js +16 -2
- package/examples/{kanban → apps/kanban}/dist/dataverse.js +94 -94
- package/examples/{kanban → apps/kanban}/dist/environmentVar.js +55 -55
- package/examples/{kanban → apps/kanban}/dist/index.css +605 -605
- package/examples/{kanban → apps/kanban}/dist/index.html +21 -21
- package/examples/{kanban → apps/kanban}/dist/index.js +860 -860
- package/examples/{kanban → apps/kanban}/dist/office365groups.js +97 -97
- package/examples/apps/kanban/dist/office365users.js +451 -0
- package/examples/{kanban → apps/kanban}/dist/outlook.js +162 -162
- package/examples/{planning Poker/dist/power-apps-data.js → apps/kanban/dist/power-apps-data.js} +2953 -2953
- package/examples/{kanban → apps/kanban}/dist/sharepoint.js +435 -339
- package/examples/{kanban → apps/kanban}/power.config.json +35 -35
- package/examples/{planning Poker → apps/planning Poker}/additional files/customizations (tables).xml +6428 -6428
- package/examples/{planning Poker → apps/planning Poker}/additional files/dataverse-tables.json +165 -165
- package/examples/{planning Poker → apps/planning Poker}/additional files/readme.md +122 -122
- package/examples/{planning Poker → apps/planning Poker}/dist/dataverse.js +78 -78
- package/examples/{planning Poker → apps/planning Poker}/dist/index.html +198 -198
- package/examples/{planning Poker → apps/planning Poker}/dist/index.js +954 -954
- package/examples/{todo/dist/power-apps-data.js → apps/planning Poker/dist/power-apps-data.js } +2953 -2953
- package/examples/{planning Poker → apps/planning Poker}/dist/styles.css +815 -815
- package/examples/{planning Poker → apps/planning Poker}/power.config.json +50 -50
- package/examples/{outlook Demo2 → apps/solution explorer}/dist/codeapp.js +9 -245
- package/examples/apps/solution explorer/dist/index.html +80 -0
- package/examples/apps/solution explorer/dist/index.js +735 -0
- package/examples/apps/solution explorer/dist/styles.css +571 -0
- package/examples/apps/solution explorer/power.config.json +151 -0
- package/examples/{todo → apps/todo}/dist/dataverse.js +64 -64
- package/examples/{todo → apps/todo}/dist/index.html +75 -75
- package/examples/{todo → apps/todo}/dist/index.js +8 -8
- package/examples/{kanban → apps/todo}/dist/power-apps-data.js +2953 -2953
- package/examples/{todo → apps/todo}/dist/renderer.js +375 -375
- package/examples/{todo → apps/todo}/dist/styles.css +691 -691
- package/examples/{todo → apps/todo}/power.config.json +34 -34
- package/examples/combined demo/.power/schemas/appschemas/dataSourcesInfo.ts +6275 -7830
- package/examples/combined demo/.power/schemas/jira/jira.Schema.json +6903 -0
- package/examples/combined demo/.power/schemas/keyvault/keyvault.Schema.json +1600 -0
- package/examples/combined demo/.power/schemas/teams/teams.Schema.json +11112 -0
- package/examples/combined demo/dist/codeapp.js +394 -1098
- package/examples/{outlook Demo2/OutlookDemo_1_0_0_1.zip → combined demo/dist/icon-512.png} +0 -0
- package/examples/combined demo/dist/index.html +29 -511
- package/examples/combined demo/dist/index.js +490 -470
- package/examples/combined demo/dist/office365users.js +513 -0
- package/examples/combined demo/dist/outlook.js +1393 -0
- package/examples/combined demo/dist/power-apps-data.js +3079 -3006
- package/examples/combined demo/dist/styles.css +483 -0
- package/examples/combined demo/power.config.json +33 -42
- package/examples/combined demo/src/generated/index.ts +12 -14
- package/examples/combined demo/src/generated/models/AzureKeyVaultModel.ts +107 -0
- package/examples/combined demo/src/generated/models/JiraModel.ts +501 -0
- package/examples/combined demo/src/generated/services/AzureKeyVaultService.ts +257 -0
- package/examples/combined demo/src/generated/services/JiraService.ts +1124 -0
- package/examples/dataverse Demo/dist/codeapp.js +394 -1085
- package/examples/dataverse Demo/dist/icon-512.png +0 -0
- package/examples/dataverse Demo/dist/index.html +146 -54
- package/examples/dataverse Demo/dist/index.js +693 -83
- package/examples/dataverse Demo/dist/power-apps-data.js +3079 -2911
- package/examples/dataverse Demo/dist/styles.css +528 -0
- package/examples/dataverse Demo/power.config.json +41 -35
- package/examples/dataverse Demo/readme.md +79 -79
- package/examples/groups Demo/dist/codeapp.js +394 -1085
- package/examples/groups Demo/dist/icon-512.png +0 -0
- package/examples/groups Demo/dist/index.html +21 -25
- package/examples/groups Demo/dist/index.js +304 -113
- package/examples/groups Demo/dist/office365groups.js +642 -0
- package/examples/groups Demo/dist/power-apps-data.js +3079 -2911
- package/examples/groups Demo/dist/styles.css +509 -0
- package/examples/groups Demo/power.config.json +25 -25
- package/examples/myProfile/dist/codeapp.js +398 -0
- package/examples/myProfile/dist/index.html +21 -184
- package/examples/myProfile/dist/index.js +324 -141
- package/examples/myProfile/dist/office365users.js +517 -169
- package/examples/myProfile/dist/power-apps-data.js +3080 -2953
- package/examples/myProfile/dist/styles.css +458 -0
- package/examples/myProfile/power.config.json +24 -23
- package/examples/outlook Demo/dist/codeapp.js +394 -1085
- package/examples/outlook Demo/dist/index.html +150 -35
- package/examples/outlook Demo/dist/index.js +516 -170
- package/examples/outlook Demo/dist/outlook.js +1393 -121
- package/examples/outlook Demo/dist/power-apps-data.js +3079 -2911
- package/examples/outlook Demo/dist/styles.css +408 -84
- package/examples/outlook Demo/power.config.json +24 -23
- package/examples/outlook Demo/readme.md +92 -82
- package/examples/sharePoint Demo/dist/codeapp.js +394 -1085
- package/examples/sharePoint Demo/dist/icon-512.png +0 -0
- package/examples/sharePoint Demo/dist/index.html +22 -255
- package/examples/sharePoint Demo/dist/index.js +899 -262
- package/examples/sharePoint Demo/dist/power-apps-data.js +3079 -2911
- package/examples/sharePoint Demo/dist/sharepoint.js +466 -0
- package/examples/sharePoint Demo/dist/styles.css +587 -0
- package/examples/sharePoint Demo/power.config.json +23 -22
- package/package.json +1 -1
- package/readme.md +465 -76
- package/.vscode/settings.json +0 -6
- package/dev files/customConnector.js +0 -98
- package/dev files/dataverse.js +0 -120
- package/dev files/environmentVar.js +0 -55
- package/dev files/office365groups.js +0 -65
- package/dev files/office365users.js +0 -169
- package/dev files/outlook.js +0 -330
- package/dev files/power-apps-data.js +0 -2952
- package/examples/combined demo/.power/schemas/office365/office365.Schema.json +0 -21098
- package/examples/combined demo/.power/schemas/office365users/office365users.Schema.json +0 -2094
- package/examples/kanban/agent/decision-log.md +0 -9
- package/examples/kanban/agent/mockup-01-editorial-glass.html +0 -159
- package/examples/kanban/agent/mockup-02-dark-rail.html +0 -147
- package/examples/kanban/agent/mockup-03-paper-grid.html +0 -114
- package/examples/kanban/agent/mockup-04-neon-minimal.html +0 -141
- package/examples/kanban/agent/mockup-05-mono-architect.html +0 -119
- package/examples/kanban/dist/office365users.js +0 -169
- package/examples/kanban/src/generated/index.ts +0 -14
- package/examples/kanban/src/generated/models/Office365GroupsModel.ts +0 -363
- package/examples/kanban/src/generated/models/Office365OutlookModel.ts +0 -2046
- package/examples/kanban/src/generated/models/Office365UsersModel.ts +0 -254
- package/examples/kanban/src/generated/services/Office365GroupsService.ts +0 -326
- package/examples/kanban/src/generated/services/Office365OutlookService.ts +0 -2476
- package/examples/kanban/src/generated/services/Office365UsersService.ts +0 -358
- package/examples/outlook Demo2/agent/decision-log.md +0 -7
- package/examples/outlook Demo2/dist/index.html +0 -98
- package/examples/outlook Demo2/dist/index.js +0 -272
- package/examples/outlook Demo2/dist/styles.css +0 -639
- package/examples/outlook Demo2/power.config.json +0 -23
- package/examples/planning Poker/.vscode/settings.json +0 -5
- package/examples/sharePoint Demo/agent/decision-log.md +0 -17
- /package/examples/{outlook Demo2 → apps/kanban}/src/generated/index.ts +0 -0
- /package/examples/{outlook Demo2 → apps/kanban}/src/generated/models/Office365GroupsModel.ts +0 -0
- /package/examples/{outlook Demo2 → apps/kanban}/src/generated/models/Office365OutlookModel.ts +0 -0
- /package/examples/{outlook Demo2 → apps/kanban}/src/generated/models/Office365UsersModel.ts +0 -0
- /package/examples/{outlook Demo2 → apps/kanban}/src/generated/services/Office365GroupsService.ts +0 -0
- /package/examples/{outlook Demo2 → apps/kanban}/src/generated/services/Office365OutlookService.ts +0 -0
- /package/examples/{outlook Demo2 → apps/kanban}/src/generated/services/Office365UsersService.ts +0 -0
- /package/examples/{planning Poker → apps/planning Poker}/additional files/AgilePoker_1_0_0_1.zip +0 -0
- /package/examples/{planning Poker → apps/planning Poker}/additional files/PokerTables_1_0_0_1.zip +0 -0
- /package/examples/{outlook Demo2 → apps/solution explorer}/dist/icon-512.png +0 -0
- /package/examples/{outlook Demo2 → apps/solution explorer}/dist/power-apps-data.js +0 -0
- /package/examples/{todo → apps/todo}/dist/icon192.png +0 -0
|
@@ -1,470 +1,490 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
if (
|
|
118
|
-
return
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
if (
|
|
132
|
-
return
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
return
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
if (
|
|
173
|
-
return
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
if (
|
|
181
|
-
return
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
function
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
<
|
|
267
|
-
|
|
268
|
-
<
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
if (
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
1
|
+
import { getMyProfile, getUserPhoto } from './office365users.js';
|
|
2
|
+
import { getCalendarView, listEmails } from './outlook.js';
|
|
3
|
+
import { enableDebugger } from "./codeapp.js";
|
|
4
|
+
|
|
5
|
+
enableDebugger();
|
|
6
|
+
|
|
7
|
+
const eRoot = document.getElementById('root');
|
|
8
|
+
|
|
9
|
+
const oState = {
|
|
10
|
+
bLoading: true,
|
|
11
|
+
bRefreshing: false,
|
|
12
|
+
oProfile: null,
|
|
13
|
+
sPhoto: '',
|
|
14
|
+
aEmails: [],
|
|
15
|
+
aMeetings: [],
|
|
16
|
+
aErrors: [],
|
|
17
|
+
sUpdatedAt: '',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
function getDayWindow() {
|
|
21
|
+
const oNow = new Date();
|
|
22
|
+
const oStart = new Date(oNow.getFullYear(), oNow.getMonth(), oNow.getDate());
|
|
23
|
+
const oEnd = new Date(oNow.getFullYear(), oNow.getMonth(), oNow.getDate() + 1);
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
oNow,
|
|
27
|
+
oStart,
|
|
28
|
+
oEnd,
|
|
29
|
+
sStartIso: oStart.toISOString(),
|
|
30
|
+
sEndIso: oEnd.toISOString(),
|
|
31
|
+
sLabel: oStart.toLocaleDateString([], {
|
|
32
|
+
weekday: 'long',
|
|
33
|
+
month: 'long',
|
|
34
|
+
day: 'numeric',
|
|
35
|
+
}),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function normalizeItems(oResult) {
|
|
40
|
+
if (Array.isArray(oResult)) {
|
|
41
|
+
return oResult;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (oResult && Array.isArray(oResult.value)) {
|
|
45
|
+
return oResult.value;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return [];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function getErrorMessage(oError) {
|
|
52
|
+
if (!oError) {
|
|
53
|
+
return 'Unknown error';
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (typeof oError === 'string') {
|
|
57
|
+
return oError;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (typeof oError.message === 'string' && oError.message) {
|
|
61
|
+
return oError.message;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
try {
|
|
65
|
+
return JSON.stringify(oError);
|
|
66
|
+
} catch (oInnerError) {
|
|
67
|
+
return String(oError);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function escapeHtml(sValue) {
|
|
72
|
+
const eDiv = document.createElement('div');
|
|
73
|
+
eDiv.textContent = sValue || '';
|
|
74
|
+
return eDiv.innerHTML;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function stripHtml(sValue) {
|
|
78
|
+
const eDiv = document.createElement('div');
|
|
79
|
+
eDiv.innerHTML = sValue || '';
|
|
80
|
+
return eDiv.textContent || eDiv.innerText || '';
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function getInitials(sName) {
|
|
84
|
+
if (!sName) {
|
|
85
|
+
return '?';
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const aParts = String(sName)
|
|
89
|
+
.split(' ')
|
|
90
|
+
.map((sPart) => sPart.trim())
|
|
91
|
+
.filter(Boolean);
|
|
92
|
+
|
|
93
|
+
if (aParts.length === 0) {
|
|
94
|
+
return '?';
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (aParts.length === 1) {
|
|
98
|
+
return aParts[0].slice(0, 2).toUpperCase();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return (aParts[0].charAt(0) + aParts[aParts.length - 1].charAt(0)).toUpperCase();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function getEmailDate(oEmail) {
|
|
105
|
+
return oEmail.DateTimeReceived || oEmail.receivedDateTime || oEmail.ReceivedDateTime || '';
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function getMeetingStart(oMeeting) {
|
|
109
|
+
return oMeeting.Start || oMeeting.start || oMeeting.startDateTime || '';
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function getMeetingEnd(oMeeting) {
|
|
113
|
+
return oMeeting.End || oMeeting.end || oMeeting.endDateTime || '';
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function toDate(oValue) {
|
|
117
|
+
if (!oValue) {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const oDate = new Date(oValue);
|
|
122
|
+
if (Number.isNaN(oDate.getTime())) {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return oDate;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function isInDay(oValue, oWindow) {
|
|
130
|
+
const oDate = toDate(oValue);
|
|
131
|
+
if (!oDate) {
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return oDate >= oWindow.oStart && oDate < oWindow.oEnd;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function formatTime(oValue) {
|
|
139
|
+
const oDate = toDate(oValue);
|
|
140
|
+
if (!oDate) {
|
|
141
|
+
return '';
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return oDate.toLocaleTimeString([], {
|
|
145
|
+
hour: 'numeric',
|
|
146
|
+
minute: '2-digit',
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function formatUpdatedAt() {
|
|
151
|
+
return new Date().toLocaleTimeString([], {
|
|
152
|
+
hour: 'numeric',
|
|
153
|
+
minute: '2-digit',
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function formatMeetingRange(oMeeting) {
|
|
158
|
+
if (oMeeting.IsAllDay || oMeeting.isAllDay) {
|
|
159
|
+
return 'All day';
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const sStart = formatTime(getMeetingStart(oMeeting));
|
|
163
|
+
const sEnd = formatTime(getMeetingEnd(oMeeting));
|
|
164
|
+
if (!sStart && !sEnd) {
|
|
165
|
+
return 'Time unavailable';
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return sStart + ' - ' + sEnd;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function renderMetaChip(sLabel, sValue) {
|
|
172
|
+
if (!sValue) {
|
|
173
|
+
return '';
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return '<span class="meta-chip">' + escapeHtml(sLabel + ': ' + sValue) + '</span>';
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function renderProfileCard(oWindow) {
|
|
180
|
+
if (!oState.oProfile) {
|
|
181
|
+
return '<div class="profile-card skeleton" style="min-height:130px"></div>';
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const oProfile = oState.oProfile;
|
|
185
|
+
const sImageHtml = oState.sPhoto
|
|
186
|
+
? '<img src="data:image/jpeg;base64,' + oState.sPhoto + '" alt="Profile photo" />'
|
|
187
|
+
: '<span>' + escapeHtml(getInitials(oProfile.displayName || oProfile.mail || 'Me')) + '</span>';
|
|
188
|
+
|
|
189
|
+
const aMeta = [
|
|
190
|
+
renderMetaChip('Mail', oProfile.mail || oProfile.userPrincipalName),
|
|
191
|
+
renderMetaChip('Phone', (oProfile.businessPhones && oProfile.businessPhones[0]) || oProfile.mobilePhone),
|
|
192
|
+
renderMetaChip('Department', oProfile.department),
|
|
193
|
+
renderMetaChip('Office', oProfile.officeLocation),
|
|
194
|
+
].filter(Boolean);
|
|
195
|
+
|
|
196
|
+
return '<div class="profile-card">'
|
|
197
|
+
+ '<div class="avatar-frame">' + sImageHtml + '</div>'
|
|
198
|
+
+ '<div>'
|
|
199
|
+
+ '<h2 class="profile-name">' + escapeHtml(oProfile.displayName || 'Signed-in user') + '</h2>'
|
|
200
|
+
+ '<p class="profile-role">' + escapeHtml(oProfile.jobTitle || 'Role unavailable') + '</p>'
|
|
201
|
+
+ '<p class="profile-line">' + escapeHtml(oWindow.sLabel) + '</p>'
|
|
202
|
+
+ '<p class="profile-line">'
|
|
203
|
+
+ escapeHtml((oProfile.mail || oProfile.userPrincipalName || '').toString())
|
|
204
|
+
+ '</p>'
|
|
205
|
+
+ '</div>'
|
|
206
|
+
+ '</div>'
|
|
207
|
+
+ '<div class="hero-meta">' + aMeta.join('') + '</div>';
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function renderStatsCard() {
|
|
211
|
+
const sUpdatedCopy = oState.sUpdatedAt
|
|
212
|
+
? 'Updated at ' + oState.sUpdatedAt
|
|
213
|
+
: 'Waiting for data';
|
|
214
|
+
|
|
215
|
+
return '<div class="stats-card">'
|
|
216
|
+
+ '<div class="stats-row">'
|
|
217
|
+
+ '<div class="stat-tile' + (oState.bLoading ? ' skeleton' : '') + '">'
|
|
218
|
+
+ '<span class="stat-label">Emails Today</span>'
|
|
219
|
+
+ '<span class="stat-value">' + String(oState.aEmails.length) + '</span>'
|
|
220
|
+
+ '</div>'
|
|
221
|
+
+ '<div class="stat-tile' + (oState.bLoading ? ' skeleton' : '') + '">'
|
|
222
|
+
+ '<span class="stat-label">Meetings Today</span>'
|
|
223
|
+
+ '<span class="stat-value">' + String(oState.aMeetings.length) + '</span>'
|
|
224
|
+
+ '</div>'
|
|
225
|
+
+ '</div>'
|
|
226
|
+
+ '<div class="toolbar">'
|
|
227
|
+
+ '<span class="status-copy">' + escapeHtml(sUpdatedCopy) + '</span>'
|
|
228
|
+
+ '<button class="action-button" data-action="refresh"' + (oState.bRefreshing ? ' disabled' : '') + '>'
|
|
229
|
+
+ (oState.bRefreshing ? 'Refreshing...' : 'Refresh')
|
|
230
|
+
+ '</button>'
|
|
231
|
+
+ '</div>'
|
|
232
|
+
+ '</div>';
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function renderEmailList() {
|
|
236
|
+
if (oState.bLoading && oState.aEmails.length === 0) {
|
|
237
|
+
return '<div class="item-list">'
|
|
238
|
+
+ '<div class="list-item skeleton" style="min-height:110px"></div>'
|
|
239
|
+
+ '<div class="list-item skeleton" style="min-height:110px"></div>'
|
|
240
|
+
+ '<div class="list-item skeleton" style="min-height:110px"></div>'
|
|
241
|
+
+ '</div>';
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if (oState.aEmails.length === 0) {
|
|
245
|
+
return '<div class="empty-state">'
|
|
246
|
+
+ '<h3 class="empty-title">No emails yet today</h3>'
|
|
247
|
+
+ '<p class="empty-copy">Your inbox is clear so far, or newer mail has not arrived in the first inbox batch yet.</p>'
|
|
248
|
+
+ '</div>';
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
return '<div class="item-list">'
|
|
252
|
+
+ oState.aEmails.map((oEmail) => {
|
|
253
|
+
const oFrom = oEmail.From || oEmail.from || {};
|
|
254
|
+
const oEmailAddress = oFrom.EmailAddress || oFrom.emailAddress || {};
|
|
255
|
+
const sSender = oEmailAddress.Name || oEmailAddress.name || oFrom.Name || 'Unknown sender';
|
|
256
|
+
const sAddress = oEmailAddress.Address || oEmailAddress.address || oFrom.Address || '';
|
|
257
|
+
const sSubject = oEmail.Subject || oEmail.subject || '(No subject)';
|
|
258
|
+
const sPreview = stripHtml(oEmail.BodyPreview || oEmail.bodyPreview || oEmail.Body || oEmail.body || '');
|
|
259
|
+
const sReceived = formatTime(getEmailDate(oEmail));
|
|
260
|
+
const bUnread = oEmail.IsRead === false || oEmail.isRead === false;
|
|
261
|
+
|
|
262
|
+
return '<article class="list-item' + (bUnread ? ' list-item--unread' : '') + '">'
|
|
263
|
+
+ '<div class="item-topline">'
|
|
264
|
+
+ '<div>'
|
|
265
|
+
+ '<h3 class="item-title">' + escapeHtml(sSubject) + '</h3>'
|
|
266
|
+
+ '<p class="item-meta">' + escapeHtml(sSender + (sAddress ? ' • ' + sAddress : '')) + '</p>'
|
|
267
|
+
+ '</div>'
|
|
268
|
+
+ '<span class="item-time">' + escapeHtml(sReceived || 'Today') + '</span>'
|
|
269
|
+
+ '</div>'
|
|
270
|
+
+ '<p class="item-preview">' + escapeHtml(sPreview.slice(0, 180) || 'No preview available.') + '</p>'
|
|
271
|
+
+ '</article>';
|
|
272
|
+
}).join('')
|
|
273
|
+
+ '</div>';
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function renderMeetingList() {
|
|
277
|
+
if (oState.bLoading && oState.aMeetings.length === 0) {
|
|
278
|
+
return '<div class="item-list">'
|
|
279
|
+
+ '<div class="list-item skeleton" style="min-height:104px"></div>'
|
|
280
|
+
+ '<div class="list-item skeleton" style="min-height:104px"></div>'
|
|
281
|
+
+ '<div class="list-item skeleton" style="min-height:104px"></div>'
|
|
282
|
+
+ '</div>';
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
if (oState.aMeetings.length === 0) {
|
|
286
|
+
return '<div class="empty-state">'
|
|
287
|
+
+ '<h3 class="empty-title">No meetings on the calendar</h3>'
|
|
288
|
+
+ '<p class="empty-copy">Today looks open. When events appear on your primary calendar, they will show up here.</p>'
|
|
289
|
+
+ '</div>';
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
return '<div class="item-list">'
|
|
293
|
+
+ oState.aMeetings.map((oMeeting) => {
|
|
294
|
+
const sSubject = oMeeting.Subject || oMeeting.subject || '(Untitled meeting)';
|
|
295
|
+
const sLocation = oMeeting.Location || oMeeting.location || 'Location not set';
|
|
296
|
+
const sOrganizer = oMeeting.Organizer || oMeeting.organizer || '';
|
|
297
|
+
const sRange = formatMeetingRange(oMeeting);
|
|
298
|
+
const sWebLink = oMeeting.WebLink || oMeeting.webLink || '';
|
|
299
|
+
|
|
300
|
+
return '<article class="list-item">'
|
|
301
|
+
+ '<div class="item-topline">'
|
|
302
|
+
+ '<div>'
|
|
303
|
+
+ '<h3 class="item-title">' + escapeHtml(sSubject) + '</h3>'
|
|
304
|
+
+ '<p class="item-meta">' + escapeHtml(sLocation) + '</p>'
|
|
305
|
+
+ '</div>'
|
|
306
|
+
+ '<span class="item-time">' + escapeHtml(sRange) + '</span>'
|
|
307
|
+
+ '</div>'
|
|
308
|
+
+ (sOrganizer ? '<p class="item-preview">Organizer: ' + escapeHtml(sOrganizer) + '</p>' : '')
|
|
309
|
+
+ (sWebLink ? '<a class="meeting-link" href="' + escapeHtml(sWebLink) + '" target="_blank" rel="noreferrer">Open in Outlook</a>' : '')
|
|
310
|
+
+ '</article>';
|
|
311
|
+
}).join('')
|
|
312
|
+
+ '</div>';
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
function renderNotice() {
|
|
316
|
+
if (oState.aErrors.length === 0) {
|
|
317
|
+
return '';
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
return '<section class="notice">'
|
|
321
|
+
+ '<h3 class="notice-title">Some data could not be loaded</h3>'
|
|
322
|
+
+ '<p class="notice-copy">' + escapeHtml(oState.aErrors.join(' ')) + ' If this is a fresh app, use Sync Connections so Outlook and Office 365 Users are available.</p>'
|
|
323
|
+
+ '</section>';
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
function renderApp() {
|
|
327
|
+
const oWindow = getDayWindow();
|
|
328
|
+
|
|
329
|
+
eRoot.innerHTML = '<div class="app-shell">'
|
|
330
|
+
+ '<section class="hero-card">'
|
|
331
|
+
+ '<div class="hero-layout">'
|
|
332
|
+
+ '<div>'
|
|
333
|
+
+ '<p class="eyebrow">Daily snapshot</p>'
|
|
334
|
+
+ '<h1 class="hero-heading">Profile, mail, and meetings in one glance.</h1>'
|
|
335
|
+
+ '<p class="hero-subtitle">A compact view of the signed-in user, the messages received today, and the meetings scheduled for the rest of the day.</p>'
|
|
336
|
+
+ renderProfileCard(oWindow)
|
|
337
|
+
+ '</div>'
|
|
338
|
+
+ '<div class="hero-side">'
|
|
339
|
+
+ renderStatsCard()
|
|
340
|
+
+ '</div>'
|
|
341
|
+
+ '</div>'
|
|
342
|
+
+ '</section>'
|
|
343
|
+
+ '<div class="content-grid">'
|
|
344
|
+
+ '<section class="panel">'
|
|
345
|
+
+ '<header class="panel-header">'
|
|
346
|
+
+ '<div>'
|
|
347
|
+
+ '<h2 class="panel-title">Today\'s Emails</h2>'
|
|
348
|
+
+ '<p class="panel-subtitle">Latest inbox items received since midnight.</p>'
|
|
349
|
+
+ '</div>'
|
|
350
|
+
+ '<span class="count-pill">' + String(oState.aEmails.length) + '</span>'
|
|
351
|
+
+ '</header>'
|
|
352
|
+
+ renderEmailList()
|
|
353
|
+
+ '</section>'
|
|
354
|
+
+ '<section class="panel">'
|
|
355
|
+
+ '<header class="panel-header">'
|
|
356
|
+
+ '<div>'
|
|
357
|
+
+ '<h2 class="panel-title">Today\'s Meetings</h2>'
|
|
358
|
+
+ '<p class="panel-subtitle">Events from your primary calendar for ' + escapeHtml(oWindow.sLabel) + '.</p>'
|
|
359
|
+
+ '</div>'
|
|
360
|
+
+ '<span class="count-pill">' + String(oState.aMeetings.length) + '</span>'
|
|
361
|
+
+ '</header>'
|
|
362
|
+
+ renderMeetingList()
|
|
363
|
+
+ '</section>'
|
|
364
|
+
+ '</div>'
|
|
365
|
+
+ renderNotice()
|
|
366
|
+
+ '</div>';
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
async function loadProfileBundle() {
|
|
370
|
+
const oProfile = await getMyProfile({
|
|
371
|
+
select: ['displayName', 'mail', 'userPrincipalName', 'jobTitle', 'department', 'officeLocation', 'businessPhones', 'mobilePhone', 'id'],
|
|
372
|
+
});
|
|
373
|
+
const sUserId = oProfile.id || oProfile.mail || oProfile.userPrincipalName;
|
|
374
|
+
let sPhoto = '';
|
|
375
|
+
|
|
376
|
+
if (sUserId) {
|
|
377
|
+
try {
|
|
378
|
+
const oPhotoResult = await getUserPhoto(sUserId);
|
|
379
|
+
sPhoto = (oPhotoResult && oPhotoResult.value) || oPhotoResult || '';
|
|
380
|
+
} catch (oPhotoError) {
|
|
381
|
+
sPhoto = '';
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
return {
|
|
386
|
+
oProfile,
|
|
387
|
+
sPhoto,
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
async function loadTodayEmails() {
|
|
392
|
+
const oWindow = getDayWindow();
|
|
393
|
+
const oResult = await listEmails({ folderId: 'Inbox', top: 50 });
|
|
394
|
+
|
|
395
|
+
return normalizeItems(oResult)
|
|
396
|
+
.filter((oEmail) => isInDay(getEmailDate(oEmail), oWindow))
|
|
397
|
+
.sort((oLeft, oRight) => {
|
|
398
|
+
const iLeft = (toDate(getEmailDate(oLeft)) || new Date(0)).getTime();
|
|
399
|
+
const iRight = (toDate(getEmailDate(oRight)) || new Date(0)).getTime();
|
|
400
|
+
return iRight - iLeft;
|
|
401
|
+
})
|
|
402
|
+
.slice(0, 10);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
async function loadTodayMeetings() {
|
|
406
|
+
const oWindow = getDayWindow();
|
|
407
|
+
const oResult = await getCalendarView({
|
|
408
|
+
calendarId: 'Calendar',
|
|
409
|
+
startDateTimeUtc: oWindow.sStartIso,
|
|
410
|
+
endDateTimeUtc: oWindow.sEndIso,
|
|
411
|
+
top: 20,
|
|
412
|
+
});
|
|
413
|
+
|
|
414
|
+
return normalizeItems(oResult)
|
|
415
|
+
.filter((oMeeting) => isInDay(getMeetingStart(oMeeting), oWindow))
|
|
416
|
+
.sort((oLeft, oRight) => {
|
|
417
|
+
const iLeft = (toDate(getMeetingStart(oLeft)) || new Date(0)).getTime();
|
|
418
|
+
const iRight = (toDate(getMeetingStart(oRight)) || new Date(0)).getTime();
|
|
419
|
+
return iLeft - iRight;
|
|
420
|
+
})
|
|
421
|
+
.slice(0, 20);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
async function refreshDashboard() {
|
|
425
|
+
oState.bLoading = !oState.sUpdatedAt;
|
|
426
|
+
oState.bRefreshing = true;
|
|
427
|
+
oState.aErrors = [];
|
|
428
|
+
renderApp();
|
|
429
|
+
|
|
430
|
+
const aResults = await Promise.allSettled([
|
|
431
|
+
loadProfileBundle(),
|
|
432
|
+
loadTodayEmails(),
|
|
433
|
+
loadTodayMeetings(),
|
|
434
|
+
]);
|
|
435
|
+
|
|
436
|
+
const [oProfileResult, oEmailResult, oMeetingResult] = aResults;
|
|
437
|
+
const aErrors = [];
|
|
438
|
+
|
|
439
|
+
if (oProfileResult.status === 'fulfilled') {
|
|
440
|
+
oState.oProfile = oProfileResult.value.oProfile;
|
|
441
|
+
oState.sPhoto = oProfileResult.value.sPhoto;
|
|
442
|
+
} else {
|
|
443
|
+
oState.oProfile = null;
|
|
444
|
+
oState.sPhoto = '';
|
|
445
|
+
aErrors.push('Profile: ' + getErrorMessage(oProfileResult.reason) + '.');
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
if (oEmailResult.status === 'fulfilled') {
|
|
449
|
+
oState.aEmails = oEmailResult.value;
|
|
450
|
+
} else {
|
|
451
|
+
oState.aEmails = [];
|
|
452
|
+
aErrors.push('Emails: ' + getErrorMessage(oEmailResult.reason) + '.');
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
if (oMeetingResult.status === 'fulfilled') {
|
|
456
|
+
oState.aMeetings = oMeetingResult.value;
|
|
457
|
+
} else {
|
|
458
|
+
oState.aMeetings = [];
|
|
459
|
+
aErrors.push('Meetings: ' + getErrorMessage(oMeetingResult.reason) + '.');
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
oState.aErrors = aErrors;
|
|
463
|
+
oState.bLoading = false;
|
|
464
|
+
oState.bRefreshing = false;
|
|
465
|
+
oState.sUpdatedAt = formatUpdatedAt();
|
|
466
|
+
renderApp();
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
function handleRootClick(oEvent) {
|
|
470
|
+
const eTarget = oEvent.target.closest('[data-action]');
|
|
471
|
+
if (!eTarget) {
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
if (eTarget.dataset.action === 'refresh' && !oState.bRefreshing) {
|
|
476
|
+
refreshDashboard();
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
async function boot() {
|
|
481
|
+
if (!eRoot) {
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
eRoot.addEventListener('click', handleRootClick);
|
|
486
|
+
renderApp();
|
|
487
|
+
await refreshDashboard();
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
boot();
|