<commit_before>import apiService from '../api/app.service'
import translations from '../modules/translations'
import {friendlyMonth, getRouteFromWpMenus} from '../modules/utils'
import Config from '../api/app.config'

let actions = {
  loadProject: ({commit}) => {
    let time = {}
    return new Promise((resolve, reject) => {
      commit('mutateActivityIndicator', true)
      time.t0 = performance.now()
      commit('mutateTranslations', translations)
      let prepareMenuUrl = (menu) => {
        menu.forEach(item => {
          let relPath = getRouteFromWpMenus(item.url)
          item.url = relPath.url
          item.pathType = relPath.flag
        })
      }

      function getMainMenu () {
        return apiService.getMenu(Config.menusIDs.primary).then((response) => {
          prepareMenuUrl(response.items)
          commit('mutateMainMenu', response.items)
        })
      }

      function getSecondaryMenu () {
        return apiService.getMenu(Config.menusIDs.secondary).then((response) => {
          prepareMenuUrl(response.items)
          commit('mutateSecondaryMenu', response.items)
        })
      }

      function getAllPosts () {
        let posts = []
        return apiService.getPosts(null, null, 100, 'desc').then((response) => {
          response.posts.forEach((post) => {
            let dateString = post.date.split('T')[0]<commit_msg>#16 remove banner and slider posts from the posts collection<commit_after>import apiService from '../api/app.service'
import translations from '../modules/translations'
import {friendlyMonth, getRouteFromWpMenus} from '../modules/utils'
import Config from '../api/app.config'

let actions = {
  loadProject: ({commit}) => {
    let time = {}
    return new Promise((resolve, reject) => {
      commit('mutateActivityIndicator', true)
      time.t0 = performance.now()
      commit('mutateTranslations', translations)
      let prepareMenuUrl = (menu) => {
        menu.forEach(item => {
          let relPath = getRouteFromWpMenus(item.url)
          item.url = relPath.url
          item.pathType = relPath.flag
        })
      }

      function getMainMenu () {
        return apiService.getMenu(Config.menusIDs.primary).then((response) => {
          prepareMenuUrl(response.items)
          commit('mutateMainMenu', response.items)
        })
      }

      function getSecondaryMenu () {
        return apiService.getMenu(Config.menusIDs.secondary).then((response) => {
          prepareMenuUrl(response.items)
          commit('mutateSecondaryMenu', response.items)
        })
      }

      function getAllPosts () {
        let posts = []
        return apiService.getPosts(null, null, 100, 'desc').then((response) => {
          let cleanPostsCollection = response.posts.filter(item => {
            if (item.categories[0] !== Config.postsIDs.bannerPosts && item.categories[0] !== Config.postsIDs.sliderPosts) {
              return item
            }
          })
          cleanPostsCollection.forEach((post) => {
            let dateString = post.date.split('T')[0]
{'fraction_non_alphanumeric': 0.12986588158325155, 'fraction_numerical': 0.004579653254824992, 'mean_word_length': 2.5475638051044083, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 20, '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': '2317874', 'n_tokens_mistral': 865, 'n_tokens_neox': 835, 'n_words': 160}