@vocollege/app 0.0.106 → 0.0.108

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.
@@ -7,7 +7,7 @@ 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
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 apps\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 apps\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 }\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 }\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
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"])));
@@ -66,4 +66,5 @@ export declare const getObjValue: (obj: any, ...props: string[]) => any;
66
66
  * https://bugzilla.mozilla.org/show_bug.cgi?id=700533
67
67
  */
68
68
  export declare const convertSvgToImage: (url: string, width?: null | number, height?: null | number, format?: string, quality?: number) => Promise<unknown>;
69
+ export declare const getCollegeUrl: (item: any, origin?: string) => string;
69
70
  export {};
@@ -59,7 +59,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
59
59
  return (mod && mod.__esModule) ? mod : { "default": mod };
60
60
  };
61
61
  Object.defineProperty(exports, "__esModule", { value: true });
62
- exports.convertSvgToImage = exports.getObjValue = exports.getGroupLogotype = exports.reducer = exports.changeObj = exports.parseState = exports.getUserString = exports.getContactName = exports.getImageDescription = exports.getImage = exports.getImageContact = exports.shortenText = exports.orderByField = exports.orderByPosition = exports.downloadFile = exports.wrapPromise = exports.createSlug2 = exports.getTemporaryId = exports.getError = exports.regexPatterns = exports.encodeQueryData = exports.localStorage = exports.createRandomString = exports.base64Url = void 0;
62
+ exports.getCollegeUrl = exports.convertSvgToImage = exports.getObjValue = exports.getGroupLogotype = exports.reducer = exports.changeObj = exports.parseState = exports.getUserString = exports.getContactName = exports.getImageDescription = exports.getImage = exports.getImageContact = exports.shortenText = exports.orderByField = exports.orderByPosition = exports.downloadFile = exports.wrapPromise = exports.createSlug2 = exports.getTemporaryId = exports.getError = exports.regexPatterns = exports.encodeQueryData = exports.localStorage = exports.createRandomString = exports.base64Url = void 0;
63
63
  var crypto_js_1 = __importDefault(require("crypto-js"));
64
64
  var he_1 = __importDefault(require("he"));
65
65
  var base64Url = function (string) {
@@ -484,3 +484,21 @@ var convertSvgToImage = function (url, width, height, format, quality) {
484
484
  }); });
485
485
  };
486
486
  exports.convertSvgToImage = convertSvgToImage;
487
+ var getCollegeUrl = function (item, origin) {
488
+ if (!origin && typeof window === "undefined") {
489
+ return "/";
490
+ }
491
+ var currentUrl = new URL(origin || window.location.href);
492
+ var urlParts = currentUrl.host.split(".");
493
+ var url = [
494
+ item === null || item === void 0 ? void 0 : item.name,
495
+ urlParts[urlParts.length - 2],
496
+ urlParts[urlParts.length - 1],
497
+ ];
498
+ var currentGroupParts = urlParts[0].split("-");
499
+ if (currentGroupParts[0] === "local") {
500
+ url[0] = "local-".concat(url[0]);
501
+ }
502
+ return currentUrl.protocol + "//" + url.join(".");
503
+ };
504
+ exports.getCollegeUrl = getCollegeUrl;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vocollege/app",
3
- "version": "0.0.106",
3
+ "version": "0.0.108",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -75,7 +75,9 @@ export const GET_USER = gql`
75
75
  title
76
76
  type
77
77
  }
78
- validig
78
+ validig {
79
+ id
80
+ }
79
81
  apps
80
82
  }
81
83
  }
@@ -431,3 +431,21 @@ export const convertSvgToImage = (
431
431
  }
432
432
  });
433
433
  };
434
+
435
+ export const getCollegeUrl = (item: any, origin?: string) => {
436
+ if (!origin && typeof window === "undefined") {
437
+ return "/";
438
+ }
439
+ const currentUrl = new URL(origin || window.location.href);
440
+ let urlParts = currentUrl.host.split(".");
441
+ let url = [
442
+ item?.name,
443
+ urlParts[urlParts.length - 2],
444
+ urlParts[urlParts.length - 1],
445
+ ];
446
+ let currentGroupParts = urlParts[0].split("-");
447
+ if (currentGroupParts[0] === "local") {
448
+ url[0] = `local-${url[0]}`;
449
+ }
450
+ return currentUrl.protocol + "//" + url.join(".");
451
+ };