@elisra-devops/docgen-skins 0.3.7 → 0.4.1
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/.github/workflows/ci.yml +7 -2
- package/.github/workflows/release.yml +7 -5
- package/bin/index.d.ts +1 -1
- package/bin/index.js +33 -27
- package/bin/index.js.map +1 -1
- package/bin/models/json/table/JSONTable.d.ts +3 -3
- package/bin/models/json/table/JSONTable.js +8 -8
- package/bin/models/json/table/JSONTable.js.map +1 -1
- package/bin/models/json/table/JSONTableCell.d.ts +4 -3
- package/bin/models/json/table/JSONTableCell.js +43 -31
- package/bin/models/json/table/JSONTableCell.js.map +1 -1
- package/bin/models/json/table/JSONTableRow.d.ts +3 -3
- package/bin/models/json/table/JSONTableRow.js +5 -5
- package/bin/models/json/table/JSONTableRow.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +69 -132
- package/src/models/json/table/JSONTable.ts +12 -24
- package/src/models/json/table/JSONTableCell.ts +64 -61
- package/src/models/json/table/JSONTableRow.ts +7 -13
package/.github/workflows/ci.yml
CHANGED
|
@@ -4,7 +4,9 @@ on:
|
|
|
4
4
|
push:
|
|
5
5
|
branches:
|
|
6
6
|
- main
|
|
7
|
-
|
|
7
|
+
paths-ignore:
|
|
8
|
+
- '.github/**'
|
|
9
|
+
|
|
8
10
|
permissions:
|
|
9
11
|
contents: write
|
|
10
12
|
packages: write
|
|
@@ -17,7 +19,9 @@ jobs:
|
|
|
17
19
|
steps:
|
|
18
20
|
- name: 📚 checkout
|
|
19
21
|
uses: actions/checkout@v2
|
|
20
|
-
|
|
22
|
+
with:
|
|
23
|
+
token: ${{ secrets.ELISRADEVOPS_ACCESS_TOKEN }}
|
|
24
|
+
|
|
21
25
|
- name: 🟢 node
|
|
22
26
|
uses: actions/setup-node@v2
|
|
23
27
|
with:
|
|
@@ -34,12 +38,10 @@ jobs:
|
|
|
34
38
|
|
|
35
39
|
- name: 'Automated Version Bump'
|
|
36
40
|
uses: 'phips28/gh-action-bump-version@master'
|
|
37
|
-
env:
|
|
38
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
39
41
|
with:
|
|
40
42
|
commit-message: 'CI: bumps version to {{version}} [skip ci]'
|
|
41
43
|
|
|
42
44
|
- name: 🚀 publish
|
|
43
45
|
run: npm publish --access public
|
|
44
46
|
env:
|
|
45
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
|
|
47
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
|
package/bin/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DocumentSkin, WIQueryResults, StyleOptions } from
|
|
1
|
+
import { DocumentSkin, WIQueryResults, StyleOptions } from './models/json/wordJsonModels';
|
|
2
2
|
export default class Skins {
|
|
3
3
|
SKIN_TYPE_TABLE: string;
|
|
4
4
|
SKIN_TYPE_PARAGRAPH: string;
|
package/bin/index.js
CHANGED
|
@@ -19,15 +19,15 @@ const JSONTestSuiteHeaderParagraph_1 = __importDefault(require("./models/json/pa
|
|
|
19
19
|
const JSONRichTextParagraph_1 = __importDefault(require("./models/json/paragraph/JSONRichTextParagraph"));
|
|
20
20
|
const default_1 = require("./models/json/default");
|
|
21
21
|
class Skins {
|
|
22
|
-
constructor(skinFormat =
|
|
23
|
-
this.SKIN_TYPE_TABLE =
|
|
24
|
-
this.SKIN_TYPE_PARAGRAPH =
|
|
25
|
-
this.SKIN_TYPE_TEST_PLAN =
|
|
22
|
+
constructor(skinFormat = 'json', templatePath) {
|
|
23
|
+
this.SKIN_TYPE_TABLE = 'table';
|
|
24
|
+
this.SKIN_TYPE_PARAGRAPH = 'paragraph';
|
|
25
|
+
this.SKIN_TYPE_TEST_PLAN = 'test-plan';
|
|
26
26
|
this.documentSkin = {
|
|
27
|
-
templatePath:
|
|
27
|
+
templatePath: '',
|
|
28
28
|
contentControls: [],
|
|
29
29
|
};
|
|
30
|
-
this.skinFormat =
|
|
30
|
+
this.skinFormat = 'json';
|
|
31
31
|
this.documentSkin.templatePath = templatePath;
|
|
32
32
|
this.skinFormat = skinFormat;
|
|
33
33
|
}
|
|
@@ -116,10 +116,10 @@ class Skins {
|
|
|
116
116
|
generateQueryBasedTable(data, styles, headingLvl = 0) {
|
|
117
117
|
logger_1.default.debug(`Generating table as ${this.skinFormat}`);
|
|
118
118
|
switch (this.skinFormat) {
|
|
119
|
-
case
|
|
119
|
+
case 'json':
|
|
120
120
|
let tableSkin = new JSONTable_1.default(data, styles, headingLvl);
|
|
121
121
|
return [tableSkin.getJSONTable()];
|
|
122
|
-
case
|
|
122
|
+
case 'html':
|
|
123
123
|
logger_1.default.info(`Generating html table!`);
|
|
124
124
|
break;
|
|
125
125
|
default:
|
|
@@ -129,28 +129,25 @@ class Skins {
|
|
|
129
129
|
generateQueryBasedParagraphs(data, styles, headingLvl = 0) {
|
|
130
130
|
logger_1.default.debug(`Generating paragraph as ${this.skinFormat}`);
|
|
131
131
|
switch (this.skinFormat) {
|
|
132
|
-
case
|
|
132
|
+
case 'json':
|
|
133
133
|
let paragraphs = [];
|
|
134
134
|
data.forEach((wi) => {
|
|
135
135
|
wi.fields.forEach((field) => {
|
|
136
136
|
//Description and Test Description are handled in richText handler
|
|
137
|
-
if (field.name ===
|
|
138
|
-
field.name === "Test Description:") {
|
|
137
|
+
if (field.name === 'Description: ' || field.name === 'Test Description:') {
|
|
139
138
|
let paragraphSkin = new JSONRichTextParagraph_1.default(field, styles, wi.Source, headingLvl + wi.level);
|
|
140
139
|
paragraphs.push(paragraphSkin.getJSONRichTextParagraph());
|
|
141
140
|
}
|
|
142
141
|
//making sure ID is not printed
|
|
143
142
|
//excluding Description and Test Description are handled in richText handler
|
|
144
|
-
if (field.name !==
|
|
145
|
-
field.name !== "Description: " &&
|
|
146
|
-
field.name !== "Test Description:") {
|
|
143
|
+
if (field.name !== 'ID' && field.name !== 'Description: ' && field.name !== 'Test Description:') {
|
|
147
144
|
let paragraphSkin = new JSONParagraph_1.default(field, styles, wi.Source, headingLvl + wi.level);
|
|
148
145
|
paragraphs.push(paragraphSkin.getJSONParagraph());
|
|
149
146
|
}
|
|
150
147
|
});
|
|
151
148
|
});
|
|
152
149
|
return paragraphs;
|
|
153
|
-
case
|
|
150
|
+
case 'html':
|
|
154
151
|
logger_1.default.info(`Generating html paragraphs!`);
|
|
155
152
|
break;
|
|
156
153
|
default:
|
|
@@ -160,7 +157,7 @@ class Skins {
|
|
|
160
157
|
generateTestBasedSkin(data, styles, headingLvl = 0, includeAttachments = true) {
|
|
161
158
|
logger_1.default.debug(`Generating testSkin as ${this.skinFormat}`);
|
|
162
159
|
switch (this.skinFormat) {
|
|
163
|
-
case
|
|
160
|
+
case 'json':
|
|
164
161
|
let testSkin = [];
|
|
165
162
|
//create suite Header pragraph
|
|
166
163
|
data.forEach((testSuite) => {
|
|
@@ -170,7 +167,7 @@ class Skins {
|
|
|
170
167
|
IsUnderline: false,
|
|
171
168
|
Size: 16,
|
|
172
169
|
Uri: null,
|
|
173
|
-
Font:
|
|
170
|
+
Font: 'Arial',
|
|
174
171
|
InsertLineBreak: false,
|
|
175
172
|
InsertSpace: true,
|
|
176
173
|
};
|
|
@@ -192,7 +189,7 @@ class Skins {
|
|
|
192
189
|
IsUnderline: false,
|
|
193
190
|
Size: 14,
|
|
194
191
|
Uri: null,
|
|
195
|
-
Font:
|
|
192
|
+
Font: 'Arial',
|
|
196
193
|
InsertLineBreak: false,
|
|
197
194
|
InsertSpace: true,
|
|
198
195
|
};
|
|
@@ -202,14 +199,14 @@ class Skins {
|
|
|
202
199
|
? headingLvl
|
|
203
200
|
: 1);
|
|
204
201
|
testSkin.push(testCaseParagraphSkin.getJSONParagraph());
|
|
205
|
-
let testDescriptionTitleParagraph = new JSONParagraph_1.default({ name:
|
|
202
|
+
let testDescriptionTitleParagraph = new JSONParagraph_1.default({ name: 'Title', value: 'Test Description:' }, default_1.DescriptionandProcedureStyle, testcase.id || 0, 0);
|
|
206
203
|
testSkin.push(testDescriptionTitleParagraph.getJSONParagraph());
|
|
207
204
|
let testDescriptionParagraph = new JSONRichTextParagraph_1.default(testcase.testCaseHeaderSkinData.fields[2], styles, testcase.id || 0, 0);
|
|
208
205
|
let richTextSkin = testDescriptionParagraph.getJSONRichTextParagraph();
|
|
209
206
|
testSkin = [...testSkin, ...richTextSkin];
|
|
210
207
|
if (testcase.testCaseRequirements) {
|
|
211
208
|
if (testcase.testCaseRequirements.length > 0) {
|
|
212
|
-
let testDescriptionTitleParagraph = new JSONParagraph_1.default({ name:
|
|
209
|
+
let testDescriptionTitleParagraph = new JSONParagraph_1.default({ name: 'Title', value: 'Covered Requirements:' }, default_1.DescriptionandProcedureStyle, testcase.id || 0, 0);
|
|
213
210
|
testSkin.push(testDescriptionTitleParagraph.getJSONParagraph());
|
|
214
211
|
//create test steps table
|
|
215
212
|
let tableSkin = new JSONTable_1.default(testcase.testCaseRequirements, styles, headingLvl);
|
|
@@ -217,16 +214,26 @@ class Skins {
|
|
|
217
214
|
testSkin.push(populatedTableSkin);
|
|
218
215
|
}
|
|
219
216
|
}
|
|
217
|
+
if (testcase.testCaseBugs) {
|
|
218
|
+
if (testcase.testCaseBugs.length > 0) {
|
|
219
|
+
let testDescriptionTitleParagraph = new JSONParagraph_1.default({ name: 'Title', value: 'Linked Bugs:' }, default_1.DescriptionandProcedureStyle, testcase.id || 0, 0);
|
|
220
|
+
testSkin.push(testDescriptionTitleParagraph.getJSONParagraph());
|
|
221
|
+
//create test steps table
|
|
222
|
+
let tableSkin = new JSONTable_1.default(testcase.testCaseBugs, styles, headingLvl);
|
|
223
|
+
let populatedTableSkin = tableSkin.getJSONTable();
|
|
224
|
+
testSkin.push(populatedTableSkin);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
220
227
|
try {
|
|
221
228
|
if (testcase.testCaseStepsSkinData.length > 0) {
|
|
222
|
-
let testProcedureTitleParagraph = new JSONParagraph_1.default({ name:
|
|
229
|
+
let testProcedureTitleParagraph = new JSONParagraph_1.default({ name: 'Title', value: 'Test Procedure:' }, default_1.DescriptionandProcedureStyle, testcase.id || 0, 0);
|
|
223
230
|
let TableContentStyles = {
|
|
224
231
|
isBold: false,
|
|
225
232
|
IsItalic: false,
|
|
226
233
|
IsUnderline: false,
|
|
227
234
|
Size: 12,
|
|
228
235
|
Uri: null,
|
|
229
|
-
Font:
|
|
236
|
+
Font: 'Arial',
|
|
230
237
|
InsertLineBreak: false,
|
|
231
238
|
InsertSpace: true,
|
|
232
239
|
};
|
|
@@ -242,12 +249,11 @@ class Skins {
|
|
|
242
249
|
}
|
|
243
250
|
//attachments table
|
|
244
251
|
if (testcase.testCaseAttachments) {
|
|
245
|
-
if (testcase.testCaseAttachments.length > 0 &&
|
|
246
|
-
|
|
247
|
-
let testDescriptionTitleParagraph = new JSONParagraph_1.default({ name: "Title", value: "Test Case Attachments:" }, styles, testcase.id || 0, 0);
|
|
252
|
+
if (testcase.testCaseAttachments.length > 0 && includeAttachments == true) {
|
|
253
|
+
let testDescriptionTitleParagraph = new JSONParagraph_1.default({ name: 'Title', value: 'Test Case Attachments:' }, styles, testcase.id || 0, 0);
|
|
248
254
|
testSkin.push(testDescriptionTitleParagraph.getJSONParagraph());
|
|
249
255
|
//create test steps table
|
|
250
|
-
let tableSkin = new JSONTable_1.default(testcase.testCaseAttachments, styles, headingLvl);
|
|
256
|
+
let tableSkin = new JSONTable_1.default(testcase.testCaseAttachments, styles, headingLvl, true);
|
|
251
257
|
let populatedTableSkin = tableSkin.getJSONTable();
|
|
252
258
|
testSkin.push(populatedTableSkin);
|
|
253
259
|
}
|
|
@@ -256,7 +262,7 @@ class Skins {
|
|
|
256
262
|
});
|
|
257
263
|
return testSkin;
|
|
258
264
|
break;
|
|
259
|
-
case
|
|
265
|
+
case 'html':
|
|
260
266
|
logger_1.default.info(`Generating html test data!`);
|
|
261
267
|
break;
|
|
262
268
|
default:
|
package/bin/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,+DAAuC;AACvC,8EAAsD;AACtD,0FAAkE;AAClE,wHAAuF;AACvF,0GAAkF;AAClF,mDAAqE;AAErE,MAAqB,KAAK;IAYxB,YAAY,aAAqB,MAAM,EAAE,YAAoB;QAX7D,oBAAe,GAAG,OAAO,CAAC;QAC1B,wBAAmB,GAAG,WAAW,CAAC;QAClC,wBAAmB,GAAG,WAAW,CAAC;QAElC,iBAAY,GAAiB;YAC3B,YAAY,EAAE,EAAE;YAChB,eAAe,EAAE,EAAE;SACpB,CAAC;QAEF,eAAU,GAAW,MAAM,CAAC;QAG1B,IAAI,CAAC,YAAY,CAAC,YAAY,GAAG,YAAY,CAAC;QAC9C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAEK,2BAA2B,CAC/B,mBAA2B,EAC3B,QAAgB,EAChB,IAAS,EACT,MAAoB,EACpB,aAAqB,CAAC,EACtB,qBAA8B,IAAI;;YAElC,IAAI;gBACF,IAAI,aAAa,CAAC;gBAElB,QAAQ,QAAQ,EAAE;oBAChB,KAAK,IAAI,CAAC,eAAe;wBACvB,aAAa,GAAG,IAAI,CAAC,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;wBACvE,IAAI,aAAa,KAAK,KAAK,EAAE;4BAC3B,gBAAM,CAAC,KAAK,CAAC,iDAAiD,mBAAmB,EAAE,CAAC,CAAC;4BACrF,OAAO,KAAK,CAAC;yBACd;wBACD,MAAM;oBACR,KAAK,IAAI,CAAC,mBAAmB;wBAC3B,aAAa,GAAG,IAAI,CAAC,4BAA4B,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;wBAC5E,IAAI,aAAa,KAAK,KAAK,EAAE;4BAC3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,EAAE,OAAO,EAAE,KAAK,EAAE,wBAAwB,EAAE,EAClD,MAAM,EACN,QAAQ,CAAC,EAAE,IAAI,CAAC,EAChB,CAAC,CACF,CAAC;gCACF,QAAQ,CAAC,IAAI,CAAC,6BAA6B,CAAC,gBAAgB,EAAE,CAAC,CAAC;gCAChE,yBAAyB;gCACzB,IAAI,SAAS,GAAG,IAAI,mBAAS,CAAC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;gCACtF,IAAI,kBAAkB,GAAG,SAAS,CAAC,YAAY,EAAE,CAAC;gCAClD,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;6BACnC;yBACF;oBACH,CAAC,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;gBACH,OAAO,QAAQ,CAAC;gBAChB,MAAM;YACR,KAAK,MAAM;gBACT,gBAAM,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;gBAC1C,MAAM;YACR;gBACE,OAAO,KAAK,CAAC;SAChB,CAAC,QAAQ;IACZ,CAAC,CAAC,uBAAuB;IAEzB,eAAe;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC,CAAC,iBAAiB;CACpB;AAzUD,wBAyUC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Table, TableRow, WIQueryResults, WIData, StyleOptions } from
|
|
1
|
+
import { Table, TableRow, WIQueryResults, WIData, StyleOptions } from '../wordJsonModels';
|
|
2
2
|
export default class JSONTable {
|
|
3
3
|
tableTemplate: Table;
|
|
4
4
|
tableStyles: StyleOptions;
|
|
5
|
-
constructor(data: WIQueryResults, tableStyles: StyleOptions, headingLvl: number);
|
|
6
|
-
generateJsonRows(data: any, tableStyles: StyleOptions): TableRow[];
|
|
5
|
+
constructor(data: WIQueryResults, tableStyles: StyleOptions, headingLvl: number, retrieveOriginal?: boolean);
|
|
6
|
+
generateJsonRows(data: any, tableStyles: StyleOptions, retrieveOriginal: boolean): TableRow[];
|
|
7
7
|
headersRowAdapter(data: WIData): WIData;
|
|
8
8
|
getJSONTable(): Table;
|
|
9
9
|
}
|
|
@@ -6,15 +6,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const logger_1 = __importDefault(require("../../../services/logger"));
|
|
7
7
|
const JSONTableRow_1 = __importDefault(require("./JSONTableRow"));
|
|
8
8
|
class JSONTable {
|
|
9
|
-
constructor(data, tableStyles, headingLvl) {
|
|
9
|
+
constructor(data, tableStyles, headingLvl, retrieveOriginal = false) {
|
|
10
10
|
this.tableStyles = tableStyles;
|
|
11
11
|
this.tableTemplate = {
|
|
12
|
-
type:
|
|
12
|
+
type: 'table',
|
|
13
13
|
headingLevel: headingLvl,
|
|
14
|
-
Rows: this.generateJsonRows(data, this.tableStyles),
|
|
14
|
+
Rows: this.generateJsonRows(data, this.tableStyles, retrieveOriginal),
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
generateJsonRows(data, tableStyles) {
|
|
17
|
+
generateJsonRows(data, tableStyles, retrieveOriginal) {
|
|
18
18
|
let rows = [];
|
|
19
19
|
let headersRowData = this.headersRowAdapter(data[0]);
|
|
20
20
|
let style2 = {
|
|
@@ -23,14 +23,14 @@ class JSONTable {
|
|
|
23
23
|
IsUnderline: false,
|
|
24
24
|
Size: 12,
|
|
25
25
|
Uri: null,
|
|
26
|
-
Font:
|
|
26
|
+
Font: 'Arial',
|
|
27
27
|
InsertLineBreak: false,
|
|
28
28
|
InsertSpace: false,
|
|
29
29
|
};
|
|
30
30
|
let headersRow = new JSONTableRow_1.default(headersRowData, style2);
|
|
31
31
|
rows.push(headersRow.getRow());
|
|
32
32
|
data.forEach((rowData) => {
|
|
33
|
-
let row = new JSONTableRow_1.default(rowData, tableStyles);
|
|
33
|
+
let row = new JSONTableRow_1.default(rowData, tableStyles, retrieveOriginal);
|
|
34
34
|
rows.push(row.getRow());
|
|
35
35
|
});
|
|
36
36
|
return rows;
|
|
@@ -39,14 +39,14 @@ class JSONTable {
|
|
|
39
39
|
let headerValuesWi;
|
|
40
40
|
try {
|
|
41
41
|
headerValuesWi = data.fields.map((field) => {
|
|
42
|
-
return { name:
|
|
42
|
+
return { name: 'header', value: field.name };
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
catch (error) {
|
|
46
46
|
logger_1.default.error(`no fields to append`);
|
|
47
47
|
}
|
|
48
48
|
return {
|
|
49
|
-
url:
|
|
49
|
+
url: '',
|
|
50
50
|
fields: headerValuesWi,
|
|
51
51
|
Source: 999999999999,
|
|
52
52
|
level: data.level,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JSONTable.js","sourceRoot":"","sources":["../../../../src/models/json/table/JSONTable.ts"],"names":[],"mappings":";;;;;AAAA,sEAA8C;
|
|
1
|
+
{"version":3,"file":"JSONTable.js","sourceRoot":"","sources":["../../../../src/models/json/table/JSONTable.ts"],"names":[],"mappings":";;;;;AAAA,sEAA8C;AAE9C,kEAA0C;AAC1C,MAAqB,SAAS;IAI5B,YAAY,IAAoB,EAAE,WAAyB,EAAE,UAAkB,EAAE,gBAAgB,GAAG,KAAK;QACvG,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,aAAa,GAAG;YACnB,IAAI,EAAE,OAAO;YACb,YAAY,EAAE,UAAU;YACxB,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,gBAAgB,CAAC;SACtE,CAAC;IACJ,CAAC;IAED,gBAAgB,CAAC,IAAS,EAAE,WAAyB,EAAE,gBAAyB;QAC9E,IAAI,IAAI,GAAe,EAAE,CAAC;QAC1B,IAAI,cAAc,GAAW,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAE7D,IAAI,MAAM,GAAG;YACX,MAAM,EAAE,IAAI;YACZ,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,KAAK;YAClB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from
|
|
1
|
+
import { TableCell, WIProperty, MultipeValuesWIProperty, StyleOptions } from '../wordJsonModels';
|
|
2
2
|
export default class JSONTableCell {
|
|
3
3
|
cell: TableCell;
|
|
4
|
-
constructor(data: WIProperty, tableStyles: StyleOptions);
|
|
5
|
-
|
|
4
|
+
constructor(data: WIProperty, tableStyles: StyleOptions, retrieveOriginal?: boolean);
|
|
5
|
+
private removeFileExtension;
|
|
6
|
+
generateJsonCell(data: WIProperty | MultipeValuesWIProperty, styles: any, retrieveOriginal: any): TableCell;
|
|
6
7
|
isPictureUri(uri: string): boolean;
|
|
7
8
|
getJsonCell(): TableCell;
|
|
8
9
|
}
|
|
@@ -7,35 +7,48 @@ const path_1 = require("path");
|
|
|
7
7
|
const JSONRun_1 = __importDefault(require("../JSONRun"));
|
|
8
8
|
const logger_1 = __importDefault(require("../../../services/logger"));
|
|
9
9
|
class JSONTableCell {
|
|
10
|
-
constructor(data, tableStyles) {
|
|
11
|
-
this.cell = this.generateJsonCell(data, tableStyles);
|
|
10
|
+
constructor(data, tableStyles, retrieveOriginal = false) {
|
|
11
|
+
this.cell = this.generateJsonCell(data, tableStyles, retrieveOriginal);
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
removeFileExtension(filePath) {
|
|
14
|
+
const lastDotIndex = filePath.lastIndexOf('.');
|
|
15
|
+
if (lastDotIndex > 0) {
|
|
16
|
+
return filePath.slice(0, lastDotIndex);
|
|
17
|
+
}
|
|
18
|
+
return filePath; // If there's no extension, return the original file path
|
|
19
|
+
}
|
|
20
|
+
generateJsonCell(data, styles, retrieveOriginal) {
|
|
14
21
|
let runs = [];
|
|
15
22
|
let attachments = [];
|
|
16
|
-
let HtmlData =
|
|
23
|
+
let HtmlData = '';
|
|
17
24
|
//multiple values
|
|
18
|
-
if (typeof data.value !==
|
|
19
|
-
typeof data.value !== "number" &&
|
|
20
|
-
data.value) {
|
|
25
|
+
if (typeof data.value !== 'string' && typeof data.value !== 'number' && data.value) {
|
|
21
26
|
data.value.forEach((runData) => {
|
|
22
27
|
//check if photo type
|
|
23
|
-
if (
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
if (runData.attachmentLink) {
|
|
29
|
+
let attachmentLink = retrieveOriginal ? runData.attachmentLink : runData.tableCellAttachmentLink;
|
|
30
|
+
if (this.isPictureUri(attachmentLink)) {
|
|
31
|
+
let attachment = {
|
|
32
|
+
type: 'Picture',
|
|
33
|
+
path: attachmentLink,
|
|
34
|
+
name: this.removeFileExtension(runData.attachmentFileName),
|
|
35
|
+
};
|
|
36
|
+
attachments.push(attachment);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
let attachment = {
|
|
40
|
+
type: 'File',
|
|
41
|
+
path: runData.attachmentLink,
|
|
42
|
+
name: this.removeFileExtension(runData.attachmentFileName),
|
|
43
|
+
};
|
|
44
|
+
attachments.push(attachment);
|
|
45
|
+
}
|
|
29
46
|
}
|
|
30
47
|
else if (/<[^>]*>/.test(runData.value)) {
|
|
31
|
-
HtmlData = runData.value ||
|
|
48
|
+
HtmlData = runData.value || '';
|
|
32
49
|
}
|
|
33
50
|
else {
|
|
34
|
-
styles.Uri = runData.relativeUrl
|
|
35
|
-
? runData.relativeUrl
|
|
36
|
-
: runData.Uri
|
|
37
|
-
? runData.Uri
|
|
38
|
-
: null;
|
|
51
|
+
styles.Uri = runData.relativeUrl ? runData.relativeUrl : runData.Uri ? runData.Uri : null;
|
|
39
52
|
styles.InsertLineBreak = false;
|
|
40
53
|
let jsonRun = new JSONRun_1.default(runData.value, styles);
|
|
41
54
|
runs = [...runs, ...jsonRun.getRun()];
|
|
@@ -43,22 +56,18 @@ class JSONTableCell {
|
|
|
43
56
|
});
|
|
44
57
|
}
|
|
45
58
|
else if (/<[^>]*>/.test(data.value)) {
|
|
46
|
-
HtmlData = data.value ||
|
|
59
|
+
HtmlData = data.value || '';
|
|
47
60
|
}
|
|
48
61
|
else {
|
|
49
|
-
styles.Uri = data.relativeUrl
|
|
50
|
-
|
|
51
|
-
: data.url
|
|
52
|
-
? data.url
|
|
53
|
-
: null;
|
|
54
|
-
let text = data.value || "";
|
|
62
|
+
styles.Uri = data.relativeUrl ? data.relativeUrl : data.url ? data.url : null;
|
|
63
|
+
let text = data.value || '';
|
|
55
64
|
let jsonRun = new JSONRun_1.default(`${text}`, styles);
|
|
56
65
|
runs = [...runs, ...jsonRun.getRun()];
|
|
57
66
|
}
|
|
58
|
-
if (HtmlData !=
|
|
67
|
+
if (HtmlData != '') {
|
|
59
68
|
let Html = {
|
|
60
|
-
type:
|
|
61
|
-
Html: HtmlData
|
|
69
|
+
type: 'html',
|
|
70
|
+
Html: HtmlData,
|
|
62
71
|
};
|
|
63
72
|
return {
|
|
64
73
|
attachments: attachments,
|
|
@@ -67,7 +76,7 @@ class JSONTableCell {
|
|
|
67
76
|
Runs: runs,
|
|
68
77
|
},
|
|
69
78
|
],
|
|
70
|
-
Html
|
|
79
|
+
Html,
|
|
71
80
|
};
|
|
72
81
|
}
|
|
73
82
|
else {
|
|
@@ -85,7 +94,10 @@ class JSONTableCell {
|
|
|
85
94
|
try {
|
|
86
95
|
let fileExt = (0, path_1.extname)(uri);
|
|
87
96
|
logger_1.default.debug(`attachment extension: ${fileExt}`);
|
|
88
|
-
if (fileExt ==
|
|
97
|
+
if (fileExt.toUpperCase() == '.PNG' ||
|
|
98
|
+
fileExt.toUpperCase() == '.JPG' ||
|
|
99
|
+
fileExt.toUpperCase() == '.JPEG' ||
|
|
100
|
+
fileExt.toUpperCase() == '.GIF') {
|
|
89
101
|
return true;
|
|
90
102
|
}
|
|
91
103
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JSONTableCell.js","sourceRoot":"","sources":["../../../../src/models/json/table/JSONTableCell.ts"],"names":[],"mappings":";;;;;AAAA,+BAA+B;AAU/B,yDAAiC;AACjC,sEAA8C;AAE9C,MAAqB,aAAa;IAEhC,YAAY,IAAgB,EAAE,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AAO,KAAK,CAAC;SACd;IACH,CAAC;IAED,WAAW;QACT,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF,CAAC,OAAO;AA1GT,gCA0GC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { TableRow, WIData, StyleOptions } from
|
|
1
|
+
import { TableRow, WIData, StyleOptions } from '../wordJsonModels';
|
|
2
2
|
export default class JSONTableRow {
|
|
3
3
|
row: TableRow;
|
|
4
|
-
constructor(data: WIData, tableStyles: StyleOptions);
|
|
5
|
-
generateJsonRow(data: WIData, styles: StyleOptions): TableRow;
|
|
4
|
+
constructor(data: WIData, tableStyles: StyleOptions, retrieveOriginal?: boolean);
|
|
5
|
+
generateJsonRow(data: WIData, styles: StyleOptions, retrieveOriginal: boolean): TableRow;
|
|
6
6
|
getRow(): TableRow;
|
|
7
7
|
}
|
|
@@ -5,16 +5,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const JSONTableCell_1 = __importDefault(require("./JSONTableCell"));
|
|
7
7
|
class JSONTableRow {
|
|
8
|
-
constructor(data, tableStyles) {
|
|
9
|
-
this.row = this.generateJsonRow(data, tableStyles);
|
|
8
|
+
constructor(data, tableStyles, retrieveOriginal = false) {
|
|
9
|
+
this.row = this.generateJsonRow(data, tableStyles, retrieveOriginal);
|
|
10
10
|
} //constructor
|
|
11
|
-
generateJsonRow(data, styles) {
|
|
11
|
+
generateJsonRow(data, styles, retrieveOriginal) {
|
|
12
12
|
let tableCells = [];
|
|
13
13
|
data.fields.forEach((wiProperty) => {
|
|
14
|
-
if (wiProperty.name ===
|
|
14
|
+
if (wiProperty.name === 'id') {
|
|
15
15
|
styles.Uri = data.url;
|
|
16
16
|
}
|
|
17
|
-
let jsonTableCell = new JSONTableCell_1.default(wiProperty, styles);
|
|
17
|
+
let jsonTableCell = new JSONTableCell_1.default(wiProperty, styles, retrieveOriginal);
|
|
18
18
|
tableCells.push(JSON.parse(JSON.stringify(jsonTableCell.getJsonCell())));
|
|
19
19
|
});
|
|
20
20
|
return { Cells: tableCells };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JSONTableRow.js","sourceRoot":"","sources":["../../../../src/models/json/table/JSONTableRow.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"JSONTableRow.js","sourceRoot":"","sources":["../../../../src/models/json/table/JSONTableRow.ts"],"names":[],"mappings":";;;;;AACA,oEAA4C;AAE5C,MAAqB,YAAY;IAG/B,YAAY,IAAY,EAAE,WAAyB,EAAE,gBAAgB,GAAG,KAAK;QAC3E,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,WAAW,EAAE,gBAAgB,CAAC,CAAC;IACvE,CAAC,CAAC,aAAa;IAEf,eAAe,CAAC,IAAY,EAAE,MAAoB,EAAE,gBAAyB;QAC3E,IAAI,UAAU,GAAgB,EAAE,CAAC;QAEjC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,UAAsB,EAAE,EAAE;YAC7C,IAAI,UAAU,CAAC,IAAI,KAAK,IAAI,EAAE;gBAC5B,MAAM,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;aACvB;YACD,IAAI,aAAa,GAAG,IAAI,uBAAa,CAAC,UAAU,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC;YAC5E,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;QAC3E,CAAC,CAAC,CAAC;QAEH,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;IAC/B,CAAC,CAAC,iBAAiB;IAEnB,MAAM;QACJ,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC,CAAC,QAAQ;CACX,CAAC,OAAO;AAxBT,+BAwBC"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,32 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from
|
|
8
|
-
import logger from "./services/logger";
|
|
9
|
-
import JSONTable from "./models/json/table/JSONTable";
|
|
10
|
-
import JSONParagraph from "./models/json/paragraph/JSONParagraph";
|
|
11
|
-
import JSONHeaderParagraph from "./models/json/paragraph/JSONTestSuiteHeaderParagraph";
|
|
12
|
-
import JSONRichTextParagraph from "./models/json/paragraph/JSONRichTextParagraph";
|
|
13
|
-
import {
|
|
14
|
-
DescriptionandProcedureStyle
|
|
15
|
-
} from "./models/json/default";
|
|
1
|
+
import { DocumentSkin, WIQueryResults, WIData, WIProperty, StyleOptions } from './models/json/wordJsonModels';
|
|
2
|
+
import logger from './services/logger';
|
|
3
|
+
import JSONTable from './models/json/table/JSONTable';
|
|
4
|
+
import JSONParagraph from './models/json/paragraph/JSONParagraph';
|
|
5
|
+
import JSONHeaderParagraph from './models/json/paragraph/JSONTestSuiteHeaderParagraph';
|
|
6
|
+
import JSONRichTextParagraph from './models/json/paragraph/JSONRichTextParagraph';
|
|
7
|
+
import { DescriptionandProcedureStyle } from './models/json/default';
|
|
16
8
|
|
|
17
9
|
export default class Skins {
|
|
18
|
-
SKIN_TYPE_TABLE =
|
|
19
|
-
SKIN_TYPE_PARAGRAPH =
|
|
20
|
-
SKIN_TYPE_TEST_PLAN =
|
|
10
|
+
SKIN_TYPE_TABLE = 'table';
|
|
11
|
+
SKIN_TYPE_PARAGRAPH = 'paragraph';
|
|
12
|
+
SKIN_TYPE_TEST_PLAN = 'test-plan';
|
|
21
13
|
|
|
22
14
|
documentSkin: DocumentSkin = {
|
|
23
|
-
templatePath:
|
|
15
|
+
templatePath: '',
|
|
24
16
|
contentControls: [],
|
|
25
17
|
};
|
|
26
18
|
|
|
27
|
-
skinFormat: string =
|
|
19
|
+
skinFormat: string = 'json';
|
|
28
20
|
|
|
29
|
-
constructor(skinFormat: string =
|
|
21
|
+
constructor(skinFormat: string = 'json', templatePath: string) {
|
|
30
22
|
this.documentSkin.templatePath = templatePath;
|
|
31
23
|
this.skinFormat = skinFormat;
|
|
32
24
|
}
|
|
@@ -44,49 +36,28 @@ export default class Skins {
|
|
|
44
36
|
|
|
45
37
|
switch (skinType) {
|
|
46
38
|
case this.SKIN_TYPE_TABLE:
|
|
47
|
-
populatedSkin = this.generateQueryBasedTable(
|
|
48
|
-
data,
|
|
49
|
-
styles,
|
|
50
|
-
headingLvl
|
|
51
|
-
);
|
|
39
|
+
populatedSkin = this.generateQueryBasedTable(data, styles, headingLvl);
|
|
52
40
|
if (populatedSkin === false) {
|
|
53
|
-
logger.error(
|
|
54
|
-
`Could not generate table for content control :${contetnControlTitle}`
|
|
55
|
-
);
|
|
41
|
+
logger.error(`Could not generate table for content control :${contetnControlTitle}`);
|
|
56
42
|
return false;
|
|
57
43
|
}
|
|
58
44
|
break;
|
|
59
45
|
case this.SKIN_TYPE_PARAGRAPH:
|
|
60
|
-
populatedSkin = this.generateQueryBasedParagraphs(
|
|
61
|
-
data,
|
|
62
|
-
styles,
|
|
63
|
-
headingLvl
|
|
64
|
-
);
|
|
46
|
+
populatedSkin = this.generateQueryBasedParagraphs(data, styles, headingLvl);
|
|
65
47
|
if (populatedSkin === false) {
|
|
66
|
-
logger.error(
|
|
67
|
-
`Could not generate paragraph for content control :${contetnControlTitle}`
|
|
68
|
-
);
|
|
48
|
+
logger.error(`Could not generate paragraph for content control :${contetnControlTitle}`);
|
|
69
49
|
return false;
|
|
70
50
|
}
|
|
71
51
|
break;
|
|
72
52
|
case this.SKIN_TYPE_TEST_PLAN:
|
|
73
|
-
populatedSkin = this.generateTestBasedSkin(
|
|
74
|
-
data,
|
|
75
|
-
styles,
|
|
76
|
-
headingLvl,
|
|
77
|
-
includeAttachments
|
|
78
|
-
);
|
|
53
|
+
populatedSkin = this.generateTestBasedSkin(data, styles, headingLvl, includeAttachments);
|
|
79
54
|
if (populatedSkin === false) {
|
|
80
|
-
logger.error(
|
|
81
|
-
`Could not generate test skin for content control :${contetnControlTitle}`
|
|
82
|
-
);
|
|
55
|
+
logger.error(`Could not generate test skin for content control :${contetnControlTitle}`);
|
|
83
56
|
return false;
|
|
84
57
|
}
|
|
85
58
|
break;
|
|
86
59
|
default:
|
|
87
|
-
logger.error(
|
|
88
|
-
`Unknown skinType : ${skinType} - not appended to document skin`
|
|
89
|
-
);
|
|
60
|
+
logger.error(`Unknown skinType : ${skinType} - not appended to document skin`);
|
|
90
61
|
return false;
|
|
91
62
|
}
|
|
92
63
|
|
|
@@ -97,9 +68,7 @@ export default class Skins {
|
|
|
97
68
|
// populatedSkin
|
|
98
69
|
// );
|
|
99
70
|
} catch (error) {
|
|
100
|
-
logger.error(
|
|
101
|
-
`Fatal error happened when generate skin for : ${contetnControlTitle}`
|
|
102
|
-
);
|
|
71
|
+
logger.error(`Fatal error happened when generate skin for : ${contetnControlTitle}`);
|
|
103
72
|
return false;
|
|
104
73
|
}
|
|
105
74
|
} //addNewContentToDocumentSkin
|
|
@@ -107,10 +76,7 @@ export default class Skins {
|
|
|
107
76
|
// iterates on content controls array:
|
|
108
77
|
// if finds return true else creates content control and returns true
|
|
109
78
|
// on error returns false
|
|
110
|
-
async validateAndAppendContentControl(
|
|
111
|
-
contetnControlTitle: string,
|
|
112
|
-
populatedSkin: any
|
|
113
|
-
): Promise<boolean> {
|
|
79
|
+
async validateAndAppendContentControl(contetnControlTitle: string, populatedSkin: any): Promise<boolean> {
|
|
114
80
|
try {
|
|
115
81
|
let isContetnControlExists: boolean[] = await Promise.all(
|
|
116
82
|
this.documentSkin.contentControls.map((contentControl, i) => {
|
|
@@ -138,9 +104,7 @@ export default class Skins {
|
|
|
138
104
|
${JSON.stringify(contetnControlTitle)}`);
|
|
139
105
|
this.documentSkin.contentControls.unshift(contentControlToAppend);
|
|
140
106
|
}
|
|
141
|
-
logger.info(
|
|
142
|
-
`Appended new content control document: ${contetnControlTitle}`
|
|
143
|
-
);
|
|
107
|
+
logger.info(`Appended new content control document: ${contetnControlTitle}`);
|
|
144
108
|
return true;
|
|
145
109
|
} catch (error) {
|
|
146
110
|
logger.error(`Error validating and appending to content control`);
|
|
@@ -150,18 +114,14 @@ export default class Skins {
|
|
|
150
114
|
|
|
151
115
|
//parses data to the class skin format and returns the parsed data
|
|
152
116
|
//returns false if supplied an invalid type or error occurd during parsing
|
|
153
|
-
generateQueryBasedTable(
|
|
154
|
-
data: WIQueryResults,
|
|
155
|
-
styles: StyleOptions,
|
|
156
|
-
headingLvl: number = 0
|
|
157
|
-
) {
|
|
117
|
+
generateQueryBasedTable(data: WIQueryResults, styles: StyleOptions, headingLvl: number = 0) {
|
|
158
118
|
logger.debug(`Generating table as ${this.skinFormat}`);
|
|
159
119
|
|
|
160
120
|
switch (this.skinFormat) {
|
|
161
|
-
case
|
|
121
|
+
case 'json':
|
|
162
122
|
let tableSkin = new JSONTable(data, styles, headingLvl);
|
|
163
123
|
return [tableSkin.getJSONTable()];
|
|
164
|
-
case
|
|
124
|
+
case 'html':
|
|
165
125
|
logger.info(`Generating html table!`);
|
|
166
126
|
break;
|
|
167
127
|
default:
|
|
@@ -169,51 +129,30 @@ export default class Skins {
|
|
|
169
129
|
} //switch
|
|
170
130
|
} //generateTable
|
|
171
131
|
|
|
172
|
-
generateQueryBasedParagraphs(
|
|
173
|
-
data: any,
|
|
174
|
-
styles: StyleOptions,
|
|
175
|
-
headingLvl: number = 0
|
|
176
|
-
) {
|
|
132
|
+
generateQueryBasedParagraphs(data: any, styles: StyleOptions, headingLvl: number = 0) {
|
|
177
133
|
logger.debug(`Generating paragraph as ${this.skinFormat}`);
|
|
178
134
|
|
|
179
135
|
switch (this.skinFormat) {
|
|
180
|
-
case
|
|
136
|
+
case 'json':
|
|
181
137
|
let paragraphs: any[] = [];
|
|
182
138
|
data.forEach((wi: WIData) => {
|
|
183
139
|
wi.fields.forEach((field: WIProperty) => {
|
|
184
140
|
//Description and Test Description are handled in richText handler
|
|
185
|
-
if (
|
|
186
|
-
field.
|
|
187
|
-
field.name === "Test Description:"
|
|
188
|
-
) {
|
|
189
|
-
let paragraphSkin = new JSONRichTextParagraph(
|
|
190
|
-
field,
|
|
191
|
-
styles,
|
|
192
|
-
wi.Source,
|
|
193
|
-
headingLvl + wi.level
|
|
194
|
-
);
|
|
141
|
+
if (field.name === 'Description: ' || field.name === 'Test Description:') {
|
|
142
|
+
let paragraphSkin = new JSONRichTextParagraph(field, styles, wi.Source, headingLvl + wi.level);
|
|
195
143
|
paragraphs.push(paragraphSkin.getJSONRichTextParagraph());
|
|
196
144
|
}
|
|
197
145
|
|
|
198
146
|
//making sure ID is not printed
|
|
199
147
|
//excluding Description and Test Description are handled in richText handler
|
|
200
|
-
if (
|
|
201
|
-
field.
|
|
202
|
-
field.name !== "Description: " &&
|
|
203
|
-
field.name !== "Test Description:"
|
|
204
|
-
) {
|
|
205
|
-
let paragraphSkin = new JSONParagraph(
|
|
206
|
-
field,
|
|
207
|
-
styles,
|
|
208
|
-
wi.Source,
|
|
209
|
-
headingLvl + wi.level
|
|
210
|
-
);
|
|
148
|
+
if (field.name !== 'ID' && field.name !== 'Description: ' && field.name !== 'Test Description:') {
|
|
149
|
+
let paragraphSkin = new JSONParagraph(field, styles, wi.Source, headingLvl + wi.level);
|
|
211
150
|
paragraphs.push(paragraphSkin.getJSONParagraph());
|
|
212
151
|
}
|
|
213
152
|
});
|
|
214
153
|
});
|
|
215
154
|
return paragraphs;
|
|
216
|
-
case
|
|
155
|
+
case 'html':
|
|
217
156
|
logger.info(`Generating html paragraphs!`);
|
|
218
157
|
break;
|
|
219
158
|
default:
|
|
@@ -229,7 +168,7 @@ export default class Skins {
|
|
|
229
168
|
) {
|
|
230
169
|
logger.debug(`Generating testSkin as ${this.skinFormat}`);
|
|
231
170
|
switch (this.skinFormat) {
|
|
232
|
-
case
|
|
171
|
+
case 'json':
|
|
233
172
|
let testSkin: any[] = [];
|
|
234
173
|
//create suite Header pragraph
|
|
235
174
|
data.forEach((testSuite: any) => {
|
|
@@ -239,7 +178,7 @@ export default class Skins {
|
|
|
239
178
|
IsUnderline: false,
|
|
240
179
|
Size: 16,
|
|
241
180
|
Uri: null,
|
|
242
|
-
Font:
|
|
181
|
+
Font: 'Arial',
|
|
243
182
|
InsertLineBreak: false,
|
|
244
183
|
InsertSpace: true,
|
|
245
184
|
};
|
|
@@ -267,7 +206,7 @@ export default class Skins {
|
|
|
267
206
|
IsUnderline: false,
|
|
268
207
|
Size: 14,
|
|
269
208
|
Uri: null,
|
|
270
|
-
Font:
|
|
209
|
+
Font: 'Arial',
|
|
271
210
|
InsertLineBreak: false,
|
|
272
211
|
InsertSpace: true,
|
|
273
212
|
};
|
|
@@ -284,11 +223,11 @@ export default class Skins {
|
|
|
284
223
|
testSkin.push(testCaseParagraphSkin.getJSONParagraph());
|
|
285
224
|
|
|
286
225
|
let testDescriptionTitleParagraph = new JSONParagraph(
|
|
287
|
-
{ name:
|
|
226
|
+
{ name: 'Title', value: 'Test Description:' },
|
|
288
227
|
DescriptionandProcedureStyle,
|
|
289
228
|
testcase.id || 0,
|
|
290
229
|
0
|
|
291
|
-
);
|
|
230
|
+
);
|
|
292
231
|
testSkin.push(testDescriptionTitleParagraph.getJSONParagraph());
|
|
293
232
|
let testDescriptionParagraph = new JSONRichTextParagraph(
|
|
294
233
|
testcase.testCaseHeaderSkinData.fields[2],
|
|
@@ -296,39 +235,49 @@ export default class Skins {
|
|
|
296
235
|
testcase.id || 0,
|
|
297
236
|
0
|
|
298
237
|
);
|
|
299
|
-
let richTextSkin: any[] =
|
|
300
|
-
testDescriptionParagraph.getJSONRichTextParagraph();
|
|
238
|
+
let richTextSkin: any[] = testDescriptionParagraph.getJSONRichTextParagraph();
|
|
301
239
|
testSkin = [...testSkin, ...richTextSkin];
|
|
302
|
-
|
|
240
|
+
|
|
303
241
|
if (testcase.testCaseRequirements) {
|
|
304
|
-
if (
|
|
305
|
-
testcase.testCaseRequirements.length > 0
|
|
306
|
-
) {
|
|
307
|
-
|
|
242
|
+
if (testcase.testCaseRequirements.length > 0) {
|
|
308
243
|
let testDescriptionTitleParagraph = new JSONParagraph(
|
|
309
|
-
{ name:
|
|
244
|
+
{ name: 'Title', value: 'Covered Requirements:' },
|
|
310
245
|
DescriptionandProcedureStyle,
|
|
311
246
|
testcase.id || 0,
|
|
312
247
|
0
|
|
313
248
|
);
|
|
314
249
|
testSkin.push(testDescriptionTitleParagraph.getJSONParagraph());
|
|
315
250
|
//create test steps table
|
|
316
|
-
let tableSkin = new JSONTable(
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
251
|
+
let tableSkin = new JSONTable(testcase.testCaseRequirements, styles, headingLvl);
|
|
252
|
+
|
|
253
|
+
let populatedTableSkin = tableSkin.getJSONTable();
|
|
254
|
+
|
|
255
|
+
testSkin.push(populatedTableSkin);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
if (testcase.testCaseBugs) {
|
|
260
|
+
if (testcase.testCaseBugs.length > 0) {
|
|
261
|
+
let testDescriptionTitleParagraph = new JSONParagraph(
|
|
262
|
+
{ name: 'Title', value: 'Linked Bugs:' },
|
|
263
|
+
DescriptionandProcedureStyle,
|
|
264
|
+
testcase.id || 0,
|
|
265
|
+
0
|
|
320
266
|
);
|
|
267
|
+
testSkin.push(testDescriptionTitleParagraph.getJSONParagraph());
|
|
268
|
+
//create test steps table
|
|
269
|
+
let tableSkin = new JSONTable(testcase.testCaseBugs, styles, headingLvl);
|
|
321
270
|
|
|
322
271
|
let populatedTableSkin = tableSkin.getJSONTable();
|
|
323
272
|
|
|
324
273
|
testSkin.push(populatedTableSkin);
|
|
325
274
|
}
|
|
326
275
|
}
|
|
327
|
-
|
|
276
|
+
|
|
328
277
|
try {
|
|
329
278
|
if (testcase.testCaseStepsSkinData.length > 0) {
|
|
330
279
|
let testProcedureTitleParagraph = new JSONParagraph(
|
|
331
|
-
{ name:
|
|
280
|
+
{ name: 'Title', value: 'Test Procedure:' },
|
|
332
281
|
DescriptionandProcedureStyle,
|
|
333
282
|
testcase.id || 0,
|
|
334
283
|
0
|
|
@@ -339,17 +288,13 @@ export default class Skins {
|
|
|
339
288
|
IsUnderline: false,
|
|
340
289
|
Size: 12,
|
|
341
290
|
Uri: null,
|
|
342
|
-
Font:
|
|
291
|
+
Font: 'Arial',
|
|
343
292
|
InsertLineBreak: false,
|
|
344
293
|
InsertSpace: true,
|
|
345
294
|
};
|
|
346
295
|
testSkin.push(testProcedureTitleParagraph.getJSONParagraph());
|
|
347
296
|
//create test steps table
|
|
348
|
-
let tableSkin = new JSONTable(
|
|
349
|
-
testcase.testCaseStepsSkinData,
|
|
350
|
-
TableContentStyles,
|
|
351
|
-
headingLvl
|
|
352
|
-
);
|
|
297
|
+
let tableSkin = new JSONTable(testcase.testCaseStepsSkinData, TableContentStyles, headingLvl);
|
|
353
298
|
let populatedTableSkin = tableSkin.getJSONTable();
|
|
354
299
|
testSkin.push(populatedTableSkin);
|
|
355
300
|
}
|
|
@@ -357,28 +302,20 @@ export default class Skins {
|
|
|
357
302
|
logger.warn(
|
|
358
303
|
`For suite id : ${testSuite.suiteSkinData.fields[0].value} , the testCaseStepsSkinData is not defined for ${testcase.testCaseHeaderSkinData.fields[0].value} `
|
|
359
304
|
);
|
|
360
|
-
|
|
305
|
+
}
|
|
361
306
|
|
|
362
307
|
//attachments table
|
|
363
308
|
if (testcase.testCaseAttachments) {
|
|
364
|
-
if (
|
|
365
|
-
testcase.testCaseAttachments.length > 0 &&
|
|
366
|
-
includeAttachments == true
|
|
367
|
-
) {
|
|
368
|
-
|
|
309
|
+
if (testcase.testCaseAttachments.length > 0 && includeAttachments == true) {
|
|
369
310
|
let testDescriptionTitleParagraph = new JSONParagraph(
|
|
370
|
-
{ name:
|
|
311
|
+
{ name: 'Title', value: 'Test Case Attachments:' },
|
|
371
312
|
styles,
|
|
372
313
|
testcase.id || 0,
|
|
373
314
|
0
|
|
374
315
|
);
|
|
375
316
|
testSkin.push(testDescriptionTitleParagraph.getJSONParagraph());
|
|
376
317
|
//create test steps table
|
|
377
|
-
let tableSkin = new JSONTable(
|
|
378
|
-
testcase.testCaseAttachments,
|
|
379
|
-
styles,
|
|
380
|
-
headingLvl
|
|
381
|
-
);
|
|
318
|
+
let tableSkin = new JSONTable(testcase.testCaseAttachments, styles, headingLvl, true);
|
|
382
319
|
let populatedTableSkin = tableSkin.getJSONTable();
|
|
383
320
|
testSkin.push(populatedTableSkin);
|
|
384
321
|
}
|
|
@@ -387,7 +324,7 @@ export default class Skins {
|
|
|
387
324
|
});
|
|
388
325
|
return testSkin;
|
|
389
326
|
break;
|
|
390
|
-
case
|
|
327
|
+
case 'html':
|
|
391
328
|
logger.info(`Generating html test data!`);
|
|
392
329
|
break;
|
|
393
330
|
default:
|
|
@@ -1,31 +1,20 @@
|
|
|
1
|
-
import logger from
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
TableRow,
|
|
5
|
-
WIQueryResults,
|
|
6
|
-
WIData,
|
|
7
|
-
WIProperty,
|
|
8
|
-
StyleOptions,
|
|
9
|
-
} from "../wordJsonModels";
|
|
10
|
-
import JSONTableRow from "./JSONTableRow";
|
|
1
|
+
import logger from '../../../services/logger';
|
|
2
|
+
import { Table, TableRow, WIQueryResults, WIData, WIProperty, StyleOptions } from '../wordJsonModels';
|
|
3
|
+
import JSONTableRow from './JSONTableRow';
|
|
11
4
|
export default class JSONTable {
|
|
12
5
|
tableTemplate: Table;
|
|
13
6
|
tableStyles: StyleOptions;
|
|
14
7
|
|
|
15
|
-
constructor(
|
|
16
|
-
data: WIQueryResults,
|
|
17
|
-
tableStyles: StyleOptions,
|
|
18
|
-
headingLvl: number
|
|
19
|
-
) {
|
|
8
|
+
constructor(data: WIQueryResults, tableStyles: StyleOptions, headingLvl: number, retrieveOriginal = false) {
|
|
20
9
|
this.tableStyles = tableStyles;
|
|
21
10
|
this.tableTemplate = {
|
|
22
|
-
type:
|
|
11
|
+
type: 'table',
|
|
23
12
|
headingLevel: headingLvl,
|
|
24
|
-
Rows: this.generateJsonRows(data, this.tableStyles),
|
|
13
|
+
Rows: this.generateJsonRows(data, this.tableStyles, retrieveOriginal),
|
|
25
14
|
};
|
|
26
15
|
}
|
|
27
16
|
|
|
28
|
-
generateJsonRows(data: any, tableStyles: StyleOptions): TableRow[] {
|
|
17
|
+
generateJsonRows(data: any, tableStyles: StyleOptions, retrieveOriginal: boolean): TableRow[] {
|
|
29
18
|
let rows: TableRow[] = [];
|
|
30
19
|
let headersRowData: WIData = this.headersRowAdapter(data[0]);
|
|
31
20
|
|
|
@@ -35,7 +24,7 @@ export default class JSONTable {
|
|
|
35
24
|
IsUnderline: false,
|
|
36
25
|
Size: 12,
|
|
37
26
|
Uri: null,
|
|
38
|
-
Font:
|
|
27
|
+
Font: 'Arial',
|
|
39
28
|
InsertLineBreak: false,
|
|
40
29
|
InsertSpace: false,
|
|
41
30
|
};
|
|
@@ -44,7 +33,7 @@ export default class JSONTable {
|
|
|
44
33
|
rows.push(headersRow.getRow());
|
|
45
34
|
|
|
46
35
|
data.forEach((rowData: WIData) => {
|
|
47
|
-
let row = new JSONTableRow(rowData, tableStyles);
|
|
36
|
+
let row = new JSONTableRow(rowData, tableStyles, retrieveOriginal);
|
|
48
37
|
rows.push(row.getRow());
|
|
49
38
|
});
|
|
50
39
|
|
|
@@ -55,14 +44,13 @@ export default class JSONTable {
|
|
|
55
44
|
let headerValuesWi;
|
|
56
45
|
try {
|
|
57
46
|
headerValuesWi = data.fields.map((field: WIProperty) => {
|
|
58
|
-
return { name:
|
|
47
|
+
return { name: 'header', value: field.name };
|
|
59
48
|
});
|
|
60
|
-
|
|
61
49
|
} catch (error) {
|
|
62
50
|
logger.error(`no fields to append`);
|
|
63
51
|
}
|
|
64
52
|
return {
|
|
65
|
-
url:
|
|
53
|
+
url: '',
|
|
66
54
|
fields: headerValuesWi,
|
|
67
55
|
Source: 999999999999,
|
|
68
56
|
level: data.level,
|
|
@@ -72,4 +60,4 @@ export default class JSONTable {
|
|
|
72
60
|
getJSONTable(): Table {
|
|
73
61
|
return this.tableTemplate;
|
|
74
62
|
} //getJSONTable
|
|
75
|
-
} //class
|
|
63
|
+
} //class
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extname } from
|
|
1
|
+
import { extname } from 'path';
|
|
2
2
|
import {
|
|
3
3
|
TableCell,
|
|
4
4
|
Run,
|
|
@@ -7,73 +7,72 @@ import {
|
|
|
7
7
|
MultipeValuesWIProperty,
|
|
8
8
|
StyleOptions,
|
|
9
9
|
JsonHtml,
|
|
10
|
-
} from
|
|
11
|
-
import JSONRun from
|
|
12
|
-
import logger from
|
|
10
|
+
} from '../wordJsonModels';
|
|
11
|
+
import JSONRun from '../JSONRun';
|
|
12
|
+
import logger from '../../../services/logger';
|
|
13
13
|
|
|
14
14
|
export default class JSONTableCell {
|
|
15
15
|
cell: TableCell;
|
|
16
|
-
constructor(data: WIProperty, tableStyles: StyleOptions) {
|
|
17
|
-
this.cell = this.generateJsonCell(data, tableStyles);
|
|
16
|
+
constructor(data: WIProperty, tableStyles: StyleOptions, retrieveOriginal = false) {
|
|
17
|
+
this.cell = this.generateJsonCell(data, tableStyles, retrieveOriginal);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
private removeFileExtension(filePath) {
|
|
21
|
+
const lastDotIndex = filePath.lastIndexOf('.');
|
|
22
|
+
if (lastDotIndex > 0) {
|
|
23
|
+
return filePath.slice(0, lastDotIndex);
|
|
24
|
+
}
|
|
25
|
+
return filePath; // If there's no extension, return the original file path
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
generateJsonCell(data: WIProperty | MultipeValuesWIProperty, styles, retrieveOriginal): TableCell {
|
|
24
29
|
let runs: Run[] = [];
|
|
25
30
|
let attachments: Attachment[] = [];
|
|
26
|
-
let HtmlData: string =
|
|
31
|
+
let HtmlData: string = '';
|
|
27
32
|
|
|
28
33
|
//multiple values
|
|
29
|
-
if (
|
|
30
|
-
typeof data.value !== "string" &&
|
|
31
|
-
typeof data.value !== "number" &&
|
|
32
|
-
data.value
|
|
33
|
-
) {
|
|
34
|
+
if (typeof data.value !== 'string' && typeof data.value !== 'number' && data.value) {
|
|
34
35
|
data.value.forEach((runData) => {
|
|
35
36
|
//check if photo type
|
|
36
|
-
if (
|
|
37
|
-
let
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
37
|
+
if (runData.attachmentLink) {
|
|
38
|
+
let attachmentLink = retrieveOriginal ? runData.attachmentLink : runData.tableCellAttachmentLink;
|
|
39
|
+
if (this.isPictureUri(attachmentLink)) {
|
|
40
|
+
let attachment = {
|
|
41
|
+
type: 'Picture',
|
|
42
|
+
path: attachmentLink,
|
|
43
|
+
name: this.removeFileExtension(runData.attachmentFileName),
|
|
44
|
+
};
|
|
45
|
+
attachments.push(attachment);
|
|
46
|
+
} else {
|
|
47
|
+
let attachment = {
|
|
48
|
+
type: 'File',
|
|
49
|
+
path: runData.attachmentLink,
|
|
50
|
+
name: this.removeFileExtension(runData.attachmentFileName),
|
|
51
|
+
};
|
|
52
|
+
attachments.push(attachment);
|
|
53
|
+
}
|
|
54
|
+
} else if (/<[^>]*>/.test(runData.value)) {
|
|
55
|
+
HtmlData = runData.value || '';
|
|
56
|
+
} else {
|
|
57
|
+
styles.Uri = runData.relativeUrl ? runData.relativeUrl : runData.Uri ? runData.Uri : null;
|
|
52
58
|
styles.InsertLineBreak = false;
|
|
53
59
|
let jsonRun = new JSONRun(runData.value, styles);
|
|
54
60
|
runs = [...runs, ...jsonRun.getRun()];
|
|
55
61
|
}
|
|
56
62
|
});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
styles.Uri = data.relativeUrl
|
|
63
|
-
? data.relativeUrl
|
|
64
|
-
: data.url
|
|
65
|
-
? data.url
|
|
66
|
-
: null;
|
|
67
|
-
let text = data.value || "";
|
|
63
|
+
} else if (/<[^>]*>/.test(data.value)) {
|
|
64
|
+
HtmlData = data.value || '';
|
|
65
|
+
} else {
|
|
66
|
+
styles.Uri = data.relativeUrl ? data.relativeUrl : data.url ? data.url : null;
|
|
67
|
+
let text = data.value || '';
|
|
68
68
|
let jsonRun = new JSONRun(`${text}`, styles);
|
|
69
69
|
runs = [...runs, ...jsonRun.getRun()];
|
|
70
70
|
}
|
|
71
|
-
if (HtmlData!=
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
71
|
+
if (HtmlData != '') {
|
|
72
|
+
let Html: JsonHtml = {
|
|
73
|
+
type: 'html',
|
|
74
|
+
Html: HtmlData,
|
|
75
|
+
};
|
|
77
76
|
return {
|
|
78
77
|
attachments: attachments,
|
|
79
78
|
Paragraphs: [
|
|
@@ -81,26 +80,30 @@ export default class JSONTableCell {
|
|
|
81
80
|
Runs: runs,
|
|
82
81
|
},
|
|
83
82
|
],
|
|
84
|
-
Html
|
|
83
|
+
Html,
|
|
85
84
|
};
|
|
86
|
-
}
|
|
87
|
-
else{
|
|
85
|
+
} else {
|
|
88
86
|
return {
|
|
89
87
|
attachments: attachments,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
} //generateJsonCells
|
|
88
|
+
Paragraphs: [
|
|
89
|
+
{
|
|
90
|
+
Runs: runs,
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
} //generateJsonCells
|
|
98
96
|
|
|
99
97
|
isPictureUri(uri: string) {
|
|
100
98
|
try {
|
|
101
99
|
let fileExt = extname(uri);
|
|
102
100
|
logger.debug(`attachment extension: ${fileExt}`);
|
|
103
|
-
if (
|
|
101
|
+
if (
|
|
102
|
+
fileExt.toUpperCase() == '.PNG' ||
|
|
103
|
+
fileExt.toUpperCase() == '.JPG' ||
|
|
104
|
+
fileExt.toUpperCase() == '.JPEG' ||
|
|
105
|
+
fileExt.toUpperCase() == '.GIF'
|
|
106
|
+
) {
|
|
104
107
|
return true;
|
|
105
108
|
} else {
|
|
106
109
|
return false;
|
|
@@ -1,27 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
TableCell,
|
|
4
|
-
WIData,
|
|
5
|
-
WIProperty,
|
|
6
|
-
StyleOptions
|
|
7
|
-
} from "../wordJsonModels";
|
|
8
|
-
import JSONTableCell from "./JSONTableCell";
|
|
1
|
+
import { TableRow, TableCell, WIData, WIProperty, StyleOptions } from '../wordJsonModels';
|
|
2
|
+
import JSONTableCell from './JSONTableCell';
|
|
9
3
|
|
|
10
4
|
export default class JSONTableRow {
|
|
11
5
|
row: TableRow;
|
|
12
6
|
|
|
13
|
-
constructor(data: WIData, tableStyles: StyleOptions) {
|
|
14
|
-
this.row = this.generateJsonRow(data, tableStyles);
|
|
7
|
+
constructor(data: WIData, tableStyles: StyleOptions, retrieveOriginal = false) {
|
|
8
|
+
this.row = this.generateJsonRow(data, tableStyles, retrieveOriginal);
|
|
15
9
|
} //constructor
|
|
16
10
|
|
|
17
|
-
generateJsonRow(data: WIData, styles: StyleOptions): TableRow {
|
|
11
|
+
generateJsonRow(data: WIData, styles: StyleOptions, retrieveOriginal: boolean): TableRow {
|
|
18
12
|
let tableCells: TableCell[] = [];
|
|
19
13
|
|
|
20
14
|
data.fields.forEach((wiProperty: WIProperty) => {
|
|
21
|
-
if (wiProperty.name ===
|
|
15
|
+
if (wiProperty.name === 'id') {
|
|
22
16
|
styles.Uri = data.url;
|
|
23
17
|
}
|
|
24
|
-
let jsonTableCell = new JSONTableCell(wiProperty, styles);
|
|
18
|
+
let jsonTableCell = new JSONTableCell(wiProperty, styles, retrieveOriginal);
|
|
25
19
|
tableCells.push(JSON.parse(JSON.stringify(jsonTableCell.getJsonCell())));
|
|
26
20
|
});
|
|
27
21
|
|