Skip to content

Commit

Permalink
Merge branch 'release/0.11.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescdavis committed Jul 30, 2019
2 parents ccc16b2 + 0891be1 commit 487cea7
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 21 deletions.
13 changes: 10 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ 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).

## [0.11.0] - 2019-07-30
### Changed
- add `isWithdrawn` and `version` custom dimensions
- add withdrawal request denial reason

## [0.10.2] - 2019-05-30
- fixed issue where withdrawal request info did not display for auto-accepted preprints
### Fixed
- issue where withdrawal request info did not display for auto-accepted preprints

## [0.10.1] - 2019-05-29
- fixed ENG-431 - Date withdrawn is incorrect on Reviews App
- fixed ENG-553 - Preprint detail page on certain preprints shows incorrect state
### Fixed
- ENG-431 - Date withdrawn is incorrect on Reviews App
- ENG-553 - Preprint detail page on certain preprints shows incorrect state

## [0.10.0] - 2019-04-09
### Added
Expand Down
36 changes: 32 additions & 4 deletions app/components/preprint-status-banner/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { computed } from '@ember/object';
import { alias } from '@ember/object/computed';
import { inject as service } from '@ember/service';
import Component from '@ember/component';
import { validator, buildValidations } from 'ember-cp-validations';
import latestAction from 'reviews/utils/latest-action';

const PENDING = 'pending';
Expand Down Expand Up @@ -106,7 +107,20 @@ const RECENT_ACTIVITY = {
},
};

export default Component.extend({
const RequestDecisionJustificationValidation = buildValidations({
requestDecisionJustification: {
description: 'Request decision justification',
validators: [
validator('presence', true),
validator('length', {
min: 20,
}),
],
disabled: false,
},
});

export default Component.extend(RequestDecisionJustificationValidation, {
i18n: service(),
theme: service(),

Expand All @@ -131,7 +145,8 @@ export default Component.extend({
reviewerComment: '',
decision: ACCEPTED,
decisionValueToggled: false,
withdrawalJustification: alias('withdrawalRequest.comment'),
requestDecisionJustification: '',
didValidate: false,

reviewsWorkflow: alias('submission.provider.reviewsWorkflow'),
reviewsCommentsPrivate: alias('submission.provider.reviewsCommentsPrivate'),
Expand Down Expand Up @@ -327,6 +342,7 @@ export default Component.extend({
}),

didInsertElement() {
this.set('requestDecisionJustification', this.get('withdrawalRequest.comment'));
this.get('submission.reviewActions')
.then(latestAction)
.then(this._handleActions.bind(this));
Expand Down Expand Up @@ -367,8 +383,14 @@ export default Component.extend({
}

let comment = '';
if (trigger === 'accept' && this.get('isPendingWithdrawal')) {
comment = this.get('withdrawalJustification').trim();
if (this.get('isPendingWithdrawal')) {
comment = this.get('requestDecisionJustification').trim();
if (trigger === 'reject') {
this.set('didValidate', true);
if (!this.get('validations.isValid')) {
return;
}
}
} else {
comment = this.get('reviewerComment').trim();
}
Expand All @@ -386,6 +408,12 @@ export default Component.extend({
},
decisionToggled() {
this.get('setUserEnteredReview')(this.get('decisionChanged'));
if (this.get('isPendingWithdrawal') && this.get('decision') === ACCEPTED) {
this.set('requestDecisionJustification', this.get('withdrawalRequest.comment'));
this.set('validations.disabled', true);
} else if (this.get('isPendingWithdrawal') && this.get('decision') === REJECTED) {
this.set('requestDecisionJustification', '');
}
},
commentChanged() {
this.get('setUserEnteredReview')(this.get('commentEdited'));
Expand Down
25 changes: 16 additions & 9 deletions app/components/preprint-status-banner/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,25 @@
<p>{{t declineExplanation}}</p>
</span>
</label>
{{#if (eq decision 'accepted')}}
<label local-class="withdrawal-justification">
<label local-class="withdrawal-justification">
{{#if (eq decision 'accepted')}}
<span class="p-l-sm">
{{t 'components.preprintStatusBanner.withdrawalJustification'}}
</span>
</label>
{{textarea
value=withdrawalJustification
rows="8"
class="form-control"
}}
{{/if}}
{{/if}}
{{#if (eq decision 'rejected')}}
<span class="p-l-sm">
{{t 'components.preprintStatusBanner.denialJustification'}}
</span>
{{/if}}
</label>
{{validated-input
inputType='textarea'
model=this
valuePath='requestDecisionJustification'
rows='8'
showErrorMessage=(and didValidate (eq decision 'rejected'))
}}
</form>
</div>
<div local-class="feedback-footer">
Expand Down
1 change: 1 addition & 0 deletions app/locales/en/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ export default {
withdrawn: 'not publicly available',
},
withdrawalJustification: 'Reason for withdrawal (optional, will be publicly displayed)',
denialJustification: 'Reason for denial (required, not publicly visible)',
pending: 'pending',
accepted: 'accepted',
rejected: 'rejected',
Expand Down
2 changes: 2 additions & 0 deletions config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ module.exports = function(environment) {
authenticated: 'dimension1',
resource: 'dimension2',
isPublic: 'dimension3',
isWithdrawn: 'dimension4',
version: 'dimension5',
},
},
],
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reviews",
"version": "0.10.2",
"version": "0.11.0",
"description": "Center for Open Science Reviews Service",
"license": "Apache-2.0",
"author": "",
Expand All @@ -22,7 +22,7 @@
"use-ember-osf-next-interfaces": "yarn upgrade @centerforopenscience/ember-osf@https://github.com/CenterForOpenScience/ember-osf.git#release/next-interfaces#$(date -u +%FT%TZ)"
},
"devDependencies": {
"@centerforopenscience/ember-osf": "https://github.com/CenterForOpenScience/ember-osf.git#0.24.0",
"@centerforopenscience/ember-osf": "https://github.com/CenterForOpenScience/ember-osf.git#0.26.0",
"@centerforopenscience/eslint-config": "^2.0.0",
"@centerforopenscience/osf-style": "1.9.0",
"@cos-forks/ember-content-placeholders": "https://github.com/cos-forks/ember-content-placeholders#c85cdbeb4b9c206c3f76a92422db76815b2c95bc",
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@
lodash "^4.17.11"
to-fast-properties "^2.0.0"

"@centerforopenscience/ember-osf@https://github.com/CenterForOpenScience/ember-osf.git#0.24.0":
version "0.24.0"
resolved "https://github.com/CenterForOpenScience/ember-osf.git#897bb9f77409f0f77d55ba3d17895b4ea5c01007"
"@centerforopenscience/ember-osf@https://github.com/CenterForOpenScience/ember-osf.git#0.26.0":
version "0.26.0"
resolved "https://github.com/CenterForOpenScience/ember-osf.git#2f413320921bbecf77cd8241c458ddfef55ed6fe"
dependencies:
broccoli-funnel "1.2.0"
broccoli-merge-trees "2.0.0"
Expand Down

0 comments on commit 487cea7

Please sign in to comment.