Skip to content

Commit

Permalink
Merge branch 'release/20.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
fabmiz committed Jul 1, 2020
2 parents 0e16d7b + e6c5337 commit 0334f28
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 42 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [20.7.0] - 2020-07-01
## Added
- user metrics CSV export on the institutional dashboard

## [20.6.1] - 2020-06-29
## Fixed
- broken UI due to `ember-responsive` ignoring our `app/breakpoints.ts`
Expand Down Expand Up @@ -1615,7 +1619,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Added
- Quick Files

[Unreleased]: https://github.com/CenterForOpenScience/ember-osf-web/compare/20.6.1...develop
[Unreleased]: https://github.com/CenterForOpenScience/ember-osf-web/compare/20.7.0...develop
[20.7.0]: https://github.com/CenterForOpenScience/ember-osf-web/releases/tag/20.7.0
[20.6.1]: https://github.com/CenterForOpenScience/ember-osf-web/releases/tag/20.6.1
[20.6.0]: https://github.com/CenterForOpenScience/ember-osf-web/releases/tag/20.6.0
[20.5.0]: https://github.com/CenterForOpenScience/ember-osf-web/releases/tag/20.5.0
Expand Down
34 changes: 15 additions & 19 deletions app/institutions/dashboard/controller.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,32 @@
import { action, computed } from '@ember/object';
import Controller from '@ember/controller';
import { computed } from '@ember/object';
import { alias } from '@ember/object/computed';
import { inject as service } from '@ember/service';

import Controller from '@ember/controller';
import { InstitutionsDashboardModel } from 'ember-osf-web/institutions/dashboard/route';
import InstitutionModel from 'ember-osf-web/models/institution';
import InstitutionDepartmentModel from 'ember-osf-web/models/institution-department';
import InstitutionSummaryMetricModel from 'ember-osf-web/models/institution-summary-metric';
import CurrentUser from 'ember-osf-web/services/current-user';
import { addQueryParam } from 'ember-osf-web/utils/url-parts';

export default class InstitutionsDashboardController extends Controller {
@service currentUser!: CurrentUser;

@alias('model.taskInstance.value') modelValue?: InstitutionsDashboardModel;
@alias('modelValue.institution') institution?: InstitutionModel;
@alias('modelValue.summaryMetrics') summaryMetrics?: InstitutionSummaryMetricModel;
@alias('modelValue.departmentMetrics') departmentMetrics?: InstitutionDepartmentModel[];
@alias('modelValue.totalUsers') totalUsers?: number;

csvImgSrc: string = '/assets/images/institutions/csv.svg';

// TODO: add csv link back when ENG-1810 is done
@computed('institution.links.csv')
get csvHref() {
// return this.institution ? this.institution.links.csv : '#';
return '#';
}

@action
onCsvButtonMouseEnter() {
this.set('csvImgSrc', '/assets/images/institutions/csv-hover.svg');
}

@action
onCsvButtonMouseLeave() {
this.set('csvImgSrc', '/assets/images/institutions/csv.svg');
@computed('institution')
get csvHref(): string {
const { institution } = this;
if (institution) {
const url = institution.hasMany('userMetrics').link();
return addQueryParam(url, 'format', 'csv');
}
return '';
}
}

Expand Down
1 change: 1 addition & 0 deletions app/institutions/dashboard/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
}

.csv-button {
display: inline-block;
width: 40px;
height: 40px;
background: #fff;
Expand Down
23 changes: 10 additions & 13 deletions app/institutions/dashboard/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,17 @@
/>
</div>
<div local-class='panel-wrapper'>
{{!-- TODO: comment this back in when ENG-1810 is implemented + tested + merged--}}
{{!-- <OsfLink
data-analytics-name='Download CSV'
class='btn btn-primary'
local-class='csv-button'
@target='_blank'
@href={{this.csvHref}}
onmouseenter={{action 'onCsvButtonMouseEnter'}}
onmouseleave={{action 'onCsvButtonMouseLeave'}}
>
<img src={{this.csvImgSrc}}
alt={{t 'institutions.dashboard.download_csv'}}
{{#if this.csvHref}}
<OsfLink
data-analytics-name='Download CSV'
aria-label={{t 'institutions.dashboard.download_csv'}}
local-class='csv-button'
download='user-metrics.csv'
@href={{this.csvHref}}
>
</OsfLink> --}}
<FaIcon @icon='table' />
</OsfLink>
{{/if}}
<Institutions::Dashboard::-Components::Panel
local-class='sso-users-connected'
@isLoading={{this.model.taskInstance.isRunning}}
Expand Down
7 changes: 1 addition & 6 deletions app/models/institution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,12 @@ import InstitutionSummaryMetricModel from 'ember-osf-web/models/institution-summ
import InstitutionDepartmentsModel from './institution-department';
import InstitutionUserModel from './institution-user';
import NodeModel from './node';
import OsfModel, { OsfLinks } from './osf-model';
import OsfModel from './osf-model';
import RegistrationModel from './registration';
import UserModel from './user';

const { attr, belongsTo, hasMany } = DS;

export interface InstitutionLinks extends OsfLinks {
csv: string;
}

/* eslint-disable camelcase */
export interface Assets {
banner?: string;
Expand All @@ -30,7 +26,6 @@ export interface Department {
}

export default class InstitutionModel extends OsfModel {
@attr() links!: InstitutionLinks;
@attr('string') name!: string;
@attr('fixstring') description!: string;
@attr('string') authUrl!: string;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-osf-web",
"version": "20.6.1",
"version": "20.7.0",
"description": "Ember front-end for the Open Science Framework",
"license": "Apache-2.0",
"author": "Center for Open Science <[email protected]>",
Expand Down
1 change: 0 additions & 1 deletion public/assets/images/institutions/csv-hover.svg

This file was deleted.

1 change: 0 additions & 1 deletion public/assets/images/institutions/csv.svg

This file was deleted.

0 comments on commit 0334f28

Please sign in to comment.