Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ module.exports = {
ecmaVersion: 'latest',
project: ['./src/{docs,marketing}/tsconfig.json'],
},
rules: {
'@typescript-eslint/triple-slash-reference': 0,
},
},
{
files: ['src/frontend/**/*.ts'],
Expand Down
4 changes: 0 additions & 4 deletions src/backend/api/backend.did
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ type ProposalReview = record {
last_updated_at : opt text;
status : ProposalReviewStatus;
summary : opt text;
review_duration_mins : opt nat16;
build_reproduced : opt bool;
images_paths : vec text;
proposal_review_commits : vec ProposalReviewCommitWithId;
Expand All @@ -245,7 +244,6 @@ type ProposalReviewWithId = record {
type CreateProposalReviewRequest = record {
proposal_id : text;
summary : opt text;
review_duration_mins : opt nat16;
build_reproduced : opt bool;
vote : opt ProposalVote;
};
Expand All @@ -259,7 +257,6 @@ type UpdateProposalReviewRequest = record {
proposal_id : text;
status : opt ProposalReviewStatus;
summary : opt text;
review_duration_mins : opt nat16;
build_reproduced : opt bool;
vote : opt ProposalVote;
};
Expand Down Expand Up @@ -296,7 +293,6 @@ type ReviewCommitState = variant {
reviewed : record {
matches_description : opt bool;
comment : opt text;
highlights : vec text;
};
not_reviewed;
};
Expand Down
3 changes: 0 additions & 3 deletions src/backend/api/src/proposal_review.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ pub struct ProposalReview {
pub last_updated_at: Option<String>,
pub status: ProposalReviewStatus,
pub summary: Option<String>,
pub review_duration_mins: Option<u16>,
pub build_reproduced: Option<bool>,
pub images_paths: Vec<String>,
pub proposal_review_commits: Vec<ProposalReviewCommitWithId>,
Expand All @@ -45,7 +44,6 @@ pub struct ProposalReviewWithId {
pub struct CreateProposalReviewRequest {
pub proposal_id: String,
pub summary: Option<String>,
pub review_duration_mins: Option<u16>,
pub build_reproduced: Option<bool>,
pub vote: Option<ProposalVote>,
}
Expand All @@ -57,7 +55,6 @@ pub struct UpdateProposalReviewRequest {
pub proposal_id: String,
pub status: Option<ProposalReviewStatus>,
pub summary: Option<String>,
pub review_duration_mins: Option<u16>,
pub build_reproduced: Option<bool>,
pub vote: Option<ProposalVote>,
}
Expand Down
1 change: 0 additions & 1 deletion src/backend/api/src/proposal_review_commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ pub enum ReviewCommitState {
Reviewed {
matches_description: Option<bool>,
comment: Option<String>,
highlights: Vec<String>,
},
#[serde(rename = "not_reviewed")]
NotReviewed,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ mod tests {
state: backend_api::ReviewCommitState::Reviewed {
matches_description: Some(true),
comment: Some("comment".to_string()),
highlights: vec![],
},
};
let response = CreateProposalReviewCommitResponse {
Expand Down Expand Up @@ -184,7 +183,6 @@ mod tests {
state: backend_api::ReviewCommitState::Reviewed {
matches_description: Some(true),
comment: Some("comment".to_string()),
highlights: vec![],
},
};
let error = ApiError::permission_denied(&format!(
Expand Down Expand Up @@ -221,7 +219,6 @@ mod tests {
state: backend_api::ReviewCommitState::Reviewed {
matches_description: Some(true),
comment: Some("comment".to_string()),
highlights: vec![],
},
};

Expand Down Expand Up @@ -255,7 +252,6 @@ mod tests {
state: backend_api::ReviewCommitState::Reviewed {
matches_description: Some(true),
comment: Some("comment".to_string()),
highlights: vec![],
},
};
let error = ApiError::permission_denied(&format!(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ mod tests {
let request = CreateProposalReviewRequest {
proposal_id: "proposal_id".to_string(),
summary: Some("summary".to_string()),
review_duration_mins: Some(10),
build_reproduced: Some(true),
vote: Some(ProposalVote::Yes),
};
Expand Down Expand Up @@ -297,7 +296,6 @@ mod tests {
let request = CreateProposalReviewRequest {
proposal_id: "proposal_id".to_string(),
summary: Some("summary".to_string()),
review_duration_mins: Some(10),
build_reproduced: Some(true),
vote: Some(ProposalVote::No),
};
Expand Down Expand Up @@ -338,7 +336,6 @@ mod tests {
proposal_id: fixtures::proposal_id().to_string(),
status: None,
summary: Some("summary".to_string()),
review_duration_mins: Some(10),
build_reproduced: Some(true),
vote: Some(ProposalVote::Yes),
};
Expand Down Expand Up @@ -374,7 +371,6 @@ mod tests {
proposal_id: fixtures::proposal_id().to_string(),
status: None,
summary: Some("summary".to_string()),
review_duration_mins: Some(10),
build_reproduced: Some(true),
vote: None,
};
Expand Down
2 changes: 1 addition & 1 deletion src/backend/impl/src/fixtures/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub fn principal_b() -> Principal {

#[fixture]
pub fn principal_c() -> Principal {
Principal::from_slice(&[1])
Principal::from_slice(&[2])
}

#[fixture]
Expand Down
2 changes: 0 additions & 2 deletions src/backend/impl/src/fixtures/proposal_review.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ pub fn proposal_review_draft() -> ProposalReview {
last_updated_at: None,
status: ProposalReviewStatus::Draft,
summary: Some("Proposal review summary".to_string()),
review_duration_mins: Some(60),
build_reproduced: Some(true),
images_ids: vec![],
vote: ProposalVote::Unspecified,
Expand All @@ -29,7 +28,6 @@ pub fn proposal_review_published() -> ProposalReview {
last_updated_at: None,
status: ProposalReviewStatus::Published,
summary: Some("Proposal review summary".to_string()),
review_duration_mins: Some(60),
build_reproduced: Some(true),
images_ids: vec![uuid()],
vote: ProposalVote::Yes,
Expand Down
1 change: 0 additions & 1 deletion src/backend/impl/src/fixtures/proposal_review_commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ pub fn proposal_review_commit_reviewed() -> ProposalReviewCommit {
state: ReviewCommitState::Reviewed(ReviewedCommitState {
matches_description: Some(true),
comment: Some("Review commit comment".to_string()),
highlights: vec![],
}),
}
}
Expand Down
1 change: 0 additions & 1 deletion src/backend/impl/src/mappings/proposal_review.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ impl From<ProposalReview> for backend_api::ProposalReview {
last_updated_at: proposal_review.last_updated_at.map(|dt| dt.to_string()),
status: proposal_review.status.into(),
summary: proposal_review.summary,
review_duration_mins: proposal_review.review_duration_mins,
build_reproduced: proposal_review.build_reproduced,
images_paths: vec![],
proposal_review_commits: vec![],
Expand Down
4 changes: 0 additions & 4 deletions src/backend/impl/src/mappings/proposal_review_commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ impl From<ReviewCommitState> for backend_api::ReviewCommitState {
ReviewCommitState::Reviewed(ReviewedCommitState {
matches_description,
comment,
highlights,
}) => backend_api::ReviewCommitState::Reviewed {
matches_description,
comment,
highlights,
},
ReviewCommitState::NotReviewed => backend_api::ReviewCommitState::NotReviewed,
}
Expand All @@ -25,11 +23,9 @@ impl From<backend_api::ReviewCommitState> for ReviewCommitState {
backend_api::ReviewCommitState::Reviewed {
matches_description,
comment,
highlights,
} => ReviewCommitState::Reviewed(ReviewedCommitState {
matches_description,
comment,
highlights,
}),
backend_api::ReviewCommitState::NotReviewed => ReviewCommitState::NotReviewed,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,6 @@ mod tests {
state: ReviewCommitState::Reviewed(ReviewedCommitState {
matches_description: Some(false),
comment: Some("Updated comment".to_string()),
highlights: vec![],
}),
..fixtures::proposal_review_commit_not_reviewed()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ pub struct ProposalReview {
pub last_updated_at: Option<DateTime>,
pub status: ProposalReviewStatus,
pub summary: Option<String>,
pub review_duration_mins: Option<u16>,
pub build_reproduced: Option<bool>,
pub images_ids: Vec<ImageId>,
pub vote: ProposalVote,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ pub type ProposalReviewCommitId = Uuid;
pub struct ReviewedCommitState {
pub matches_description: Option<bool>,
pub comment: Option<String>,
pub highlights: Vec<String>,
}

impl Display for ReviewedCommitState {
Expand All @@ -31,13 +30,6 @@ impl Display for ReviewedCommitState {
commit_details = format!("{}\nComment: {}", commit_details, comment);
}
}
if !self.highlights.is_empty() {
commit_details = format!(
"{}\nHighlights: {}",
commit_details,
self.highlights.join(", ")
);
}
write!(f, "{}", commit_details)
}
}
Expand Down Expand Up @@ -215,7 +207,6 @@ mod tests {
let mut state = ReviewedCommitState {
matches_description: None,
comment: None,
highlights: vec![],
};

assert_eq!(state.to_string(), "Matches description: Unanswered");
Expand All @@ -234,17 +225,5 @@ mod tests {
state.to_string(),
"Matches description: true\nComment: test"
);

state.highlights = vec!["test".to_string()];
assert_eq!(
state.to_string(),
"Matches description: true\nComment: test\nHighlights: test"
);

state.highlights = vec!["test1".to_string(), "test2".to_string()];
assert_eq!(
state.to_string(),
"Matches description: true\nComment: test\nHighlights: test1, test2"
);
}
}
Loading
Loading