@edifice.io/client 2.6.12-develop-integration.20261103121816 → 2.6.12-develop-b2school.20261103144351
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/calendar/interface.d.ts +22 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +333 -458
- package/dist/services/OdeServices.d.ts +0 -4
- package/package.json +3 -3
- package/dist/googledrive/Service.d.ts +0 -63
- package/dist/googledrive/interface.d.ts +0 -58
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var P = Object.defineProperty;
|
|
2
2
|
var I = (n, e, t) => e in n ? P(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
-
var
|
|
3
|
+
var u = (n, e, t) => I(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import axios from "axios";
|
|
5
5
|
import { MimeTypeUtils } from "@edifice.io/utilities";
|
|
6
6
|
import { UAParser } from "ua-parser-js";
|
|
@@ -100,8 +100,8 @@ const ERROR_CODE = {
|
|
|
100
100
|
// TODO compléter
|
|
101
101
|
}, C = class C {
|
|
102
102
|
constructor(e) {
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
u(this, "name");
|
|
104
|
+
u(this, "listeners", /* @__PURE__ */ new Set());
|
|
105
105
|
this.name = e;
|
|
106
106
|
}
|
|
107
107
|
/**
|
|
@@ -139,11 +139,11 @@ const ERROR_CODE = {
|
|
|
139
139
|
this.listeners.clear(), C.channels.delete(this.name);
|
|
140
140
|
}
|
|
141
141
|
};
|
|
142
|
-
|
|
142
|
+
u(C, "channels", /* @__PURE__ */ new Map());
|
|
143
143
|
let SimpleChannel = C;
|
|
144
144
|
class Subscription {
|
|
145
145
|
constructor(e, t) {
|
|
146
|
-
|
|
146
|
+
u(this, "revoke");
|
|
147
147
|
this._channel = e, this.revoke = this.setReceiver((s) => t == null ? void 0 : t(s));
|
|
148
148
|
}
|
|
149
149
|
setReceiver(e) {
|
|
@@ -160,7 +160,7 @@ class Subject {
|
|
|
160
160
|
/* We maintain channels for sending messages.
|
|
161
161
|
* Receiving channels are instantiated per subscription.
|
|
162
162
|
*/
|
|
163
|
-
|
|
163
|
+
u(this, "publishChannels", /* @__PURE__ */ new Map());
|
|
164
164
|
}
|
|
165
165
|
getChannelName(e) {
|
|
166
166
|
return "Subject:" + e;
|
|
@@ -195,9 +195,9 @@ const ASYNC_DATA_NAME = {
|
|
|
195
195
|
class Promisified {
|
|
196
196
|
constructor() {
|
|
197
197
|
//-------------------------------------
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
198
|
+
u(this, "_resolution");
|
|
199
|
+
u(this, "_rejection");
|
|
200
|
+
u(this, "_promise", new Promise((e, t) => {
|
|
201
201
|
this._resolution = e, this._rejection = t;
|
|
202
202
|
}));
|
|
203
203
|
}
|
|
@@ -214,8 +214,8 @@ class Promisified {
|
|
|
214
214
|
class NotifyFramework {
|
|
215
215
|
constructor() {
|
|
216
216
|
//-------------------------------------
|
|
217
|
-
|
|
218
|
-
|
|
217
|
+
u(this, "promises", {});
|
|
218
|
+
u(this, "subject", new Subject());
|
|
219
219
|
}
|
|
220
220
|
asyncData(e) {
|
|
221
221
|
return typeof this.promises[e] > "u" && (this.promises[e] = new Promisified()), this.promises[e];
|
|
@@ -246,8 +246,8 @@ const notify = new NotifyFramework(), loadedScripts$1 = {};
|
|
|
246
246
|
class Http {
|
|
247
247
|
constructor(e) {
|
|
248
248
|
// Axios automatically manages the XSRF-TOKEN cookie and the X-XSRF-TOKEN HTTP header.
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
u(this, "axios");
|
|
250
|
+
u(this, "_latestResponse");
|
|
251
251
|
this.axios = axios.create(e);
|
|
252
252
|
}
|
|
253
253
|
setCdn(e) {
|
|
@@ -327,8 +327,8 @@ class Http {
|
|
|
327
327
|
const r = s ?? "exports", i = this.toAxiosConfig(t);
|
|
328
328
|
return i.headers && (i.headers.Accept = "application/javascript"), this.axios.get(this.toCdnUrl(e), i).then((o) => this.mapAxiosResponse(o, t)).then((o) => {
|
|
329
329
|
try {
|
|
330
|
-
const
|
|
331
|
-
return Function(
|
|
330
|
+
const a = `"use strict";var ${r.split(".")[0]}={};${o};return ${r};`;
|
|
331
|
+
return Function(a)();
|
|
332
332
|
} catch {
|
|
333
333
|
return o;
|
|
334
334
|
}
|
|
@@ -344,7 +344,7 @@ class Http {
|
|
|
344
344
|
}
|
|
345
345
|
class TransportFramework {
|
|
346
346
|
constructor() {
|
|
347
|
-
|
|
347
|
+
u(this, "_http", new Http());
|
|
348
348
|
}
|
|
349
349
|
get http() {
|
|
350
350
|
return this._http;
|
|
@@ -363,11 +363,11 @@ class ConfigurationFrameworkFactory {
|
|
|
363
363
|
const http$2 = transport.http;
|
|
364
364
|
class Session {
|
|
365
365
|
constructor() {
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
366
|
+
u(this, "_me", null);
|
|
367
|
+
u(this, "_currentLanguage", "");
|
|
368
|
+
u(this, "_notLoggedIn", !0);
|
|
369
|
+
u(this, "_description");
|
|
370
|
+
u(this, "_profile");
|
|
371
371
|
}
|
|
372
372
|
get currentLanguage() {
|
|
373
373
|
return this._currentLanguage;
|
|
@@ -412,7 +412,7 @@ class Session {
|
|
|
412
412
|
hasRight(e, t) {
|
|
413
413
|
if (t === "owner")
|
|
414
414
|
return e.owner && e.owner.userId === this._me.userId;
|
|
415
|
-
const s = t.right || t, i = e.shared.filter((
|
|
415
|
+
const s = t.right || t, i = e.shared.filter((a) => (this._me.groupsIds || []).indexOf(a.groupId) !== -1 || a.userId === this._me.userId).find((a) => a[s] || a.manager) !== void 0, o = t.workflow ? this.hasWorkflow(t.workflow) : !0;
|
|
416
416
|
return i && o;
|
|
417
417
|
}
|
|
418
418
|
////////////////////////////////////////////////////////// Storage management
|
|
@@ -485,7 +485,7 @@ class Session {
|
|
|
485
485
|
}
|
|
486
486
|
class SessionFramework {
|
|
487
487
|
constructor() {
|
|
488
|
-
|
|
488
|
+
u(this, "session", new Session());
|
|
489
489
|
}
|
|
490
490
|
initialize() {
|
|
491
491
|
return this.session.initialize();
|
|
@@ -509,22 +509,22 @@ class SessionFramework {
|
|
|
509
509
|
const session = new SessionFramework();
|
|
510
510
|
class Theme {
|
|
511
511
|
constructor() {
|
|
512
|
-
|
|
513
|
-
|
|
512
|
+
u(this, "_conf");
|
|
513
|
+
u(this, "_loaded");
|
|
514
514
|
// legacy (readonly)
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
515
|
+
u(this, "skinName", "");
|
|
516
|
+
u(this, "themeName", "");
|
|
517
|
+
u(this, "skin", "raw");
|
|
518
|
+
u(this, "themeUrl", "/assets/themes/raw/default/");
|
|
519
|
+
u(this, "templateOverrides", {});
|
|
520
|
+
u(this, "portalTemplate", "/assets/themes/raw/portal.html");
|
|
521
|
+
u(this, "basePath", "");
|
|
522
|
+
u(this, "logoutCallback", "");
|
|
523
|
+
u(this, "skins", []);
|
|
524
|
+
u(this, "is1D", !1);
|
|
525
|
+
u(this, "is2D", !1);
|
|
526
|
+
u(this, "_onSkinReady", notify.onSkinReady());
|
|
527
|
+
u(this, "_onOverrideReady", notify.onOverridesReady());
|
|
528
528
|
}
|
|
529
529
|
initialize(e) {
|
|
530
530
|
return notify.onSessionReady().promise.then(() => this.load(e));
|
|
@@ -858,9 +858,9 @@ class Idiom {
|
|
|
858
858
|
const i = new Promisified();
|
|
859
859
|
promises$1[t] = i.promise;
|
|
860
860
|
const o = {};
|
|
861
|
-
e && (o["Accept-Language"] = e), transport.http.get(t, { headers: o }).then((
|
|
862
|
-
Object.assign(bundle$1,
|
|
863
|
-
}).catch((
|
|
861
|
+
e && (o["Accept-Language"] = e), transport.http.get(t, { headers: o }).then((a) => {
|
|
862
|
+
Object.assign(bundle$1, a), typeof s == "function" && s(), i.resolve();
|
|
863
|
+
}).catch((a) => {
|
|
864
864
|
typeof s == "function" && s(), i.reject();
|
|
865
865
|
});
|
|
866
866
|
}
|
|
@@ -896,7 +896,7 @@ class Idiom {
|
|
|
896
896
|
class UserPreferences {
|
|
897
897
|
constructor() {
|
|
898
898
|
//-------------------------------------
|
|
899
|
-
|
|
899
|
+
u(this, "data", {});
|
|
900
900
|
}
|
|
901
901
|
get(e) {
|
|
902
902
|
return this.data[e];
|
|
@@ -923,10 +923,10 @@ class UserPreferences {
|
|
|
923
923
|
class User {
|
|
924
924
|
constructor() {
|
|
925
925
|
//-------------------------------------
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
926
|
+
u(this, "_me", null);
|
|
927
|
+
u(this, "_keepOpenOnLogout", !1);
|
|
928
|
+
u(this, "_preferences", new UserPreferences());
|
|
929
|
+
u(this, "_bookmarkedApps", []);
|
|
930
930
|
}
|
|
931
931
|
get keepOpenOnLogout() {
|
|
932
932
|
return this._keepOpenOnLogout;
|
|
@@ -970,7 +970,7 @@ class User {
|
|
|
970
970
|
});
|
|
971
971
|
let r = !0;
|
|
972
972
|
const i = [];
|
|
973
|
-
s.bookmarks.forEach((o,
|
|
973
|
+
s.bookmarks.forEach((o, a) => {
|
|
974
974
|
const c = this._me.apps.find((l) => l.name === o);
|
|
975
975
|
if (c) {
|
|
976
976
|
const l = Object.assign({}, c);
|
|
@@ -978,8 +978,8 @@ class User {
|
|
|
978
978
|
} else
|
|
979
979
|
i.push(o), r = !1;
|
|
980
980
|
}), i.forEach((o) => {
|
|
981
|
-
const
|
|
982
|
-
|
|
981
|
+
const a = s.bookmarks.indexOf(o);
|
|
982
|
+
a !== -1 && s.bookmarks.splice(a, 1);
|
|
983
983
|
}), r || transport.http.putJson("/userbook/preference/apps", s);
|
|
984
984
|
});
|
|
985
985
|
}
|
|
@@ -1000,9 +1000,9 @@ const http$1 = transport == null ? void 0 : transport.http;
|
|
|
1000
1000
|
class AppConf {
|
|
1001
1001
|
constructor() {
|
|
1002
1002
|
//-------------------------------------
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1003
|
+
u(this, "_publicConf", {});
|
|
1004
|
+
u(this, "_currentApp");
|
|
1005
|
+
u(this, "_appConf", {});
|
|
1006
1006
|
}
|
|
1007
1007
|
/**
|
|
1008
1008
|
* Get the currently initialized App.
|
|
@@ -1040,8 +1040,8 @@ class AppConf {
|
|
|
1040
1040
|
class Analytics {
|
|
1041
1041
|
constructor() {
|
|
1042
1042
|
//-------------------------------------
|
|
1043
|
-
|
|
1044
|
-
|
|
1043
|
+
u(this, "_status", "void");
|
|
1044
|
+
u(this, "_params");
|
|
1045
1045
|
}
|
|
1046
1046
|
get status() {
|
|
1047
1047
|
return this._status;
|
|
@@ -1082,9 +1082,9 @@ class Analytics {
|
|
|
1082
1082
|
const t = await notify.onSessionReady().promise, s = session.session.description;
|
|
1083
1083
|
let r;
|
|
1084
1084
|
for (const l of t.structures) {
|
|
1085
|
-
const
|
|
1086
|
-
if (
|
|
1087
|
-
r =
|
|
1085
|
+
const h = e.structureMap[l];
|
|
1086
|
+
if (h && h.collectiviteId && h.UAI) {
|
|
1087
|
+
r = h;
|
|
1088
1088
|
break;
|
|
1089
1089
|
}
|
|
1090
1090
|
}
|
|
@@ -1095,11 +1095,11 @@ class Analytics {
|
|
|
1095
1095
|
if (!i) return;
|
|
1096
1096
|
const o = i.xiti;
|
|
1097
1097
|
if (!o || !o.LIBELLE_SERVICE || !r.UAI) return;
|
|
1098
|
-
function
|
|
1099
|
-
let
|
|
1100
|
-
for (let
|
|
1101
|
-
|
|
1102
|
-
return
|
|
1098
|
+
function a(l) {
|
|
1099
|
+
let h = "";
|
|
1100
|
+
for (let E = 0; E < l.length; E++)
|
|
1101
|
+
h += l.charCodeAt(E);
|
|
1102
|
+
return h;
|
|
1103
1103
|
}
|
|
1104
1104
|
const c = {
|
|
1105
1105
|
Student: "ELEVE",
|
|
@@ -1118,7 +1118,7 @@ class Analytics {
|
|
|
1118
1118
|
PROJET: r.projetId ? r.projetId : e.ID_PROJET,
|
|
1119
1119
|
EXPLOITANT: e.ID_EXPLOITANT,
|
|
1120
1120
|
PLATFORME: r.plateformeId ? r.plateformeId : e.ID_PLATEFORME,
|
|
1121
|
-
ID_PERSO:
|
|
1121
|
+
ID_PERSO: a(t.userId),
|
|
1122
1122
|
PROFILE: s.profiles && s.profiles.length > 0 ? c[s.profiles[0]] ?? "" : ""
|
|
1123
1123
|
};
|
|
1124
1124
|
}
|
|
@@ -1146,12 +1146,12 @@ function detectDevice() {
|
|
|
1146
1146
|
if (typeof window > "u")
|
|
1147
1147
|
return { osName: "", osVersion: "", deviceType: "", deviceName: "" };
|
|
1148
1148
|
const n = UAParser(), e = isPad(), t = n.device.vendor || "", s = n.device.model || "", r = t && s ? `${t} ${s}` : s || t || "Unknown";
|
|
1149
|
-
let i = n.os.name || "Unknown", o = n.device.type || (e ? "tablet" : "desktop"),
|
|
1150
|
-
return e && i.toLowerCase() == "macos" && (i = "iPadOS", o = "tablet",
|
|
1149
|
+
let i = n.os.name || "Unknown", o = n.device.type || (e ? "tablet" : "desktop"), a = r;
|
|
1150
|
+
return e && i.toLowerCase() == "macos" && (i = "iPadOS", o = "tablet", a = "iPad"), {
|
|
1151
1151
|
osName: i,
|
|
1152
1152
|
osVersion: n.os.version || "Unknown",
|
|
1153
1153
|
deviceType: o,
|
|
1154
|
-
deviceName:
|
|
1154
|
+
deviceName: a
|
|
1155
1155
|
};
|
|
1156
1156
|
}
|
|
1157
1157
|
function readDeviceCookies() {
|
|
@@ -1177,7 +1177,7 @@ function setDeviceCookies() {
|
|
|
1177
1177
|
class ConfigurationFramework {
|
|
1178
1178
|
constructor() {
|
|
1179
1179
|
//-------------------------------------
|
|
1180
|
-
|
|
1180
|
+
u(this, "Platform", {
|
|
1181
1181
|
deploymentTag: "",
|
|
1182
1182
|
cdnDomain: "",
|
|
1183
1183
|
apps: new AppConf(),
|
|
@@ -1186,16 +1186,16 @@ class ConfigurationFramework {
|
|
|
1186
1186
|
idiom: new Idiom(),
|
|
1187
1187
|
listLanguages: () => transport.http.get("/languages")
|
|
1188
1188
|
});
|
|
1189
|
-
|
|
1189
|
+
u(this, "School", {
|
|
1190
1190
|
//apps; -> pinnedApps;
|
|
1191
1191
|
});
|
|
1192
|
-
|
|
1192
|
+
u(this, "User", new User());
|
|
1193
1193
|
setDeviceCookies();
|
|
1194
1194
|
}
|
|
1195
1195
|
async initialize(e, t) {
|
|
1196
1196
|
if (!e) {
|
|
1197
|
-
const r = (l) => (l < 10 ? "0" : "") + l.toFixed(0), i = /* @__PURE__ */ new Date(), o = i.getFullYear(),
|
|
1198
|
-
e = `${o}${r(
|
|
1197
|
+
const r = (l) => (l < 10 ? "0" : "") + l.toFixed(0), i = /* @__PURE__ */ new Date(), o = i.getFullYear(), a = i.getMonth() + 1, c = i.getDate();
|
|
1198
|
+
e = `${o}${r(a)}${r(c)}`;
|
|
1199
1199
|
}
|
|
1200
1200
|
const s = e;
|
|
1201
1201
|
this.Platform.deploymentTag = e, typeof t == "string" && t.length > 0 && (this.Platform.cdnDomain = t), transport.http.setCdn(this.Platform.cdnDomain), await Promise.all([
|
|
@@ -1233,12 +1233,12 @@ class ConfigurationFramework {
|
|
|
1233
1233
|
// }
|
|
1234
1234
|
}
|
|
1235
1235
|
const configure = new ConfigurationFramework(), http = transport == null ? void 0 : transport.http;
|
|
1236
|
-
var
|
|
1237
|
-
const me = (
|
|
1236
|
+
var _;
|
|
1237
|
+
const me = (_ = session == null ? void 0 : session.session) == null ? void 0 : _.user;
|
|
1238
1238
|
class Notification {
|
|
1239
1239
|
constructor(e) {
|
|
1240
|
-
|
|
1241
|
-
|
|
1240
|
+
u(this, "_id");
|
|
1241
|
+
u(this, "model");
|
|
1242
1242
|
e.reported = e.reporters && e.reporters.length > 0, this._id = e._id, this.model = e;
|
|
1243
1243
|
}
|
|
1244
1244
|
isUnread() {
|
|
@@ -1258,14 +1258,14 @@ class Notification {
|
|
|
1258
1258
|
class TimelineApp {
|
|
1259
1259
|
constructor() {
|
|
1260
1260
|
//-------------------------------------
|
|
1261
|
-
|
|
1262
|
-
|
|
1261
|
+
u(this, "_notifications", []);
|
|
1262
|
+
u(this, "_notificationTypes", []);
|
|
1263
1263
|
// ex: ["BLOG"]
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1264
|
+
u(this, "_flashMessages", []);
|
|
1265
|
+
u(this, "_pageNumber", 0);
|
|
1266
|
+
u(this, "_lastPage", !1);
|
|
1267
|
+
u(this, "_loading", !1);
|
|
1268
|
+
u(this, "showMine", !1);
|
|
1269
1269
|
}
|
|
1270
1270
|
get notifications() {
|
|
1271
1271
|
return this._notifications;
|
|
@@ -1324,7 +1324,7 @@ class TimelineApp {
|
|
|
1324
1324
|
if (r.number && r.results) {
|
|
1325
1325
|
const i = r.results.filter(
|
|
1326
1326
|
(o) => this._notifications.findIndex(
|
|
1327
|
-
(
|
|
1327
|
+
(a) => a._id === o._id
|
|
1328
1328
|
) === -1
|
|
1329
1329
|
).map((o) => new Notification(o));
|
|
1330
1330
|
this._notifications = this._notifications.concat(i), this._pageNumber++;
|
|
@@ -1355,126 +1355,7 @@ const ReactionTypes = [
|
|
|
1355
1355
|
"REACTION_2",
|
|
1356
1356
|
"REACTION_3",
|
|
1357
1357
|
"REACTION_4"
|
|
1358
|
-
], GOOGLE_DRIVE_FOLDER_MIME_TYPE = "application/vnd.google-apps.folder", GOOGLE_DRIVE_NATIVE_MIME_TYPE_PREFIX = "application/vnd.google-apps.", GOOGLE_DRIVE_EXPORTABLE_MIME_TYPES = [
|
|
1359
|
-
"application/vnd.google-apps.document",
|
|
1360
|
-
"application/vnd.google-apps.spreadsheet",
|
|
1361
|
-
"application/vnd.google-apps.presentation"
|
|
1362
1358
|
];
|
|
1363
|
-
function toGoogleDriveDocument(n) {
|
|
1364
|
-
const e = n.mimeType === GOOGLE_DRIVE_FOLDER_MIME_TYPE;
|
|
1365
|
-
return {
|
|
1366
|
-
id: n.id,
|
|
1367
|
-
name: n.name,
|
|
1368
|
-
ownerDisplayName: n.ownerDisplayName,
|
|
1369
|
-
contentType: n.mimeType,
|
|
1370
|
-
size: n.size,
|
|
1371
|
-
isFolder: e,
|
|
1372
|
-
canCopyToWorkspace: e || !n.mimeType.startsWith(GOOGLE_DRIVE_NATIVE_MIME_TYPE_PREFIX) || GOOGLE_DRIVE_EXPORTABLE_MIME_TYPES.includes(n.mimeType),
|
|
1373
|
-
lastModified: n.modifiedTime,
|
|
1374
|
-
shared: n.shared
|
|
1375
|
-
};
|
|
1376
|
-
}
|
|
1377
|
-
class GoogleDriveCopyError extends Error {
|
|
1378
|
-
constructor(e, t, s) {
|
|
1379
|
-
super(e), this.copied = t, this.failures = s, this.name = "GoogleDriveCopyError";
|
|
1380
|
-
}
|
|
1381
|
-
}
|
|
1382
|
-
class GoogleDriveService {
|
|
1383
|
-
constructor(e) {
|
|
1384
|
-
this.context = e;
|
|
1385
|
-
}
|
|
1386
|
-
get http() {
|
|
1387
|
-
return this.context.http();
|
|
1388
|
-
}
|
|
1389
|
-
/**
|
|
1390
|
-
* List a user's Google Drive documents and folders inside a given folder.
|
|
1391
|
-
*
|
|
1392
|
-
* Google Drive addresses its entries by opaque id, not by path: `parentId` is
|
|
1393
|
-
* the id of the folder to list. The query param is nonetheless named `path`,
|
|
1394
|
-
* as the backend kept the name it uses for Nextcloud.
|
|
1395
|
-
*
|
|
1396
|
-
* @param userId - the id of the user whose files are listed.
|
|
1397
|
-
* @param parentId - id of the folder to list; the Drive root when omitted.
|
|
1398
|
-
*/
|
|
1399
|
-
async listDocuments(e, t) {
|
|
1400
|
-
return (await this.http.get(
|
|
1401
|
-
`/googledrive/files/user/${e}`,
|
|
1402
|
-
{ queryParams: t ? { path: t } : void 0 }
|
|
1403
|
-
)).data.map(toGoogleDriveDocument);
|
|
1404
|
-
}
|
|
1405
|
-
/**
|
|
1406
|
-
* List the documents and folders other users shared with a user. Browse the
|
|
1407
|
-
* content of a shared folder with `listDocuments`, from the folder's id.
|
|
1408
|
-
*
|
|
1409
|
-
* As in the legacy workspace, only a document shared for editing can be
|
|
1410
|
-
* copied to the workspace: an owner can forbid readers and commenters to
|
|
1411
|
-
* download a file (copyRequiresWriterPermission), which fails the copy.
|
|
1412
|
-
*
|
|
1413
|
-
* @param userId - the id of the user the documents are shared with.
|
|
1414
|
-
*/
|
|
1415
|
-
async listSharedDocuments(e) {
|
|
1416
|
-
return (await this.http.get(`/googledrive/files/user/${e}/shared`)).data.map(({ owners: s, role: r, ...i }) => {
|
|
1417
|
-
var u;
|
|
1418
|
-
const o = toGoogleDriveDocument({
|
|
1419
|
-
...i,
|
|
1420
|
-
ownerDisplayName: (u = s == null ? void 0 : s[0]) == null ? void 0 : u.displayName
|
|
1421
|
-
});
|
|
1422
|
-
return {
|
|
1423
|
-
...o,
|
|
1424
|
-
canCopyToWorkspace: o.canCopyToWorkspace && r === "writer"
|
|
1425
|
-
};
|
|
1426
|
-
});
|
|
1427
|
-
}
|
|
1428
|
-
/**
|
|
1429
|
-
* Copy Google Drive documents into the entcore workspace.
|
|
1430
|
-
*
|
|
1431
|
-
* @param userId - the id of the user whose files are copied.
|
|
1432
|
-
* @param ids - Drive ids of the documents to copy.
|
|
1433
|
-
* @param parentId - the workspace folder to copy into; user's root when omitted.
|
|
1434
|
-
* @param params.application - the application the documents are added from.
|
|
1435
|
-
* @param params.visibility - "protected" files the documents under the
|
|
1436
|
-
* documents added from applications, the way an upload does.
|
|
1437
|
-
* @throws GoogleDriveCopyError when the backend reports at least one failure.
|
|
1438
|
-
*/
|
|
1439
|
-
async copyDocumentToWorkspace(e, t, s, r) {
|
|
1440
|
-
const i = t.map((d) => `id=${encodeURIComponent(d)}`).join("&"), u = (await this.http.put(
|
|
1441
|
-
`/googledrive/files/user/${e}/copy/workspace?${i}`,
|
|
1442
|
-
void 0,
|
|
1443
|
-
{
|
|
1444
|
-
queryParams: {
|
|
1445
|
-
...s ? { parentId: s } : {},
|
|
1446
|
-
...r != null && r.application ? { application: r.application } : {},
|
|
1447
|
-
...(r == null ? void 0 : r.visibility) === "protected" ? { protected: !0 } : {}
|
|
1448
|
-
}
|
|
1449
|
-
}
|
|
1450
|
-
)).data ?? [], c = u.map((d) => d.workspace).filter((d) => !!(d != null && d._id)), l = new Set(u.map((d) => d.id)), p = [
|
|
1451
|
-
...u.filter((d) => {
|
|
1452
|
-
var h;
|
|
1453
|
-
return d.status === "error" || !((h = d.workspace) != null && h._id);
|
|
1454
|
-
}).map(({ id: d, message: h }) => ({ id: d, message: h })),
|
|
1455
|
-
...t.filter((d) => !l.has(d)).map((d) => ({ id: d, message: void 0 }))
|
|
1456
|
-
];
|
|
1457
|
-
if (p.length > 0)
|
|
1458
|
-
throw new GoogleDriveCopyError(
|
|
1459
|
-
`Failed to copy ${p.length} of ${t.length} Google Drive document(s) to the workspace`,
|
|
1460
|
-
c,
|
|
1461
|
-
p
|
|
1462
|
-
);
|
|
1463
|
-
return c;
|
|
1464
|
-
}
|
|
1465
|
-
/**
|
|
1466
|
-
* Build the URL to download/preview a Google Drive document.
|
|
1467
|
-
* There is no dedicated thumbnail endpoint on the backend, so this is also
|
|
1468
|
-
* used as an image preview source for image documents.
|
|
1469
|
-
* @param userId - the id of the user who owns the file.
|
|
1470
|
-
* @param doc - the document to build the URL for.
|
|
1471
|
-
*/
|
|
1472
|
-
getFileUrl(e, t) {
|
|
1473
|
-
return `/googledrive/files/user/${e}/file/${encodeURIComponent(
|
|
1474
|
-
t.id
|
|
1475
|
-
)}/download?isFolder=${t.isFolder}`;
|
|
1476
|
-
}
|
|
1477
|
-
}
|
|
1478
1359
|
class NotifyFrameworkFactory {
|
|
1479
1360
|
static instance() {
|
|
1480
1361
|
return notify;
|
|
@@ -1533,7 +1414,7 @@ const m = class m {
|
|
|
1533
1414
|
//
|
|
1534
1415
|
// PROTECTED HELPERS
|
|
1535
1416
|
//
|
|
1536
|
-
|
|
1417
|
+
u(this, "checkHttpResponse", (e) => {
|
|
1537
1418
|
if (this.http.latestResponse.status >= 300)
|
|
1538
1419
|
throw this.http.latestResponse.statusText;
|
|
1539
1420
|
return e;
|
|
@@ -1751,22 +1632,22 @@ const m = class m {
|
|
|
1751
1632
|
//
|
|
1752
1633
|
// STATIC REGISTRY
|
|
1753
1634
|
//
|
|
1754
|
-
|
|
1755
|
-
|
|
1635
|
+
u(m, "registry", new ServiceRegistry()), // Expose some useful functions
|
|
1636
|
+
u(m, "register", m.registry.register.bind(m.registry)), u(m, "findService", m.registry.findService.bind(m.registry)), u(m, "findMainService", m.registry.findMainService.bind(m.registry)), u(m, "isRegistered", m.registry.isRegistered.bind(m.registry));
|
|
1756
1637
|
let ResourceService = m;
|
|
1757
1638
|
const APP$3 = "collaborativeeditor", RESOURCE$3 = "collaborativeeditor";
|
|
1758
1639
|
class CollaborativeEditorResourceService extends ResourceService {
|
|
1759
1640
|
async create(e) {
|
|
1760
|
-
const { name: t, description: s, thumbnail: r, folder: i } = e, o = r ? await this.getThumbnailPath(r) : "",
|
|
1641
|
+
const { name: t, description: s, thumbnail: r, folder: i } = e, o = r ? await this.getThumbnailPath(r) : "", a = await this.http.post("/collaborativeeditor", {
|
|
1761
1642
|
name: t,
|
|
1762
1643
|
description: s,
|
|
1763
1644
|
thumbnail: o,
|
|
1764
1645
|
folder: i
|
|
1765
1646
|
});
|
|
1766
|
-
return this.checkHttpResponse(
|
|
1647
|
+
return this.checkHttpResponse(a), a;
|
|
1767
1648
|
}
|
|
1768
1649
|
async update(e) {
|
|
1769
|
-
const { name: t, description: s, thumbnail: r, entId: i } = e, o = await this.getThumbnailPath(r),
|
|
1650
|
+
const { name: t, description: s, thumbnail: r, entId: i } = e, o = await this.getThumbnailPath(r), a = await this.http.put(
|
|
1770
1651
|
`/collaborativeeditor/${i}`,
|
|
1771
1652
|
{
|
|
1772
1653
|
name: t,
|
|
@@ -1774,7 +1655,7 @@ class CollaborativeEditorResourceService extends ResourceService {
|
|
|
1774
1655
|
thumbnail: o
|
|
1775
1656
|
}
|
|
1776
1657
|
);
|
|
1777
|
-
return this.checkHttpResponse(
|
|
1658
|
+
return this.checkHttpResponse(a), { thumbnail: o, entId: i };
|
|
1778
1659
|
}
|
|
1779
1660
|
getResourceType() {
|
|
1780
1661
|
return RESOURCE$3;
|
|
@@ -2029,9 +1910,9 @@ class AnalyticsService {
|
|
|
2029
1910
|
let r;
|
|
2030
1911
|
if (!(t != null && t.structures)) return;
|
|
2031
1912
|
for (const l of t.structures) {
|
|
2032
|
-
const
|
|
2033
|
-
if (
|
|
2034
|
-
r =
|
|
1913
|
+
const h = n.structureMap[l];
|
|
1914
|
+
if (h && h.collectiviteId && h.UAI) {
|
|
1915
|
+
r = h;
|
|
2035
1916
|
break;
|
|
2036
1917
|
}
|
|
2037
1918
|
}
|
|
@@ -2040,11 +1921,11 @@ class AnalyticsService {
|
|
|
2040
1921
|
if (!i) return;
|
|
2041
1922
|
const o = i.xiti;
|
|
2042
1923
|
if (!o || !o.LIBELLE_SERVICE || !r.UAI) return;
|
|
2043
|
-
function
|
|
2044
|
-
let
|
|
2045
|
-
for (let
|
|
2046
|
-
|
|
2047
|
-
return
|
|
1924
|
+
function a(l) {
|
|
1925
|
+
let h = "";
|
|
1926
|
+
for (let E = 0; E < l.length; E++)
|
|
1927
|
+
h += l.charCodeAt(E);
|
|
1928
|
+
return h;
|
|
2048
1929
|
}
|
|
2049
1930
|
const c = {
|
|
2050
1931
|
Student: "ELEVE",
|
|
@@ -2063,7 +1944,7 @@ class AnalyticsService {
|
|
|
2063
1944
|
PROJET: r.projetId ? r.projetId : n.ID_PROJET,
|
|
2064
1945
|
EXPLOITANT: n.ID_EXPLOITANT,
|
|
2065
1946
|
PLATFORME: r.plateformeId ? r.plateformeId : n.ID_PLATEFORME,
|
|
2066
|
-
ID_PERSO:
|
|
1947
|
+
ID_PERSO: a(t.userId),
|
|
2067
1948
|
PROFILE: s && s.length > 0 ? c[s[0]] ?? "" : ""
|
|
2068
1949
|
};
|
|
2069
1950
|
}
|
|
@@ -2298,25 +2179,25 @@ class ConfService {
|
|
|
2298
2179
|
conf: t,
|
|
2299
2180
|
publicTheme: s
|
|
2300
2181
|
}) {
|
|
2301
|
-
var
|
|
2302
|
-
const r = await this.http.get("/theme"), i = (
|
|
2303
|
-
(
|
|
2182
|
+
var E;
|
|
2183
|
+
const r = await this.http.get("/theme"), i = (E = t == null ? void 0 : t.overriding) == null ? void 0 : E.find(
|
|
2184
|
+
(p) => (
|
|
2304
2185
|
// Fix #WB2-2660:
|
|
2305
2186
|
// If Public access => get the neo theme
|
|
2306
2187
|
// Else get the theme from the user preference
|
|
2307
|
-
s ?
|
|
2188
|
+
s ? p.parent === "theme-open-ent" && p.bootstrapVersion === "ode-bootstrap-neo" : p.child === (r == null ? void 0 : r.themeName)
|
|
2308
2189
|
)
|
|
2309
|
-
), o = s ? "default" : (r == null ? void 0 : r.skinName) || (i == null ? void 0 : i.skins[0]),
|
|
2190
|
+
), o = s ? "default" : (r == null ? void 0 : r.skinName) || (i == null ? void 0 : i.skins[0]), a = (r == null ? void 0 : r.skin) || `/assets/themes/${i == null ? void 0 : i.child}/skins/${o}/`, c = i == null ? void 0 : i.skins, l = i == null ? void 0 : i.bootstrapVersion.split("-").slice(-1)[0], h = (i == null ? void 0 : i.parent) === "panda";
|
|
2310
2191
|
return {
|
|
2311
|
-
basePath: `${this.cdnDomain}${
|
|
2192
|
+
basePath: `${this.cdnDomain}${a}../../`,
|
|
2312
2193
|
bootstrapVersion: l,
|
|
2313
|
-
is1d:
|
|
2194
|
+
is1d: h,
|
|
2314
2195
|
logoutCallback: (r == null ? void 0 : r.logoutCallback) || "",
|
|
2315
2196
|
skin: i == null ? void 0 : i.child,
|
|
2316
2197
|
skinName: o,
|
|
2317
2198
|
skins: c,
|
|
2318
2199
|
themeName: i == null ? void 0 : i.child,
|
|
2319
|
-
themeUrl:
|
|
2200
|
+
themeUrl: a,
|
|
2320
2201
|
npmTheme: (i == null ? void 0 : i.npmTheme) ?? void 0,
|
|
2321
2202
|
uiOverrides: i == null ? void 0 : i.uiOverrides
|
|
2322
2203
|
};
|
|
@@ -2333,7 +2214,7 @@ class ConfService {
|
|
|
2333
2214
|
const SEND_ALL = "*";
|
|
2334
2215
|
class WebBroker {
|
|
2335
2216
|
constructor(e) {
|
|
2336
|
-
|
|
2217
|
+
u(this, "subscription");
|
|
2337
2218
|
this.odeServices = e;
|
|
2338
2219
|
}
|
|
2339
2220
|
get http() {
|
|
@@ -2365,10 +2246,10 @@ class WebBroker {
|
|
|
2365
2246
|
}
|
|
2366
2247
|
class DataService {
|
|
2367
2248
|
constructor(e) {
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2249
|
+
u(this, "_webBroker");
|
|
2250
|
+
u(this, "app");
|
|
2251
|
+
u(this, "user");
|
|
2252
|
+
u(this, "profile");
|
|
2372
2253
|
this.odeServices = e;
|
|
2373
2254
|
}
|
|
2374
2255
|
get conf() {
|
|
@@ -2402,7 +2283,7 @@ class DataService {
|
|
|
2402
2283
|
addUserInfos(e) {
|
|
2403
2284
|
return this.user && (e.userId = this.user.userId, e.structure = this.user.structureNames[0]), this.profile && (e.profil = this.profile[0]), e;
|
|
2404
2285
|
}
|
|
2405
|
-
trackVideoSave(e, t, s, r, i, o,
|
|
2286
|
+
trackVideoSave(e, t, s, r, i, o, a) {
|
|
2406
2287
|
const c = this.addUserInfos({
|
|
2407
2288
|
"event-type": "VIDEO_SAVE",
|
|
2408
2289
|
module: this.app || "video",
|
|
@@ -2413,7 +2294,7 @@ class DataService {
|
|
|
2413
2294
|
source: r ? "CAPTURED" : "UPLOADED",
|
|
2414
2295
|
url: i
|
|
2415
2296
|
});
|
|
2416
|
-
|
|
2297
|
+
a && (c.device_type = a), this.trackWebEvent(c);
|
|
2417
2298
|
}
|
|
2418
2299
|
trackVideoRead(e, t, s, r, i) {
|
|
2419
2300
|
const o = this.addUserInfos({
|
|
@@ -2481,14 +2362,14 @@ class DirectoryService {
|
|
|
2481
2362
|
id: s,
|
|
2482
2363
|
displayName: r,
|
|
2483
2364
|
notVisibleCount: o,
|
|
2484
|
-
groups: t.map(({ name:
|
|
2365
|
+
groups: t.map(({ name: a, id: c, nbUsers: l }) => ({
|
|
2485
2366
|
nbUsers: l,
|
|
2486
|
-
displayName:
|
|
2367
|
+
displayName: a,
|
|
2487
2368
|
id: c
|
|
2488
2369
|
})),
|
|
2489
|
-
users: i.map(({ displayName:
|
|
2370
|
+
users: i.map(({ displayName: a, id: c, profile: l }) => ({
|
|
2490
2371
|
profile: l,
|
|
2491
|
-
displayName:
|
|
2372
|
+
displayName: a,
|
|
2492
2373
|
// these info are missing from api
|
|
2493
2374
|
firstName: "",
|
|
2494
2375
|
lastName: "",
|
|
@@ -2503,9 +2384,9 @@ class DirectoryService {
|
|
|
2503
2384
|
users: r
|
|
2504
2385
|
}) {
|
|
2505
2386
|
this.cache.clearCache("/directory/sharebookmark/all");
|
|
2506
|
-
const i = r.map((
|
|
2507
|
-
if (typeof
|
|
2508
|
-
const { displayName: y, groups:
|
|
2387
|
+
const i = r.map((p) => typeof p == "string" ? p : p.id), o = s.map((p) => typeof p == "string" ? p : p.id), a = t.map(async (p) => {
|
|
2388
|
+
if (typeof p == "string") {
|
|
2389
|
+
const { displayName: y, groups: d, id: g, notVisibleCount: A, users: f } = await this.getBookMarkById(p), w = f.map((D) => D.id), F = d.map((D) => D.id);
|
|
2509
2390
|
return {
|
|
2510
2391
|
displayName: y,
|
|
2511
2392
|
id: g,
|
|
@@ -2513,19 +2394,19 @@ class DirectoryService {
|
|
|
2513
2394
|
members: [...F, ...w]
|
|
2514
2395
|
};
|
|
2515
2396
|
} else
|
|
2516
|
-
return Promise.resolve(
|
|
2517
|
-
}), l = (await Promise.all(
|
|
2397
|
+
return Promise.resolve(p);
|
|
2398
|
+
}), l = (await Promise.all(a)).map((p) => p.members).reduce((p, y) => [...p, ...y], []), h = {
|
|
2518
2399
|
name: e,
|
|
2519
2400
|
members: [...i, ...o, ...l]
|
|
2520
|
-
}, { id:
|
|
2401
|
+
}, { id: E } = await this.http.postJson(
|
|
2521
2402
|
"/directory/sharebookmark",
|
|
2522
|
-
|
|
2403
|
+
h
|
|
2523
2404
|
);
|
|
2524
2405
|
return {
|
|
2525
|
-
id:
|
|
2406
|
+
id: E,
|
|
2526
2407
|
displayName: e,
|
|
2527
2408
|
notVisibleCount: 0,
|
|
2528
|
-
members:
|
|
2409
|
+
members: h.members
|
|
2529
2410
|
};
|
|
2530
2411
|
}
|
|
2531
2412
|
}
|
|
@@ -2564,10 +2445,10 @@ class EmbedderService {
|
|
|
2564
2445
|
urlIsFromPattern(e, t) {
|
|
2565
2446
|
const s = new RegExp("[^{}]+(?=(?:[^{}]*{[^}]*})*[^}]*$)", "g"), r = new RegExp("{[^}]*}", "g");
|
|
2566
2447
|
let i = !0;
|
|
2567
|
-
const o = t.match(s) || [],
|
|
2568
|
-
return (t.match(r) || []).forEach((l,
|
|
2569
|
-
l.includes("ignore") ||
|
|
2570
|
-
}),
|
|
2448
|
+
const o = t.match(s) || [], a = [];
|
|
2449
|
+
return (t.match(r) || []).forEach((l, h) => {
|
|
2450
|
+
l.includes("ignore") || a.push(o[h]);
|
|
2451
|
+
}), a.forEach((l) => {
|
|
2571
2452
|
if (!e.includes(l)) {
|
|
2572
2453
|
i = !1;
|
|
2573
2454
|
return;
|
|
@@ -2598,17 +2479,17 @@ class EmbedderService {
|
|
|
2598
2479
|
if (this.urlIsFromPattern(t, s)) {
|
|
2599
2480
|
const r = new RegExp("{[a-zA-Z0-9_.]+}", "g"), i = s.match(r) || [];
|
|
2600
2481
|
let o = e.embed;
|
|
2601
|
-
for (const
|
|
2602
|
-
let c = s.split(
|
|
2482
|
+
for (const a of i) {
|
|
2483
|
+
let c = s.split(a)[0];
|
|
2603
2484
|
const l = c.split("}");
|
|
2604
2485
|
l.length > 1 && (c = l[l.length - 1]);
|
|
2605
|
-
let
|
|
2606
|
-
if (!
|
|
2486
|
+
let h = t.split(c)[1];
|
|
2487
|
+
if (!h)
|
|
2607
2488
|
continue;
|
|
2608
|
-
const
|
|
2609
|
-
|
|
2610
|
-
const
|
|
2611
|
-
o = o.replace(
|
|
2489
|
+
const E = s.split(a)[1].split("{")[0];
|
|
2490
|
+
E && (h = h.split(E)[0]);
|
|
2491
|
+
const p = new RegExp("\\" + a.replace(/}/, "\\}"), "g");
|
|
2492
|
+
o = o.replace(p, h);
|
|
2612
2493
|
}
|
|
2613
2494
|
return o;
|
|
2614
2495
|
}
|
|
@@ -2862,9 +2743,9 @@ class IdiomService {
|
|
|
2862
2743
|
const i = new Promisified();
|
|
2863
2744
|
promises[t] = i.promise;
|
|
2864
2745
|
const o = {};
|
|
2865
|
-
e && (o["Accept-Language"] = e), this.http.get(t, { headers: o }).then((
|
|
2866
|
-
Object.assign(bundle,
|
|
2867
|
-
}).catch((
|
|
2746
|
+
e && (o["Accept-Language"] = e), this.http.get(t, { headers: o }).then((a) => {
|
|
2747
|
+
Object.assign(bundle, a), typeof s == "function" && s(), i.resolve();
|
|
2748
|
+
}).catch((a) => {
|
|
2868
2749
|
typeof s == "function" && s(), i.reject();
|
|
2869
2750
|
});
|
|
2870
2751
|
}
|
|
@@ -2943,7 +2824,7 @@ class NextcloudService {
|
|
|
2943
2824
|
* documents added from applications, the way an upload does.
|
|
2944
2825
|
*/
|
|
2945
2826
|
async copyDocumentToWorkspace(e, t, s, r) {
|
|
2946
|
-
const i = t.map((
|
|
2827
|
+
const i = t.map((a) => `path=${encodeURIComponent(a)}`).join("&");
|
|
2947
2828
|
return (await this.http.put(
|
|
2948
2829
|
`/nextcloud/files/user/${e}/copy/workspace?${i}`,
|
|
2949
2830
|
void 0,
|
|
@@ -2954,7 +2835,7 @@ class NextcloudService {
|
|
|
2954
2835
|
...(r == null ? void 0 : r.visibility) === "protected" ? { protected: !0 } : {}
|
|
2955
2836
|
}
|
|
2956
2837
|
}
|
|
2957
|
-
)).data.filter((
|
|
2838
|
+
)).data.filter((a) => !!(a != null && a._id));
|
|
2958
2839
|
}
|
|
2959
2840
|
/**
|
|
2960
2841
|
* Check whether a user has an active Nextcloud OAuth2 connection.
|
|
@@ -2988,7 +2869,7 @@ class AbstractBehaviourService {
|
|
|
2988
2869
|
//-----------------
|
|
2989
2870
|
//--- Utilities ---
|
|
2990
2871
|
//-----------------
|
|
2991
|
-
|
|
2872
|
+
u(this, "_cache");
|
|
2992
2873
|
this.context = e, this._cache = new CacheService(this.context);
|
|
2993
2874
|
}
|
|
2994
2875
|
getApplication() {
|
|
@@ -3022,8 +2903,8 @@ class AbstractBehaviourService {
|
|
|
3022
2903
|
class ActualitesBehaviour extends AbstractBehaviourService {
|
|
3023
2904
|
constructor() {
|
|
3024
2905
|
super(...arguments);
|
|
3025
|
-
|
|
3026
|
-
|
|
2906
|
+
u(this, "APP", "actualites");
|
|
2907
|
+
u(this, "RESOURCE", "actualites");
|
|
3027
2908
|
}
|
|
3028
2909
|
async loadResources() {
|
|
3029
2910
|
const [t, s] = await Promise.all([
|
|
@@ -3034,10 +2915,10 @@ class ActualitesBehaviour extends AbstractBehaviourService {
|
|
|
3034
2915
|
/* @__PURE__ */ new Map()
|
|
3035
2916
|
);
|
|
3036
2917
|
return t.map((i) => {
|
|
3037
|
-
var
|
|
2918
|
+
var a;
|
|
3038
2919
|
let o;
|
|
3039
2920
|
return i.threadIcon ? o = i.threadIcon + "?thumbnail=48x48" : o = "/img/icons/glyphicons_036_file.png", this.dataToResource({
|
|
3040
|
-
title: i.title + " [" + ((
|
|
2921
|
+
title: i.title + " [" + ((a = r.get(i.threadId)) == null ? void 0 : a.title) + "]",
|
|
3041
2922
|
ownerName: i.owner.displayName,
|
|
3042
2923
|
owner: i.owner.id,
|
|
3043
2924
|
icon: o,
|
|
@@ -3058,8 +2939,8 @@ const hexToDataUrl = (n, e = 1, t = 1) => {
|
|
|
3058
2939
|
class AppointmentsBehaviour extends AbstractBehaviourService {
|
|
3059
2940
|
constructor() {
|
|
3060
2941
|
super(...arguments);
|
|
3061
|
-
|
|
3062
|
-
|
|
2942
|
+
u(this, "APP", "appointments");
|
|
2943
|
+
u(this, "RESOURCE", "appointments");
|
|
3063
2944
|
}
|
|
3064
2945
|
async loadResources() {
|
|
3065
2946
|
return (await this.httpGet("/appointments/grids/linker")).map((s) => this.dataToResource({
|
|
@@ -3077,8 +2958,8 @@ class AppointmentsBehaviour extends AbstractBehaviourService {
|
|
|
3077
2958
|
class BlogBehaviour extends AbstractBehaviourService {
|
|
3078
2959
|
constructor() {
|
|
3079
2960
|
super(...arguments);
|
|
3080
|
-
|
|
3081
|
-
|
|
2961
|
+
u(this, "APP", "blog");
|
|
2962
|
+
u(this, "RESOURCE", "blog");
|
|
3082
2963
|
}
|
|
3083
2964
|
loadResources() {
|
|
3084
2965
|
return new Promise(async (t, s) => {
|
|
@@ -3086,7 +2967,7 @@ class BlogBehaviour extends AbstractBehaviourService {
|
|
|
3086
2967
|
const r = await this.httpGet("/blog/linker"), i = [];
|
|
3087
2968
|
r.forEach((o) => {
|
|
3088
2969
|
o.thumbnail ? o.thumbnail = o.thumbnail + "?thumbnail=48x48" : o.thumbnail = "/img/illustrations/blog.svg";
|
|
3089
|
-
const
|
|
2970
|
+
const a = o.fetchPosts.map((c) => this.dataToResource({
|
|
3090
2971
|
owner: o.author.userId,
|
|
3091
2972
|
ownerName: o.author.username,
|
|
3092
2973
|
title: c.title + " [" + o.title + "]",
|
|
@@ -3096,7 +2977,7 @@ class BlogBehaviour extends AbstractBehaviourService {
|
|
|
3096
2977
|
shared: !!(o.shared && o.shared.length >= 0),
|
|
3097
2978
|
modified: o.modified
|
|
3098
2979
|
}));
|
|
3099
|
-
i.push(...
|
|
2980
|
+
i.push(...a);
|
|
3100
2981
|
}), t(i);
|
|
3101
2982
|
} catch (r) {
|
|
3102
2983
|
s(r);
|
|
@@ -3107,8 +2988,8 @@ class BlogBehaviour extends AbstractBehaviourService {
|
|
|
3107
2988
|
class CollaborativewallBehaviour extends AbstractBehaviourService {
|
|
3108
2989
|
constructor() {
|
|
3109
2990
|
super(...arguments);
|
|
3110
|
-
|
|
3111
|
-
|
|
2991
|
+
u(this, "APP", "collaborativewall");
|
|
2992
|
+
u(this, "RESOURCE", "collaborativewall");
|
|
3112
2993
|
}
|
|
3113
2994
|
async loadResources() {
|
|
3114
2995
|
return (await this.httpGet(
|
|
@@ -3130,8 +3011,8 @@ class CollaborativewallBehaviour extends AbstractBehaviourService {
|
|
|
3130
3011
|
class CommunityBehaviour extends AbstractBehaviourService {
|
|
3131
3012
|
constructor() {
|
|
3132
3013
|
super(...arguments);
|
|
3133
|
-
|
|
3134
|
-
|
|
3014
|
+
u(this, "APP", "community");
|
|
3015
|
+
u(this, "RESOURCE", "community");
|
|
3135
3016
|
}
|
|
3136
3017
|
async loadResources() {
|
|
3137
3018
|
return (await this.httpGet(
|
|
@@ -3155,8 +3036,8 @@ class CommunityBehaviour extends AbstractBehaviourService {
|
|
|
3155
3036
|
class ExercizerBehaviour extends AbstractBehaviourService {
|
|
3156
3037
|
constructor() {
|
|
3157
3038
|
super(...arguments);
|
|
3158
|
-
|
|
3159
|
-
|
|
3039
|
+
u(this, "APP", "exercizer");
|
|
3040
|
+
u(this, "RESOURCE", "exercizer");
|
|
3160
3041
|
}
|
|
3161
3042
|
async loadResources() {
|
|
3162
3043
|
return (await this.httpGet(
|
|
@@ -3164,8 +3045,8 @@ class ExercizerBehaviour extends AbstractBehaviourService {
|
|
|
3164
3045
|
)).map((s) => {
|
|
3165
3046
|
const r = s.picture ? s.picture + "?thumbnail=48x48" : "/img/illustrations/exercizer.svg";
|
|
3166
3047
|
let i, o = !1;
|
|
3167
|
-
const
|
|
3168
|
-
return
|
|
3048
|
+
const a = JSON.parse(s.scheduled_at);
|
|
3049
|
+
return a.groupList.length > 0 ? (o = !0, i = a.groupList[0].name) : a.userList.length > 0 ? (o = !0, i = a.userList[0].name) : i = "", a.groupList.length + a.userList.length > 1 && (i += "..."), this.dataToResource({
|
|
3169
3050
|
title: s.title,
|
|
3170
3051
|
owner: s.owner,
|
|
3171
3052
|
ownerName: i,
|
|
@@ -3181,8 +3062,8 @@ class ExercizerBehaviour extends AbstractBehaviourService {
|
|
|
3181
3062
|
class FormulaireBehaviour extends AbstractBehaviourService {
|
|
3182
3063
|
constructor() {
|
|
3183
3064
|
super(...arguments);
|
|
3184
|
-
|
|
3185
|
-
|
|
3065
|
+
u(this, "APP", "formulaire");
|
|
3066
|
+
u(this, "RESOURCE", "formulaire");
|
|
3186
3067
|
}
|
|
3187
3068
|
async loadResources() {
|
|
3188
3069
|
return (await this.httpGet(
|
|
@@ -3202,8 +3083,8 @@ class FormulaireBehaviour extends AbstractBehaviourService {
|
|
|
3202
3083
|
class ForumBehaviour extends AbstractBehaviourService {
|
|
3203
3084
|
constructor() {
|
|
3204
3085
|
super(...arguments);
|
|
3205
|
-
|
|
3206
|
-
|
|
3086
|
+
u(this, "APP", "forum");
|
|
3087
|
+
u(this, "RESOURCE", "forum");
|
|
3207
3088
|
}
|
|
3208
3089
|
async loadResources() {
|
|
3209
3090
|
return (await this.httpGet("/forum/categories")).map(
|
|
@@ -3223,8 +3104,8 @@ class ForumBehaviour extends AbstractBehaviourService {
|
|
|
3223
3104
|
class HomeworksBehaviour extends AbstractBehaviourService {
|
|
3224
3105
|
constructor() {
|
|
3225
3106
|
super(...arguments);
|
|
3226
|
-
|
|
3227
|
-
|
|
3107
|
+
u(this, "APP", "homeworks");
|
|
3108
|
+
u(this, "RESOURCE", "homeworks");
|
|
3228
3109
|
}
|
|
3229
3110
|
async loadResources() {
|
|
3230
3111
|
return (await this.httpGet("/homeworks/list")).filter((t) => t.owner && t.trashed === 0).map((t) => this.dataToResource({
|
|
@@ -3242,8 +3123,8 @@ class HomeworksBehaviour extends AbstractBehaviourService {
|
|
|
3242
3123
|
class MagnetoBehaviour extends AbstractBehaviourService {
|
|
3243
3124
|
constructor() {
|
|
3244
3125
|
super(...arguments);
|
|
3245
|
-
|
|
3246
|
-
|
|
3126
|
+
u(this, "APP", "magneto");
|
|
3127
|
+
u(this, "RESOURCE", "magneto");
|
|
3247
3128
|
}
|
|
3248
3129
|
async loadResources() {
|
|
3249
3130
|
const { all: t } = await this.httpGet(
|
|
@@ -3264,8 +3145,8 @@ class MagnetoBehaviour extends AbstractBehaviourService {
|
|
|
3264
3145
|
class MindmapBehaviour extends AbstractBehaviourService {
|
|
3265
3146
|
constructor() {
|
|
3266
3147
|
super(...arguments);
|
|
3267
|
-
|
|
3268
|
-
|
|
3148
|
+
u(this, "APP", "mindmap");
|
|
3149
|
+
u(this, "RESOURCE", "mindmap");
|
|
3269
3150
|
}
|
|
3270
3151
|
async loadResources() {
|
|
3271
3152
|
return (await this.httpGet("/mindmap/list/all")).map(
|
|
@@ -3285,8 +3166,8 @@ class MindmapBehaviour extends AbstractBehaviourService {
|
|
|
3285
3166
|
class PagesBehaviour extends AbstractBehaviourService {
|
|
3286
3167
|
constructor() {
|
|
3287
3168
|
super(...arguments);
|
|
3288
|
-
|
|
3289
|
-
|
|
3169
|
+
u(this, "APP", "pages");
|
|
3170
|
+
u(this, "RESOURCE", "pages");
|
|
3290
3171
|
}
|
|
3291
3172
|
async loadResources() {
|
|
3292
3173
|
const t = await this.httpGet("/pages/list/all"), s = [];
|
|
@@ -3304,15 +3185,15 @@ class PagesBehaviour extends AbstractBehaviourService {
|
|
|
3304
3185
|
shared: typeof r.shared < "u",
|
|
3305
3186
|
modified: r.modified
|
|
3306
3187
|
})
|
|
3307
|
-
), (o = r.pages) == null || o.forEach((
|
|
3188
|
+
), (o = r.pages) == null || o.forEach((a) => {
|
|
3308
3189
|
s.push(
|
|
3309
3190
|
this.dataToResource({
|
|
3310
|
-
title:
|
|
3191
|
+
title: a.title,
|
|
3311
3192
|
owner: r.owner.userId,
|
|
3312
3193
|
ownerName: r.owner.displayName,
|
|
3313
3194
|
icon: i,
|
|
3314
|
-
path: "/pages#/website/" + r._id + "/" +
|
|
3315
|
-
_id: r._id + "/" +
|
|
3195
|
+
path: "/pages#/website/" + r._id + "/" + a.titleLink,
|
|
3196
|
+
_id: r._id + "/" + a.titleLink,
|
|
3316
3197
|
shared: typeof r.shared < "u",
|
|
3317
3198
|
modified: r.modified
|
|
3318
3199
|
})
|
|
@@ -3324,8 +3205,8 @@ class PagesBehaviour extends AbstractBehaviourService {
|
|
|
3324
3205
|
class PollBehaviour extends AbstractBehaviourService {
|
|
3325
3206
|
constructor() {
|
|
3326
3207
|
super(...arguments);
|
|
3327
|
-
|
|
3328
|
-
|
|
3208
|
+
u(this, "APP", "poll");
|
|
3209
|
+
u(this, "RESOURCE", "poll");
|
|
3329
3210
|
}
|
|
3330
3211
|
async loadResources() {
|
|
3331
3212
|
return (await this.httpGet("/poll/list/all")).map((s) => {
|
|
@@ -3346,8 +3227,8 @@ class PollBehaviour extends AbstractBehaviourService {
|
|
|
3346
3227
|
class ScrapbookBehaviour extends AbstractBehaviourService {
|
|
3347
3228
|
constructor() {
|
|
3348
3229
|
super(...arguments);
|
|
3349
|
-
|
|
3350
|
-
|
|
3230
|
+
u(this, "APP", "scrapbook");
|
|
3231
|
+
u(this, "RESOURCE", "scrapbook");
|
|
3351
3232
|
}
|
|
3352
3233
|
async loadResources() {
|
|
3353
3234
|
return (await this.httpGet(
|
|
@@ -3370,8 +3251,8 @@ class ScrapbookBehaviour extends AbstractBehaviourService {
|
|
|
3370
3251
|
class TimelinegeneratorBehaviour extends AbstractBehaviourService {
|
|
3371
3252
|
constructor() {
|
|
3372
3253
|
super(...arguments);
|
|
3373
|
-
|
|
3374
|
-
|
|
3254
|
+
u(this, "APP", "timelinegenerator");
|
|
3255
|
+
u(this, "RESOURCE", "timelinegenerator");
|
|
3375
3256
|
}
|
|
3376
3257
|
loadResources() {
|
|
3377
3258
|
return new Promise(async (t, s) => {
|
|
@@ -3379,12 +3260,12 @@ class TimelinegeneratorBehaviour extends AbstractBehaviourService {
|
|
|
3379
3260
|
const i = (await this.httpGet(
|
|
3380
3261
|
"/timelinegenerator/timelines"
|
|
3381
3262
|
)).map((o) => {
|
|
3382
|
-
const
|
|
3263
|
+
const a = o.icon || "/img/illustrations/timeline-default.png";
|
|
3383
3264
|
return this.dataToResource({
|
|
3384
3265
|
title: o.headline,
|
|
3385
3266
|
ownerName: o.owner.displayName,
|
|
3386
3267
|
owner: o.owner.userId,
|
|
3387
|
-
icon:
|
|
3268
|
+
icon: a,
|
|
3388
3269
|
path: "/timelinegenerator#/view/" + o._id,
|
|
3389
3270
|
_id: o._id,
|
|
3390
3271
|
shared: typeof o.shared < "u",
|
|
@@ -3401,8 +3282,8 @@ class TimelinegeneratorBehaviour extends AbstractBehaviourService {
|
|
|
3401
3282
|
class WikiBehaviour extends AbstractBehaviourService {
|
|
3402
3283
|
constructor() {
|
|
3403
3284
|
super(...arguments);
|
|
3404
|
-
|
|
3405
|
-
|
|
3285
|
+
u(this, "APP", "wiki");
|
|
3286
|
+
u(this, "RESOURCE", "wiki");
|
|
3406
3287
|
}
|
|
3407
3288
|
async loadResources() {
|
|
3408
3289
|
return (await this.httpGet(
|
|
@@ -3425,8 +3306,8 @@ class WikiBehaviour extends AbstractBehaviourService {
|
|
|
3425
3306
|
class WorkspaceBehaviour extends AbstractBehaviourService {
|
|
3426
3307
|
constructor() {
|
|
3427
3308
|
super(...arguments);
|
|
3428
|
-
|
|
3429
|
-
|
|
3309
|
+
u(this, "APP", "workspace");
|
|
3310
|
+
u(this, "RESOURCE", "workspace");
|
|
3430
3311
|
}
|
|
3431
3312
|
loadResources({ search: t, asset_id: s }) {
|
|
3432
3313
|
return new Promise(async (r, i) => {
|
|
@@ -3434,12 +3315,12 @@ class WorkspaceBehaviour extends AbstractBehaviourService {
|
|
|
3434
3315
|
let o = "/workspace/documents?filter=all&hierarchical=true";
|
|
3435
3316
|
s && s.length ? o += `&search=${t}` : t && t.length && (o += `&search=${t}`);
|
|
3436
3317
|
const c = (await this.httpGet(o)).filter((l) => !l.deleted).map((l) => {
|
|
3437
|
-
const
|
|
3318
|
+
const h = l.metadata["content-type"] && l.metadata["content-type"].indexOf("image") !== -1 ? `/workspace/document/${l._id}?thumbnail=120x120` : "/img/icons/unknown-large.png";
|
|
3438
3319
|
return this.dataToResource({
|
|
3439
3320
|
title: l.name,
|
|
3440
3321
|
ownerName: l.ownerName,
|
|
3441
3322
|
owner: l.owner,
|
|
3442
|
-
icon:
|
|
3323
|
+
icon: h,
|
|
3443
3324
|
path: `/workspace/document/${l._id}`,
|
|
3444
3325
|
_id: l._id,
|
|
3445
3326
|
shared: !!(l.shared && l.shared.length >= 0),
|
|
@@ -3453,7 +3334,7 @@ class WorkspaceBehaviour extends AbstractBehaviourService {
|
|
|
3453
3334
|
});
|
|
3454
3335
|
}
|
|
3455
3336
|
}
|
|
3456
|
-
const
|
|
3337
|
+
const b = class b {
|
|
3457
3338
|
static async initialize(e, t) {
|
|
3458
3339
|
const s = e.http();
|
|
3459
3340
|
if (!this.resourceProducingApps.length) {
|
|
@@ -3464,7 +3345,7 @@ const R = class R {
|
|
|
3464
3345
|
e.session().getUser()
|
|
3465
3346
|
]);
|
|
3466
3347
|
i != null && i.apps && (r != null && r.length) && (this.resourceProducingApps = r.filter(
|
|
3467
|
-
(o) => i.apps.some((
|
|
3348
|
+
(o) => i.apps.some((a) => a.address.includes(o))
|
|
3468
3349
|
));
|
|
3469
3350
|
} catch (r) {
|
|
3470
3351
|
console.warn("Failed to load resource-producing apps:", r);
|
|
@@ -3547,9 +3428,9 @@ const R = class R {
|
|
|
3547
3428
|
//
|
|
3548
3429
|
// STATIC REGISTRY
|
|
3549
3430
|
//
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
let SnipletsService =
|
|
3431
|
+
u(b, "registry", new ServiceRegistry()), // Expose some useful functions
|
|
3432
|
+
u(b, "findBehaviour", b.registry.findService.bind(b.registry)), u(b, "hasBehaviour", b.registry.isRegistered.bind(b.registry)), u(b, "resourceProducingApps", []);
|
|
3433
|
+
let SnipletsService = b;
|
|
3553
3434
|
class RightService {
|
|
3554
3435
|
constructor(e) {
|
|
3555
3436
|
this.context = e;
|
|
@@ -3747,14 +3628,14 @@ class SessionService {
|
|
|
3747
3628
|
r,
|
|
3748
3629
|
i,
|
|
3749
3630
|
o,
|
|
3750
|
-
|
|
3631
|
+
a
|
|
3751
3632
|
] = await Promise.all([
|
|
3752
3633
|
this.getCurrentLanguage(e),
|
|
3753
3634
|
this.latestQuotaAndUsage(e),
|
|
3754
3635
|
this.loadDescription(e),
|
|
3755
3636
|
this.getUserProfile(),
|
|
3756
3637
|
this.getBookmarks(e)
|
|
3757
|
-
]), { type: c, ...l } = t || {},
|
|
3638
|
+
]), { type: c, ...l } = t || {}, h = {
|
|
3758
3639
|
...l,
|
|
3759
3640
|
profiles: c || ["Guest"],
|
|
3760
3641
|
// "type" field from /userbook/api/person becomes "profiles"
|
|
@@ -3765,9 +3646,9 @@ class SessionService {
|
|
|
3765
3646
|
user: e,
|
|
3766
3647
|
quotaAndUsage: r,
|
|
3767
3648
|
currentLanguage: s,
|
|
3768
|
-
userDescription:
|
|
3649
|
+
userDescription: h,
|
|
3769
3650
|
userProfile: o,
|
|
3770
|
-
bookmarkedApps:
|
|
3651
|
+
bookmarkedApps: a
|
|
3771
3652
|
};
|
|
3772
3653
|
}
|
|
3773
3654
|
login(e, t, s, r) {
|
|
@@ -3861,7 +3742,7 @@ class SessionService {
|
|
|
3861
3742
|
applications: []
|
|
3862
3743
|
});
|
|
3863
3744
|
const i = [];
|
|
3864
|
-
return r.bookmarks.forEach((o,
|
|
3745
|
+
return r.bookmarks.forEach((o, a) => {
|
|
3865
3746
|
const c = ((e == null ? void 0 : e.apps) || []).find(
|
|
3866
3747
|
(l) => l.name === o
|
|
3867
3748
|
);
|
|
@@ -3877,11 +3758,11 @@ class SessionService {
|
|
|
3877
3758
|
}
|
|
3878
3759
|
async getPerson(e = {}) {
|
|
3879
3760
|
var c;
|
|
3880
|
-
const { options: t = {}, params: s = {} } = e, r = new URLSearchParams(s).toString(), i = `/userbook/api/person${r ? `?${r}` : ""}`, { response: o, value:
|
|
3761
|
+
const { options: t = {}, params: s = {} } = e, r = new URLSearchParams(s).toString(), i = `/userbook/api/person${r ? `?${r}` : ""}`, { response: o, value: a } = await this.cache.httpGet(
|
|
3881
3762
|
i,
|
|
3882
3763
|
t
|
|
3883
3764
|
);
|
|
3884
|
-
return o.status < 200 || o.status >= 300 || typeof
|
|
3765
|
+
return o.status < 200 || o.status >= 300 || typeof a == "string" ? null : ((c = a == null ? void 0 : a.result) == null ? void 0 : c[0]) || null;
|
|
3885
3766
|
}
|
|
3886
3767
|
async isAdml() {
|
|
3887
3768
|
const e = await this.getUser();
|
|
@@ -3939,38 +3820,38 @@ class ShareService {
|
|
|
3939
3820
|
t,
|
|
3940
3821
|
s,
|
|
3941
3822
|
r
|
|
3942
|
-
),
|
|
3823
|
+
), a = await this.cache.httpGetJson(o), c = a.users.visibles.filter(({ username: p, firstName: y, lastName: d, login: g }) => {
|
|
3943
3824
|
const A = StringUtils.removeAccents(
|
|
3944
|
-
|
|
3825
|
+
d || ""
|
|
3945
3826
|
).toLowerCase(), f = StringUtils.removeAccents(
|
|
3946
3827
|
y || ""
|
|
3947
3828
|
).toLowerCase(), w = StringUtils.removeAccents(
|
|
3948
|
-
|
|
3829
|
+
p || ""
|
|
3949
3830
|
).toLowerCase(), F = StringUtils.removeAccents(g || "").toLowerCase();
|
|
3950
3831
|
return w.includes(i) || f.includes(i) || A.includes(i) || F.includes(i);
|
|
3951
|
-
}).map((
|
|
3952
|
-
avatarUrl: this.directory.getAvatarUrl(
|
|
3953
|
-
directoryUrl: this.directory.getDirectoryUrl(
|
|
3954
|
-
displayName:
|
|
3955
|
-
id:
|
|
3956
|
-
profile:
|
|
3832
|
+
}).map((p) => ({
|
|
3833
|
+
avatarUrl: this.directory.getAvatarUrl(p.id, "user"),
|
|
3834
|
+
directoryUrl: this.directory.getDirectoryUrl(p.id, "user"),
|
|
3835
|
+
displayName: p.username,
|
|
3836
|
+
id: p.id,
|
|
3837
|
+
profile: p.profile,
|
|
3957
3838
|
type: "user"
|
|
3958
|
-
})), l =
|
|
3959
|
-
avatarUrl: this.directory.getAvatarUrl(
|
|
3960
|
-
directoryUrl: this.directory.getDirectoryUrl(
|
|
3961
|
-
displayName:
|
|
3962
|
-
id:
|
|
3839
|
+
})), l = a.groups.visibles.filter(({ name: p }) => StringUtils.removeAccents(p || "").toLowerCase().includes(i)).map((p) => ({
|
|
3840
|
+
avatarUrl: this.directory.getAvatarUrl(p.id, "group"),
|
|
3841
|
+
directoryUrl: this.directory.getDirectoryUrl(p.id, "group"),
|
|
3842
|
+
displayName: p.name,
|
|
3843
|
+
id: p.id,
|
|
3963
3844
|
type: "group",
|
|
3964
|
-
structureName:
|
|
3845
|
+
structureName: p.structureName
|
|
3965
3846
|
}));
|
|
3966
|
-
return [...(await this.directory.getBookMarks()).filter(({ displayName:
|
|
3967
|
-
|
|
3968
|
-
).toLowerCase().includes(i)).map((
|
|
3847
|
+
return [...(await this.directory.getBookMarks()).filter(({ displayName: p }) => StringUtils.removeAccents(
|
|
3848
|
+
p || ""
|
|
3849
|
+
).toLowerCase().includes(i)).map((p) => ({
|
|
3969
3850
|
avatarUrl: "",
|
|
3970
3851
|
directoryUrl: "",
|
|
3971
3852
|
profile: "",
|
|
3972
|
-
displayName:
|
|
3973
|
-
id:
|
|
3853
|
+
displayName: p.displayName,
|
|
3854
|
+
id: p.id,
|
|
3974
3855
|
type: "sharebookmark"
|
|
3975
3856
|
})), ...c, ...l];
|
|
3976
3857
|
}
|
|
@@ -3986,10 +3867,10 @@ class ShareService {
|
|
|
3986
3867
|
return s;
|
|
3987
3868
|
}
|
|
3988
3869
|
getActionsAvailableFor({ id: e, type: t }, s, r) {
|
|
3989
|
-
const o = (t === "user" ? s.users.checked[e] : s.groups.checked[e]) || [],
|
|
3990
|
-
for (const l of
|
|
3870
|
+
const o = (t === "user" ? s.users.checked[e] : s.groups.checked[e]) || [], a = Object.keys(r), c = [];
|
|
3871
|
+
for (const l of a)
|
|
3991
3872
|
r[l].filter(
|
|
3992
|
-
(
|
|
3873
|
+
(p) => o.includes(p)
|
|
3993
3874
|
).length > 0 && c.push(l);
|
|
3994
3875
|
return c;
|
|
3995
3876
|
}
|
|
@@ -4001,26 +3882,26 @@ class ShareService {
|
|
|
4001
3882
|
s == null ? void 0 : s.getResourceRights
|
|
4002
3883
|
), o = await this.cache.httpGetJson(
|
|
4003
3884
|
i
|
|
4004
|
-
),
|
|
3885
|
+
), a = await this.getShareMapping(
|
|
4005
3886
|
e,
|
|
4006
3887
|
s == null ? void 0 : s.getShareMapping
|
|
4007
3888
|
), c = await this.cache.httpGetJson(
|
|
4008
3889
|
"/infra/public/json/sharing-rights.json"
|
|
4009
|
-
), l = Object.keys(o.users.checked).map((
|
|
4010
|
-
(A) => A.id ===
|
|
4011
|
-
)).filter((
|
|
3890
|
+
), l = Object.keys(o.users.checked).map((d) => o.users.visibles.find(
|
|
3891
|
+
(A) => A.id === d
|
|
3892
|
+
)).filter((d) => d !== void 0).map((d) => {
|
|
4012
3893
|
const g = this.getActionsAvailableFor(
|
|
4013
|
-
{ id:
|
|
3894
|
+
{ id: d.id, type: "user" },
|
|
4014
3895
|
o,
|
|
4015
|
-
|
|
3896
|
+
a
|
|
4016
3897
|
);
|
|
4017
3898
|
return {
|
|
4018
|
-
id:
|
|
3899
|
+
id: d.id,
|
|
4019
3900
|
type: "user",
|
|
4020
|
-
displayName:
|
|
4021
|
-
profile:
|
|
4022
|
-
avatarUrl: this.directory.getAvatarUrl(
|
|
4023
|
-
directoryUrl: this.directory.getDirectoryUrl(
|
|
3901
|
+
displayName: d.username,
|
|
3902
|
+
profile: d.profile,
|
|
3903
|
+
avatarUrl: this.directory.getAvatarUrl(d.id, "user"),
|
|
3904
|
+
directoryUrl: this.directory.getDirectoryUrl(d.id, "user"),
|
|
4024
3905
|
actions: g.map((f) => {
|
|
4025
3906
|
const w = c[f];
|
|
4026
3907
|
return {
|
|
@@ -4030,21 +3911,21 @@ class ShareService {
|
|
|
4030
3911
|
};
|
|
4031
3912
|
})
|
|
4032
3913
|
};
|
|
4033
|
-
}).sort((
|
|
4034
|
-
(A) => A.id ===
|
|
4035
|
-
)).filter((
|
|
3914
|
+
}).sort((d, g) => (d.displayName || "").localeCompare(g.displayName)), h = Object.keys(o.groups.checked).map((d) => o.groups.visibles.find(
|
|
3915
|
+
(A) => A.id === d
|
|
3916
|
+
)).filter((d) => d !== void 0).map((d) => {
|
|
4036
3917
|
const g = this.getActionsAvailableFor(
|
|
4037
|
-
{ id:
|
|
3918
|
+
{ id: d.id, type: "group" },
|
|
4038
3919
|
o,
|
|
4039
|
-
|
|
3920
|
+
a
|
|
4040
3921
|
);
|
|
4041
3922
|
return {
|
|
4042
|
-
id:
|
|
3923
|
+
id: d.id,
|
|
4043
3924
|
type: "group",
|
|
4044
|
-
displayName:
|
|
3925
|
+
displayName: d.name,
|
|
4045
3926
|
profile: void 0,
|
|
4046
|
-
avatarUrl: this.directory.getAvatarUrl(
|
|
4047
|
-
directoryUrl: this.directory.getDirectoryUrl(
|
|
3927
|
+
avatarUrl: this.directory.getAvatarUrl(d.id, "group"),
|
|
3928
|
+
directoryUrl: this.directory.getDirectoryUrl(d.id, "group"),
|
|
4048
3929
|
actions: g.map((f) => {
|
|
4049
3930
|
const w = c[f];
|
|
4050
3931
|
return {
|
|
@@ -4054,26 +3935,26 @@ class ShareService {
|
|
|
4054
3935
|
};
|
|
4055
3936
|
})
|
|
4056
3937
|
};
|
|
4057
|
-
}).sort((
|
|
4058
|
-
({ groupDisplayName:
|
|
3938
|
+
}).sort((d, g) => (d.displayName || "").localeCompare(g.displayName)), E = [...l, ...h], p = o.groups.visibles.map(
|
|
3939
|
+
({ groupDisplayName: d, id: g, name: A, labels: f }) => ({
|
|
4059
3940
|
labels: f,
|
|
4060
|
-
displayName:
|
|
3941
|
+
displayName: d || A,
|
|
4061
3942
|
id: g
|
|
4062
3943
|
})
|
|
4063
3944
|
), y = o.users.visibles.map(
|
|
4064
|
-
({ id:
|
|
3945
|
+
({ id: d, profile: g, username: A, firstName: f, lastName: w, login: F }) => ({
|
|
4065
3946
|
displayName: A,
|
|
4066
3947
|
firstName: f,
|
|
4067
3948
|
lastName: w,
|
|
4068
3949
|
login: F,
|
|
4069
3950
|
profile: g,
|
|
4070
|
-
id:
|
|
3951
|
+
id: d
|
|
4071
3952
|
})
|
|
4072
3953
|
);
|
|
4073
3954
|
return {
|
|
4074
|
-
rights:
|
|
3955
|
+
rights: E,
|
|
4075
3956
|
visibleBookmarks: r,
|
|
4076
|
-
visibleGroups:
|
|
3957
|
+
visibleGroups: p,
|
|
4077
3958
|
visibleUsers: y
|
|
4078
3959
|
};
|
|
4079
3960
|
}
|
|
@@ -4084,7 +3965,7 @@ class ShareService {
|
|
|
4084
3965
|
bookmarks: {}
|
|
4085
3966
|
}, i = await this.getShareMapping(e, s);
|
|
4086
3967
|
for (const o of t) {
|
|
4087
|
-
const
|
|
3968
|
+
const a = o.actions.map((l) => i[l.id]).reduce((l, h) => Array.isArray(h) ? [...l, ...h] : l, []), c = [...new Set(a)];
|
|
4088
3969
|
c.length > 0 && (o.type === "user" ? r.users[o.id] = c : o.type === "group" ? r.groups[o.id] = c : r.bookmarks[o.id] = c);
|
|
4089
3970
|
}
|
|
4090
3971
|
return r;
|
|
@@ -4094,40 +3975,40 @@ class ShareService {
|
|
|
4094
3975
|
e,
|
|
4095
3976
|
s,
|
|
4096
3977
|
r == null ? void 0 : r.getShareMapping
|
|
4097
|
-
), o = (r == null ? void 0 : r.saveResourceRights) || `/${e}/share/resource/${t}`,
|
|
3978
|
+
), o = (r == null ? void 0 : r.saveResourceRights) || `/${e}/share/resource/${t}`, a = this.getSearchUrl(
|
|
4098
3979
|
e,
|
|
4099
3980
|
t,
|
|
4100
3981
|
"",
|
|
4101
3982
|
r == null ? void 0 : r.getResourceRights
|
|
4102
3983
|
);
|
|
4103
|
-
return this.cache.clearCache(
|
|
3984
|
+
return this.cache.clearCache(a), await this.http.putJson(o, i);
|
|
4104
3985
|
}
|
|
4105
3986
|
async getActionsForApp(e, t) {
|
|
4106
3987
|
const s = await this.cache.httpGetJson(
|
|
4107
3988
|
"/infra/public/json/sharing-rights.json"
|
|
4108
3989
|
), r = await this.getShareMapping(e, t);
|
|
4109
3990
|
return Object.keys(s).map((o) => {
|
|
4110
|
-
const
|
|
3991
|
+
const a = s[o];
|
|
4111
3992
|
return {
|
|
4112
3993
|
displayName: o,
|
|
4113
3994
|
id: o,
|
|
4114
|
-
priority:
|
|
4115
|
-
requires:
|
|
3995
|
+
priority: a.priority,
|
|
3996
|
+
requires: a.requires
|
|
4116
3997
|
};
|
|
4117
3998
|
}).filter((o) => {
|
|
4118
|
-
var
|
|
4119
|
-
return ((
|
|
4120
|
-
}).sort((o,
|
|
3999
|
+
var a;
|
|
4000
|
+
return ((a = r[o.id]) == null ? void 0 : a.length) > 0;
|
|
4001
|
+
}).sort((o, a) => o.priority - a.priority);
|
|
4121
4002
|
}
|
|
4122
4003
|
}
|
|
4123
4004
|
const loadedScripts = {};
|
|
4124
4005
|
class HttpService {
|
|
4125
4006
|
constructor(e, t) {
|
|
4126
4007
|
// Axios automatically manages the XSRF-TOKEN cookie and the X-XSRF-TOKEN HTTP header.
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4008
|
+
u(this, "axios");
|
|
4009
|
+
u(this, "baseUrl");
|
|
4010
|
+
u(this, "headers", {});
|
|
4011
|
+
u(this, "_latestResponse");
|
|
4131
4012
|
this.context = e, this.axios = axios.create(t);
|
|
4132
4013
|
}
|
|
4133
4014
|
fixBaseUrl(e) {
|
|
@@ -4342,8 +4223,8 @@ class HttpService {
|
|
|
4342
4223
|
const r = s ?? "exports", i = this.toAxiosConfig(t);
|
|
4343
4224
|
return i.headers && (i.headers.Accept = "application/javascript"), this.axios.get(this.toCdnUrl(e), i).then((o) => this.mapAxiosResponse(o, t)).then((o) => {
|
|
4344
4225
|
try {
|
|
4345
|
-
const
|
|
4346
|
-
return Function(
|
|
4226
|
+
const a = `"use strict";var ${r.split(".")[0]}={};${o};return ${r};`;
|
|
4227
|
+
return Function(a)();
|
|
4347
4228
|
} catch {
|
|
4348
4229
|
return o;
|
|
4349
4230
|
}
|
|
@@ -4357,7 +4238,7 @@ class HttpService {
|
|
|
4357
4238
|
});
|
|
4358
4239
|
}
|
|
4359
4240
|
}
|
|
4360
|
-
const
|
|
4241
|
+
const R = class R {
|
|
4361
4242
|
// in minutes. Applies to recorded videos.
|
|
4362
4243
|
constructor(e) {
|
|
4363
4244
|
this.context = e;
|
|
@@ -4378,8 +4259,8 @@ const b = class b {
|
|
|
4378
4259
|
APP$4.VIDEO
|
|
4379
4260
|
);
|
|
4380
4261
|
return {
|
|
4381
|
-
maxWeight: (e == null ? void 0 : e["max-videosize-mbytes"]) ??
|
|
4382
|
-
maxDuration: (e == null ? void 0 : e["max-videoduration-minutes"]) ??
|
|
4262
|
+
maxWeight: (e == null ? void 0 : e["max-videosize-mbytes"]) ?? R.MAX_WEIGHT,
|
|
4263
|
+
maxDuration: (e == null ? void 0 : e["max-videoduration-minutes"]) ?? R.MAX_DURATION,
|
|
4383
4264
|
acceptVideoUploadExtensions: ((t = e == null ? void 0 : e["accept-videoupload-extensions"]) == null ? void 0 : t.map(
|
|
4384
4265
|
(s) => s.toUpperCase()
|
|
4385
4266
|
)) ?? []
|
|
@@ -4402,43 +4283,43 @@ const b = class b {
|
|
|
4402
4283
|
throw new Error("Invalid video filename");
|
|
4403
4284
|
const i = `${e.browser.name} ${e.browser.version}`, o = new FormData();
|
|
4404
4285
|
o.append("device", e.device || ""), o.append("browser", i), o.append("url", e.url), o.append("app", t), o.append("file", e.file, e.filename), o.append("weight", "" + e.file.size), o.append("captation", "" + s);
|
|
4405
|
-
let
|
|
4406
|
-
r && (
|
|
4286
|
+
let a = `/video/encode?captation=${s}`;
|
|
4287
|
+
r && (a += `&duration=${r}`);
|
|
4407
4288
|
const c = await this.http.post(
|
|
4408
|
-
|
|
4289
|
+
a,
|
|
4409
4290
|
o,
|
|
4410
4291
|
{ headers: { "Content-Type": "multipart/form-data" } }
|
|
4411
4292
|
);
|
|
4412
4293
|
if (c.state == "running") {
|
|
4413
|
-
let l = 0,
|
|
4294
|
+
let l = 0, h = 1;
|
|
4414
4295
|
do {
|
|
4415
|
-
const
|
|
4296
|
+
const E = h + l;
|
|
4416
4297
|
await new Promise(
|
|
4417
|
-
(y) => setTimeout(y,
|
|
4418
|
-
), l =
|
|
4419
|
-
const
|
|
4298
|
+
(y) => setTimeout(y, E * 1e3)
|
|
4299
|
+
), l = h, h = Math.min(8, E);
|
|
4300
|
+
const p = await this.http.get(
|
|
4420
4301
|
`/video/status/${c.processid}`
|
|
4421
4302
|
);
|
|
4422
|
-
if (
|
|
4423
|
-
return
|
|
4424
|
-
|
|
4303
|
+
if (p.state == "succeed")
|
|
4304
|
+
return p.videoworkspaceid && p.videosize && this.context.data().trackVideoSave(
|
|
4305
|
+
p.videoworkspaceid,
|
|
4425
4306
|
Math.round(r),
|
|
4426
|
-
|
|
4307
|
+
p.videosize,
|
|
4427
4308
|
s,
|
|
4428
4309
|
e.url,
|
|
4429
4310
|
i,
|
|
4430
4311
|
e.device
|
|
4431
|
-
),
|
|
4432
|
-
if (
|
|
4312
|
+
), p;
|
|
4313
|
+
if (p.state == "error")
|
|
4433
4314
|
break;
|
|
4434
4315
|
} while (!0);
|
|
4435
4316
|
}
|
|
4436
4317
|
throw new Error("Video cannot be uploaded.");
|
|
4437
4318
|
}
|
|
4438
4319
|
};
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
let VideoService =
|
|
4320
|
+
u(R, "MAX_WEIGHT", 50), // in Mbytes. Applies to uploaded videos.
|
|
4321
|
+
u(R, "MAX_DURATION", 3);
|
|
4322
|
+
let VideoService = R;
|
|
4442
4323
|
class WidgetService {
|
|
4443
4324
|
constructor(e) {
|
|
4444
4325
|
this.context = e;
|
|
@@ -4519,7 +4400,7 @@ const defaultMappers = {
|
|
|
4519
4400
|
}
|
|
4520
4401
|
};
|
|
4521
4402
|
// FIXME add edumedia support
|
|
4522
|
-
|
|
4403
|
+
u(v, "roleMappers", [
|
|
4523
4404
|
(e) => Object.keys(defaultMappers).find((s) => defaultMappers[s](e))
|
|
4524
4405
|
]);
|
|
4525
4406
|
let DocumentHelper = v;
|
|
@@ -4537,29 +4418,29 @@ class WorkspaceService {
|
|
|
4537
4418
|
size: e.size,
|
|
4538
4419
|
extension: i,
|
|
4539
4420
|
role: DocumentHelper.role(r, !1, i)
|
|
4540
|
-
},
|
|
4541
|
-
return { basename:
|
|
4421
|
+
}, a = t.replace("." + o.extension, ""), c = o.extension ? a + "." + o.extension : a;
|
|
4422
|
+
return { basename: a, fullname: c, metadata: o };
|
|
4542
4423
|
}
|
|
4543
4424
|
async saveFile(e, t) {
|
|
4544
4425
|
const { fullname: s, metadata: r } = this.extractMetadata(e), i = new FormData();
|
|
4545
4426
|
i.append("file", e, s);
|
|
4546
4427
|
const o = [];
|
|
4547
4428
|
((t == null ? void 0 : t.visibility) === "public" || (t == null ? void 0 : t.visibility) === "protected") && o.push(`${t.visibility}=true`), t != null && t.application && o.push(`application=${t.application}`), r.role === "img" && o.push("quality=1"), t != null && t.parentId && o.push(`parentId=${t.parentId}`);
|
|
4548
|
-
const
|
|
4429
|
+
const a = await this.http.postFile(
|
|
4549
4430
|
`/workspace/document?${o.join("&")}`,
|
|
4550
4431
|
i
|
|
4551
4432
|
);
|
|
4552
4433
|
if (this.http.isResponseError())
|
|
4553
4434
|
throw this.http.latestResponse.statusText;
|
|
4554
|
-
return
|
|
4435
|
+
return a;
|
|
4555
4436
|
}
|
|
4556
4437
|
async updateFile(e, t, s) {
|
|
4557
4438
|
const { fullname: r, metadata: i } = this.extractMetadata(t), o = new FormData();
|
|
4558
4439
|
o.append("file", t, r);
|
|
4559
|
-
const
|
|
4560
|
-
i.role === "img" &&
|
|
4440
|
+
const a = [];
|
|
4441
|
+
i.role === "img" && a.push("quality=1"), s != null && s.alt && a.push(`alt=${s.alt}`), s != null && s.legend && a.push(`legend=${s.legend}`), s != null && s.name && a.push(`name=${s.name}`);
|
|
4561
4442
|
const c = await this.http.putFile(
|
|
4562
|
-
`/workspace/document/${e}?${
|
|
4443
|
+
`/workspace/document/${e}?${a.join("&")}`,
|
|
4563
4444
|
o
|
|
4564
4445
|
);
|
|
4565
4446
|
if (this.http.isResponseError())
|
|
@@ -4610,11 +4491,11 @@ class WorkspaceService {
|
|
|
4610
4491
|
);
|
|
4611
4492
|
if (this.http.isResponseError())
|
|
4612
4493
|
throw this.http.latestResponse.statusText;
|
|
4613
|
-
return r.forEach((o,
|
|
4494
|
+
return r.forEach((o, a) => {
|
|
4614
4495
|
const c = e.findIndex(
|
|
4615
4496
|
(l) => l._id === o._id
|
|
4616
4497
|
);
|
|
4617
|
-
0 <= c && c < e.length && (e[c] = i[
|
|
4498
|
+
0 <= c && c < e.length && (e[c] = i[a]);
|
|
4618
4499
|
}), e.filter((o) => !!o);
|
|
4619
4500
|
}
|
|
4620
4501
|
return e;
|
|
@@ -4629,12 +4510,12 @@ class WorkspaceService {
|
|
|
4629
4510
|
if (typeof e == "string")
|
|
4630
4511
|
return e.includes("data:image") || e.includes("thumbnail") ? e : `${e}${e.includes("?") ? "&" : "?"}thumbnail=${r}`;
|
|
4631
4512
|
{
|
|
4632
|
-
const
|
|
4513
|
+
const a = `/workspace/${e.public ? "pub/" : ""}document/${e._id}?thumbnail=`, c = e.thumbnails;
|
|
4633
4514
|
if ((o = (i = e.metadata) == null ? void 0 : i["content-type"]) != null && o.includes("video")) {
|
|
4634
4515
|
const l = c && Object.keys(c).length > 0 ? Object.keys(c)[0] : null;
|
|
4635
|
-
return l ?
|
|
4516
|
+
return l ? a + l : null;
|
|
4636
4517
|
} else
|
|
4637
|
-
return
|
|
4518
|
+
return a + r;
|
|
4638
4519
|
}
|
|
4639
4520
|
}
|
|
4640
4521
|
/**
|
|
@@ -4688,24 +4569,23 @@ class WorkspaceService {
|
|
|
4688
4569
|
}
|
|
4689
4570
|
class OdeServices {
|
|
4690
4571
|
constructor() {
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
this._analytics = new AnalyticsService(this), this._cache = new CacheService(this), this._conf = new ConfService(this), this._data = new DataService(this), this._directory = new DirectoryService(this), this._googledrive = new GoogleDriveService(this), this._http = new HttpService(this), this._idiom = new IdiomService(this), this._nextcloud = new NextcloudService(this), this._notify = NotifyFrameworkFactory.instance(), this._rights = new RightService(this), this._session = new SessionService(this), this._share = new ShareService(this), this._video = new VideoService(this), this._widget = new WidgetService(this), this._workspace = new WorkspaceService(this), this._embedder = new EmbedderService(this);
|
|
4572
|
+
u(this, "_analytics");
|
|
4573
|
+
u(this, "_cache");
|
|
4574
|
+
u(this, "_conf");
|
|
4575
|
+
u(this, "_data");
|
|
4576
|
+
u(this, "_directory");
|
|
4577
|
+
u(this, "_http");
|
|
4578
|
+
u(this, "_idiom");
|
|
4579
|
+
u(this, "_nextcloud");
|
|
4580
|
+
u(this, "_notify");
|
|
4581
|
+
u(this, "_rights");
|
|
4582
|
+
u(this, "_session");
|
|
4583
|
+
u(this, "_share");
|
|
4584
|
+
u(this, "_video");
|
|
4585
|
+
u(this, "_widget");
|
|
4586
|
+
u(this, "_workspace");
|
|
4587
|
+
u(this, "_embedder");
|
|
4588
|
+
this._analytics = new AnalyticsService(this), this._cache = new CacheService(this), this._conf = new ConfService(this), this._data = new DataService(this), this._directory = new DirectoryService(this), this._http = new HttpService(this), this._idiom = new IdiomService(this), this._nextcloud = new NextcloudService(this), this._notify = NotifyFrameworkFactory.instance(), this._rights = new RightService(this), this._session = new SessionService(this), this._share = new ShareService(this), this._video = new VideoService(this), this._widget = new WidgetService(this), this._workspace = new WorkspaceService(this), this._embedder = new EmbedderService(this);
|
|
4709
4589
|
}
|
|
4710
4590
|
initialize() {
|
|
4711
4591
|
return this._data.initialize(), this;
|
|
@@ -4728,9 +4608,6 @@ class OdeServices {
|
|
|
4728
4608
|
directory() {
|
|
4729
4609
|
return this._directory;
|
|
4730
4610
|
}
|
|
4731
|
-
googledrive() {
|
|
4732
|
-
return this._googledrive;
|
|
4733
|
-
}
|
|
4734
4611
|
http() {
|
|
4735
4612
|
return this._http;
|
|
4736
4613
|
}
|
|
@@ -4915,10 +4792,10 @@ const isActionAvailable = (n, e) => {
|
|
|
4915
4792
|
class WidgetFramework {
|
|
4916
4793
|
constructor() {
|
|
4917
4794
|
//-------------------------------------
|
|
4918
|
-
|
|
4919
|
-
|
|
4795
|
+
u(this, "_initialized");
|
|
4796
|
+
u(this, "_widgets", []);
|
|
4920
4797
|
////////////////////////////////////// USER PREFERENCES
|
|
4921
|
-
|
|
4798
|
+
u(this, "_userPrefs", {});
|
|
4922
4799
|
}
|
|
4923
4800
|
initialize(e, t) {
|
|
4924
4801
|
return this._initialized || (this._initialized = new Promisified(), notify.onSessionReady().promise.then((s) => {
|
|
@@ -4961,20 +4838,20 @@ class WidgetFramework {
|
|
|
4961
4838
|
this._userPrefs = e ?? this._userPrefs;
|
|
4962
4839
|
const t = configure.Platform.theme, s = [];
|
|
4963
4840
|
t.listSkins().then((r) => {
|
|
4964
|
-
var
|
|
4965
|
-
const i = ((
|
|
4841
|
+
var a;
|
|
4842
|
+
const i = ((a = r.find((c) => c.child === t.skin)) == null ? void 0 : a.parent) === "panda" ? secondLevelWidgets : firstLevelWidgets;
|
|
4966
4843
|
this._widgets = this._widgets.filter((c, l) => {
|
|
4967
|
-
const
|
|
4968
|
-
return i.indexOf(
|
|
4969
|
-
index: defaultWidgetOrder[
|
|
4844
|
+
const h = c.platformConf.name;
|
|
4845
|
+
return i.indexOf(h) !== -1 ? !1 : (this._userPrefs[h] || (this._userPrefs[h] = {
|
|
4846
|
+
index: defaultWidgetOrder[h] ?? 999,
|
|
4970
4847
|
show: !0,
|
|
4971
4848
|
position: c.platformConf.position
|
|
4972
|
-
}), c.platformConf.mandatory && (this._userPrefs[
|
|
4849
|
+
}), c.platformConf.mandatory && (this._userPrefs[h].show = !0, this._userPrefs[h].index = defaultWidgetOrder[h] ?? 999), c.platformConf.i18n && s.push(c.platformConf.i18n), c.applyUserPref(this._userPrefs[h]), !0);
|
|
4973
4850
|
});
|
|
4974
4851
|
const o = new Idiom();
|
|
4975
4852
|
this._widgets = this._widgets.sort((c, l) => {
|
|
4976
|
-
const
|
|
4977
|
-
return
|
|
4853
|
+
const h = o.translate(`timeline.settings.${c.platformConf.name}`).toLowerCase(), E = o.translate(`timeline.settings.${l.platformConf.name}`).toLowerCase();
|
|
4854
|
+
return h < E ? -1 : h > E ? 1 : 0;
|
|
4978
4855
|
});
|
|
4979
4856
|
});
|
|
4980
4857
|
}
|
|
@@ -4982,8 +4859,8 @@ class WidgetFramework {
|
|
|
4982
4859
|
class Widget {
|
|
4983
4860
|
//-------------------------------------
|
|
4984
4861
|
constructor(e) {
|
|
4985
|
-
|
|
4986
|
-
|
|
4862
|
+
u(this, "_schoolConf", {});
|
|
4863
|
+
u(this, "_userPref");
|
|
4987
4864
|
this._platformConf = e, this._userPref = null;
|
|
4988
4865
|
}
|
|
4989
4866
|
get platformConf() {
|
|
@@ -5034,8 +4911,6 @@ export {
|
|
|
5034
4911
|
ERROR_CODE,
|
|
5035
4912
|
EVENT_NAME,
|
|
5036
4913
|
FOLDER,
|
|
5037
|
-
GOOGLE_DRIVE_FOLDER_MIME_TYPE,
|
|
5038
|
-
GoogleDriveCopyError,
|
|
5039
4914
|
ITimelineFactory,
|
|
5040
4915
|
LAYER_NAME,
|
|
5041
4916
|
NotifyFrameworkFactory,
|