Skip to content

Commit cc30af4

Browse files
authored
Merge pull request #20 from silx-kit/report
Ask people to send their local file when reporting errors
2 parents aa1ee03 + 8d3423f commit cc30af4

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

src/utils.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,24 @@ export async function resolveFileUrl(
7575
};
7676
}
7777

78+
const INTRO =
79+
'Please introduce yourself (name, organisation, scientific field, etc.)';
80+
81+
function getReportIntro(fileOrUrl?: H5File | string) {
82+
if (
83+
fileOrUrl &&
84+
typeof fileOrUrl !== 'string' &&
85+
fileOrUrl.service === FileService.Local
86+
) {
87+
return `<<<
88+
1. ${INTRO}
89+
2. To help us understand the issue, please send us your HDF5 file (ideally via a file sharing service).
90+
>>>`;
91+
}
92+
93+
return `<<< ${INTRO} >>>`;
94+
}
95+
7896
export function buildMailto(
7997
subject: string,
8098
message: string,
@@ -83,7 +101,7 @@ export function buildMailto(
83101
): string {
84102
const body = `Hi,
85103
86-
<<< Please introduce yourself (name, organisation, scientific field, etc.) >>>
104+
${getReportIntro(fileOrUrl)}
87105
88106
${message}
89107

0 commit comments

Comments
 (0)