Skip to content

Commit 73b24a1

Browse files
committed
updates
1 parent 2a64217 commit 73b24a1

File tree

2 files changed

+25
-13
lines changed

2 files changed

+25
-13
lines changed

components/testmonitor/actions/create-test-result/create-test-result.mjs

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,27 @@ export default {
7878
return {};
7979
},
8080
async run({ $ }) {
81+
let attachmentData = [];
82+
if (this.attachments) {
83+
try {
84+
const files = parseObject(this.attachments);
85+
for (const file of files) {
86+
const {
87+
stream, metadata,
88+
} = await getFileStreamAndMetadata(file);
89+
const data = new FormData();
90+
data.append("file", stream, {
91+
contentType: metadata.contentType,
92+
knownLength: metadata.size,
93+
filename: metadata.name,
94+
});
95+
attachmentData.push(data);
96+
}
97+
} catch (e) {
98+
throw new ConfigurationError(`Error accessing attachments: ${e.message}`);
99+
}
100+
}
101+
81102
let testResultId;
82103
let summary = "";
83104
try {
@@ -94,16 +115,7 @@ export default {
94115

95116
if (this.attachments) {
96117
try {
97-
for (const file of parseObject(this.attachments)) {
98-
const data = new FormData();
99-
const {
100-
stream, metadata,
101-
} = await getFileStreamAndMetadata(file);
102-
data.append("file", stream, {
103-
contentType: metadata.contentType,
104-
knownLength: metadata.size,
105-
filename: metadata.name,
106-
});
118+
for (const data of attachmentData) {
107119
await this.testmonitor.uploadAttachment({
108120
$,
109121
testResultId,
@@ -112,7 +124,7 @@ export default {
112124
});
113125
}
114126
} catch (e) {
115-
summary = ", but the attachments could not be loaded.";
127+
throw new ConfigurationError(`Error uploading attachments: ${e.message}`);
116128
}
117129
}
118130

components/timetonic/actions/common/create-update-row.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default {
5656
id, name: label,
5757
}) => ({
5858
value: `${id}`,
59-
label,
59+
label: label || `${id}`,
6060
})) || [];
6161
props[`id_${id}`].options = options;
6262
props[`id_${id}`].description = "The Row ID from the linked table to create a link to";
@@ -65,7 +65,7 @@ export default {
6565
}) => {
6666
props[`${id}_${rowId}_link_text`] = {
6767
type: "string",
68-
default: name,
68+
default: name || `${rowId}`,
6969
hidden: true,
7070
};
7171
});

0 commit comments

Comments
 (0)