<commit_before>(ns frontend.components.pages.user-settings
  (:require [frontend.analytics :as analytics]
            [frontend.api :as api]
            [frontend.components.account :as old-components]
            [frontend.components.aside :as aside]
            [frontend.components.common :as common]
            [frontend.components.templates.main :as main-template]
            [frontend.config :as config]
            [frontend.models.user :as user]
            [frontend.routes :as routes]
            [frontend.state :as state]
            [frontend.utils :refer [set-page-title!]]
            [frontend.utils.ajax :as ajax]
            [frontend.utils.legacy :refer [build-legacy]]
            [frontend.utils.seq :refer [select-in]]
            [om.next :as om-next :refer-macros [defui]])
  (:require-macros [frontend.utils :refer [component element html]]))

(defn nav-items []
  (remove
    nil?
    [{:type :subpage :href (routes/v1-account) :title "Notifications" :subpage :notifications}
     {:type :subpage :href (routes/v1-account-subpage {:subpage "api"}) :title "API Tokens" :subpage :api}
     {:type :subpage :href (routes/v1-account-subpage {:subpage "heroku"}) :title "Heroku" :subpage :heroku}
     (when-not (config/enterprise?)
       {:type :subpage :href (routes/v1-account-subpage {:subpage "plans"}) :title "Plan Pricing" :subpage :plans})
     (when-not (config/enterprise?)
       {:type :subpage :href (routes/v1-account-subpage {:subpage "beta"}) :title "Beta Program" :subpage :beta})]))

(defn menu [subpage]
  (html
   ;; TODO: Now that this is rendered from here, the settings menus should use a
   ;; styled component. See CIRCLE-2545.
   [:div.aside-user
    [:header
     [:h4 "Account Settings"]
     [:a.close-menu {:href "./"} ; This may need to change if we drop hashtags from url structure
      (common/ico :fail-light)]]
    [:div.aside-user-options
     (aside/expand-menu-items (nav-items) subpage)]]))

(defui ^:once Page
  static om-next/IQuery
  (query [this]
    ;; NB: Every Page *must* query for {:legacy/state [*]}, to make it available
    ;; to frontend.components.header/header. This is necessary until the
    ;; wrapper, not the template, renders the header.<commit_msg>Remove close button from user settings<commit_after>(ns frontend.components.pages.user-settings
  (:require [frontend.analytics :as analytics]
            [frontend.api :as api]
            [frontend.components.account :as old-components]
            [frontend.components.aside :as aside]
            [frontend.components.common :as common]
            [frontend.components.templates.main :as main-template]
            [frontend.config :as config]
            [frontend.models.user :as user]
            [frontend.routes :as routes]
            [frontend.state :as state]
            [frontend.utils :refer [set-page-title!]]
            [frontend.utils.ajax :as ajax]
            [frontend.utils.legacy :refer [build-legacy]]
            [frontend.utils.seq :refer [select-in]]
            [om.next :as om-next :refer-macros [defui]])
  (:require-macros [frontend.utils :refer [component element html]]))

(defn nav-items []
  (remove
    nil?
    [{:type :subpage :href (routes/v1-account) :title "Notifications" :subpage :notifications}
     {:type :subpage :href (routes/v1-account-subpage {:subpage "api"}) :title "API Tokens" :subpage :api}
     {:type :subpage :href (routes/v1-account-subpage {:subpage "heroku"}) :title "Heroku" :subpage :heroku}
     (when-not (config/enterprise?)
       {:type :subpage :href (routes/v1-account-subpage {:subpage "plans"}) :title "Plan Pricing" :subpage :plans})
     (when-not (config/enterprise?)
       {:type :subpage :href (routes/v1-account-subpage {:subpage "beta"}) :title "Beta Program" :subpage :beta})]))

(defn menu [subpage]
  (html
   ;; TODO: Now that this is rendered from here, the settings menus should use a
   ;; styled component. See CIRCLE-2545.
   [:div.aside-user
    [:header
     [:h4 "Account Settings"]]
    [:div.aside-user-options
     (aside/expand-menu-items (nav-items) subpage)]]))

(defui ^:once Page
  static om-next/IQuery
  (query [this]
    ;; NB: Every Page *must* query for {:legacy/state [*]}, to make it available
    ;; to frontend.components.header/header. This is necessary until the
    ;; wrapper, not the template, renders the header.
{'fraction_non_alphanumeric': 0.14210405684162275, 'fraction_numerical': 0.0045840018336007335, 'mean_word_length': 3.0, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2976371', 'n_tokens_mistral': 1433, 'n_tokens_neox': 1389, 'n_words': 376}