<commit_before>import {layerInformation} from 'js/config';
import esriRequest from 'esri/request';
import urlUtils from 'esri/urlUtils';
import domClass from 'dojo/dom-class';
import alt from 'js/alt';

class ModalActions {

  showLayerInfo (layerId) {
    brApp.debug('ModalActions >>> showLayerInfo');
    // let emptyObj = {};
    // let layerInfo = layerInformation[layerId] || emptyObj;
    // this.dispatch(layerInfo);
    // if (layerInfo !== emptyObj) {
    //   domClass.remove('layer-modal', 'hidden');
    // }

    // urlUtils.addProxyRule({
    //   urlPrefix: 'http://api.globalforestwatch.org',
    //   proxyUrl: '/map/php/proxy.php'
    // });

    // console.log(metadataIds);
    // console.log(layersConfig);

    // let metadataId = layersConfig.filter((l) => l.id === layerId)[0].metadataId;
    // console.log(metadataId);

    esriRequest({
      // url: metadataUrl + metadataId,
      url: 'http://fires.globalforestwatch.org/map/php/proxy.php?http://api.globalforestwatch.org/metadata/noaa18_fires',
      handleAs: 'json',
      callbackParamName: 'callback'
    }, {
      usePost: true
    }).then(res => {
      this.dispatch(res);
      domClass.remove('layer-modal', 'hidden');
    }, err => {<commit_msg>Routing through staging proxy to test calls<commit_after>import {layerInformation} from 'js/config';
import esriRequest from 'esri/request';
import esriConfig from 'esri/config';
import urlUtils from 'esri/urlUtils';
import domClass from 'dojo/dom-class';
import alt from 'js/alt';

class ModalActions {

  showLayerInfo (layerId) {
    brApp.debug('ModalActions >>> showLayerInfo');
    // let emptyObj = {};
    // let layerInfo = layerInformation[layerId] || emptyObj;
    // this.dispatch(layerInfo);
    // if (layerInfo !== emptyObj) {
    //   domClass.remove('layer-modal', 'hidden');
    // }

    urlUtils.addProxyRule({
      urlPrefix: 'http://api.globalforestwatch.org',
      proxyUrl: 'http://wri-gfw-water-staging.herokuapp.com/proxy/proxy.php'
    });

    esriConfig.defaults.io.corsEnabledServers.push('api.globalforestwatch.org');
    esriConfig.defaults.io.corsEnabledServers.push('wri-gfw-water.herokuapp.com');

    // console.log(metadataIds);
    // console.log(layersConfig);

    // let metadataId = layersConfig.filter((l) => l.id === layerId)[0].metadataId;
    // console.log(metadataId);

    esriRequest({
      // url: metadataUrl + metadataId,
      url: 'http://api.globalforestwatch.org/metadata/noaa18_fires',
      handleAs: 'json',
      callbackParamName: 'callback'
    }, {
      usePost: true
    }).then(res => {
      this.dispatch(res);
      domClass.remove('layer-modal', 'hidden');
    }, err => {
{'fraction_non_alphanumeric': 0.1650521609538003, 'fraction_numerical': 0.0022354694485842027, 'mean_word_length': 3.188767550702028, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '6521020', 'n_tokens_mistral': 871, 'n_tokens_neox': 848, 'n_words': 148}