Skip to content

Commit

Permalink
Merge branch 'release/2.6.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lopukhin committed Mar 27, 2018
2 parents a1cf673 + 91be165 commit be5e461
Show file tree
Hide file tree
Showing 21 changed files with 434 additions and 178 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
<a name="2.6.4"></a>
## [2.6.4](https://github.com/web-pal/chronos-timetracker/compare/v2.6.3...v2.6.4) (2018-03-27)


### Bug Fixes

* **Browsing Issues:** fix for filter of issues for sprint ([#102](https://github.com/web-pal/chronos-timetracker/issues/102)) ([26b0608](https://github.com/web-pal/chronos-timetracker/commit/26b0608))
* **Issue Detail View:** fix too wide comments tab if there are comments with long strings ([#100](https://github.com/web-pal/chronos-timetracker/issues/100)) ([804bfb6](https://github.com/web-pal/chronos-timetracker/commit/804bfb6)), closes [#83](https://github.com/web-pal/chronos-timetracker/issues/83)


### Features

* add adjust start time checkbox to worklog modal ([#98](https://github.com/web-pal/chronos-timetracker/issues/98)) ([0ce226d](https://github.com/web-pal/chronos-timetracker/commit/0ce226d)), closes [#84](https://github.com/web-pal/chronos-timetracker/issues/84)
* **Tracking:** add checkbox to post comment also as issue comment ([#99](https://github.com/web-pal/chronos-timetracker/issues/99)) ([6f6c23a](https://github.com/web-pal/chronos-timetracker/commit/6f6c23a)), closes [#90](https://github.com/web-pal/chronos-timetracker/issues/90)
* **Tracking:** worklog comment as a required item ([#101](https://github.com/web-pal/chronos-timetracker/issues/101)) ([33043bd](https://github.com/web-pal/chronos-timetracker/commit/33043bd)), closes [#81](https://github.com/web-pal/chronos-timetracker/issues/81)



<a name="2.6.3"></a>
## [2.6.3](https://github.com/web-pal/chronos-timetracker/compare/v2.6.2...v2.6.3) (2018-03-21)

Expand Down
2 changes: 1 addition & 1 deletion app/components/ErrorBoundary/ErrorBoundary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ErrorBoundary extends Component<any, any> {
return (
<div>
<h1>Something went wrong.</h1>
You may try to
You may try to &nbsp;
<Button
appearance="danger"
onClick={() => this.props.dispatch(
Expand Down
3 changes: 3 additions & 0 deletions app/containers/IssueView/IssueComments/styled/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ export const CommentBody = styled.span`
color: #172B4D;
font-weight: 400;
margin-left: 48px;
& > p, & > div, & > span {
word-break: break-all;
}
`;

export const CommentAvatar = styled.img`
Expand Down
27 changes: 14 additions & 13 deletions app/containers/IssueView/TrackingBar/TrackingBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ type Props = {
remainingEstimateNewValue: string,
remainingEstimateReduceByValue: string,
dispatch: Dispatch,
isCommentDialogOpen: boolean,
}

function addLeadingZero(s: number): string {
Expand All @@ -80,6 +81,7 @@ const TrackingBar: StatelessFunctionalComponent<Props> = ({
remainingEstimateNewValue,
remainingEstimateReduceByValue,
dispatch,
isCommentDialogOpen,
}: Props): Node => (
<Transition
appear
Expand Down Expand Up @@ -107,6 +109,8 @@ const TrackingBar: StatelessFunctionalComponent<Props> = ({
onRemainingEstimateReduceByChange={(value) => {
dispatch(uiActions.setUiState('remainingEstimateReduceByValue', value));
}}
dialogOpen={isCommentDialogOpen}
setDialogState={value => dispatch(uiActions.setUiState('isCommentDialogOpen', value))}
/>
{screenshotsAllowed &&
<div style={{ marginLeft: 10 }}>
Expand Down Expand Up @@ -139,22 +143,18 @@ const TrackingBar: StatelessFunctionalComponent<Props> = ({
{getTimeString(time)}
</Time>
</Flex>
<div
onClick={() => {
if (screenshotUploading) {
// eslint-disable-next-line no-alert
window.alert(
'Currently app in process of uploading screenshot, wait few seconds please',
);
} else {
dispatch(timerActions.stopTimerRequest());
}
}}
>
<div className="worklog-edit-popup-shouldNotCLose">
<StopButton
alt="stop"
onClick={() => {
dispatch(timerActions.stopTimerRequest());
if (screenshotUploading) {
// eslint-disable-next-line no-alert
window.alert(
'Currently app in process of uploading screenshot, wait few seconds please',
);
} else {
dispatch(timerActions.stopTimerRequest());
}
}}
/>
</div>
Expand All @@ -172,6 +172,7 @@ function mapStateToProps(state) {
remainingEstimateValue: getUiState('remainingEstimateValue')(state),
remainingEstimateNewValue: getUiState('remainingEstimateNewValue')(state),
remainingEstimateReduceByValue: getUiState('remainingEstimateReduceByValue')(state),
isCommentDialogOpen: getUiState('isCommentDialogOpen')(state),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
EditButtonContainer,
} from './styled';

import WorklogCommentOptions from './WorklogCommentOptions';

type Props = {
issue: Issue,
Expand All @@ -34,35 +35,39 @@ type Props = {
onRemainingEstimateChange: Function,
onRemainingEstimateNewChange: Function,
onRemainingEstimateReduceByChange: Function,
dialogOpen: boolean,
setDialogState: (dialogOpen: boolean) => void,
};

type State = {
dialogOpen: boolean,
isEditing: boolean,
};

class WorklogCommentDialog extends PureComponent<Props, State> {
constructor(props: Props) {
super(props);
this.state = {
dialogOpen: false,
isEditing: true,
comment: this.props.comment,
};
}

onConfirm = () => {
this.exitEditingMode();
this.props.onSetComment(this.state.comment);
};

onCancel = () => {
this.exitEditingMode();
this.setState({ comment: this.props.comment });
};

toggleDialog = () => {
const newState = !this.props.dialogOpen;
this.setState({
dialogOpen: !this.state.dialogOpen,
isEditing: !this.state.dialogOpen,
isEditing: newState,
});
this.props.setDialogState(newState);
}

enterEditingMode = () => {
Expand All @@ -89,8 +94,8 @@ class WorklogCommentDialog extends PureComponent<Props, State> {
autoFocus
isEditing
isInitiallySelected
value={this.props.comment}
onChange={e => this.props.onSetComment(e.target.value)}
value={this.state.comment}
onChange={e => this.setState({ comment: e.target.value })}
/>
}
readView={(
Expand All @@ -106,6 +111,7 @@ class WorklogCommentDialog extends PureComponent<Props, State> {
onConfirm={this.onConfirm}
onCancel={this.onCancel}
/>
<WorklogCommentOptions />
<RemainingEstimatePicker
issue={this.props.issue}
value={this.props.remainingEstimateValue}
Expand All @@ -124,17 +130,19 @@ class WorklogCommentDialog extends PureComponent<Props, State> {
<EditButtonContainer>
<InlineDialog
content={this.renderDialog()}
isOpen={this.state.dialogOpen}
isOpen={this.props.dialogOpen}
onClose={(e) => {
// Atlaskit HACK.
// without it inline dialog gets closed on clicking inline-edit action buttons
const { path } = e.event;
const shouldClose = !path.some(el => el.className === 'worklog-edit-popup');
const shouldClose = !path.some(el =>
el.className === 'worklog-edit-popup' ||
el.className === 'worklog-edit-popup-shouldNotCLose');
if (shouldClose) {
this.setState({
dialogOpen: false,
isEditing: true,
});
this.props.setDialogState(false);
}
}}
position="bottom left"
Expand Down
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);
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ export const EditButton = styled(EditFilledIcon)`
export const EditButtonContainer = styled.div`
cursor: pointer;
`;

export const IssueCommentCheckboxWrapper = styled.div`
margin-left: -10px;
`;
19 changes: 18 additions & 1 deletion app/containers/Modals/SettingsModal/General/GeneralSettings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,25 @@ import type {
import {
SettingsSectionContent,
ContentLabel,
InputNumber,
} from './styled';


type Props = {
settings: SettingsGeneral,
setTraySettings: (value: any) => void,
clearChache: () => void,
setEmptyWorklogSettings: () => void,
}

const GeneralSettings: StatelessFunctionalComponent<Props> = ({
settings,
setTraySettings,
clearChache,
setEmptyWorklogSettings,
}: Props): Node => {
const isIconHidden = !!settings.trayShowTimer;
const isEmptyWorklogForbid = !!settings.isEmptyWorklogForbid;
// const isTimerHidden = false;
return (
<SettingsSectionContent>
Expand Down Expand Up @@ -72,9 +76,22 @@ const GeneralSettings: StatelessFunctionalComponent<Props> = ({
Clear cache
</Button>
</ButtonGroup>
<H100 style={{ margin: '4px 0 0 0' }}>
<H100 style={{ margin: '4px 0 0 6px' }}>
Clearing cache will cause logout.
</H100>
<br />
<H100 style={{ margin: '0 0 4px 6px' }}>
Configure whether to forbid sending worlogs without comment
</H100>
<CheckboxGroup>
<Checkbox
isChecked={isEmptyWorklogForbid}
value={isEmptyWorklogForbid}
name="sendEmptyWorklog"
label="Forbid sending worklog without comment"
onChange={() => setEmptyWorklogSettings(!isEmptyWorklogForbid)}
/>
</CheckboxGroup>
</Flex>
</SettingsSectionContent>
);
Expand Down
23 changes: 23 additions & 0 deletions app/containers/Modals/SettingsModal/General/styled/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,26 @@ export const ContentLabel = styled.span`
font-weight: 600;
color: black;
`;

export const InputNumber = styled.input.attrs({
type: 'number',
})`
appearance: none;
color: inherit;
font-size: 16px;
font-family: inherit;
letter-spacing: inherit;
background: transparent;
border: 0;
box-sizing: border-box;
cursor: inherit;
line-height: inherit;
margin: 0;
outline: none;
padding: 0;
width: 100%;
:invalid {
box-shadow: none;
}
`;
7 changes: 7 additions & 0 deletions app/containers/Modals/SettingsModal/SettingsModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ const SettingsModal: StatelessFunctionalComponent<Props> = ({
clearChache={() => dispatch(
settingsActions.clearElectronCache(),
)}
setEmptyWorklogSettings={(value) => {
dispatch(settingsActions.setLocalDesktopSetting(
value,
'isEmptyWorklogForbid',
));
}
}
/>
}
{tab === 'Notifications' &&
Expand Down
Loading

0 comments on commit be5e461

Please sign in to comment.