Skip to content

Commit

Permalink
fix(tags): add tag modal not displaying create tag modal
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed Jul 5, 2022
1 parent f62045a commit 4b141e6
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/client/containers/Modals/AddTagsModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import PropTypes from 'prop-types'
import { connect } from 'react-redux'

import { getTagsWithPage } from 'actions/tickets'
import { showModal, hideModal } from 'actions/common'

import BaseModal from 'containers/Modals/BaseModal'
import Button from 'components/Button'
Expand All @@ -39,6 +40,14 @@ class AddTagsModal extends React.Component {
$(this.select).trigger('chosen:updated')
}

onCreateTagClicked (e) {
e.preventDefault()
this.props.hideModal()
setTimeout(() => {
this.props.showModal('CREATE_TAG')
}, 300)
}

onSubmit (e) {
e.preventDefault()
let selectedTags = $(e.target.tags).val()
Expand Down Expand Up @@ -108,7 +117,7 @@ class AddTagsModal extends React.Component {
</option>
))}
</select>
<button type='button' style={{ borderRadius: 0 }}>
<button type='button' style={{ borderRadius: 0 }} onClick={e => this.onCreateTagClicked(e)}>
<i className='material-icons' style={{ marginRight: 0 }}>
add
</i>
Expand Down Expand Up @@ -151,12 +160,14 @@ AddTagsModal.propTypes = {
currentTags: PropTypes.array,
tagsSettings: PropTypes.object.isRequired,
getTagsWithPage: PropTypes.func.isRequired,
socket: PropTypes.object.isRequired
socket: PropTypes.object.isRequired,
showModal: PropTypes.func.isRequired,
hideModal: PropTypes.func.isRequired
}

const mapStateToProps = state => ({
tagsSettings: state.tagsSettings,
socket: state.shared.socket
})

export default connect(mapStateToProps, { getTagsWithPage })(AddTagsModal)
export default connect(mapStateToProps, { getTagsWithPage, showModal, hideModal })(AddTagsModal)

0 comments on commit 4b141e6

Please sign in to comment.