@baravak/risloo-profile-cli 3.5.1 → 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
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
|
|
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
|
}
|
|
@@ -236,7 +236,7 @@
|
|
|
236
236
|
}}
|
|
237
237
|
{{/forLoop}}
|
|
238
238
|
<text x="{{math 31 '+' (math @key '*' 40) }}" y="{{math 163 '-' (math mark '*' 2)}}" text-anchor="end" font-size="12px" font-weight="500" fill="{{label.bg}}">{{mark}}</text>
|
|
239
|
-
<text x="{{math 25 '+' (math @key '*' 40) }}" y="{{math 159 '-' (math label.max '*' 2)}}" text-anchor="start" font-size="8px" font-weight="400" fill="#71717A">{{
|
|
239
|
+
<text x="{{math 25 '+' (math @key '*' 40) }}" y="{{math 159 '-' (math label.max '*' 2)}}" text-anchor="start" font-size="8px" font-weight="400" fill="#71717A">{{label.max}}</text>
|
|
240
240
|
{{#each (wrapOnNewline label.fr) as | line index |}}
|
|
241
241
|
<text x="{{math 25 '+' (math itemKey '*' 40) }}" y="{{math 175 '+' (math index '*' 10)}}" text-anchor="middle" font-size="8px" font-weight="400" fill="{{item.label.color}}">{{line}}</text>
|
|
242
242
|
{{/each}}
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
dy="4">
|
|
26
26
|
{{concat info.title (ternary titleAppend titleAppend '')}}
|
|
27
27
|
</text>
|
|
28
|
-
<a href="
|
|
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
|
-
|
|
38
|
+
{{iENV.domainUC}}
|
|
39
39
|
</text>
|
|
40
40
|
</a>
|
|
41
41
|
</g>
|