Adds util funciton to check if a need  has suggestions
import won from "./won-es6.js";
import { get, getIn } from "./utils.js";
import { labels } from "./won-label-utils.js";
+import * as connectionUtils from "./connection-utils.js";
/**
* Determines if a given need is a Active
@@ -119,6 +120,13 @@ export function hasGroupFacet(need) {
);
}
+export function hasSuggestedConnections(need) {
+ return (
+ get(need, "connections") &&
+ !!get(need, "connections").find(conn => connectionUtils.isSuggested(conn))
+ );
+}
+
/**
* Determines if a given need is a Search-Need (see draft in create-search.js)
* @param need
