Skip to content
Permalink
Browse files

Fixes for the contest phase attribute on proposal contest phase param…

…eters being switched
  • Loading branch information...
carlosbpf committed Oct 11, 2019
1 parent c4b65f8 commit a38ea9dcc9d9b0671c7246ba0978aea61a9e3219
@@ -206,7 +206,7 @@ public ContestPhasePromoteType getContestPhaseAutopromoteEnum() {
public Boolean getProposalVisibility(long proposalId) {
IProposalPhaseClient proposalPhaseClient = StaticProposalContext.getProposalPhaseClient();
IProposalContestPhaseAttribute attr = proposalPhaseClient
.getProposalContestPhaseAttribute(proposalId, this.getId(),
.getProposalContestPhaseAttribute( this.getId(),proposalId,
ProposalContestPhaseAttributeKeys.VISIBLE);
return attr == null || attr.getNumericValue() == 1;

@@ -37,7 +37,7 @@ private IContestPhaseRibbonType fetchRibbonType(ProposalWrapper proposal) {

IProposalContestPhaseAttribute ribbonAttribute =
StaticProposalContext.getProposalPhaseClient().getProposalContestPhaseAttribute(
proposalId, contestPhase.getId(),
contestPhase.getId(),proposalId,
ProposalContestPhaseAttributeKeys.RIBBON);
if (ribbonAttribute != null) {
long typeId = ribbonAttribute.getNumericValue();
@@ -218,8 +218,7 @@ public boolean isDeleted() {
long visibleAttributeValue = 1;
if (contestPhase != null) {
IProposalContestPhaseAttribute pcpa = clients.proposalPhase
.getProposalContestPhaseAttribute(this.getId(),
contestPhase.getId(),
.getProposalContestPhaseAttribute(contestPhase.getId(),this.getId(),
ProposalContestPhaseAttributeKeys.VISIBLE);
if (pcpa != null) {
visibleAttributeValue = pcpa.getNumericValue();
@@ -951,7 +950,7 @@ public ProposalWrapper getBaseProposal() {
long baseProposalContestId = proposalAttributeHelper
.getAttributeValueLong(ProposalAttributeKeys.BASE_PROPOSAL_CONTEST_ID, 0);
if (baseProposalContestId > 0) {
return clients.proposal.getProposal(baseProposalId);
return new ProposalWrapper(clients.proposal.getProposal(baseProposalId));
}
}
return null;
@@ -81,7 +81,7 @@ boolean promoteProposal(@RequestParam("proposalId") Long proposalId,
default Boolean isProposalContestPhaseAttributeSetAndTrue(Long proposalId, long contestPhaseId,
String name) {
IProposalContestPhaseAttribute proposalAttribute =
getProposalContestPhaseAttribute(proposalId, contestPhaseId, name);
getProposalContestPhaseAttribute(contestPhaseId,proposalId, name);
return proposalAttribute != null && proposalAttribute.getStringValue().equals("true");
}

@@ -128,15 +128,15 @@ default IProposalContestPhaseAttribute persistProposalContestPhaseAttribute(Long
default boolean hasProposalContestPhaseAttribute(Long proposalId, long contestPhaseId,
String name) {
IProposalContestPhaseAttribute proposalContestPhaseAttribute =
getProposalContestPhaseAttribute(proposalId, contestPhaseId, name);
getProposalContestPhaseAttribute(contestPhaseId,proposalId, name);
return proposalContestPhaseAttribute != null;
}

default IProposalContestPhaseAttribute getOrCreateProposalContestPhaseAttribute(Long proposalId,
Long contestPhaseId, String name, Long aditionalId, Long numericValue,
String stringValue) {
IProposalContestPhaseAttribute proposalContestPhaseAttribute =
getProposalContestPhaseAttribute(proposalId, contestPhaseId, name);
getProposalContestPhaseAttribute( contestPhaseId,proposalId, name);
if (proposalContestPhaseAttribute != null) {
return proposalContestPhaseAttribute;
} else {
@@ -162,7 +162,7 @@ default IProposalContestPhaseAttribute setProposalContestPhaseAttribute(Long pro
Long contestPhaseId, String name, Long aditionalId, Long numericValue,
String stringValue) {
IProposalContestPhaseAttribute proposalContestPhaseAttribute =
getProposalContestPhaseAttribute(proposalId, contestPhaseId, name);
getProposalContestPhaseAttribute(contestPhaseId,proposalId, name);
if (proposalContestPhaseAttribute != null) {
proposalContestPhaseAttribute.setAdditionalId(aditionalId);
proposalContestPhaseAttribute.setNumericValue(numericValue);
@@ -193,7 +193,7 @@ IProposalContestPhaseAttribute createProposalContestPhaseAttribute(
default boolean deleteProposalContestPhaseAttribute(Long proposalId, Long contestPhaseId,
String name) {
IProposalContestPhaseAttribute pcpa =
getProposalContestPhaseAttribute(proposalId, contestPhaseId, name);
getProposalContestPhaseAttribute(contestPhaseId,proposalId, name);
return deleteProposalContestPhaseAttribute(pcpa.getId());
}

@@ -31,15 +31,15 @@ public boolean isProposalVisible(ProposalWrapper p) {
}

IProposalContestPhaseAttribute attr = StaticProposalContext.getProposalPhaseClient()
.getProposalContestPhaseAttribute(p.getId(),
phase.getId(), ProposalContestPhaseAttributeKeys.VISIBLE);
.getProposalContestPhaseAttribute(
phase.getId(), p.getId(),ProposalContestPhaseAttributeKeys.VISIBLE);

return attr == null || attr.getNumericValue() != 0;
}

private IProposalContestPhaseAttribute getAttribute(long proposalId, String key) {
return StaticProposalContext.getProposalPhaseClient()
.getProposalContestPhaseAttribute(proposalId, phase.getId(), key);
.getProposalContestPhaseAttribute(phase.getId(),proposalId, key);
}

public boolean isAllProposalsReviewed() {
@@ -35,17 +35,19 @@ public ProposalJudgingCommentHelper(ProposalWrapper proposal, ContestPhaseWrappe
public String getScreeningComment() {
//get fellow decision
IProposalContestPhaseAttribute fellowActionAttribute = proposalPhaseClient.
getProposalContestPhaseAttribute(proposal.getId(),
getProposalContestPhaseAttribute(
contestPhase.getId(),
proposal.getId(),
ProposalContestPhaseAttributeKeys.FELLOW_ACTION);
FellowAction fellowAction = FellowAction.fromInt(
fellowActionAttribute.getNumericValue().intValue());

if (fellowAction != FellowAction.NO_DECISION &&
fellowAction != FellowAction.PASS_TO_JUDGES) {
String fellowRejectionText = proposalPhaseClient.
getProposalContestPhaseAttribute(proposal.getId(),
getProposalContestPhaseAttribute(
contestPhase.getId(),
proposal.getId(),
ProposalContestPhaseAttributeKeys.FELLOW_ACTION_COMMENT)
.getStringValue();

@@ -68,7 +70,7 @@ public String getSubject(){
}
public void setScreeningComment(String comment) {
IProposalContestPhaseAttribute fellowActionAttribute = proposalPhaseClient.
getProposalContestPhaseAttribute(proposal.getId(), contestPhase.getId(), ProposalContestPhaseAttributeKeys.FELLOW_ACTION);
getProposalContestPhaseAttribute(contestPhase.getId(), proposal.getId(), ProposalContestPhaseAttributeKeys.FELLOW_ACTION);
FellowAction fellowAction = FellowAction.fromInt(fellowActionAttribute.getNumericValue().intValue());

//save comment if the action is "incomplete" or "off-topic"
@@ -80,16 +82,16 @@ public void setScreeningComment(String comment) {

public String getAdvancingComment() {
IProposalContestPhaseAttribute advanceDecisionAttribute = proposalPhaseClient.
getProposalContestPhaseAttribute(proposal.getId(), contestPhase.getId(),
getProposalContestPhaseAttribute(contestPhase.getId(),proposal.getId(),
ProposalContestPhaseAttributeKeys.JUDGE_DECISION);

if (advanceDecisionAttribute != null) {
AdvanceDecision advanceDecision = AdvanceDecision.fromInt(
advanceDecisionAttribute.getNumericValue().intValue());

if (advanceDecision != AdvanceDecision.NO_DECISION) {
return proposalPhaseClient.getProposalContestPhaseAttribute(proposal.getId(),
contestPhase.getId(), ProposalContestPhaseAttributeKeys.PROPOSAL_REVIEW)
return proposalPhaseClient.getProposalContestPhaseAttribute(
contestPhase.getId(), proposal.getId(), ProposalContestPhaseAttributeKeys.PROPOSAL_REVIEW)
.getStringValue();
}
}
@@ -119,8 +121,9 @@ public String getPromotionComment(boolean isWrapWithTemplate) {
//get fellow decision

IProposalContestPhaseAttribute fellowActionAttribute = proposalPhaseClient
.getProposalContestPhaseAttribute(proposal.getId(),
.getProposalContestPhaseAttribute(
contestPhase.getId(),
proposal.getId(),
ProposalContestPhaseAttributeKeys.FELLOW_ACTION);
FellowAction fellowAction = fellowActionAttribute != null
? FellowAction
@@ -131,15 +134,17 @@ public String getPromotionComment(boolean isWrapWithTemplate) {
if (fellowAction == FellowAction.PASS_TO_JUDGES) {
final IProposalContestPhaseAttribute reviewTextAttribute =
proposalPhaseClient.
getProposalContestPhaseAttribute(proposal.getId(),
getProposalContestPhaseAttribute(
contestPhase.getId(),
proposal.getId(),
ProposalContestPhaseAttributeKeys.PROPOSAL_REVIEW);
String reviewText = reviewTextAttribute != null
? reviewTextAttribute.getStringValue() : "";

IProposalContestPhaseAttribute advanceDecisionAttribute = proposalPhaseClient
.getProposalContestPhaseAttribute(proposal.getId(),
.getProposalContestPhaseAttribute(
contestPhase.getId(),
proposal.getId(),
ProposalContestPhaseAttributeKeys.JUDGE_DECISION);
AdvanceDecision advanceDecision =
advanceDecisionAttribute != null
@@ -170,8 +175,8 @@ public String getPromotionComment(boolean isWrapWithTemplate) {
} else if (fellowAction != FellowAction.NO_DECISION) {
final IProposalContestPhaseAttribute fellowReviewTextAttribute =
proposalPhaseClient.getProposalContestPhaseAttribute(
proposal.getId(),
contestPhase.getId(),
proposal.getId(),
ProposalContestPhaseAttributeKeys.FELLOW_ACTION_COMMENT
);
String fellowReviewText = fellowReviewTextAttribute != null
@@ -354,8 +354,9 @@ private String moveProposals(ProposalContext proposalContext, List<ProposalWrapp
//first, see if a ribbon already exists

IProposalContestPhaseAttribute attribute = proposalPhaseClient
.getProposalContestPhaseAttribute(proposal.getId(),
.getProposalContestPhaseAttribute(
moveToContestPhase.getId(),
proposal.getId(),
ProposalContestPhaseAttributeKeys.RIBBON);


@@ -109,7 +109,7 @@ private String getProposalJudgeReviewCsv(ContestWrapper contest, ContestPhaseWra
for (ProposalWrapper proposal : stillActiveProposals) {
IProposalContestPhaseAttribute fellowActionAttribute =
StaticProposalContext.getProposalPhaseClient()
.getProposalContestPhaseAttribute(proposal.getId(), judgingPhase.getId(),
.getProposalContestPhaseAttribute(judgingPhase.getId(),proposal.getId(),
ProposalContestPhaseAttributeKeys.FELLOW_ACTION);

if (fellowActionAttribute != null) {
@@ -190,8 +190,9 @@ private String getProposalJudgeReviewCsv(ContestWrapper contest, ContestPhaseWra

if (judgingPhase.getFellowScreeningActive()) {
final IProposalContestPhaseAttribute selectedJudgesAttribute = proposalPhaseClient
.getProposalContestPhaseAttribute(proposal.getId(),
.getProposalContestPhaseAttribute(
judgingPhase.getId(),
proposal.getId(),
ProposalContestPhaseAttributeKeys.SELECTED_JUDGES);
if (selectedJudgesAttribute == null) {
throw new IllegalStateException("Fellow screening active,"
@@ -173,7 +173,7 @@ private Boolean wasProposalPromotedInContestPhase(ProposalContext proposalContex
proposalContext.getClients().getProposalPhaseClient();
IProposalContestPhaseAttribute judgingDecisionAttr =
proposalPhaseClient.getProposalContestPhaseAttribute(
proposal.getId(), contestPhase.getId(),
contestPhase.getId(),proposal.getId(),
ProposalContestPhaseAttributeKeys.JUDGE_DECISION);
if (judgingDecisionAttr != null) {
Long judgingDecision = judgingDecisionAttr.getNumericValue();

0 comments on commit a38ea9d

Please sign in to comment.
You can’t perform that action at this time.