-
Notifications
You must be signed in to change notification settings - Fork 186
[dashboard | statistics] Add Project Size to dashboard charts #10057
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
Open
jeffersoncasimir
wants to merge
30
commits into
aces:main
Choose a base branch
from
jeffersoncasimir:2025_09_11_project_size_chart
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
e4243a8
[statistics] Cleanup filters and add Registration Date
skarya22 3f14d60
Fix line length
skarya22 8355dd0
Add subtitles to dashboard panels
skarya22 ab499d1
Fix formatting
skarya22 69994e2
Fix tests
skarya22 c45fa23
Fix issue with visit filter + console warning + date_registered
skarya22 22e7083
Reorganize and add age distribution
skarya22 c3b9c24
Fix php formatting
skarya22 8f148d6
Just trying to make phan happy
skarya22 49b9729
Add % to age chart and bigger subtitle
skarya22 7389b4b
Add project size charts + Generalize helpers
jeffersoncasimir 90534f7
Add SQL patch + RB
jeffersoncasimir 1612603
Rename 'Project Size' to 'Dataset Size'
jeffersoncasimir a40e1c7
Fint php lint
jeffersoncasimir 81204c2
Remove commented code
jeffersoncasimir 3c2159a
Fix conflict
jeffersoncasimir 93f133c
Compliance changes
jeffersoncasimir 86c1a80
Lint fixes
jeffersoncasimir 30e5592
Static fixes
jeffersoncasimir d0aa6bb
Satisfy linter
jeffersoncasimir 683709d
Satisfy linter
jeffersoncasimir 08f6a54
Corrected merge change
jeffersoncasimir d3ce416
Remove console.log
jeffersoncasimir eed888b
Rebase to aces/main
jeffersoncasimir 0c89da1
Fix failing static tests
jeffersoncasimir f14630c
Fix failing static tests
jeffersoncasimir cf24d8c
Fix null scenario
jeffersoncasimir f3e66dc
Fix null scenario
jeffersoncasimir 15842fa
Make strings translatable
jeffersoncasimir dccac10
Revert unecessary changes
jeffersoncasimir File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| -- Create cached_data_type table to track different types of cached data | ||
| CREATE TABLE `cached_data_type` ( | ||
| `CachedDataTypeID` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, | ||
| `Name` VARCHAR(255) UNIQUE NOT NULL, | ||
| PRIMARY KEY (`CachedDataTypeID`) | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
|
|
||
| -- Create cached_data table to track cached data | ||
| CREATE TABLE `cached_data` ( | ||
| `CachedDataID` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, | ||
| `CachedDataTypeID` INT(10) UNSIGNED NOT NULL, | ||
| `Value` TEXT NOT NULL, | ||
| `LastUpdate` TIMESTAMP NOT NULL | ||
| DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
| PRIMARY KEY (`CachedDataID`), | ||
| CONSTRAINT `FK_cached_data_type` FOREIGN KEY (`CachedDataTypeID`) | ||
| REFERENCES `cached_data_type` (`CachedDataTypeID`) | ||
| ON UPDATE CASCADE ON DELETE CASCADE | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
|
|
||
| INSERT INTO `cached_data_type` (`Name`) SELECT 'projects_disk_space'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,7 +45,8 @@ const StudyProgression = (props) => { | |
| legend: 'under', | ||
| options: {line: 'line'}, | ||
| chartObject: null, | ||
| titlePrefix: 'Month', | ||
| yLabel: t('Candidates registered', {ns: 'statistics'}), | ||
| titlePrefix: t('Month', {ns: 'loris'}), | ||
| }, | ||
| }, | ||
| 'total_recruitment': { | ||
|
|
@@ -58,7 +59,25 @@ const StudyProgression = (props) => { | |
| legend: '', | ||
| options: {line: 'line'}, | ||
| chartObject: null, | ||
| titlePrefix: 'Month', | ||
| yLabel: t('Candidates registered', {ns: 'statistics'}), | ||
| titlePrefix: t('Month', {ns: 'loris'}), | ||
| }, | ||
| }, | ||
| 'project_sizes': { | ||
| 'size_byproject': { | ||
| sizing: 11, | ||
| title: t('Dataset size breakdown by project', {ns: 'statistics'}), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is also not in the locale files |
||
| filters: '', | ||
| chartType: 'pie', | ||
| dataType: 'pie', | ||
| label: t('Size (GB)', {ns: 'statistics'}), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see this in the .po file, nor .pot file |
||
| units: t('GB', {ns: 'loris'}), | ||
| showPieLabelRatio: false, | ||
| legend: '', | ||
| options: {pie: 'pie', bar: 'bar'}, | ||
| chartObject: null, | ||
| yLabel: t('Size (GB)', {ns: 'statistics'}), | ||
| titlePrefix: t('Project', {ns: 'loris'}), | ||
| }, | ||
| }, | ||
| }); | ||
|
|
@@ -173,9 +192,16 @@ const StudyProgression = (props) => { | |
| {showChart('total_scans', 'scans_bymonth')} | ||
| </div> | ||
| ) : ( | ||
| <p>There have been no scans yet.</p> | ||
| <p>{t('There have been no scans yet.', {ns: 'statistics'})}</p> | ||
| ), | ||
| title: title('Site Scans'), | ||
| subtitle: t( | ||
| 'Total Scans: {{count}}', | ||
| { | ||
| ns: 'statistics', | ||
| count: json['studyprogression']['total_scans'], | ||
| } | ||
| ), | ||
| onToggleFilters: () => setShowFiltersScans((prev) => !prev), | ||
| }, | ||
| { | ||
|
|
@@ -212,11 +238,53 @@ const StudyProgression = (props) => { | |
| {showChart('total_recruitment', 'siterecruitment_bymonth')} | ||
| </div> | ||
| ) : ( | ||
| <p>There have been no candidates registered yet.</p> | ||
| <p> | ||
| {t( | ||
| 'There have been no candidates registered yet.', | ||
| {ns: 'statistics'} | ||
| )} | ||
| </p> | ||
| ), | ||
| title: title('Site Recruitment'), | ||
| onToggleFilters: () => showFiltersBreakdown((prev) => !prev), | ||
| }, | ||
| { | ||
| content: | ||
| Object.keys(json['options']['projects']).length > 0 ? ( | ||
| <div | ||
| style={{ | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| gap: '10px', | ||
| }} | ||
| > | ||
| <div className="btn-group" style={{marginBottom: '10px'}}> | ||
| </div> | ||
| {showFiltersBreakdown && ( | ||
| <QueryChartForm | ||
| Module={'statistics'} | ||
| name={'studyprogression'} | ||
| id={'studyprogressionProjectSizesForm'} | ||
| data={props.data} | ||
| callback={(formDataObj) => { | ||
| updateFilters(formDataObj, 'project_sizes'); | ||
| }} | ||
| /> | ||
| )} | ||
| {showChart('project_sizes', 'size_byproject')} | ||
| </div> | ||
| ) : ( | ||
| <p>{t('There is no data yet.', {ns: 'statistics'})}</p> | ||
| ), | ||
| title: title('Project Dataset Sizes'), | ||
| subtitle: t( | ||
| 'Total Size: {{count}} GB', | ||
| { | ||
| ns: 'statistics', | ||
| count: json['studyprogression']['total_size'] ?? -1, | ||
| } | ||
| ), | ||
| }, | ||
| ]} | ||
| /> | ||
| </> | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.