@vocollege/app 0.0.150 → 0.0.151
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/modules/Services/I18n/strings.json +13 -1
- package/dist/modules/VoApi/mutations/users.js +1 -1
- package/dist/modules/VoApi/queries/users.js +3 -3
- package/dist/modules/VoAuth.d.ts +1 -0
- package/dist/modules/VoAuth.js +11 -0
- package/package.json +1 -1
- package/src/modules/Services/I18n/strings.json +13 -1
- package/src/modules/VoApi/mutations/users.ts +8 -0
- package/src/modules/VoApi/queries/users.ts +20 -0
- package/src/modules/VoAuth.ts +6 -0
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"electronicReference": "Elektronisk referens",
|
|
25
25
|
"professionalTitle": "Yrkestitel",
|
|
26
26
|
"notifyUser": "Notifiera användaren om att kontot har skapats",
|
|
27
|
+
"notifications": "Notiser",
|
|
27
28
|
"gdpr": "Jag samtycker till att VO-College lagrar mina personuppgifter",
|
|
28
29
|
"gdprIsRequired": "Du behöver godkänna att vi hanterar dina personuppgifter",
|
|
29
30
|
"sendResetEmail": "Återställ lösenord",
|
|
@@ -43,7 +44,18 @@
|
|
|
43
44
|
"name": "excludeFromAutomaticDeletion",
|
|
44
45
|
"label": "Uteslut denna användare från automatisk radering"
|
|
45
46
|
}
|
|
46
|
-
]
|
|
47
|
+
],
|
|
48
|
+
"options": {
|
|
49
|
+
"disableAllNotifications": "Stäng av alla notiser",
|
|
50
|
+
"onlyValedictorianNotifications": "Få endast notiser från validander",
|
|
51
|
+
"notificationSelection": "Val av notiser",
|
|
52
|
+
"notificationDisableDailyMail": "Avstå från dagliga mailutskick"
|
|
53
|
+
},
|
|
54
|
+
"notifications": {
|
|
55
|
+
"all": "Ta emot alla notiser",
|
|
56
|
+
"candidate": "Få endast notiser från validander",
|
|
57
|
+
"none": "Stäng av alla notiser"
|
|
58
|
+
}
|
|
47
59
|
},
|
|
48
60
|
"acl": {
|
|
49
61
|
"label": "ACL",
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.SEND_RESET_EMAIL_TO_USER = exports.DELETE_USER = exports.UPDATE_USER = exports.CREATE_USER = void 0;
|
|
8
8
|
var client_1 = require("@apollo/client");
|
|
9
9
|
exports.CREATE_USER = (0, client_1.gql)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n mutation CreateUser($input: UpdateUserInput!) {\n createUser(input: $input) {\n id\n name\n email\n firstname\n lastname\n }\n }\n"], ["\n mutation CreateUser($input: UpdateUserInput!) {\n createUser(input: $input) {\n id\n name\n email\n firstname\n lastname\n }\n }\n"])));
|
|
10
|
-
exports.UPDATE_USER = (0, client_1.gql)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n mutation UpdateUser($id: ID!, $input: UpdateUserInput!) {\n updateUser(id: $id, input: $input) {\n id\n name\n email\n firstname\n lastname\n images {\n id\n title\n filename\n filesize\n filetype\n url\n }\n updated_at\n created_at\n groups {\n id\n title\n type\n }\n roles {\n id\n label\n type\n }\n groupRoles {\n id\n label\n type\n }\n apps\n settings\n }\n }\n"], ["\n mutation UpdateUser($id: ID!, $input: UpdateUserInput!) {\n updateUser(id: $id, input: $input) {\n id\n name\n email\n firstname\n lastname\n images {\n id\n title\n filename\n filesize\n filetype\n url\n }\n updated_at\n created_at\n groups {\n id\n title\n type\n }\n roles {\n id\n label\n type\n }\n groupRoles {\n id\n label\n type\n }\n apps\n settings\n }\n }\n"])));
|
|
10
|
+
exports.UPDATE_USER = (0, client_1.gql)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n mutation UpdateUser($id: ID!, $input: UpdateUserInput!) {\n updateUser(id: $id, input: $input) {\n id\n name\n email\n firstname\n lastname\n images {\n id\n title\n filename\n filesize\n filetype\n url\n }\n updated_at\n created_at\n groups {\n id\n title\n type\n }\n roles {\n id\n label\n type\n }\n groupRoles {\n id\n label\n type\n }\n apps\n settings\n validig {\n options {\n id\n name\n type\n value\n }\n }\n }\n }\n"], ["\n mutation UpdateUser($id: ID!, $input: UpdateUserInput!) {\n updateUser(id: $id, input: $input) {\n id\n name\n email\n firstname\n lastname\n images {\n id\n title\n filename\n filesize\n filetype\n url\n }\n updated_at\n created_at\n groups {\n id\n title\n type\n }\n roles {\n id\n label\n type\n }\n groupRoles {\n id\n label\n type\n }\n apps\n settings\n validig {\n options {\n id\n name\n type\n value\n }\n }\n }\n }\n"])));
|
|
11
11
|
exports.DELETE_USER = (0, client_1.gql)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n mutation DeleteUser($id: ID!) {\n deleteUser(id: $id) {\n id\n }\n }\n"], ["\n mutation DeleteUser($id: ID!) {\n deleteUser(id: $id) {\n id\n }\n }\n"])));
|
|
12
12
|
exports.SEND_RESET_EMAIL_TO_USER = (0, client_1.gql)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\nmutation SendResetEmailToUser($id: ID!) {\n sendResetEmailToUser(id: $id) {\n id\n }\n }\n"], ["\nmutation SendResetEmailToUser($id: ID!) {\n sendResetEmailToUser(id: $id) {\n id\n }\n }\n"])));
|
|
13
13
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -6,9 +6,9 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.GET_ACCOUNT = exports.GET_USERS_SIMPLIFIED = exports.GET_USERS = exports.GET_USER = exports.GET_USERS_FIELDS = void 0;
|
|
8
8
|
var client_1 = require("@apollo/client");
|
|
9
|
-
exports.GET_USERS_FIELDS = (0, client_1.gql)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n fragment UsersFields on User {\n id\n name\n email\n active\n status\n updated_at\n created_at\n roles {\n id\n label\n type\n }\n groupRoles {\n id\n label\n type\n }\n groups {\n id\n name\n title\n }\n validig {\n id\n }\n }\n"], ["\n fragment UsersFields on User {\n id\n name\n email\n active\n status\n updated_at\n created_at\n roles {\n id\n label\n type\n }\n groupRoles {\n id\n label\n type\n }\n groups {\n id\n name\n title\n }\n validig {\n id\n }\n }\n"])));
|
|
10
|
-
exports.GET_USER = (0, client_1.gql)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n query User($id: ID!) {\n user(id: $id) {\n id\n name\n email\n firstname\n lastname\n active\n personal_number\n address1\n address2\n postalcode\n town\n country\n phone1\n profession\n status\n gdpr\n description\n updated_at\n created_at\n images {\n id\n title\n filename\n filesize\n filetype\n url\n }\n roles {\n id\n label\n type\n }\n groupRoles {\n id\n label\n type\n }\n groups {\n id\n title\n type\n }\n validig {\n id\n }\n apps\n settings\n }\n }\n"], ["\n query User($id: ID!) {\n user(id: $id) {\n id\n name\n email\n firstname\n lastname\n active\n personal_number\n address1\n address2\n postalcode\n town\n country\n phone1\n profession\n status\n gdpr\n description\n updated_at\n created_at\n images {\n id\n title\n filename\n filesize\n filetype\n url\n }\n roles {\n id\n label\n type\n }\n groupRoles {\n id\n label\n type\n }\n groups {\n id\n title\n type\n }\n validig {\n id\n }\n apps\n settings\n }\n }\n"])));
|
|
9
|
+
exports.GET_USERS_FIELDS = (0, client_1.gql)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n fragment UsersFields on User {\n id\n name\n email\n active\n status\n updated_at\n created_at\n roles {\n id\n label\n type\n }\n groupRoles {\n id\n label\n type\n }\n groups {\n id\n name\n title\n }\n validig {\n id\n options {\n id\n name\n type\n value\n }\n }\n }\n"], ["\n fragment UsersFields on User {\n id\n name\n email\n active\n status\n updated_at\n created_at\n roles {\n id\n label\n type\n }\n groupRoles {\n id\n label\n type\n }\n groups {\n id\n name\n title\n }\n validig {\n id\n options {\n id\n name\n type\n value\n }\n }\n }\n"])));
|
|
10
|
+
exports.GET_USER = (0, client_1.gql)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n query User($id: ID!) {\n user(id: $id) {\n id\n name\n email\n firstname\n lastname\n active\n personal_number\n address1\n address2\n postalcode\n town\n country\n phone1\n profession\n status\n gdpr\n description\n updated_at\n created_at\n images {\n id\n title\n filename\n filesize\n filetype\n url\n }\n roles {\n id\n label\n type\n }\n groupRoles {\n id\n label\n type\n }\n groups {\n id\n title\n type\n }\n validig {\n id\n options {\n id\n name\n type\n value\n }\n }\n apps\n settings\n \n }\n }\n"], ["\n query User($id: ID!) {\n user(id: $id) {\n id\n name\n email\n firstname\n lastname\n active\n personal_number\n address1\n address2\n postalcode\n town\n country\n phone1\n profession\n status\n gdpr\n description\n updated_at\n created_at\n images {\n id\n title\n filename\n filesize\n filetype\n url\n }\n roles {\n id\n label\n type\n }\n groupRoles {\n id\n label\n type\n }\n groups {\n id\n title\n type\n }\n validig {\n id\n options {\n id\n name\n type\n value\n }\n }\n apps\n settings\n \n }\n }\n"])));
|
|
11
11
|
exports.GET_USERS = (0, client_1.gql)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n # query Users($page: Int!, $search: String) {\n # users(page: $page, search: $search) {\n # paginatorInfo {\n # total\n # currentPage\n # hasMorePages\n # }\n # data {\n # name\n # email\n # }\n # }\n # }\n\n query Users(\n $search: String\n $page: Int\n $limit: Int\n $orderBy: [GetUsersOrderByClause]\n $filters: [GetUsersFilter]\n ) {\n allGroups(categories: [\"region\", \"local\"]) {\n id\n title\n }\n roles {\n id\n name\n label\n }\n users(\n search: $search\n page: $page\n limit: $limit\n orderBy: $orderBy\n filters: $filters\n ) {\n paginatorInfo {\n total\n currentPage\n hasMorePages\n }\n data {\n ...UsersFields\n }\n }\n }\n ", "\n"], ["\n # query Users($page: Int!, $search: String) {\n # users(page: $page, search: $search) {\n # paginatorInfo {\n # total\n # currentPage\n # hasMorePages\n # }\n # data {\n # name\n # email\n # }\n # }\n # }\n\n query Users(\n $search: String\n $page: Int\n $limit: Int\n $orderBy: [GetUsersOrderByClause]\n $filters: [GetUsersFilter]\n ) {\n allGroups(categories: [\"region\", \"local\"]) {\n id\n title\n }\n roles {\n id\n name\n label\n }\n users(\n search: $search\n page: $page\n limit: $limit\n orderBy: $orderBy\n filters: $filters\n ) {\n paginatorInfo {\n total\n currentPage\n hasMorePages\n }\n data {\n ...UsersFields\n }\n }\n }\n ", "\n"])), exports.GET_USERS_FIELDS);
|
|
12
12
|
exports.GET_USERS_SIMPLIFIED = (0, client_1.gql)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n query UsersSimplified(\n $search: String\n $page: Int\n $limit: Int\n $orderBy: [GetUsersOrderByClause]\n $filters: [GetUsersFilter]\n ) {\n users(\n search: $search\n page: $page\n limit: $limit\n orderBy: $orderBy\n filters: $filters\n ) {\n paginatorInfo {\n total\n currentPage\n hasMorePages\n }\n data {\n ...UsersFields\n }\n }\n }\n ", "\n"], ["\n query UsersSimplified(\n $search: String\n $page: Int\n $limit: Int\n $orderBy: [GetUsersOrderByClause]\n $filters: [GetUsersFilter]\n ) {\n users(\n search: $search\n page: $page\n limit: $limit\n orderBy: $orderBy\n filters: $filters\n ) {\n paginatorInfo {\n total\n currentPage\n hasMorePages\n }\n data {\n ...UsersFields\n }\n }\n }\n ", "\n"])), exports.GET_USERS_FIELDS);
|
|
13
|
-
exports.GET_ACCOUNT = (0, client_1.gql)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n query Account($id: ID!) {\n user(id: $id) {\n id\n name\n email\n firstname\n lastname\n active\n personal_number\n address1\n address2\n postalcode\n town\n country\n phone1\n profession\n status\n description\n workplace\n gdpr\n images {\n id\n title\n filename\n filesize\n filetype\n url\n }\n }\n userSettings {\n publicDefaultPortfolio {\n id\n name\n disk\n }\n }\n }\n"], ["\n query Account($id: ID!) {\n user(id: $id) {\n id\n name\n email\n firstname\n lastname\n active\n personal_number\n address1\n address2\n postalcode\n town\n country\n phone1\n profession\n status\n description\n workplace\n gdpr\n images {\n id\n title\n filename\n filesize\n filetype\n url\n }\n }\n userSettings {\n publicDefaultPortfolio {\n id\n name\n disk\n }\n }\n }\n"])));
|
|
13
|
+
exports.GET_ACCOUNT = (0, client_1.gql)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n query Account($id: ID!) {\n user(id: $id) {\n id\n name\n email\n firstname\n lastname\n active\n personal_number\n address1\n address2\n postalcode\n town\n country\n phone1\n profession\n status\n description\n workplace\n gdpr\n images {\n id\n title\n filename\n filesize\n filetype\n url\n }\n validig {\n options {\n name\n type\n value\n }\n }\n }\n userSettings {\n publicDefaultPortfolio {\n id\n name\n disk\n }\n }\n }\n"], ["\n query Account($id: ID!) {\n user(id: $id) {\n id\n name\n email\n firstname\n lastname\n active\n personal_number\n address1\n address2\n postalcode\n town\n country\n phone1\n profession\n status\n description\n workplace\n gdpr\n images {\n id\n title\n filename\n filesize\n filetype\n url\n }\n validig {\n options {\n name\n type\n value\n }\n }\n }\n userSettings {\n publicDefaultPortfolio {\n id\n name\n disk\n }\n }\n }\n"])));
|
|
14
14
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
package/dist/modules/VoAuth.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ declare class VoAuth extends VoBase {
|
|
|
19
19
|
check(forceRedirect?: boolean, forceLoad?: boolean): Promise<any>;
|
|
20
20
|
loadUser(force?: boolean): Promise<any>;
|
|
21
21
|
get currentUser(): any;
|
|
22
|
+
get isOnlyValidigCandidate(): any;
|
|
22
23
|
getToken(): VoTokenType | void;
|
|
23
24
|
initAuth(): {
|
|
24
25
|
state: string;
|
package/dist/modules/VoAuth.js
CHANGED
|
@@ -369,6 +369,17 @@ var VoAuth = /** @class */ (function (_super) {
|
|
|
369
369
|
enumerable: false,
|
|
370
370
|
configurable: true
|
|
371
371
|
});
|
|
372
|
+
Object.defineProperty(VoAuth.prototype, "isOnlyValidigCandidate", {
|
|
373
|
+
get: function () {
|
|
374
|
+
var _a, _b, _c, _d;
|
|
375
|
+
if ((_a = this.user) === null || _a === void 0 ? void 0 : _a.validig) {
|
|
376
|
+
return ((_c = (_b = this.user) === null || _b === void 0 ? void 0 : _b.roles) === null || _c === void 0 ? void 0 : _c.length) == 1 && ((_d = this.user) === null || _d === void 0 ? void 0 : _d.roles.find(function (r) { return r.name === "candidate"; }));
|
|
377
|
+
}
|
|
378
|
+
return false;
|
|
379
|
+
},
|
|
380
|
+
enumerable: false,
|
|
381
|
+
configurable: true
|
|
382
|
+
});
|
|
372
383
|
VoAuth.prototype.getToken = function () {
|
|
373
384
|
try {
|
|
374
385
|
var refreshTokenKey = VoConfig_1.default.get.AUTH_STORAGE_REFRESH_TOKEN || "";
|
package/package.json
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"electronicReference": "Elektronisk referens",
|
|
25
25
|
"professionalTitle": "Yrkestitel",
|
|
26
26
|
"notifyUser": "Notifiera användaren om att kontot har skapats",
|
|
27
|
+
"notifications": "Notiser",
|
|
27
28
|
"gdpr": "Jag samtycker till att VO-College lagrar mina personuppgifter",
|
|
28
29
|
"gdprIsRequired": "Du behöver godkänna att vi hanterar dina personuppgifter",
|
|
29
30
|
"sendResetEmail": "Återställ lösenord",
|
|
@@ -43,7 +44,18 @@
|
|
|
43
44
|
"name": "excludeFromAutomaticDeletion",
|
|
44
45
|
"label": "Uteslut denna användare från automatisk radering"
|
|
45
46
|
}
|
|
46
|
-
]
|
|
47
|
+
],
|
|
48
|
+
"options": {
|
|
49
|
+
"disableAllNotifications": "Stäng av alla notiser",
|
|
50
|
+
"onlyValedictorianNotifications": "Få endast notiser från validander",
|
|
51
|
+
"notificationSelection": "Val av notiser",
|
|
52
|
+
"notificationDisableDailyMail": "Avstå från dagliga mailutskick"
|
|
53
|
+
},
|
|
54
|
+
"notifications": {
|
|
55
|
+
"all": "Ta emot alla notiser",
|
|
56
|
+
"candidate": "Få endast notiser från validander",
|
|
57
|
+
"none": "Stäng av alla notiser"
|
|
58
|
+
}
|
|
47
59
|
},
|
|
48
60
|
"acl": {
|
|
49
61
|
"label": "ACL",
|
|
@@ -26,6 +26,12 @@ export const GET_USERS_FIELDS = gql`
|
|
|
26
26
|
}
|
|
27
27
|
validig {
|
|
28
28
|
id
|
|
29
|
+
options {
|
|
30
|
+
id
|
|
31
|
+
name
|
|
32
|
+
type
|
|
33
|
+
value
|
|
34
|
+
}
|
|
29
35
|
}
|
|
30
36
|
}
|
|
31
37
|
`;
|
|
@@ -77,9 +83,16 @@ export const GET_USER = gql`
|
|
|
77
83
|
}
|
|
78
84
|
validig {
|
|
79
85
|
id
|
|
86
|
+
options {
|
|
87
|
+
id
|
|
88
|
+
name
|
|
89
|
+
type
|
|
90
|
+
value
|
|
91
|
+
}
|
|
80
92
|
}
|
|
81
93
|
apps
|
|
82
94
|
settings
|
|
95
|
+
|
|
83
96
|
}
|
|
84
97
|
}
|
|
85
98
|
`;
|
|
@@ -192,6 +205,13 @@ export const GET_ACCOUNT = gql`
|
|
|
192
205
|
filetype
|
|
193
206
|
url
|
|
194
207
|
}
|
|
208
|
+
validig {
|
|
209
|
+
options {
|
|
210
|
+
name
|
|
211
|
+
type
|
|
212
|
+
value
|
|
213
|
+
}
|
|
214
|
+
}
|
|
195
215
|
}
|
|
196
216
|
userSettings {
|
|
197
217
|
publicDefaultPortfolio {
|
package/src/modules/VoAuth.ts
CHANGED
|
@@ -234,6 +234,12 @@ class VoAuth extends VoBase {
|
|
|
234
234
|
get currentUser() {
|
|
235
235
|
return this.user;
|
|
236
236
|
}
|
|
237
|
+
get isOnlyValidigCandidate() {
|
|
238
|
+
if (this.user?.validig) {
|
|
239
|
+
return this.user?.roles?.length == 1 && this.user?.roles.find((r: any) => r.name ==="candidate");
|
|
240
|
+
}
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
237
243
|
|
|
238
244
|
getToken(): VoTokenType | void {
|
|
239
245
|
try {
|