Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

send whole url string in email link #1464

Merged
merged 2 commits into from
Apr 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions backend/packages/Upgrade/src/api/services/AnalyticsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,42 +291,41 @@ export class AnalyticsService {
break;
}
}
logsUser[userId][queryId] = metricKey[0] + ": " + logsUser[userId][queryId]
logsUser[userId][queryId] = metricKey[0] + ': ' + logsUser[userId][queryId];
}
}
}
// merge with data
const csvRows = csvExportData.map((row) => {
const queryObject = logsUser[row.userId];
const queryDataToAdd = {};
let postRule = "";
let revertToCondition = "";
let postRule = '';
let revertToCondition = '';

for (const queryId in queryObject) {
if (queryObject[queryId]) {
queryDataToAdd[queryNameIdMapping[queryId]] = queryObject[queryId];
}
}
if (row.postRule === "assign") {
if (row.postRule === 'assign') {
if (row.revertTo !== null) {
revertToCondition = row.revertTo;
} else {
revertToCondition = "Default";
revertToCondition = 'Default';
}
postRule = "Assign: " + revertToCondition;
postRule = 'Assign: ' + revertToCondition;
} else {
postRule = "Continue";

postRule = 'Continue';
}

let excludeIfReached = "FALSE";
let excludeIfReached = 'FALSE';
if (row.excludeIfReached) {
excludeIfReached = "TRUE";
excludeIfReached = 'TRUE';
}

let stratification = "NA";
let stratification = 'NA';
if (row.stratification && row.stratificationValue) {
stratification = row.stratification + ": " + row.stratificationValue;
stratification = row.stratification + ': ' + row.stratificationValue;
}
return {
ExperimentId: row.experimentId,
Expand All @@ -347,7 +346,9 @@ export class AnalyticsService {
Payload: row.payload ? row.payload : row.conditionName,
PostRule: postRule,
EnrollmentStartDate: new Date(row.enrollmentStartDate).toISOString(),
EnrollmentCompleteDate: row.enrollmentCompleteDate? new Date(row.enrollmentCompleteDate).toISOString(): "",
EnrollmentCompleteDate: row.enrollmentCompleteDate
? new Date(row.enrollmentCompleteDate).toISOString()
: '',
MarkExperimentPointTime: new Date(row.markExperimentPointTime).toISOString(),
EnrollmentCode: row.enrollmentCode,
ExclusionCode: row.exclusionCode,
Expand Down Expand Up @@ -430,7 +431,7 @@ export class AnalyticsService {
<br>
Here is the exported experiment data:
<br>
<a href="${signedURLMonitored[0]}">Monitored Experiment Data</a>`;
<a href="${signedURLMonitored}">Monitored Experiment Data</a>`;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the only actual change yeah? makes sense to me.


const emailSubject = `Exported Data for the experiment: ${experiment.name}`;
// send email to the user
Expand Down
Loading