This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| logstash -f ./logstash.config | |
| - AWS Elasticsearch | |
| hosts => "https://search-faq-staging-nwt2m3iq6falf52dhkxc2ia4me.us-east-2.es.amazonaws.com:443" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title></title> | |
| </head> | |
| <body> | |
| <script type="text/javascript"> | |
| function shorten(s) { | |
| const len = s.length; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from "react"; | |
| import axios from "axios"; | |
| import Loading from "../components/Loading"; | |
| class Import extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.file = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| const { intentsClient, sessionClient } = require('./config'); | |
| const { jsonToCsv, mergeIntents } = require('./dialogflowHelper'); | |
| const projectId = process.env.DIALOGFLOW_PROJECT_ID; | |
| const detectIntent = (query, languageCode = 'en-Us') => { | |
| // Define session path | |
| const sessionId = Math.random().toString(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Autosuggest from "react-autosuggest"; | |
| import React, { Component } from "react"; | |
| import "./Home.css"; | |
| import SuggestionValue from "./SuggestionValue"; | |
| import axios from "axios"; | |
| import { find } from "lodash"; | |
| import config from "../config"; | |
| const renderSuggestion = suggestion => suggestion.q; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| axios({ | |
| url: 'http://localhost:5000/static/example.pdf', | |
| method: 'GET', | |
| responseType: 'blob', // important | |
| }).then((response) => { | |
| const url = window.URL.createObjectURL(new Blob([response.data])); | |
| const link = document.createElement('a'); | |
| link.href = url; | |
| link.setAttribute('download', 'file.pdf'); | |
| document.body.appendChild(link); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from "react"; | |
| export default class SearchBar extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.handleQueryChange = this.handleQueryChange.bind(this); | |
| } | |
| handleQueryChange = e => { | |
| this.props.onQueryChange(e.target.value); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| import TextField from 'components/base/TextField'; | |
| const WAIT_INTERVAL = 1000; | |
| const ENTER_KEY = 13; | |
| export default class TextSearch extends Component { | |
| constructor(props) { | |
| super(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "extends": ["react-app", "plugin:prettier/recommended"] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| const csv = require('csvtojson'); | |
| const stringToRow = (csvStr) => new Promise((resolve, reject) => { | |
| csv({ | |
| noheader: true, | |
| output: 'csv' | |
| }) | |
| .fromString(csvStr) |