Skip to content

Commit 3998b56

Browse files
committed
Merge branch 'hotfix/21.10.1'
2 parents 1ce5948 + 1a54747 commit 3998b56

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

lib/osf-components/addon/components/node-card/component.ts

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,32 @@ export default class NodeCard extends Component {
7878
}
7979
}
8080

81+
get shouldAllowUpdate() {
82+
if (this.node instanceof RegistrationModel) {
83+
return (
84+
this.node.reviewsState === RegistrationReviewStates.Accepted ||
85+
this.node.reviewsState === RegistrationReviewStates.Embargo
86+
);
87+
}
88+
return false;
89+
}
90+
8191
get shouldShowViewChangesButton() {
8292
if (this.node instanceof RegistrationModel) {
83-
return this.node.revisionState === RevisionReviewStates.RevisionInProgress ||
84-
this.node.revisionState === RevisionReviewStates.RevisionPendingModeration;
93+
return this.shouldAllowUpdate &&
94+
(
95+
this.node.revisionState === RevisionReviewStates.RevisionInProgress ||
96+
this.node.revisionState === RevisionReviewStates.RevisionPendingModeration ||
97+
this.node.revisionState === RevisionReviewStates.Unapproved
98+
);
8599
}
86100
return false;
87101
}
88102

89103
get shouldShowUpdateButton() {
90104
if (this.node instanceof RegistrationModel && this.node.userHasAdminPermission) {
91105
return this.node.revisionState === RevisionReviewStates.Approved &&
92-
(
93-
this.node.reviewsState === RegistrationReviewStates.Accepted ||
94-
this.node.reviewsState === RegistrationReviewStates.Embargo
95-
);
106+
this.shouldAllowUpdate;
96107
}
97108
return false;
98109
}

0 commit comments

Comments
 (0)