@baravak/risloo-profile-cli 3.5.2 → 3.5.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baravak/risloo-profile-cli",
3
- "version": "3.5.2",
3
+ "version": "3.5.3",
4
4
  "description": "**Risloo Profile CLI** is a library for creating profiles, reports and sheets for *psychological* samples.",
5
5
  "main": "bin/risloo.js",
6
6
  "publishConfig": {
package/src/Profile.js CHANGED
@@ -4,6 +4,9 @@ const qrCodeGenerator = require("./qrcode/qrCodeGenerator");
4
4
  moment.locale("fa");
5
5
  moment.loadPersian({ dialect: "persian-modern" });
6
6
 
7
+ const domainENV = process.env.NODE_REA_DOAMIN || "risloo.ir";
8
+ const shortDomainENV = process.env.SHORT_DOMAIN || "r1l.ir";
9
+
7
10
  // Implement String.prototype.format
8
11
  String.prototype.format = function () {
9
12
  var args = arguments;
@@ -367,11 +370,11 @@ class Profile {
367
370
  this.spec = new Spec(config, this.profileSpec);
368
371
  const { canvas } = this.spec.parameters;
369
372
  this.canvas = new Canvas(canvas, variant);
370
-
371
373
  this.dataset = new Dataset(dataset, this.spec.parameters);
372
374
 
373
375
  if (this.variant === "with-sidebar") this._generateQRCode();
374
376
 
377
+ this.variantx = 10;
375
378
  this.contextArr = this._calcContext();
376
379
  }
377
380
 
@@ -379,11 +382,15 @@ class Profile {
379
382
  const { dataset, canvas } = this;
380
383
  const width = canvas.sidebar?.qrcode?.width || 120;
381
384
  const height = canvas.sidebar?.qrcode?.height || 120;
382
- const data = `https://r1l.ir/${dataset.info.id}/?utm_source=risloo.ir&utm_medium=profile&utm_campaign=${dataset.info.id}`;
385
+ const data = `https://${shortDomainENV}/${dataset.info.id}/?utm_source=${domainENV}&utm_medium=profile&utm_campaign=${dataset.info.id}`;
383
386
  this.qrcode = { link: data, svg: qrCodeGenerator(data, { width, height }) };
384
387
  }
385
388
 
386
389
  getTemplateEngineParams() {
390
+ const iENV = {
391
+ domain: domainENV,
392
+ domainUC: domainENV.toUpperCase(),
393
+ };
387
394
  const {
388
395
  variant,
389
396
  measure,
@@ -403,6 +410,7 @@ class Profile {
403
410
  ...context,
404
411
  variant,
405
412
  measure,
413
+ iENV,
406
414
  }));
407
415
  }
408
416
  }
@@ -25,7 +25,7 @@
25
25
  dy="4">
26
26
  {{concat info.title (ternary titleAppend titleAppend '')}}
27
27
  </text>
28
- <a href="http://risloo.ir" target="_blank" fill="white">
28
+ <a href="https://{{iENV.domain}}" target="_blank" fill="white">
29
29
  <text
30
30
  class="eng-font"
31
31
  x="0"
@@ -35,7 +35,7 @@
35
35
  text-anchor="end"
36
36
  letter-spacing="2"
37
37
  dy="5">
38
- RISLOO.IR
38
+ {{iENV.domainUC}}
39
39
  </text>
40
40
  </a>
41
41
  </g>