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

Pull from Staging #349

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
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
54 changes: 32 additions & 22 deletions helper/chart_data_v3.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,23 +378,28 @@ exports.entityReportChart = async function (data, entityId, entityType, reportTy
//sort the response objects based on questionExternalId field
await response.reportSections.sort(getSortOrder("order")); //Pass the attribute to be sorted on

response.filters = [{
order: "",
filter: {
type: "dropdown",
title: "",
keyToSend: "submissionId",
data: submissions
}
},{
response.filters = [];
if (submissions.length > 1) {
response.filters.push({
order: "",
filter: {
type: "dropdown",
title: "",
keyToSend: "submissionId",
data: submissions
}
});
}

response.filters.push({
order: "",
filter: {
type: "segment",
title: "",
keyToSend: "criteriaWise",
data: ["questionWise","criteriaWise"]
}
}]
});

if (!reportType || reportType == filesHelper.survey) {
// Get the questions array
Expand Down Expand Up @@ -962,23 +967,28 @@ exports.entityScoreReportChartObjectCreation = async function (data, reportType)
//sort the response objects using questionExternalId field
await response.reportSections.sort(getSortOrder("order")); //Pass the attribute to be sorted on

response.filters = [{
order: "",
filter: {
type: "dropdown",
title: "",
keyToSend: "submissionId",
data: submissions
},
},{
response.filters = [];
if ( submissions.length > 1 ) {
response.filters.push({
order: "",
filter: {
type: "dropdown",
title: "",
keyToSend: "submissionId",
data: submissions
},
});
}

response.filters.push({
order: "",
filter: {
type: "segment",
title: "",
keyToSend: "criteriaWise",
data: ["questionWise","criteriaWise"]
}
}]
});

if (!reportType) {
// Get the question array
Expand Down Expand Up @@ -1526,15 +1536,15 @@ exports.entityLevelReportData = async function (data) {
return resolve({
result : result,
submissionId: latestSubmissionId,
filters : [{
filters : submissions.length > 1 ? [{
order: "",
filter: {
type: "dropdown",
title: "",
keyToSend: "submissionId",
data: submissions
},
}]
}] : []


});
Expand Down