Skip to content

Commit f400e3b

Browse files
committed
Fix the problem for the GitHubIssuePanel #27
- Hide the comments section in New Issue
1 parent 50239f0 commit f400e3b

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

src/main/java/com/junichi11/netbeans/modules/github/issues/issue/ui/GitHubIssuePanel.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ public void update() {
202202
}
203203

204204
// existing issue
205-
if (!gitHubIssue.isNew()) {
205+
boolean isExistingIssue = !gitHubIssue.isNew();
206+
if (isExistingIssue) {
206207
Issue issue = gitHubIssue.getIssue();
207208
if (issue != null) {
208209
// set existing info
@@ -272,9 +273,10 @@ public void update() {
272273
}
273274

274275
// visibility
275-
setNewCommentVisible();
276+
setCommentsSectionVisible(isExistingIssue);
277+
setNewCommentVisible(isExistingIssue);
276278
setCollaboratorsComponentsVisible(isCollaborator);
277-
attributesViewPanel.setVisible(!gitHubIssue.isNew());
279+
attributesViewPanel.setVisible(isExistingIssue);
278280

279281
fireChange();
280282
}
@@ -511,11 +513,7 @@ public void setErrorMessage(String errorMessage) {
511513
headerErrorLabel.setText(errorMessage);
512514
}
513515

514-
private void setNewCommentVisible() {
515-
if (gitHubIssue == null) {
516-
return;
517-
}
518-
boolean isVisible = !gitHubIssue.isNew(); // existing issue
516+
private void setNewCommentVisible(boolean isVisible) {
519517
newCommentLabel.setVisible(isVisible);
520518
newCommentTabbedPanel.setVisible(isVisible);
521519
newCommentButton.setVisible(isVisible);
@@ -526,6 +524,10 @@ private void setNewCommentVisible() {
526524
}
527525
}
528526

527+
private void setCommentsSectionVisible(boolean isVisible) {
528+
commentsCollapsibleSectionPanel.setVisible(isVisible);
529+
}
530+
529531
public void setNewCommentEnabled(boolean isEnabled) {
530532
newCommentTabbedPanel.setEnabled(isEnabled);
531533
newCommentButton.setEnabled(isEnabled);

0 commit comments

Comments
 (0)