Skip to content

Show empty dashboard panels for fresh installs#10503

Open
Montekkundan wants to merge 1 commit into
aces:mainfrom
Montekkundan:montek/10426-dashboard-empty-state
Open

Show empty dashboard panels for fresh installs#10503
Montekkundan wants to merge 1 commit into
aces:mainfrom
Montekkundan:montek/10426-dashboard-empty-state

Conversation

@Montekkundan
Copy link
Copy Markdown
Contributor

Brief summary of changes

  • Shows empty Recruitment and Study Progression dashboard panels when no participant data has been collected yet.
  • Adds localized No data collected yet strings for the Statistics locale files.

Testing instructions (if applicable)

  • On the Dashboard with zero active candidates, confirm the Statistics widget shows Recruitment — Overall | Total Participants: 0 with No data collected yet.
  • Confirm a separate Study Progression panel also shows No data collected yet.

Link(s) to related issue(s)

@github-actions github-actions Bot added Language: Javascript PR or issue that update Javascript code Module: statistics PR or issue related to statistics module Multilingual Any tasks related to making LORIS multilingual labels May 19, 2026
@Montekkundan Montekkundan force-pushed the montek/10426-dashboard-empty-state branch from 1622610 to 01890d1 Compare May 19, 2026 18:22
@skarya22 skarya22 self-assigned this May 29, 2026
@skarya22 skarya22 self-requested a review May 29, 2026 15:28
Copy link
Copy Markdown
Contributor

@skarya22 skarya22 left a comment

Choose a reason for hiding this comment

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

Little cleanup. Looks good though!

Comment on lines +383 to +393
<Panel
title={
t('Recruitment', {ns: 'statistics'})
+ ' — '
+ t('Overall', {ns: 'statistics'})
+ ' | '
+ t(
'Total Participants: {{count}}',
{ns: 'statistics', count: totalParticipants}
)
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can reduce some code by removing the extra details on Recruitment. We don't need the Total Participants since it is 0.

Suggested change
<Panel
title={
t('Recruitment', {ns: 'statistics'})
+ ' — '
+ t('Overall', {ns: 'statistics'})
+ ' | '
+ t(
'Total Participants: {{count}}',
{ns: 'statistics', count: totalParticipants}
)
}
<Panel
title={t('Recruitment', {ns: 'statistics'})}

Comment on lines +21 to +33
/**
* Returns the total number of participants reported by the widget endpoint.
*
* @param {object} data - Widget endpoint data
* @return {number|null} The total participant count, or null before data loads.
*/
const getTotalParticipants = (data) => {
if (!data || !data.recruitment || !data.recruitment.overall) {
return null;
}

return Number(data.recruitment.overall.total_recruitment);
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't need this after the comment below

@skarya22 skarya22 assigned Montekkundan and unassigned skarya22 Jun 1, 2026
@skarya22 skarya22 added the State: Needs work PR awaiting additional work by the author to proceed label Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language: Javascript PR or issue that update Javascript code Module: statistics PR or issue related to statistics module Multilingual Any tasks related to making LORIS multilingual State: Needs work PR awaiting additional work by the author to proceed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Dashboard] Improve fresh install appearance (no raisinbread) - Bad UI without data

2 participants