{"version":3,"sources":["webpack:///./app/containers/HelpCenter/constants.js","webpack:///./app/containers/HelpCenter/actions.js","webpack:///./app/containers/HelpCenter/sagas.js","webpack:///./app/containers/HelpCenter/reducer.js","webpack:///./app/containers/HelpCenter/selectors.js","webpack:///./app/containers/HelpCenter/Article.js","webpack:///./app/containers/HelpCenter/index.js"],"names":["FETCH_HELP_ARTICLES","FETCH_HELP_ARTICLES_SUCCESS","FETCH_HELP_ARTICLES_ERROR","fetchHelpArticles","createAction","fetchHelpArticlesSuccess","fetchHelpArticlesError","getHelpArticles","helpCenterSaga","window","config","put","manifestUrl","helpCenterManifestUrl","fetch","then","response","json","console","error","all","takeLatest","initialState","fromJS","loading","helpArticles","helpCenterReducer","handleActions","state","payload","set","selectHelpCenterDomain","get","Map","selectHelpArticles","createSelector","List","selectHelpArticlesLoading","selectError","themeable","icon","article","theme","styles","container","padding","header","display","gridTemplateColumns","title","fontWeight","paddingRight","date","color","neutralMedium","description","dark","fontSize","margin","marginRight","Hoverable","onClick","open","style","hoverStyle","backgroundColor","highlight","CloudBadge","type","Icon","fa","name","moment","format","MarkdownDisplay","content","TableLoader","CenterContent","HelpCenter","props","e","setState","search","target","value","searchVal","toLowerCase","map","category","update","articles","filter","includes","filterNot","cat","isEmpty","BorderedCard","sectionContainer","sectionTitle","sectionContent","articleWrapper","isLoading","Error","filteredArticles","getFilteredArticles","EmptySection","renderSection","preloadSearch","qs","parse","location","gridTemplateRows","gridTemplateAreas","height","gridArea","gridColumnGap","marginBottom","textAlign","overflow","fontVariant","neutralDark","borderBottom","neutralLight","maxHeight","supportWrapper","this","SearchInput","placeholder","onChange","setSearch","Button","href","SUPPORT_EMAIL","renderContent","alignItems","justifyContent","rel","openSourceLicenseUrl","React","Component","mapStateToProps","createStructuredSelector","withConnect","connect","dispatch","bindActionCreators","withReducer","injectReducer","key","reducer","withSaga","injectSaga","saga","sagas","compose"],"mappings":"qIAAA,sRAAO,IAAMA,oBAAsB,qCACtBC,4BACX,6CACWC,0B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HP,KAAKQ,gBACN,sBACEtE,MAAO,CACLhB,QAAS,OACTuF,WAAY,SACZC,eAAgB,oBAJpB,EAOE,oBACExE,MAAO,CACLlB,QAAS,+BACTK,WAAY,OAEdiC,OAAO,SACPqD,IAAI,sBACJL,KAAM1H,OAAOC,OAAO+H,2BAPtB,iC,4GA3KV,YAAgCC,gBAAMC,WAqMhCC,gBAAkBC,aAAyB,CAC/C1H,MAAOmB,YACP+D,UAAWhE,0BACXZ,aAAcS,qBAYhB,IAAM4G,YAAcC,oBAClBH,iBAVF,SAA4BI,UAC1B,OAAOC,oCACL,CACE9I,6BAEF6I,aASEE,YAAcC,wBAAc,CAChCC,IAAK,aACLC,QAASA,UAELC,SAAWC,qBAAW,CAAEH,IAAK,aAAcI,KAAMC,UAExCC,qDACbZ,YACAI,YACAI,SACA/G,YAJamH,CAKb5E","file":"34.2bdb18baefbfe5a3a9c2.chunk.js","sourcesContent":["export const FETCH_HELP_ARTICLES = 'app/HelpCenter/FETCH_HELP_ARTICLES'\nexport const FETCH_HELP_ARTICLES_SUCCESS =\n 'app/HelpCenter/FETCH_HELP_ARTICLES_SUCCESS'\nexport const FETCH_HELP_ARTICLES_ERROR =\n 'app/HelpCenter/FETCH_HELP_ARTICLES_ERROR'\n","import {\n FETCH_HELP_ARTICLES,\n FETCH_HELP_ARTICLES_SUCCESS,\n FETCH_HELP_ARTICLES_ERROR,\n} from './constants'\nimport { createAction } from 'redux-actions'\n\nexport const fetchHelpArticles = createAction(FETCH_HELP_ARTICLES)\nexport const fetchHelpArticlesSuccess = createAction(\n FETCH_HELP_ARTICLES_SUCCESS\n)\n\nexport const fetchHelpArticlesError = createAction(FETCH_HELP_ARTICLES_ERROR)\n","import { all, put, takeLatest } from 'redux-saga/effects'\n\nimport { fetchHelpArticlesSuccess, fetchHelpArticlesError } from './actions'\nimport { FETCH_HELP_ARTICLES } from './constants'\n\nfunction* getHelpArticles() {\n if (!window.config) {\n yield put(fetchHelpArticlesError('Could not read from configuration'))\n }\n\n try {\n const manifestUrl = window.config.helpCenterManifestUrl\n if (!manifestUrl) {\n yield put(\n fetchHelpArticlesError(\n 'No source for help documents has been configured'\n )\n )\n return\n }\n\n const json = yield fetch(manifestUrl).then(response => response.json())\n\n yield put(fetchHelpArticlesSuccess(json))\n } catch (e) {\n yield put(fetchHelpArticlesError('Error fetching help documents', e))\n //eslint-disable-next-line no-console\n console.error('Failed to fetch manifest of help articles', e)\n }\n}\n\nfunction* helpCenterSaga() {\n yield all([takeLatest(FETCH_HELP_ARTICLES, getHelpArticles)])\n}\n\nexport default helpCenterSaga\n","import { fromJS } from 'immutable'\n\nimport {\n FETCH_HELP_ARTICLES,\n FETCH_HELP_ARTICLES_SUCCESS,\n FETCH_HELP_ARTICLES_ERROR,\n} from './constants'\nimport { handleActions } from 'redux-actions'\n\nconst initialState = fromJS({\n loading: false,\n helpArticles: [],\n error: null,\n})\n\nconst helpCenterReducer = handleActions(\n {\n [FETCH_HELP_ARTICLES_SUCCESS]: (state, { payload }) =>\n state\n .set('helpArticles', fromJS(payload))\n .set('loading', false)\n .set('error', null),\n [FETCH_HELP_ARTICLES]: state =>\n state.set('loading', true).set('error', null),\n [FETCH_HELP_ARTICLES_ERROR]: (state, { payload }) =>\n state.set('loading', false).set('error', payload),\n },\n initialState\n)\n\nexport default helpCenterReducer\n","import { createSelector } from 'reselect'\nimport { Map, List } from 'immutable'\n\nexport const selectHelpCenterDomain = state => state.get('helpCenter', Map())\n\nexport const selectHelpArticles = createSelector(\n selectHelpCenterDomain,\n state => state.get('helpArticles') || List()\n)\n\nexport const selectHelpArticlesLoading = createSelector(\n selectHelpCenterDomain,\n state => state.get('loading') || false\n)\n\nexport const selectError = createSelector(\n selectHelpCenterDomain,\n state => state.get('error') || false\n)\n","import React from 'react'\nimport PropTypes from 'prop-types'\nimport ImmutablePropTypes from 'react-immutable-proptypes'\nimport moment from 'moment'\n\nimport Hoverable from 'components/Hoverable'\nimport Icon from 'components/Icon'\nimport themeable, { themeShape } from 'containers/ThemeManager/Themeable'\nimport CloudBadge from 'components/CloudBadge'\nimport MarkdownDisplay from 'components/MarkdownDisplay'\n\nconst Article = ({ article, theme }) => {\n const openLink = () => {\n window.open(article.get('url'), '_blank')\n }\n\n const styles = {\n container: {\n padding: '0.5em 1em',\n },\n header: {\n display: 'grid',\n gridTemplateColumns: 'auto 1fr auto',\n },\n title: {\n fontWeight: 400,\n paddingRight: '0.5em',\n },\n date: {\n color: theme.neutralMedium,\n fontWeight: 400,\n },\n description: {\n color: theme.dark,\n fontSize: '0.95em',\n margin: '0.5em 0',\n },\n icon: {\n marginRight: '0.5em',\n },\n }\n\n const getIcon = () => {\n const icon = article.get('iconName')\n\n if (!icon) {\n return \n }\n\n if (\n icon === 'aws' ||\n icon === 'azure' ||\n icon === 'sonrai' ||\n icon === 'gcp'\n ) {\n return \n }\n\n return \n }\n\n return (\n \n
\n {getIcon()}\n {article.get('name')}\n {article.get('date') && (\n \n {moment(article.get('date')).format('ll')}\n \n )}\n
\n\n {article.get('description') && (\n
\n \n
\n )}\n \n )\n}\n\nArticle.propTypes = {\n article: ImmutablePropTypes.contains({\n url: PropTypes.string.isRequired,\n name: PropTypes.string.isRequired,\n description: PropTypes.string,\n date: PropTypes.string,\n iconName: PropTypes.string,\n }),\n theme: themeShape,\n}\n\nexport default themeable(Article)\n","import React from 'react'\nimport PropTypes from 'prop-types'\nimport { connect } from 'react-redux'\nimport { createStructuredSelector } from 'reselect'\nimport { bindActionCreators, compose } from 'redux'\nimport ImmutablePropTypes from 'react-immutable-proptypes'\nimport TableLoader from 'components/TableLoader'\nimport injectReducer from 'utils/injectReducer'\nimport injectSaga from 'utils/injectSaga'\nimport { List } from 'immutable'\nimport EmptySection from 'components/EmptySection'\nimport CenterContent from 'components/CenterContent'\nimport Error from 'components/Error'\nimport qs from 'query-string'\nimport { SUPPORT_EMAIL } from 'appConstants'\nimport Button from 'components/Button'\nimport BorderedCard from 'components/BorderedCard'\nimport SearchInput from 'components/SearchInput'\nimport themeable, { themeShape } from 'containers/ThemeManager/Themeable'\nimport reducer from './reducer'\nimport sagas from './sagas'\nimport {\n selectHelpArticlesLoading,\n selectHelpArticles,\n selectError,\n} from './selectors'\nimport { fetchHelpArticles } from './actions'\nimport Article from './Article'\n\nexport class HelpCenter extends React.Component {\n constructor(props) {\n super(props)\n\n if (props.helpArticles.isEmpty()) {\n props.fetchHelpArticles()\n }\n\n const preloadSearch = qs.parse(props.location.search).preloadSearch\n\n this.state = {\n search: preloadSearch || '',\n }\n\n this.styles = {\n container: {\n display: 'grid',\n gridTemplateRows: 'auto 1fr',\n gridTemplateAreas: '\"header\" \"content\"',\n padding: '1em',\n height: '100%',\n },\n header: {\n gridArea: 'header',\n padding: '1em 3em',\n display: 'grid',\n gridTemplateColumns: '40% 1fr',\n gridColumnGap: '4em',\n },\n title: {\n fontSize: '1.3em',\n fontWeight: 400,\n marginBottom: '1em',\n textAlign: 'center',\n },\n content: {\n gridArea: 'content',\n overflow: 'auto',\n padding: '1em 3em',\n display: 'grid',\n gridTemplateColumns: '1fr 1fr',\n gridColumnGap: '4em',\n },\n sectionTitle: {\n fontVariant: 'small-caps',\n color: this.props.theme.neutralDark,\n fontSize: '1.3em',\n fontWeight: 400,\n borderBottom: `2px solid ${this.props.theme.neutralLight}`,\n },\n articleWrapper: {\n margin: '0.5em',\n },\n sectionContainer: {\n marginBottom: '2em',\n },\n sectionContent: {\n maxHeight: '600px',\n overflow: 'auto',\n },\n supportWrapper: {\n textAlign: 'right',\n },\n }\n }\n\n setSearch = e => {\n this.setState({\n search: e.target.value,\n })\n }\n\n getFilteredArticles = () => {\n if (!this.state.search) {\n return this.props.helpArticles\n }\n\n const searchVal = this.state.search.toLowerCase()\n\n return this.props.helpArticles\n .map(category =>\n category.update('articles', articles =>\n articles.filter(\n article =>\n article\n .get('description', '')\n .toLowerCase()\n .includes(searchVal) ||\n article\n .get('name', '')\n .toLowerCase()\n .includes(searchVal)\n )\n )\n )\n .filterNot(cat => cat.get('articles', List()).isEmpty())\n }\n\n renderSection = category => {\n return (\n \n
\n {category.get('categoryName')}\n
\n
\n {category.get('articles', List()).map(article => (\n
\n
\n
\n ))}\n
\n
\n )\n }\n\n renderContent = () => {\n if (this.props.isLoading) {\n return \n }\n\n if (this.props.error) {\n return \n }\n\n if (this.props.helpArticles.isEmpty()) {\n return No knowledge base articles\n }\n\n const filteredArticles = this.getFilteredArticles()\n\n if (this.state.search && filteredArticles.isEmpty()) {\n return (\n \n No resources matching "{this.state.search}"\n \n )\n }\n\n return (\n
\n {filteredArticles.map(this.renderSection)}\n
\n )\n }\n\n render() {\n return (\n
\n
\n
\n \n
\n\n
\n \n
\n
\n {this.renderContent()}\n \n \n Open Source Licenses\n \n
\n \n )\n }\n}\n\nHelpCenter.propTypes = {\n error: PropTypes.string,\n isLoading: PropTypes.bool,\n helpArticles: ImmutablePropTypes.list,\n fetchHelpArticles: PropTypes.func,\n theme: themeShape,\n location: PropTypes.object,\n}\n\nconst mapStateToProps = createStructuredSelector({\n error: selectError,\n isLoading: selectHelpArticlesLoading,\n helpArticles: selectHelpArticles,\n})\n\nfunction mapDispatchToProps(dispatch) {\n return bindActionCreators(\n {\n fetchHelpArticles,\n },\n dispatch\n )\n}\n\nconst withConnect = connect(\n mapStateToProps,\n mapDispatchToProps\n)\n\nconst withReducer = injectReducer({\n key: 'helpCenter',\n reducer: reducer,\n})\nconst withSaga = injectSaga({ key: 'helpCenter', saga: sagas })\n\nexport default compose(\n withConnect,\n withReducer,\n withSaga,\n themeable\n)(HelpCenter)\n"],"sourceRoot":""}