\n
\n {!_.isEmpty(this.props.swimlaneTags) && (\n
\n {this.props.swimlaneTags.map((tag, i) => {\n const tagKey = _.first(tag.split(':'))\n const tagValue =\n tag.split(':').length > 1 ? _.last(tag.split(':')) : ''\n return (\n \n )\n })}\n
\n )}\n\n {this.state.isEditing || _.isEmpty(this.props.swimlaneTags) ? (\n
this.setState({ isEditing: false })}\n options={this.props.options}\n isLoading={this.props.isLoadingTagValues}\n getTagValues={this.props.getTagValues}\n tagValues={this.props.tagValues}\n onChange={this.props.onChange}\n showCloseEdit={!_.isEmpty(this.props.swimlaneTags)}\n disabled={this.props.disabled}\n />\n ) : (\n \n \n this.setState({\n isEditing: true,\n })\n }\n color=\"primary\"\n disabled={this.props.disabled}\n >\n \n Add Tag\n \n
\n )}\n \n )\n }\n }\n}\n\nSwimlaneTagManager.propTypes = {\n isAdvanced: PropTypes.bool,\n fetchTags: PropTypes.func,\n onChange: PropTypes.func,\n options: PropTypes.array,\n selectStyles: PropTypes.object,\n swimlaneTags: PropTypes.array,\n theme: themeShape,\n isLoadingTagValues: PropTypes.bool,\n tagValues: ImmutablePropTypes.iterable,\n getTagValues: PropTypes.func,\n disabled: PropTypes.bool,\n}\n\nexport default themeable(SwimlaneTagManager)\n","/*\n *\n * SwimlaneManager constants\n *\n */\n\nexport const GET_PREVIEW_RESULTS = 'app/SwimlaneManager/GET_PREVIEW_RESULTS'\nexport const SET_PREVIEW_RESULTS = 'app/SwimlaneManager/SET_PREVIEW_RESULTS'\nexport const CREATE_SWIMLANE = 'app/SwimlaneManager/CREATE_SWIMLANE'\nexport const CREATE_SWIMLANE_SUCCESS =\n 'app/SwimlaneManager/CREATE_SWIMLANE_SUCCESS'\n\nexport const GET_TAG_VALUES = 'app/SwimlaneManager/GET_TAG_VALUES'\nexport const SET_TAG_VALUES = 'app/SwimlaneManager/SET_TAG_VALUES'\n\nexport const GET_BOT_VALUES = 'app/SwimlaneManager/GET_BOT_VALUES'\nexport const SET_BOT_VALUES = 'app/SwimlaneManager/SET_BOT_VALUES'\n\nexport const SET_MANAGEMENT_ERROR = 'app/SwimlaneManager/SET_MANAGEMENT_ERROR'\n","/*\n *\n * SwimlaneManager reducer\n *\n */\n\nimport { fromJS } from 'immutable'\nimport { handleActions } from 'redux-actions'\n\nimport {\n GET_PREVIEW_RESULTS,\n SET_PREVIEW_RESULTS,\n CREATE_SWIMLANE,\n CREATE_SWIMLANE_SUCCESS,\n GET_TAG_VALUES,\n SET_TAG_VALUES,\n SET_BOT_VALUES,\n SET_MANAGEMENT_ERROR,\n} from './constants'\n\nconst initialState = fromJS({\n previewResults: [],\n loadingPreviewResults: false,\n creatingSwimlane: false,\n loadingTagValues: false,\n tagValues: null,\n botValues: [],\n error: null,\n})\n\nconst swimlaneManagerReducer = handleActions(\n {\n [CREATE_SWIMLANE]: state => state.set('creatingSwimlane', true),\n [CREATE_SWIMLANE_SUCCESS]: state =>\n state.set('creatingSwimlane', false).set('error', null),\n [GET_PREVIEW_RESULTS]: state => state.set('loadingPreviewResults', true),\n [SET_PREVIEW_RESULTS]: (state, { payload }) =>\n state\n .set('previewResults', fromJS(payload))\n .set('loadingPreviewResults', false),\n [SET_BOT_VALUES]: (state, { payload }) =>\n state.set('botValues', fromJS(payload)),\n [GET_TAG_VALUES]: state => state.set('loadingTagValues', true),\n [SET_TAG_VALUES]: (state, { payload }) =>\n state.set('loadingTagValues', false).set('tagValues', fromJS(payload)),\n [SET_MANAGEMENT_ERROR]: (state, { payload }) =>\n state\n .set('error', payload)\n .set('loadingPreviewResults', false)\n .set('creatingSwimlane', false),\n },\n initialState\n)\n\nexport default swimlaneManagerReducer\n","import React, { Component } from 'react'\nimport ImmutablePropTypes from 'react-immutable-proptypes'\nimport DataTable from 'components/DataTable'\n\nclass SwimlanePreview extends Component {\n styles = {\n container: {\n height: '100%',\n },\n }\n\n getData = () => {\n // name, srn, account, tagSet, resource id (as specified by High Overlord Jon Beardsman II)\n let data = []\n if (this.props.resources) {\n this.props.resources.toJS().forEach(resource => {\n data.push({\n name: resource.name ? resource.name : '',\n account: resource.account ? resource.account : '',\n tagSet: resource.tagSet ? resource.tagSet : '',\n srn: resource.srn ? resource.srn : '',\n resourceId: resource.resourceId ? resource.resourceId : '',\n })\n })\n }\n return data\n }\n\n sortAlpha = (a, b) => {\n if (a.toLowerCase() === b.toLowerCase()) {\n return 0\n } else if (a.toLowerCase() > b.toLowerCase()) {\n return 1\n } else if (b.toLowerCase() > a.toLowerCase()) {\n return -1\n }\n\n return a.toLowerCase() > b.toLowerCase()\n }\n\n getColumnDef = () => {\n return {\n name: {\n headerName: 'Name',\n field: 'name',\n sort: 'asc',\n comparator: this.sortAlpha,\n },\n account: {\n headerName: 'Account',\n field: 'account',\n },\n resourceId: {\n headerName: 'Resource Id',\n field: 'resourceId',\n },\n srn: {\n headerName: 'Srn',\n field: 'srn',\n },\n tagSet: {\n headerName: 'Tags',\n field: 'tagSet',\n },\n }\n }\n\n render() {\n return (\n