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

Dev #474

Merged
merged 9 commits into from
Aug 6, 2024
Merged
8 changes: 5 additions & 3 deletions libs/api/custom-reports/src/lib/custom-reports.strategies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,11 @@ export function decomposeConfig(config: ReportConfig<Date>) {
const chunkedUrls = chunkMap(urls, (url) => url, 50);

const queries = dateRanges.flatMap((dateRange) =>
!grouped && breakdownDimension
? urls.map((url) => toQueryConfig(dateRange, [url]))
: chunkedUrls.map((url) => toQueryConfig(dateRange, url)),
grouped
? [toQueryConfig(dateRange, urls)]
: breakdownDimension
? urls.map((url) => toQueryConfig(dateRange, [url]))
: chunkedUrls.map((url) => toQueryConfig(dateRange, url)),
);

return queries.map((query) => ({
Expand Down
12 changes: 12 additions & 0 deletions libs/upd/components/src/lib/apex-bar/apex.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ export class ApexStore extends ComponentStore<ChartOptions> {
...state.chart,
stacked: value?.isStacked,
stackType: value?.isStacked100 ? '100%' : undefined,
// update for more than 2 series
height: 175
},
dataLabels: {
enabled: value?.hasDataLabels,
Expand All @@ -138,7 +140,17 @@ export class ApexStore extends ComponentStore<ChartOptions> {
? `${val}%`
: `${val} %`;
},
show: false,
},
crosshairs: {
show: false,
},
axisTicks: {
show: false
},
axisBorder: {
show: false
}
},
yaxis: {
...state.yaxis,
Expand Down
1 change: 1 addition & 0 deletions libs/upd/i18n/src/lib/translations/en-CA.json
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,7 @@
"Overview | Page feedback": "UPD | Overview | Page feedback",
"Overview | Call drivers": "UPD | Overview | Call drivers",
"Overview | UX tests": "UPD | Overview | UX tests",
"Overview | GC Tasks": "UPD | Overview | GC tasks",
"Tasks | Home": "UPD | Tasks | Home",
"Tasks | Summary": "UPD | Tasks | Summary",
"Tasks | Web traffic": "UPD | Tasks | Web traffic",
Expand Down
1 change: 1 addition & 0 deletions libs/upd/i18n/src/lib/translations/fr-CA.json
Original file line number Diff line number Diff line change
Expand Up @@ -1427,6 +1427,7 @@
"Overview | Page feedback": "TBPC | Aperçu | Rétroaction sur la page",
"Overview | Call drivers": "TBPC | Aperçu | Facteurs générateurs d'appels",
"Overview | UX tests": "TBPC | Aperçu | Essais sur l'expérience utilisateur",
"Overview | GC Tasks": "TBPC | Aperçu | Sondage sur la reussite des tâches du GC",
"Tasks | Home": "TBPC | Tâches | Accueil",
"Tasks | Summary": "TBPC | Tâches | Résumé",
"Tasks | Web traffic": "TBPC | Tâches | Trafic Web",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -775,16 +775,32 @@ export class ProjectsDetailsFacade {
}),
);


totalParticipants$ = this.projectsDetailsData$.pipe(
map((data) => {

const uxTests = data?.taskSuccessByUxTest;

if (!uxTests || !uxTests.length) {
return 0;
const maxUsersByType: Record<string, number> = {};

for (const { test_type, total_users = 0 } of uxTests) {
if (test_type) {
maxUsersByType[test_type] = Math.max(
maxUsersByType[test_type] || 0,
total_users,
);
}
}

return Math.max(...uxTests.map((test) => test.total_users || 0));
}),
const totalUsers = Object.values(maxUsersByType).reduce(
(accumulator, value) =>
accumulator + value,
0,
);
return totalUsers;

},
)
);

feedbackTotalComments$ = this.projectsDetailsData$.pipe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -671,27 +671,53 @@ export class TasksDetailsFacade {
}),
);




totalParticipants$ = this.tasksDetailsData$.pipe(
map((data) => {
const uxTests = data?.taskSuccessByUxTest;

const maxTotalUsersByTitle = uxTests.reduce<Record<string, number>>(
const uxTests = data?.taskSuccessByUxTest || [];
const maxTotalUsersByValidation = uxTests.reduce<Record<string, number>>(
(acc, test) => {
acc[test.title] = Math.max(
acc[test.title] || 0,
test.total_users || 0,
);
if (test.test_type === 'Validation') {
acc[test.title] = Math.max(
acc[test.title] || 0,
test.total_users || 0,
);
}
return acc;
},
{},
);

return Object.values(maxTotalUsersByTitle).reduce(

const maxTotalUsersByNonValidation = uxTests.reduce<Record<string, number>>(
(acc, test) => {
if (test.test_type !== 'Validation') {
acc[test.title] = Math.max(
acc[test.title] || 0,
test.total_users || 0,
);
}
return acc;
},
{},
);
const validationSum = Object.values(maxTotalUsersByValidation).reduce(
(sum, val) => sum + val,
0,
);

const nonValidationSum = Object.values(maxTotalUsersByNonValidation).reduce(
(sum, val) => sum + val,
0,
);

return validationSum + nonValidationSum;
}),
);



feedbackTotalComments$ = this.tasksDetailsData$.pipe(
map((data) => data?.numComments || 0),
Expand Down
Loading