<commit_before>import { connect } from 'react-redux';
import { createElement, PureComponent } from 'react';
import { getStorageWithExpiration } from 'utils/localStorage';
import PropTypes from 'prop-types';

import { actions } from 'components/modal-download';

import Component from './download-menu-component';

const { S3_BUCKET_NAME } = process.env;
const { CW_FILES_PREFIX } = process.env;

const server = `http://${S3_BUCKET_NAME}.s3.amazonaws.com`;
const folder = `/${CW_FILES_PREFIX}climate-watch-download-zip`;
const url = `${server}${folder}`;

const mapStateToProps = ({ modalDownload }) => ({
  isOpen: modalDownload.isOpen
});

class DownloadMenuContainer extends PureComponent {
  handleOnClick = (downloadUrl, size) => {
    if (getStorageWithExpiration('userSurvey')) {
      return window.location.assign(downloadUrl);
    }

    return this.props.setModalDownloadParams({
      open: true,
      downloadUrl,
      size
    });
  };

  downloadMenuOptionsWithSurvey = [
    {
      label: 'All data (62 MB)',
      action: this.handleOnClick.bind(this, `${url}/all.zip`, '62 MB')
    },
    {
      label: 'NDC Content (6.4 MB)',
      action: this.handleOnClick.bind(this, `${url}/ndc-content.zip`, '6.4 MB')
    },
    {
      label: 'NDC Targets (329 kB)',
      action: this.handleOnClick.bind(
        this,
        `${url}/NDC_quantification.zip`,
        '329 kB'
      )
    },
    {
      label: 'NDC Text in HTML (53 MB)',
      action: this.handleOnClick.bind(this, `${url}/NDC_text_HTML.zip`, '53 MB')
    },
    {
      label: 'GHG emissions (3.5 MB)',
      action: this.handleOnClick.bind(
        this,
        `${url}/ghg-emissions.zip`,<commit_msg>Adds download for NDC-SDG Linkages<commit_after>import { connect } from 'react-redux';
import { createElement, PureComponent } from 'react';
import { getStorageWithExpiration } from 'utils/localStorage';
import PropTypes from 'prop-types';

import { actions } from 'components/modal-download';

import Component from './download-menu-component';

const { S3_BUCKET_NAME } = process.env;
const { CW_FILES_PREFIX } = process.env;

const server = `http://${S3_BUCKET_NAME}.s3.amazonaws.com`;
const folder = `/${CW_FILES_PREFIX}climate-watch-download-zip`;
const url = `${server}${folder}`;

const mapStateToProps = ({ modalDownload }) => ({
  isOpen: modalDownload.isOpen
});

class DownloadMenuContainer extends PureComponent {
  handleOnClick = (downloadUrl, size) => {
    if (getStorageWithExpiration('userSurvey')) {
      return window.location.assign(downloadUrl);
    }

    return this.props.setModalDownloadParams({
      open: true,
      downloadUrl,
      size
    });
  };

  downloadMenuOptionsWithSurvey = [
    {
      label: 'All data (62 MB)',
      action: this.handleOnClick.bind(this, `${url}/all.zip`, '62 MB')
    },
    {
      label: 'NDC Content (6.4 MB)',
      action: this.handleOnClick.bind(this, `${url}/ndc-content.zip`, '6.4 MB')
    },
    {
      label: 'NDC-SDG Linkages (763 KB)',
      action: this.handleOnClick.bind(
        this,
        `${url}/ndc-sdg-linkages.zip`,
        '763 KB'
      )
    },
    {
      label: 'NDC Targets (329 kB)',
      action: this.handleOnClick.bind(
        this,
        `${url}/NDC_quantification.zip`,
        '329 kB'
      )
    },
    {
      label: 'NDC Text in HTML (53 MB)',
      action: this.handleOnClick.bind(this, `${url}/NDC_text_HTML.zip`, '53 MB')
    },
    {
      label: 'GHG emissions (3.5 MB)',
      action: this.handleOnClick.bind(
        this,
        `${url}/ghg-emissions.zip`,
{'fraction_non_alphanumeric': 0.15248525695029486, 'fraction_numerical': 0.014602639707947207, 'mean_word_length': 3.015783540022548, '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': 23, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1691419', 'n_tokens_mistral': 1196, 'n_tokens_neox': 1180, 'n_words': 244}