<commit_before>import axios from "axios";

export default {
  title: {
    id: "title_translations"
  },
  description: {
    id: "descripcio-projecte"
  },
  phases: {
    id: "estat"
  },
  location: {
    id: "wkt",
    center: [41.536908, 2.4418503],
    minZoom: 13,
    maxZoom: 16
  },
  availableFilters: [
    {
      id: "daterange",
      startKey: "data-inici",
      endKey: "data-final"
    },
    {
      id: "estat",
      multiple: true
    },
    {
      id: "nom-servei-responsable",
      multiple: true
    },
    {
      id: "tipus-projecte"
    },
    {
      id: "import"
    }
  ],
  availableGalleryFields: [
    {
      id: "estat",
      multiple: true
    },
    {
      id: "data-inici",
      filter: "date"
    },
    {
      id: "data-final",
      filter: "date"
    },
    {
      id: "import",
      filter: "money"
    },
    {
      id: "tipus"
    },
    {
      id: "element"
    },
  ],
  availableTableFields: [
    {
      id: "nom-projecte"
    },
    {
      id: "estat",
      multiple: true
    },
    {
      id: "import",
      filter: "money"
    }
  ],
  availableProjectFields: [
    {
      id: "nom-servei-responsable",
      multiple: true
    },
    {
      id: "tipus-projecte",
      multiple: true
    },
    {
      id: "adreca"
    },
    {
      id: "adjudicatari"
    },
    {
      id: "estat",
      multiple: true
    },
    {
      type: "separator"
    },
    {
      id: "data-inici",
      filter: "date"
    },
    {
      id: "data-final",
      filter: "date"
    },
    {
      id: "data-adjudicacio",
      filter: "date"
    },
    {
      id: "data-inici-redaccio",
      filter: "date"
    },
    {
      id: "data-fi-redaccio",
      filter: "date"
    },
    {
      type: "separator"
    },
    {
      id: "partida",
    },
    {
      id: "any-partida",
    },
    {
      id: "import",
      filter: "money"
    },
    {
      id: "import-adjudicacio",
      filter: "money"
    },
    {
      id: "import-liquidacio",
      filter: "money"
    },
    {
      id: "budget",
      filter: "money",
      type: "highlight"
    },
    {
      type: "separator"
    },
    {
      id: "documents",
      type: "icon",
      icon: {
        title: "nom",
        href: "url",
        name: "file"
      }
    },
    {
      id: "tasques",
      type: "table",
      table: {
        columns: [{
          id: "nomactuacio"
        }, {
          id: "data"
        }, {
          id: "nimport",
          filter: "money"
        }]
      }
    }
  ],
  itemSpecialConfiguration: {
    fn: async data => {
      const dataArr = Array.isArray(data) ? data : [data];
      const filterArr = dataArr.filter(d => d.attributes.partida && d.attributes["any-partida"]);
      const allIds = filterArr.map(d => `'${d.attributes.partida}'`).join(",");

      // Avoid the query if there's no code_with_zone (partida)
      if (allIds) {
        const endpoint = `http://mataro.gobify.net/api/v1/data`;
        // const endpoint = `${location.origin}/api/v1/data`;
        const query = `
          SELECT code_with_zone as partida, paranyprs as year, sum(parimport) as budget
          FROM mataro_budgets
          WHERE "parimport" IS NOT NULL
          AND "code_with_zone" IN (${allIds})
          GROUP BY code_with_zone, paranyprs
        `;

        const { data: { data: sql } } = await axios.get(endpoint, {
          params: {
            sql: query.trim()
          }
        })

        for (let index = 0; index < dataArr.length; index++) {<commit_msg>Update mataro.conf.js<commit_after>import axios from "axios";

export default {
  title: {
    id: "title_translations"
  },
  description: {
    id: "descripcio-projecte"
  },
  phases: {
    id: "estat"
  },
  location: {
    id: "wkt",
    center: [41.536908, 2.4418503],
    minZoom: 13,
    maxZoom: 16
  },
  availableFilters: [
    {
      id: "daterange",
      startKey: "data-inici",
      endKey: "data-final"
    },
    {
      id: "estat",
      multiple: true
    },
    {
      id: "nom-servei-responsable",
      multiple: true
    },
    {
      id: "tipus-projecte"
    },
    {
      id: "import"
    }
  ],
  availableGalleryFields: [
    {
      id: "estat",
      multiple: true
    },
    {
      id: "data-inici",
      filter: "date"
    },
    {
      id: "data-final",
      filter: "date"
    },
    {
      id: "import",
      filter: "money"
    },
    {
      id: "tipus"
    },
    {
      id: "element"
    },
  ],
  availableTableFields: [
    {
      id: "nom-projecte"
    },
    {
      id: "estat",
      multiple: true
    },
    {
      id: "import",
      filter: "money"
    }
  ],
  availableProjectFields: [
    {
      id: "nom-servei-responsable",
      multiple: true
    },
    {
      id: "tipus-projecte",
      multiple: true
    },
    {
      id: "adreca"
    },
    {
      id: "adjudicatari"
    },
    {
      id: "estat",
      multiple: true
    },
    {
      type: "separator"
    },
    {
      id: "data-inici",
      filter: "date"
    },
    {
      id: "data-final",
      filter: "date"
    },
    {
      id: "data-adjudicacio",
      filter: "date"
    },
    {
      id: "data-inici-redaccio",
      filter: "date"
    },
    {
      id: "data-fi-redaccio",
      filter: "date"
    },
    {
      type: "separator"
    },
    {
      id: "partida",
    },
    {
      id: "any-partida",
    },
    {
      id: "import",
      filter: "money"
    },
    {
      id: "import-adjudicacio",
      filter: "money"
    },
    {
      id: "import-liquidacio",
      filter: "money"
    },
    {
      id: "budget",
      filter: "money",
      type: "highlight"
    },
    {
      type: "separator"
    },
    {
      id: "documents",
      type: "icon",
      icon: {
        title: "nom",
        href: "url",
        name: "file"
      }
    },
    {
      id: "tasques",
      type: "table",
      table: {
        columns: [{
          id: "nomactuacio"
        }, {
          id: "data"
        }, {
          id: "nimport",
          filter: "money"
        }]
      }
    }
  ],
  itemSpecialConfiguration: {
    fn: async data => {
      const dataArr = Array.isArray(data) ? data : [data];
      const filterArr = dataArr.filter(d => d.attributes.partida && d.attributes["any-partida"]);
      const allIds = filterArr.map(d => `'${d.attributes.partida}'`).join(",");

      // Avoid the query if there's no code_with_zone (partida)
      if (allIds) {
        const endpoint = `${location.origin}/api/v1/data`;
        const query = `
          SELECT code_with_zone as partida, paranyprs as year, sum(parimport) as budget
          FROM mataro_budgets
          WHERE "parimport" IS NOT NULL
          AND "code_with_zone" IN (${allIds})
          GROUP BY code_with_zone, paranyprs
        `;

        const { data: { data: sql } } = await axios.get(endpoint, {
          params: {
            sql: query.trim()
          }
        })

        for (let index = 0; index < dataArr.length; index++) {
{'fraction_non_alphanumeric': 0.1572488584474886, 'fraction_numerical': 0.006421232876712328, 'mean_word_length': 1.4836995038979448, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '5395413', 'n_tokens_mistral': 2561, 'n_tokens_neox': 2498, 'n_words': 484}