Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

News #803

Merged
merged 10 commits into from
Nov 19, 2021
Merged

News #803

merged 10 commits into from
Nov 19, 2021

Conversation

jaakkonakaza
Copy link
Member

Description of the PR

Testing

unit integration e2e manual
  • new unit tests created
  • all unit tests pass
  • new integration tests created
  • all integration tests pass
  • new e2e tests created
  • all e2e tests pass
  • manual testing went well

Have you updated the TESTING.md or other relevant documentation on your branch?

  • Yes.
  • Not yet. I will do it next.
  • Not relevant.

# Conflicts:
#	src/main/java/fi/aalto/cs/apluscourses/intellij/actions/OpenItemAction.java
#	src/main/java/fi/aalto/cs/apluscourses/intellij/toolwindows/APlusToolWindowFactory.java
#	src/main/java/fi/aalto/cs/apluscourses/intellij/utils/Interfaces.java
#	src/main/java/fi/aalto/cs/apluscourses/presentation/MainViewModel.java
#	src/main/java/fi/aalto/cs/apluscourses/ui/CollapsibleSplitter.java
#	src/main/resources/resources.properties
# Conflicts:
#	src/main/java/fi/aalto/cs/apluscourses/intellij/model/CourseUpdater.java
#	src/main/java/fi/aalto/cs/apluscourses/intellij/toolwindows/APlusToolWindowFactory.java
# Conflicts:
#	src/main/java/fi/aalto/cs/apluscourses/intellij/model/CourseUpdater.java
#	src/main/java/fi/aalto/cs/apluscourses/intellij/toolwindows/APlusToolWindowFactory.java
@sonarqubecloud
Copy link

Please retry analysis of this Pull-Request directly on SonarCloud.

Comment on lines -76 to +77
presentation.userDropdown.notLoggedIn=Not logged in
presentation.userDropdown.loggedInAs=Logged in as {0}
presentation.userDropdown.notLoggedIn=Not Logged In
presentation.userDropdown.loggedInAs=Logged In As {0}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No

Copy link
Member

@OlliKiljunen OlliKiljunen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! I wrote some nits and questions but this is mergeable also as-is. Nice reuse of existing logic. Well done!

@@ -27,6 +27,7 @@ repositories {
}

dependencies {
implementation 'org.jsoup:jsoup:1.14.3'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you consider other alternatives? Anyway, this looks like a good choice.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read some comparisons online and this seemed like the best choice


public class OpenItemAction extends DumbAwareAction {
public class OpenItemAction<T> extends DumbAwareAction {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class: Excellent!

Comment on lines 36 to 37
newsViewModel.getModel().getNews().forEach(News::setRead);
mainViewModel.newsTreeViewModel.valueChanged();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: This logic could perhaps be in the model.

Comment on lines 106 to 107
return readNews.getReadNews() != null
&& Arrays.stream(readNews.getReadNews().split(";")).anyMatch(idS -> Long.parseLong(idS) == this.id);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Store the array in a variable instead of getting it twice.

@NotNull Options options) {
@Nullable Options options) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you consider using some kind of "allGoesOptions" instead of making this nullable? That way some null checks below could perhaps have been avoided.


@NotNull
public String getTitle() {
var unread = getModel().getNews().stream().filter(news -> !news.isRead()).count();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NitL This logic would be better in the model.

Base automatically changed from no-token to master November 19, 2021 17:22
…nges

# Conflicts:
#	src/main/java/fi/aalto/cs/apluscourses/intellij/utils/Interfaces.java
#	src/test/java/fi/aalto/cs/apluscourses/intellij/model/CourseUpdaterTest.java
…nges

# Conflicts:
#	src/main/java/fi/aalto/cs/apluscourses/intellij/utils/Interfaces.java
#	src/test/java/fi/aalto/cs/apluscourses/intellij/model/CourseUpdaterTest.java
@jaakkonakaza jaakkonakaza merged commit 310b729 into master Nov 19, 2021
@jaakkonakaza jaakkonakaza deleted the news branch November 19, 2021 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Push course news into IJ
3 participants