Skip to content

Commit 4b141e6

Browse files
committed
fix(tags): add tag modal not displaying create tag modal
1 parent f62045a commit 4b141e6

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/client/containers/Modals/AddTagsModal.jsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import PropTypes from 'prop-types'
1616
import { connect } from 'react-redux'
1717

1818
import { getTagsWithPage } from 'actions/tickets'
19+
import { showModal, hideModal } from 'actions/common'
1920

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

43+
onCreateTagClicked (e) {
44+
e.preventDefault()
45+
this.props.hideModal()
46+
setTimeout(() => {
47+
this.props.showModal('CREATE_TAG')
48+
}, 300)
49+
}
50+
4251
onSubmit (e) {
4352
e.preventDefault()
4453
let selectedTags = $(e.target.tags).val()
@@ -108,7 +117,7 @@ class AddTagsModal extends React.Component {
108117
</option>
109118
))}
110119
</select>
111-
<button type='button' style={{ borderRadius: 0 }}>
120+
<button type='button' style={{ borderRadius: 0 }} onClick={e => this.onCreateTagClicked(e)}>
112121
<i className='material-icons' style={{ marginRight: 0 }}>
113122
add
114123
</i>
@@ -151,12 +160,14 @@ AddTagsModal.propTypes = {
151160
currentTags: PropTypes.array,
152161
tagsSettings: PropTypes.object.isRequired,
153162
getTagsWithPage: PropTypes.func.isRequired,
154-
socket: PropTypes.object.isRequired
163+
socket: PropTypes.object.isRequired,
164+
showModal: PropTypes.func.isRequired,
165+
hideModal: PropTypes.func.isRequired
155166
}
156167

157168
const mapStateToProps = state => ({
158169
tagsSettings: state.tagsSettings,
159170
socket: state.shared.socket
160171
})
161172

162-
export default connect(mapStateToProps, { getTagsWithPage })(AddTagsModal)
173+
export default connect(mapStateToProps, { getTagsWithPage, showModal, hideModal })(AddTagsModal)

0 commit comments

Comments
 (0)