-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Tracking): add checkbox to post comment also as issue comment (#99)
* feat(Tracking): add checkbox to post worklog comment also as issue comment ISSUES CLOSED: #90 * fix: fix comment field cancel behavior
- Loading branch information
1 parent
0ce226d
commit 6f6c23a
Showing
6 changed files
with
88 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
68 changes: 68 additions & 0 deletions
68
app/containers/IssueView/TrackingBar/WorklogCommentDialog/WorklogCommentOptions.jsx
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// @flow | ||
import React from 'react'; | ||
import { connect } from 'react-redux'; | ||
import { compose, withHandlers } from 'recompose'; | ||
|
||
import { | ||
CheckboxStateless as Checkbox, | ||
CheckboxGroup, | ||
} from '@atlaskit/checkbox'; | ||
|
||
import { | ||
uiActions, | ||
} from 'actions'; | ||
import { | ||
getUiState, | ||
} from 'selectors'; | ||
|
||
import type { | ||
StatelessFunctionalComponent, | ||
Node, | ||
} from 'react'; | ||
|
||
import type { | ||
Dispatch, | ||
} from 'types'; | ||
|
||
import { | ||
IssueCommentCheckboxWrapper, | ||
} from './styled'; | ||
|
||
type Props = { | ||
postAlsoAsIssueComment: boolean, | ||
changePostOption: () => void, | ||
}; | ||
|
||
const WorklogCommentOptions: StatelessFunctionalComponent<Props> = ({ | ||
postAlsoAsIssueComment, | ||
changePostOption, | ||
}: Props): Node => | ||
<IssueCommentCheckboxWrapper> | ||
<CheckboxGroup> | ||
<Checkbox | ||
isChecked={postAlsoAsIssueComment} | ||
value={postAlsoAsIssueComment} | ||
name="postAlsoAsIssueComment" | ||
label="Post also as comment to issue" | ||
onChange={changePostOption} | ||
/> | ||
</CheckboxGroup> | ||
</IssueCommentCheckboxWrapper>; | ||
|
||
export default compose( | ||
connect( | ||
state => ({ | ||
postAlsoAsIssueComment: getUiState('postAlsoAsIssueComment')(state), | ||
}), | ||
dispatch => ({ dispatch }), | ||
), | ||
withHandlers({ | ||
changePostOption: ({ | ||
dispatch, | ||
postAlsoAsIssueComment, | ||
}: { | ||
postAlsoAsIssueComment: boolean, | ||
dispatch: Dispatch, | ||
}) => () => dispatch(uiActions.setUiState('postAlsoAsIssueComment', !postAlsoAsIssueComment)) | ||
}) | ||
)(WorklogCommentOptions); |
This file contains 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
This file contains 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
This file contains 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
This file contains 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