Skip to content

Commit

Permalink
CONDEC-686: Add filter criteria used in code class view to FilterSett…
Browse files Browse the repository at this point in the history
…ings (#287)

* Set default link distance to 3 in FilterSettings class

* Remove warning text from link distance input field to simplify code (it is not really necessary)

* Add minDegree and maxDegree to the FilterSettings class

* Change getClassTreant REST method to POST method and pass FilterSettings object instead of single filter criteria as parameters

* Add velocity template for the node degree filter (min and max link number) to make it reusable

* Translate filter criteria for node degree (number of links) and isDecisionKnowledgeOnly using i18n properties

* Add filter criteria isTestCodeShown to FilterSettings

* Add methods isElementMatchingDegreeFilter and isElementMatchingIsTestCodeFilter in FilteringManager and use it in Treant

* Remove usage of GenericLinkManager in Treant because the Treant should not know this class, it should only use the KnowledgeGraph for better separation of concerns

* Remove isCollapsed parameter from createTreantNode method because we use the linkDistance filter instead

* Fix that startTime (createdAfter/createdEarliest) and endTime (createdBefore/createdLatest) were swapped in graph view of Jira issue view
  • Loading branch information
kleebaum authored Jul 10, 2020
1 parent 6fe431a commit 89cf802
Show file tree
Hide file tree
Showing 26 changed files with 647 additions and 527 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ private boolean checkout(String checkoutObjectName, String repoUri, boolean isCo
try {
gits.get(repoUri).checkout().setName(checkoutName).call();
} catch (GitAPIException | JGitInternalException e) {
System.out.println("Could not checkout " + checkoutName);
System.out.println("Could not checkout " + checkoutName + e.getMessage());
LOGGER.error("Could not checkout " + checkoutName + ". " + e.getMessage());
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ public class FilterSettings {
private List<String> linkTypes;
private List<String> decisionGroups;
private boolean isOnlyDecisionKnowledgeShown;
private boolean isTestCodeShown;
private int linkDistance;
private int minDegree;
private int maxDegree;

@XmlElement
private long startDate;
Expand All @@ -56,7 +59,10 @@ public FilterSettings(@JsonProperty("projectKey") String projectKey,
this.knowledgeStatus = KnowledgeStatus.getAllKnowledgeStatus();
this.decisionGroups = DecisionGroupManager.getAllDecisionGroups(projectKey);
this.isOnlyDecisionKnowledgeShown = false;
this.linkDistance = 4;
this.isTestCodeShown = false;
this.linkDistance = 3;
this.minDegree = 0;
this.maxDegree = 50;
}

public FilterSettings(String projectKey, String query, ApplicationUser user) {
Expand Down Expand Up @@ -298,8 +304,58 @@ public int getLinkDistance() {
* filtered graph. All nodes with a greater distance are not
* included.
*/
@JsonProperty("linkDistance")
public void setLinkDistance(int linkDistance) {
this.linkDistance = linkDistance;
}

/**
* @return minimal number of links that a knowledge element (=node) needs to
* have to be included in the filtered graph.
*/
public int getMinDegree() {
return minDegree;
}

/**
* @param minDegree
* minimal number of links that a knowledge element (=node) needs to
* have to be included in the filtered graph.
*/
public void setMinDegree(int minDegree) {
this.minDegree = minDegree;
}

/**
* @return maximal number of links that a knowledge element (=node) needs to
* have to be included in the filtered graph.
*/
public int getMaxDegree() {
return maxDegree;
}

/**
* @param maxDegree
* maximal number of links that a knowledge element (=node) needs to
* have to be included in the filtered graph.
*/
public void setMaxDegree(int maxDegree) {
this.maxDegree = maxDegree;
}

/**
* @return true if code classes for unit tests are shown in the filtered graph.
*/
public boolean isTestCodeShown() {
return isTestCodeShown;
}

/**
* @param isTestCodeShown
* true if code classes for unit tests are shown in the filtered
* graph.
*/
@JsonProperty("isTestCodeShown")
public void setTestCodeShown(boolean isTestCodeShown) {
this.isTestCodeShown = isTestCodeShown;
}
}
Loading

0 comments on commit 89cf802

Please sign in to comment.