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

[ENG-5024] feature/insti-dash-improv #2395

Merged
merged 110 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
f8b6683
[ENG-6074] Rework institutions dashboard page (#2289)
futa-ikeda Aug 20, 2024
9b3174a
update user model for institutional dashboard (#2299)
Johnetordoff Aug 26, 2024
6028288
[ENG-6078][ENG-6080] Link to past reports (#2296)
futa-ikeda Aug 26, 2024
1ef837e
Link to reports updates (#2302)
futa-ikeda Aug 30, 2024
5cc1654
[ENG-6116] Sort User Columns for Institutional Dashboard User table (…
Johnetordoff Sep 9, 2024
8dbbb81
[ENG-6181] Update search mirage view (#2318)
futa-ikeda Sep 10, 2024
f6311c4
[ENG-6117] Add Filter for Orcid on Instutional Dashboard (#2315)
Johnetordoff Sep 11, 2024
28f7b48
[ENG-6194] Add functionality to show/hide certain columns in table (#…
Johnetordoff Sep 12, 2024
ad2647a
match dropdown select colors and details
Sep 13, 2024
ae93ff2
add total user label to user list
Sep 13, 2024
9de661e
clean-up for CR
Sep 17, 2024
403b884
Added a new total count kpi
bp-cos Aug 27, 2024
c852096
Added a new test and removed an old one
bp-cos Sep 3, 2024
e4267ce
Fixed some api issues
bp-cos Sep 17, 2024
168e260
Removed old tests
bp-cos Sep 17, 2024
08dd57f
Merge branch 'feature/insti-dash-improv' of https://github.com/Center…
Sep 17, 2024
e7a3496
Updates to add the project total
bp-cos Sep 17, 2024
61f0429
Added a test with test-data elements
bp-cos Sep 18, 2024
1671617
Merge branch 'feature/insti-dash-improv' of https://github.com/Center…
Sep 19, 2024
e3e1c76
make clicking apply close dropdown and make table scrollable for mobile
Sep 19, 2024
7921928
tweak slider animation
Sep 19, 2024
2a9cbc7
Updated the model
bp-cos Sep 18, 2024
7361501
Added all the new attributes
bp-cos Sep 19, 2024
84859d0
make user table always scrollable
Sep 20, 2024
bc05082
updated the mirage institution and institution-summary-metric factory
bp-cos Sep 18, 2024
8052f7f
Added the new attributes to the mirage files
bp-cos Sep 20, 2024
ac605ac
Updates to make mirage numbers more realistic
bp-cos Sep 20, 2024
25d34a4
Merge pull request #2327 from Johnetordoff/improve-mobile-styling-ins…
Johnetordoff Sep 20, 2024
eed4a4d
Added the dynamic registration data to the component and fixed the tests
bp-cos Sep 18, 2024
e98cdc2
Added the dynamic preprint data to the component and fixed the tests
bp-cos Sep 18, 2024
8add1f9
Updates to css and html
bp-cos Sep 18, 2024
b68e7a7
Merge branch 'develop' into feature/insti-dash-improv
futa-ikeda Sep 23, 2024
fdc3cb7
[ENG-6182] Add table to projects tab (#2335)
futa-ikeda Sep 24, 2024
a9056a2
[ENG-6183] Project list filtering (#2345)
futa-ikeda Oct 7, 2024
f3d5e19
Added a new doughnut component
bp-cos Oct 1, 2024
f14f292
Fixed the mobile formatting and made the graphs dynamic
bp-cos Oct 2, 2024
72ea5a3
Updates for all the love
bp-cos Oct 2, 2024
d8f54d6
Added a very rudimentary test for the chart-kpi wrapper
bp-cos Oct 3, 2024
0f41eab
Added some more tests
bp-cos Oct 3, 2024
c7ffc35
Added additional tests and more dynamic data
bp-cos Oct 7, 2024
d4a3e4f
Minor updates for comments
bp-cos Oct 8, 2024
8596ddc
Removed a pauseTeset
bp-cos Oct 8, 2024
3259cfd
[ENG-6184] Allow sorting for project list (#2348)
futa-ikeda Oct 9, 2024
f5a8b13
Added the registration chart
bp-cos Oct 8, 2024
735e45a
Added total osf projects
bp-cos Oct 8, 2024
e07510e
Added licenses and updated tests
bp-cos Oct 8, 2024
763cc02
Added add-ons and storage regions
bp-cos Oct 8, 2024
9bc8adf
Added data storage
bp-cos Oct 8, 2024
658e0e3
Finished the kpis
bp-cos Oct 10, 2024
afedf85
Added the correct chart types
bp-cos Oct 10, 2024
17c2216
Added a new util for human readable bytes to the model
bp-cos Oct 10, 2024
0dd3be5
[ENG-6328] Show hide cols (#2350)
futa-ikeda Oct 11, 2024
449b9a8
fix preprint typo for institutional dashboard
Oct 14, 2024
411f63e
Merge pull request #2354 from Johnetordoff/fix-preprints
Johnetordoff Oct 15, 2024
72ca3cf
make total user count dynamic for the user tab
Oct 18, 2024
73268f9
Update month data fields to be strings (#2358)
futa-ikeda Oct 18, 2024
651c7a4
Merge pull request #2359 from Johnetordoff/update-total-user-for-dash…
Johnetordoff Oct 18, 2024
faa9268
[ENG-6368] Share summary graphs (#2361)
futa-ikeda Oct 23, 2024
6e42b4d
[ENG-6246][ENG-6269][ENG-6275] Add new property fields to mirage (#2…
futa-ikeda Oct 23, 2024
91c1fc9
add basic fancy pagination
Oct 24, 2024
54de8fc
Merge branch 'feature/insti-dash-improv' of https://github.com/Center…
Oct 24, 2024
325f2e5
[ENG-6192] Summary tab styling (#2355)
futa-ikeda Oct 24, 2024
0349d7f
add better styling
Oct 24, 2024
16db640
sync translations and fix linting issues
Oct 24, 2024
7a98abe
fix number from squishing on mobile
Oct 24, 2024
fd6a1e4
make paginator configurable
Oct 25, 2024
1c5a7a8
make sure preprint tab isn't hidden and apply button is always visibl…
Oct 25, 2024
628e460
[ENG-6270][ENG-6273][ENG-6274] Add registration table (#2362)
futa-ikeda Oct 25, 2024
3be1637
Merge pull request #2364 from Johnetordoff/fix-mobile-users-count-das…
Johnetordoff Oct 25, 2024
764a97c
fix css name
Oct 28, 2024
f384399
fix css vars to use names
Oct 28, 2024
af37f8d
Merge branch 'feature/insti-dash-improv' of https://github.com/Center…
Oct 28, 2024
5439883
Merge pull request #2363 from Johnetordoff/add-fancy-pagination-buttons
Johnetordoff Oct 28, 2024
ce77e65
improve responsive design for Apply button
Oct 28, 2024
0f763ff
Merge pull request #2366 from Johnetordoff/insti-dashboard-mobile-fixes
Johnetordoff Oct 28, 2024
defd028
[ENG-6276][ENG-6277][ENG-6278] Add Preprints table (#2370)
futa-ikeda Oct 30, 2024
500d9c7
make null dates appear as N/A
Oct 31, 2024
5b6af65
remove table wrapper and fix pagination
Oct 31, 2024
05147b1
Merge pull request #2371 from Johnetordoff/dashboard-demo-feedback
Johnetordoff Oct 31, 2024
b785d5c
Fix reroute to not-found (#2375)
futa-ikeda Nov 1, 2024
a39b12c
[ENG-6419] Share integration (#2377)
futa-ikeda Nov 5, 2024
0a3b593
Fix how index-value-search qps are passed (#2379)
futa-ikeda Nov 5, 2024
4320073
[No ticket] Update language and counts on summary page (#2381)
futa-ikeda Nov 7, 2024
10140b7
Prevent modifying args.defaultQueryOptions when adding filters (#2382)
futa-ikeda Nov 7, 2024
3931250
Hide right panel properly on desktop view (#2383)
futa-ikeda Nov 7, 2024
0efac04
[ENG-6419] Update SHARE getters (#2384)
futa-ikeda Nov 7, 2024
4c26c7b
move archive link button to each tab and add a download button
Nov 11, 2024
c4f364d
Fix issue when applying multiple filters of a kind (#2387)
futa-ikeda Nov 11, 2024
bd40d53
move around tests to reflect new behavior
Nov 12, 2024
a3dd9ac
Merge pull request #2386 from Johnetordoff/add-download-dashboard-but…
Johnetordoff Nov 12, 2024
1731732
Fix bug where value-searches did not contain all filters applied (#2388)
futa-ikeda Nov 12, 2024
00fef7a
Merge branch 'develop' into feature/insti-dash-improv
futa-ikeda Nov 12, 2024
4877062
Remove old components (#2389)
futa-ikeda Nov 12, 2024
83c4a77
Update no data placeholder text (#2390)
futa-ikeda Nov 14, 2024
54f13d2
Avoid fetching components for projects and registrations tab (#2392)
futa-ikeda Nov 14, 2024
54ebbf1
Add ability to sort by storageByteCount (#2391)
futa-ikeda Nov 14, 2024
3a51a9e
Pagination machination (#2393)
futa-ikeda Nov 14, 2024
f5ced50
Limit institution banner image size (#2394)
futa-ikeda Nov 15, 2024
1cc765f
Bring back a local-class that got removed (#2396)
futa-ikeda Nov 15, 2024
46ea031
[ENG-6401] Mobile styling (#2398)
futa-ikeda Nov 18, 2024
fe98821
Move boolean filters into group (#2399)
futa-ikeda Nov 18, 2024
fbc17d9
Allow users to sort by view and download count (#2400)
futa-ikeda Nov 18, 2024
07a94db
Implement boolean filters correctly (#2402)
futa-ikeda Nov 19, 2024
2405c48
Update projects/registrations/preprints table to have title link to p…
futa-ikeda Nov 19, 2024
54b4eb9
Show orcid in user list table (#2403)
futa-ikeda Nov 19, 2024
6c2996b
A11y (#2404)
futa-ikeda Nov 19, 2024
c71eb9f
Add placeholder if user has no ORCID (#2405)
futa-ikeda Nov 19, 2024
30b2b8e
Remove tooltip from summary kpi (#2406)
futa-ikeda Nov 19, 2024
684c877
[ENG-6567][ENG-6598] Fix dropdown placement for mobile (#2408)
futa-ikeda Nov 20, 2024
7955075
Rewrite hasOsfmapValue based on earlier suggestion (#2407)
futa-ikeda Nov 20, 2024
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
2 changes: 1 addition & 1 deletion app/adapters/share-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const osfUrl = config.OSF.url;

export default class ShareAdapter extends JSONAPIAdapter {
host = config.OSF.shareBaseUrl.replace(/\/$/, ''); // Remove trailing slash to avoid // in URLs
namespace = 'api/v3';
namespace = 'trove';

queryRecord(store: any, type: any, query: any) {
// check if we aren't serving locally, otherwise add accessService query param to card/value searches
Expand Down
37 changes: 2 additions & 35 deletions app/guid-node/registrations/styles.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// stylelint-disable max-nesting-depth, selector-max-compound-selectors
@import 'app/styles/components';

.registration-container {
margin: 30px;
Expand All @@ -19,41 +20,7 @@

/* stylelint-disable selector-no-qualifying-type */
ul.tab-list {
margin-bottom: 10px;
border-bottom: 1px solid #ddd;
box-sizing: border-box;
color: rgb(51, 51, 51);
display: block;
line-height: 20px;
list-style-image: none;
list-style-position: outside;
list-style-type: none;
height: 41px;
padding: 0;
}

/* stylelint-enable selector-no-qualifying-type */
.tab-list {
li {
display: block;
position: relative;
margin-bottom: -1px;
float: left;
height: 41px;
padding: 10px 15px;
}

li:global(.ember-tabs__tab--selected) {
background-color: #f8f8f8;
border-bottom: 2px solid #204762;
}

li:hover {
border-color: transparent;
text-decoration: none;
background-color: #f8f8f8;
color: var(--primary-color);
}
@include tab-list;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
import { click, render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
import { setupMirage } from 'ember-cli-mirage/test-support';
import { setupIntl } from 'ember-intl/test-support';
import { setupRenderingTest } from 'ember-qunit';
import { TestContext } from 'ember-test-helpers';
import { module, test } from 'qunit';

module('Integration | institutions | dashboard | -components | chart-kpi', hooks => {
setupRenderingTest(hooks);
setupMirage(hooks);
setupIntl(hooks);

hooks.beforeEach(function(this: TestContext) {
const data = Object({
title: 'This is the title',
chartData: [
Object({
label: 'a very long data set title that needs to be handled',
total: 100000,
}),
],
chartType: 'pie',
});

this.set('data', data);
});

test('it renders the data correctly', async assert => {

// Given the component is rendered
await render(hbs`
<Institutions::Dashboard::-Components::ChartKpiWrapper::ChartKpi
@data={{this.data}}
/>
`);
// Then the chart is verified
assert.dom('[data-test-chart]')
.exists('The test chart exists');

// And the title is verified
assert.dom('[data-test-chart-title]')
.hasText('This is the title');

assert.dom('[data-test-toggle-icon]')
.hasAttribute('data-icon', 'caret-down');

// Finally the expanded data is not visible
assert.dom('[data-test-expansion-data]')
.hasStyle({display: 'none'});
});

test('it renders the expanded data correctly', async assert => {

// Given the component is rendered
await render(hbs`
<Institutions::Dashboard::-Components::ChartKpiWrapper::ChartKpi
@data={{this.data}}
/>
`);
// When I click the expanded icon
await click('[data-test-expand-additional-data]');

// Then I verify the icon has changed
assert.dom('[data-test-toggle-icon]')
.hasAttribute('data-icon', 'caret-up');

// And the expanded data is visible
assert.dom('[data-test-expansion-data]')
.exists('The expansion data is visible');

// And the expanded data position 0 color is verified
assert.dom('[data-test-expanded-color="0"]')
.hasAttribute('style', 'background-color:#00D1FF');

// And the expanded data position 0 name is verified
assert.dom('[data-test-expanded-name="0"]')
.hasText('a very long data set title that needs to be handled');

// And the expanded data position 0 total is verified
assert.dom('[data-test-expanded-total="0"]')
.hasText('100000');
});

/**
* I need to determine if this is going to be a feature or not
test('it renders the without data correctly', async function(this: EnginesIntlTestContext, assert) {
const data = Object({
total: 0,
title: 'This is the title',
icon: 'building',
});

this.set('data', data);


await render(hbs`
<Institutions::Dashboard::-Components::ChartKpiWrapper::ChartKpi
@data={{this.data}}
/>
`);

assert.dom('[data-test-kpi-title]')
.hasText('This is the title');
assert.dom('[data-test-kpi-data]')
.hasText('No data for institution found.');
assert.dom('[data-test-kpi-icon]')
.hasAttribute('data-icon', 'building');
});
*/
Comment on lines +85 to +110
Copy link
Contributor

Choose a reason for hiding this comment

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

Have we determined if this is a feature or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems this won't be needed, so will address this in a follow-up PR as well

});
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
import Component from '@glimmer/component';
import { action } from '@ember/object';
import { inject as service } from '@ember/service';
import { tracked } from '@glimmer/tracking';
import { ChartData, ChartOptions } from 'ember-cli-chart';
import Intl from 'ember-intl/services/intl';
// eslint-disable-next-line max-len
import { ChartDataModel, KpiChartModel } from 'ember-osf-web/institutions/dashboard/-components/chart-kpi-wrapper/component';

interface KPIChartWrapperArgs {
data: KpiChartModel;
}

interface DataModel {
name: string;
total: number;
color: string;
}

export default class ChartKpi extends Component<KPIChartWrapperArgs> {
@service intl!: Intl;

@tracked collapsed = true;
@tracked expandedData = [] as DataModel[];

/**
* chartOptions
*
* @description A getter for the chartjs options
*
* @returns a ChartOptions model which is custom to COS
*/
get chartOptions(): ChartOptions {
const options = {
aspectRatio: 1,
legend: {
display: false,
},
scales: {
xAxes: [{
display: false,
}],
yAxes: [{
display: false,
ticks: { min: 0 },
}],
},
};
if (this.args.data.chartType === 'bar') {
options.scales.yAxes[0].display = true;
}
return options;
}

/**
* getColor
*
* @description Gets a specific color using a modulus
*
* @param index The index to retrieve
*
* @returns the color
*/
private getColor(index: number): string {
const backgroundColors = [
'#00D1FF',
'#009CEF',
'#0063EF',
'#00568D',
'#004673',
'#00375A',
'#263947',
];

return backgroundColors[index % backgroundColors.length];
}

/**
* chartData
*
* @description Transforms the standard chart data into data the charts can display
*
* @returns void
*/
get chartData(): ChartData {
const backgroundColors = [] as string[];
const data = [] as number[];
const labels = [] as string[];
const { taskInstance, chartData } = this.args.data;

const rawData = taskInstance?.value || chartData || [];

rawData.forEach((rawChartData: ChartDataModel, $index: number) => {
backgroundColors.push(this.getColor($index));

data.push(rawChartData.total);
labels.push(rawChartData.label);
this.expandedData.push({
name: rawChartData.label,
total: rawChartData.total,
color: this.getColor($index),
});
});
return {
labels,
datasets: [{
data,
fill: false,
backgroundColor: backgroundColors,
}],
};
}

@action
public toggleExpandedData() {
this.collapsed = !this.collapsed;
}
}
Loading
Loading