@zeesoft/i18n-verify 2.1.3 → 2.1.6
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/genrc.mjs +1 -0
- package/dist/i18n.mjs +1 -0
- package/dist/index.mjs +1 -0
- package/package.json +25 -17
- package/postinstall.js +28 -0
- package/readme.md +21 -1
- package/dist/driver/adapters/cypress.js +0 -161
- package/dist/driver/adapters/nightwatch.js +0 -160
- package/dist/driver/adapters/selenium.js +0 -90
- package/dist/driver/adapters/webdriver.io.js +0 -81
- package/dist/driver/baseDriver.js +0 -93
- package/dist/driver/factory.js +0 -27
- package/dist/index.js +0 -52
- package/dist/lib/config.js +0 -102
- package/dist/lib/i18n.js +0 -259
- package/dist/lib/reports.js +0 -140
- package/dist/lib/validator/base.js +0 -125
- package/dist/lib/validator/currency.js +0 -94
- package/dist/lib/validator/date.js +0 -72
- package/dist/lib/validator/datetime.js +0 -72
- package/dist/lib/validator/index.js +0 -156
- package/dist/lib/validator/number.js +0 -58
- package/dist/lib/validator/percentage.js +0 -78
- package/dist/lib/validator/string.js +0 -172
- package/dist/lib/validator/time.js +0 -72
- package/dist/template/report.html +0 -1678
- package/dist/utils/cache.js +0 -47
- package/dist/utils/common.js +0 -18
- package/dist/utils/configFile.js +0 -65
- package/dist/utils/constants.js +0 -148
- package/dist/utils/cypress.js +0 -120
- package/dist/utils/dateUtils/chronoNode.js +0 -52
- package/dist/utils/file.js +0 -61
- package/dist/utils/graphic.js +0 -57
- package/dist/utils/logs.js +0 -79
- package/dist/utils/objects/cacheData.js +0 -72
- package/dist/utils/objects/metaData.js +0 -29
- package/dist/utils/objects/reportData.js +0 -30
- package/dist/utils/objects/statData.js +0 -380
- package/dist/utils/objects/stringData.js +0 -64
- package/dist/utils/objects/stringInfo.js +0 -51
- package/dist/utils/regex.js +0 -8
- package/dist/utils/reportFactory/base.js +0 -59
- package/dist/utils/reportFactory/html/index.js +0 -51
- package/dist/utils/reportFactory/html/template/body.js +0 -117
- package/dist/utils/reportFactory/html/template/css.js +0 -476
- package/dist/utils/reportFactory/html/template/html.js +0 -63
- package/dist/utils/reportFactory/html/template/javascript/data.js +0 -66
- package/dist/utils/reportFactory/html/template/javascript/global.js +0 -45
- package/dist/utils/reportFactory/html/template/javascript/grid.js +0 -129
- package/dist/utils/reportFactory/html/template/javascript/index.js +0 -22
- package/dist/utils/reportFactory/html/template/javascript/insight.js +0 -248
- package/dist/utils/reportFactory/html/template/javascript/log.js +0 -19
- package/dist/utils/reportFactory/html/template/javascript/menuBar.js +0 -123
- package/dist/utils/reportFactory/html/template/javascript/overview.js +0 -818
- package/dist/utils/reportFactory/index.js +0 -36
- package/dist/utils/reportFactory/table.js +0 -95
- package/dist/utils/resource.js +0 -58
- package/dist/utils/runtime.js +0 -36
- package/dist/utils/scripts/genreport.js +0 -1
- package/dist/utils/scripts/postinstall.js +0 -22
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _default = metaData => `// DataStore
|
|
8
|
-
(() => {
|
|
9
|
-
// prepare appData and set DataStore
|
|
10
|
-
var appData = {
|
|
11
|
-
appName: '${metaData.appName}',
|
|
12
|
-
defaultLocale: '${metaData.defaultLocale}',
|
|
13
|
-
timeStamp: '${metaData.reportTime}',
|
|
14
|
-
metaData: {
|
|
15
|
-
stats: {},
|
|
16
|
-
statsByLocale: {}
|
|
17
|
-
},
|
|
18
|
-
stringsData: {},
|
|
19
|
-
locales: Object.keys(rawData)
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
for (const entry of Object.entries(rawData)) {
|
|
23
|
-
const locale = entry[0];
|
|
24
|
-
const stats = entry[1].metaData.stats;
|
|
25
|
-
const stringsData = entry[1].stringsData;
|
|
26
|
-
|
|
27
|
-
if (Object.keys(appData.metaData.stats).length) {
|
|
28
|
-
for (const prop in stats) {
|
|
29
|
-
appData.metaData.stats[prop] += stats[prop];
|
|
30
|
-
}
|
|
31
|
-
} else {
|
|
32
|
-
appData.metaData.stats = {...stats};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
appData.metaData.statsByLocale[locale] = stats;
|
|
36
|
-
appData.stringsData[locale] = stringsData;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function SimpleDataStore() {
|
|
40
|
-
this._getData = () => appData;
|
|
41
|
-
|
|
42
|
-
this.ranSuccessfully = () => this.getLocales().length > 0;
|
|
43
|
-
|
|
44
|
-
this.getTimestamp = () => this._getData().timeStamp;
|
|
45
|
-
|
|
46
|
-
this.getAppName = () => this._getData().appName;
|
|
47
|
-
|
|
48
|
-
this.isDefaultLocale = (locale) =>
|
|
49
|
-
locale === this._getData().defaultLocale;
|
|
50
|
-
|
|
51
|
-
this.getLocalesData = () => this._getData().stringsData || {};
|
|
52
|
-
|
|
53
|
-
this.getLocales = () => this._getData().locales || [];
|
|
54
|
-
|
|
55
|
-
this.getStatByLocale = (locale) =>
|
|
56
|
-
this._getData().metaData.statsByLocale[locale] || {};
|
|
57
|
-
|
|
58
|
-
this.getOverallStats = () => this._getData().metaData.stats || {};
|
|
59
|
-
|
|
60
|
-
this.getDataByLocale = (locale) =>
|
|
61
|
-
this._getData().stringsData[locale] || {};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
DataStore = new SimpleDataStore();
|
|
65
|
-
})();`;
|
|
66
|
-
exports.default = _default;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _default = () => `var DataStore;
|
|
8
|
-
// global functions
|
|
9
|
-
function openImageViewer(imageSrc) {
|
|
10
|
-
var imageView = document.getElementById('imageView');
|
|
11
|
-
imageView.src = \`\${window.getProductUrl()}/\${imageSrc}\`;
|
|
12
|
-
document.getElementById('imageViewer').style.display = 'block';
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function closeImageViewer() {
|
|
16
|
-
delete document.getElementById('imageView').src;
|
|
17
|
-
document.getElementById('imageViewer').style.display = 'none';
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
//to dynamically show/hide header based upon query param: ?standalone=<true|false>
|
|
21
|
-
window.getProductUrl = () => {
|
|
22
|
-
if (window.productUrl) {
|
|
23
|
-
return window.productUrl;
|
|
24
|
-
} else {
|
|
25
|
-
window.productUrl = \`\${window.location.protocol}//\${
|
|
26
|
-
window.location.host
|
|
27
|
-
}\${window.location.pathname.match(/^.+[^\\/report\\.html]/g)?.[0]}\`;
|
|
28
|
-
return window.productUrl;
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
const params = new URLSearchParams(location.href.match(/(\\?.*$)/g)?.[0]);
|
|
32
|
-
if (params.size) {
|
|
33
|
-
const disableHeader = params.get('standalone') === 'true';
|
|
34
|
-
if (disableHeader) {
|
|
35
|
-
window.disableHeader = disableHeader;
|
|
36
|
-
const header = document.getElementsByTagName('header')[0],
|
|
37
|
-
main = document.getElementsByTagName('main')[0],
|
|
38
|
-
headerHeight = header.offsetHeight,
|
|
39
|
-
mainHeight = main.offsetHeight;
|
|
40
|
-
header.style.display = 'none';
|
|
41
|
-
main.style.height = \`\${headerHeight + mainHeight}px\`;
|
|
42
|
-
document.getElementById('locale').style.height = '96%';
|
|
43
|
-
}
|
|
44
|
-
}`;
|
|
45
|
-
exports.default = _default;
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _default = () => `// locale grid
|
|
8
|
-
(() => {
|
|
9
|
-
if (!DataStore.ranSuccessfully()) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
document.addEventListener('DOMContentLoaded', function () {
|
|
14
|
-
let table;
|
|
15
|
-
document.querySelectorAll('.sub-menu-item').forEach((menu) => {
|
|
16
|
-
menu.addEventListener('click', (e) => {
|
|
17
|
-
render(e.currentTarget.dataset.locale);
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
const updateTitle = (locale) => {
|
|
22
|
-
document.querySelector(
|
|
23
|
-
'#locale .title'
|
|
24
|
-
).textContent = \`\${locale} I18n Coverage Details\`;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const buildGrid = (locale) => {
|
|
28
|
-
const data = DataStore.getDataByLocale(locale) || {};
|
|
29
|
-
$.fn.dataTable.ext.errMode = 'none';
|
|
30
|
-
const dataSet = [];
|
|
31
|
-
Object.entries(data).map((entry) =>
|
|
32
|
-
entry[1].forEach(
|
|
33
|
-
(v) =>
|
|
34
|
-
v.type !== 'REVIEWED' &&
|
|
35
|
-
dataSet.push([entry[0], v.type, v.description, v.imagePath])
|
|
36
|
-
)
|
|
37
|
-
);
|
|
38
|
-
table = new DataTable('#locale .coverage-info table', {
|
|
39
|
-
columns: [
|
|
40
|
-
{ title: 'String' },
|
|
41
|
-
{ title: 'Type' },
|
|
42
|
-
{ title: 'Page' },
|
|
43
|
-
{ title: 'Screenshot' }
|
|
44
|
-
],
|
|
45
|
-
columnDefs: [
|
|
46
|
-
{
|
|
47
|
-
width: '44%',
|
|
48
|
-
targets: 0
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
width: '18%',
|
|
52
|
-
targets: 1
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
width: '18%',
|
|
56
|
-
targets: 2
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
width: '18%',
|
|
60
|
-
targets: 3,
|
|
61
|
-
orderable: false,
|
|
62
|
-
searchable: false,
|
|
63
|
-
data: null,
|
|
64
|
-
render: function (data) {
|
|
65
|
-
return \`<a href="#" class="view-screenshot-btn" onclick="openImageViewer('\${data[3]}')"><img title="View screenshot for '\${data[2]}'" class="view-screenshot-image"></img></a>\`;
|
|
66
|
-
},
|
|
67
|
-
className: 'dt-head-center dt-body-center'
|
|
68
|
-
}
|
|
69
|
-
],
|
|
70
|
-
data: dataSet,
|
|
71
|
-
initComplete: function () {
|
|
72
|
-
this.api()
|
|
73
|
-
.columns()
|
|
74
|
-
.every(function () {
|
|
75
|
-
const column = this;
|
|
76
|
-
|
|
77
|
-
if (column[0][0] === 3) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const select = $(
|
|
82
|
-
'<select class="filter dt-input"><option value="">Filter By</option></select>'
|
|
83
|
-
)
|
|
84
|
-
.appendTo($(column.header()).before())
|
|
85
|
-
.on('change', function () {
|
|
86
|
-
const val = $.fn.dataTable.util.escapeRegex(
|
|
87
|
-
$(this).val()
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
column
|
|
91
|
-
.search(val ? '^' + val + '$' : '', true, false)
|
|
92
|
-
.draw();
|
|
93
|
-
})
|
|
94
|
-
.on('click', function (e) {
|
|
95
|
-
e.stopPropagation();
|
|
96
|
-
e.stopImmediatePropagation();
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
column
|
|
100
|
-
.data()
|
|
101
|
-
.unique()
|
|
102
|
-
.sort()
|
|
103
|
-
.each(function (d, j) {
|
|
104
|
-
select.append(
|
|
105
|
-
'<option value="' + d + '">' + d + '</option>'
|
|
106
|
-
);
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
},
|
|
110
|
-
sScrollY:
|
|
111
|
-
document
|
|
112
|
-
.querySelector('#locale .coverage-info')
|
|
113
|
-
.getBoundingClientRect().height - 142,
|
|
114
|
-
pageLength: 25,
|
|
115
|
-
lengthMenu: [10, 25, 50, 100]
|
|
116
|
-
});
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
const render = (locale) => {
|
|
120
|
-
if (table) {
|
|
121
|
-
table.destroy();
|
|
122
|
-
}
|
|
123
|
-
updateTitle(locale);
|
|
124
|
-
buildGrid(locale);
|
|
125
|
-
};
|
|
126
|
-
});
|
|
127
|
-
})();
|
|
128
|
-
`;
|
|
129
|
-
exports.default = _default;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _menuBar = _interopRequireDefault(require("./menuBar.js"));
|
|
8
|
-
var _overview = _interopRequireDefault(require("./overview.js"));
|
|
9
|
-
var _insight = _interopRequireDefault(require("./insight.js"));
|
|
10
|
-
var _grid = _interopRequireDefault(require("./grid.js"));
|
|
11
|
-
var _data = _interopRequireDefault(require("./data.js"));
|
|
12
|
-
var _global = _interopRequireDefault(require("./global.js"));
|
|
13
|
-
var _log = _interopRequireDefault(require("./log.js"));
|
|
14
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
-
var _default = metaData => `${(0, _global.default)()}
|
|
16
|
-
${(0, _data.default)(metaData)}
|
|
17
|
-
${(0, _menuBar.default)()}
|
|
18
|
-
${(0, _overview.default)()}
|
|
19
|
-
${(0, _insight.default)()}
|
|
20
|
-
${(0, _grid.default)()}
|
|
21
|
-
${(0, _log.default)()}`;
|
|
22
|
-
exports.default = _default;
|
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _default = () => `// insights content
|
|
8
|
-
(() => {
|
|
9
|
-
if (!DataStore.ranSuccessfully()) {
|
|
10
|
-
document.getElementById('overview').innerHTML =
|
|
11
|
-
'Unable to prepare zQA automation report for the project.';
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
document.addEventListener('DOMContentLoaded', function () {
|
|
16
|
-
renderCards();
|
|
17
|
-
|
|
18
|
-
// helper methods to generate cards and its sections
|
|
19
|
-
function createStatSection(locale, data) {
|
|
20
|
-
const isDefaultLocale = DataStore.isDefaultLocale(locale);
|
|
21
|
-
const holder = document.createElement('div');
|
|
22
|
-
const table = document.createElement('table');
|
|
23
|
-
const tbody = document.createElement('tbody');
|
|
24
|
-
const name = document.createElement('div');
|
|
25
|
-
const tableData = {
|
|
26
|
-
'Internationlized Strings':
|
|
27
|
-
data.localizedStrings +
|
|
28
|
-
data.untranslatedStrings +
|
|
29
|
-
data.partialStrings,
|
|
30
|
-
'Not Internationlized Strings': data.notLocalizedStrings,
|
|
31
|
-
'Internationlized Numbers': data.localizedNumber,
|
|
32
|
-
'Not Internationlized Numbers': data.notLocalizedNumber,
|
|
33
|
-
'Internationlized Currency': data.localizedCurrency,
|
|
34
|
-
'Not Internationlized Currency': data.notLocalizedCurrency,
|
|
35
|
-
'Internationlized Percentage': data.localizedPercentage,
|
|
36
|
-
'Not Internationlized Percentage': data.notLocalizedPercentage,
|
|
37
|
-
'Internationlized Date': data.localizedDate,
|
|
38
|
-
'Not Internationlized Date': data.notLocalizedDate,
|
|
39
|
-
'Internationlized Time': data.localizedTime,
|
|
40
|
-
'Not Internationlized Time': data.notLocalizedTime,
|
|
41
|
-
'Internationlized DateTime': data.localizedDate,
|
|
42
|
-
'Not Internationlized DateTime': data.notLocalizedDateTime,
|
|
43
|
-
'Encoding Issue Strings': data.encoding,
|
|
44
|
-
'DNT Strings': data.dnt,
|
|
45
|
-
'Ignored Strings': data.ignored,
|
|
46
|
-
'Untranslated Strings': data.untranslatedStrings,
|
|
47
|
-
'Auto Ignored Strings': data.autoIgnored,
|
|
48
|
-
'User Input Strings': data.userInput,
|
|
49
|
-
'Total Reviewed': data.reviewed
|
|
50
|
-
};
|
|
51
|
-
const addRow = (name, value) => {
|
|
52
|
-
const row = document.createElement('tr');
|
|
53
|
-
|
|
54
|
-
const col1 = document.createElement('td');
|
|
55
|
-
col1.classList.add('name');
|
|
56
|
-
col1.textContent = name;
|
|
57
|
-
|
|
58
|
-
const col2 = document.createElement('td');
|
|
59
|
-
col2.classList.add('value');
|
|
60
|
-
col2.textContent = value;
|
|
61
|
-
|
|
62
|
-
row.appendChild(col1);
|
|
63
|
-
row.appendChild(col2);
|
|
64
|
-
return row;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
for (const rowData of Object.entries(tableData)) {
|
|
68
|
-
if (!isDefaultLocale || rowData[0] !== 'Untranslated Strings') {
|
|
69
|
-
tbody.appendChild(addRow(rowData[0], rowData[1]));
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
holder.classList.add('stat');
|
|
74
|
-
name.classList.add('name');
|
|
75
|
-
name.textContent = 'Summary';
|
|
76
|
-
holder.append(name);
|
|
77
|
-
|
|
78
|
-
table.appendChild(tbody);
|
|
79
|
-
holder.appendChild(table);
|
|
80
|
-
return holder;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function createStatusBarSection(locale, data) {
|
|
84
|
-
const holder = document.createElement('div');
|
|
85
|
-
holder.classList.add('status-bar');
|
|
86
|
-
|
|
87
|
-
const generateBarEl = (name, total, current) => {
|
|
88
|
-
const getColorClass = (value) => {
|
|
89
|
-
if (value <= 25) {
|
|
90
|
-
return 'red';
|
|
91
|
-
} else if (value <= 50) {
|
|
92
|
-
return 'yellow';
|
|
93
|
-
} else if (value <= 75) {
|
|
94
|
-
return 'blue';
|
|
95
|
-
} else if (value <= 100) {
|
|
96
|
-
return 'green';
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
current = (current / total) * 100;
|
|
100
|
-
current = isNaN(current) || !isFinite(current) ? 0 : current;
|
|
101
|
-
const holder = document.createElement('div');
|
|
102
|
-
holder.classList.add('bar-container');
|
|
103
|
-
|
|
104
|
-
const nameHolder = document.createElement('div');
|
|
105
|
-
nameHolder.classList.add('name');
|
|
106
|
-
nameHolder.textContent = name;
|
|
107
|
-
|
|
108
|
-
const barHolder = document.createElement('div');
|
|
109
|
-
barHolder.classList.add('bar-holder');
|
|
110
|
-
|
|
111
|
-
const bar = document.createElement('div');
|
|
112
|
-
bar.classList.add('bar');
|
|
113
|
-
bar.classList.add(\`--\${getColorClass(current)}\`);
|
|
114
|
-
bar.style.width = \`\${current}%\`;
|
|
115
|
-
bar.textContent = \`\${current.toFixed(0)}%\`;
|
|
116
|
-
|
|
117
|
-
barHolder.appendChild(bar);
|
|
118
|
-
holder.appendChild(nameHolder);
|
|
119
|
-
holder.appendChild(barHolder);
|
|
120
|
-
|
|
121
|
-
return holder;
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
const isDefaultLocale = DataStore.isDefaultLocale(locale),
|
|
125
|
-
totalI18nCount = isDefaultLocale
|
|
126
|
-
? 100
|
|
127
|
-
: data.localizedStrings +
|
|
128
|
-
data.untranslatedStrings +
|
|
129
|
-
data.partialStrings +
|
|
130
|
-
data.notLocalizedStrings,
|
|
131
|
-
i18nStrings = isDefaultLocale
|
|
132
|
-
? 100
|
|
133
|
-
: data.localizedStrings +
|
|
134
|
-
data.untranslatedStrings +
|
|
135
|
-
data.partialStrings,
|
|
136
|
-
totalLocCount = isDefaultLocale
|
|
137
|
-
? 100
|
|
138
|
-
: totalI18nCount -
|
|
139
|
-
data.untranslatedStrings -
|
|
140
|
-
data.notLocalizedStrings,
|
|
141
|
-
totalNumberCount = isDefaultLocale
|
|
142
|
-
? 100
|
|
143
|
-
: data.localizedNumber +
|
|
144
|
-
data.localizedCurrency +
|
|
145
|
-
data.localizedPercentage +
|
|
146
|
-
data.notLocalizedPercentage +
|
|
147
|
-
data.notLocalizedCurrency +
|
|
148
|
-
data.notLocalizedNumber,
|
|
149
|
-
i18nNumbers = isDefaultLocale
|
|
150
|
-
? 100
|
|
151
|
-
: totalNumberCount -
|
|
152
|
-
data.notLocalizedPercentage -
|
|
153
|
-
data.notLocalizedCurrency -
|
|
154
|
-
data.notLocalizedNumber,
|
|
155
|
-
totalI18nDateTimeCount = isDefaultLocale
|
|
156
|
-
? 100
|
|
157
|
-
: data.localizedDate +
|
|
158
|
-
data.localizedDateTime +
|
|
159
|
-
data.localizedTime +
|
|
160
|
-
data.notLocalizedDate +
|
|
161
|
-
data.notLocalizedDateTime +
|
|
162
|
-
data.notLocalizedTime,
|
|
163
|
-
i18nDateTime = isDefaultLocale
|
|
164
|
-
? 100
|
|
165
|
-
: totalI18nDateTimeCount -
|
|
166
|
-
data.notLocalizedDate -
|
|
167
|
-
data.notLocalizedDateTime -
|
|
168
|
-
data.notLocalizedTime;
|
|
169
|
-
|
|
170
|
-
holder.appendChild(
|
|
171
|
-
generateBarEl('String I18n level', totalI18nCount, i18nStrings)
|
|
172
|
-
);
|
|
173
|
-
|
|
174
|
-
holder.appendChild(
|
|
175
|
-
generateBarEl('String L10n level', totalI18nCount, totalLocCount)
|
|
176
|
-
);
|
|
177
|
-
|
|
178
|
-
holder.appendChild(
|
|
179
|
-
generateBarEl('Number I18n level', totalNumberCount, i18nNumbers)
|
|
180
|
-
);
|
|
181
|
-
|
|
182
|
-
holder.appendChild(
|
|
183
|
-
generateBarEl(
|
|
184
|
-
'DateTime I18n level',
|
|
185
|
-
totalI18nDateTimeCount,
|
|
186
|
-
i18nDateTime
|
|
187
|
-
)
|
|
188
|
-
);
|
|
189
|
-
return holder;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
function generateCardContents(locale, data) {
|
|
193
|
-
const cardContent = document.createElement('div');
|
|
194
|
-
cardContent.classList.add('card-content');
|
|
195
|
-
|
|
196
|
-
cardContent.appendChild(createStatusBarSection(locale, data));
|
|
197
|
-
cardContent.appendChild(createStatSection(locale, data));
|
|
198
|
-
return cardContent;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
function createCardEl(locale, data) {
|
|
202
|
-
const card = document.createElement('div');
|
|
203
|
-
const title = document.createElement('div');
|
|
204
|
-
card.classList.add('card');
|
|
205
|
-
card.dataset.locale = locale;
|
|
206
|
-
title.classList.add('title');
|
|
207
|
-
title.textContent = \`\${locale} details\`;
|
|
208
|
-
|
|
209
|
-
// fire menu selection event on clicking the card
|
|
210
|
-
card.addEventListener('click', () => {
|
|
211
|
-
const previousSelectedSubMenu = document.querySelector(
|
|
212
|
-
'.sub-menu-item.selected'
|
|
213
|
-
);
|
|
214
|
-
if (previousSelectedSubMenu) {
|
|
215
|
-
window.previousSelectedLocale =
|
|
216
|
-
previousSelectedSubMenu.dataset.locale;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
document
|
|
220
|
-
.querySelector(\`.sub-menu-item[data-locale="\${locale}"]\`)
|
|
221
|
-
.click();
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
card.appendChild(title);
|
|
225
|
-
card.appendChild(generateCardContents(locale, data));
|
|
226
|
-
return card;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
function renderCards() {
|
|
230
|
-
// read from global variable appData;
|
|
231
|
-
const localeInfo = DataStore.getLocalesData();
|
|
232
|
-
|
|
233
|
-
if (Object.keys(localeInfo).length) {
|
|
234
|
-
const cardHolder = document.querySelector(
|
|
235
|
-
'#insights .cards .holder'
|
|
236
|
-
);
|
|
237
|
-
for (const locale in localeInfo) {
|
|
238
|
-
const cardEl = createCardEl(
|
|
239
|
-
locale,
|
|
240
|
-
DataStore.getStatByLocale(locale)
|
|
241
|
-
);
|
|
242
|
-
cardHolder.appendChild(cardEl);
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
})();`;
|
|
248
|
-
exports.default = _default;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _default = () => `// log content
|
|
8
|
-
(() => {
|
|
9
|
-
document.addEventListener('DOMContentLoaded', function () {
|
|
10
|
-
const pre = document.querySelector('#log .log-content pre');
|
|
11
|
-
pre.textContent = 'Loading...';
|
|
12
|
-
document
|
|
13
|
-
.querySelector('li[data-page="log"]')
|
|
14
|
-
?.addEventListener('click', (e) => {
|
|
15
|
-
pre.textContent = window.logData || 'No log data found!';
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
})();`;
|
|
19
|
-
exports.default = _default;
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _default = metaData => `(() => {
|
|
8
|
-
// for sidebar menu
|
|
9
|
-
const loadContent = (section, highlightMenu = false) => {
|
|
10
|
-
if (highlightMenu) {
|
|
11
|
-
document
|
|
12
|
-
.querySelector('li[data-page="overview"]')
|
|
13
|
-
?.classList.add('selected');
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const contents = document.querySelectorAll('.content');
|
|
17
|
-
contents.forEach((content) => {
|
|
18
|
-
content.id !== section
|
|
19
|
-
? content.classList.remove('active')
|
|
20
|
-
: content.classList.add('active');
|
|
21
|
-
|
|
22
|
-
section === 'overview' &&
|
|
23
|
-
window.persistOverviewCharts &&
|
|
24
|
-
window.persistOverviewCharts();
|
|
25
|
-
|
|
26
|
-
window.currentPage = section;
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
document.addEventListener('DOMContentLoaded', function () {
|
|
31
|
-
const createMenuItems = (() => {
|
|
32
|
-
const ul = document.querySelector('.sidebar .submenu');
|
|
33
|
-
const createListItems = (locale) => {
|
|
34
|
-
const li = document.createElement('li');
|
|
35
|
-
li.classList.add('sub-menu-item');
|
|
36
|
-
li.dataset.locale = locale;
|
|
37
|
-
|
|
38
|
-
const a = document.createElement('a');
|
|
39
|
-
a.href = '#';
|
|
40
|
-
a.textContent = locale;
|
|
41
|
-
|
|
42
|
-
li.appendChild(a);
|
|
43
|
-
return li;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
for (const locale of DataStore.getLocales()) {
|
|
47
|
-
ul.appendChild(createListItems(locale));
|
|
48
|
-
}
|
|
49
|
-
})();
|
|
50
|
-
|
|
51
|
-
const menuItems = document.querySelectorAll('.menu-item'),
|
|
52
|
-
submenuItems = document.querySelectorAll('.sub-menu-item');
|
|
53
|
-
|
|
54
|
-
menuItems.forEach((item) => {
|
|
55
|
-
item.addEventListener('click', function (event) {
|
|
56
|
-
const selectedMenuItem = document.querySelector(
|
|
57
|
-
'.menu-item.selected'
|
|
58
|
-
),
|
|
59
|
-
selectedSubmenu = document.querySelector('.submenu.active'),
|
|
60
|
-
page = item.dataset.page;
|
|
61
|
-
|
|
62
|
-
if (selectedMenuItem) {
|
|
63
|
-
selectedMenuItem.classList.remove('selected');
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (selectedSubmenu) {
|
|
67
|
-
selectedSubmenu.classList.remove('active');
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if (item.classList.contains('has-submenu')) {
|
|
71
|
-
event.preventDefault();
|
|
72
|
-
item.classList.add('selected');
|
|
73
|
-
const submenu = item.querySelector('.submenu');
|
|
74
|
-
submenu.classList.add('active');
|
|
75
|
-
} else {
|
|
76
|
-
item.classList.add('selected');
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if (selectedSubmenu) {
|
|
80
|
-
selectedSubmenu
|
|
81
|
-
.querySelectorAll('.sub-menu-item')
|
|
82
|
-
.forEach((submenuItem) => {
|
|
83
|
-
submenuItem.textContent !== item.textContent &&
|
|
84
|
-
submenuItem.classList.remove('selected');
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
loadContent(page);
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
loadContent('overview', true);
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
submenuItems.forEach((sItem) => {
|
|
95
|
-
sItem.addEventListener('click', function (event) {
|
|
96
|
-
const selectedSubMenuItem = document.querySelector(
|
|
97
|
-
'.sub-menu-item.selected'
|
|
98
|
-
);
|
|
99
|
-
event.preventDefault();
|
|
100
|
-
event.stopPropagation();
|
|
101
|
-
|
|
102
|
-
if (selectedSubMenuItem) {
|
|
103
|
-
selectedSubMenuItem.classList.remove('selected');
|
|
104
|
-
window.previousSelectedLocale =
|
|
105
|
-
selectedSubMenuItem.dataset.locale;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
sItem.classList.add('selected');
|
|
109
|
-
loadContent('locale');
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
// update footer info
|
|
114
|
-
const footer = document.querySelector('.sidebar .footer');
|
|
115
|
-
footer.textContent = \`\${new Date().getFullYear()} @ Zeesoft. All rights reserved.\`;
|
|
116
|
-
|
|
117
|
-
// update project info
|
|
118
|
-
document.querySelector(
|
|
119
|
-
'header .logo'
|
|
120
|
-
).innerHTML = \`zQA Report | \${DataStore.getAppName()}<span class="project-info"><span class="time">Report generated at: \${DataStore.getTimestamp()}</span></span>\`;
|
|
121
|
-
});
|
|
122
|
-
})();`;
|
|
123
|
-
exports.default = _default;
|