<commit_before>import angular from "angular";
import won from "../../won-es6.js";
import Immutable from "immutable";
import sendRequestModule from "../send-request.js";
import postMessagesModule from "../post-messages.js";
import postInfoModule from "../post-info.js";
import connectionsOverviewModule from "../connections-overview.js";
import { attach, getIn } from "../../utils.js";
import { actionCreators } from "../../actions/actions.js";
import {
  selectNeedByConnectionUri,
  selectAllOwnNeeds,
} from "../../selectors.js";
import { resetParams } from "../../configRouting.js";

const serviceDependencies = ["$ngRedux", "$scope"];

class ConnectionsController {
  constructor() {
    attach(this, serviceDependencies, arguments);
    this.WON = won.WON;
    this.resetParams = resetParams;
    this.open = {};

    const selectFromState = state => {
      const selectedPostUri = decodeURIComponent(
        getIn(state, ["router", "currentParams", "postUri"])
      );
      const selectedPost =
        selectedPostUri && state.getIn(["needs", selectedPostUri]);
      const showCreateView = getIn(state, [
        "router",
        "currentParams",
        "showCreateView",
      ]);
      const connectionUri = decodeURIComponent(
        getIn(state, ["router", "currentParams", "connectionUri"])
      );
      const need =
        connectionUri && selectNeedByConnectionUri(state, connectionUri);
      const connection = need && need.getIn(["connections", connectionUri]);
      const connectionType =
        need &&
        connectionUri &&
        need.getIn(["connections", connectionUri, "state"]);

      const ownNeeds = selectAllOwnNeeds(state).filter(
        post =>
          !(
            post.get("isWhatsAround") &&
            post.get("state") === won.WON.InactiveCompacted
          )
      );

      let connections = Immutable.Map();
<commit_msg>filter closed whats new needs as well<commit_after>import angular from "angular";
import won from "../../won-es6.js";
import Immutable from "immutable";
import sendRequestModule from "../send-request.js";
import postMessagesModule from "../post-messages.js";
import postInfoModule from "../post-info.js";
import connectionsOverviewModule from "../connections-overview.js";
import { attach, getIn } from "../../utils.js";
import { actionCreators } from "../../actions/actions.js";
import {
  selectNeedByConnectionUri,
  selectAllOwnNeeds,
} from "../../selectors.js";
import { resetParams } from "../../configRouting.js";

const serviceDependencies = ["$ngRedux", "$scope"];

class ConnectionsController {
  constructor() {
    attach(this, serviceDependencies, arguments);
    this.WON = won.WON;
    this.resetParams = resetParams;
    this.open = {};

    const selectFromState = state => {
      const selectedPostUri = decodeURIComponent(
        getIn(state, ["router", "currentParams", "postUri"])
      );
      const selectedPost =
        selectedPostUri && state.getIn(["needs", selectedPostUri]);
      const showCreateView = getIn(state, [
        "router",
        "currentParams",
        "showCreateView",
      ]);
      const connectionUri = decodeURIComponent(
        getIn(state, ["router", "currentParams", "connectionUri"])
      );
      const need =
        connectionUri && selectNeedByConnectionUri(state, connectionUri);
      const connection = need && need.getIn(["connections", connectionUri]);
      const connectionType =
        need &&
        connectionUri &&
        need.getIn(["connections", connectionUri, "state"]);

      const ownNeeds = selectAllOwnNeeds(state).filter(
        post =>
          !(
            (post.get("isWhatsAround") || post.get("isWhatsNew")) &&
            post.get("state") === won.WON.InactiveCompacted
          )
      );

      let connections = Immutable.Map();

{'fraction_non_alphanumeric': 0.14484023048716604, 'fraction_numerical': 0.0005238344683080147, 'mean_word_length': 3.028481012658228, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4631395', 'n_tokens_mistral': 1039, 'n_tokens_neox': 1033, 'n_words': 239}