Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MI-2502]:Added custom type for webhook post in order to comment, edit and close issues #13

Merged
merged 14 commits into from
Jan 31, 2023
Merged
20 changes: 5 additions & 15 deletions webapp/src/components/github_issue/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ const GithubIssue = ({theme, post}: GithubIssueProps) => {

const updateStyleForCloseOrReopenButton = () => {
if (postProps.status === 'Close') {
buttonClassName = 'btn btn-danger';
style.close_or_reopen_button.backgroundColor = '#dc3545';
return style.close_or_reopen_button;
}
return null;
return style.other_buttons;
};
Nityanand13 marked this conversation as resolved.
Show resolved Hide resolved
const issue = {
repo_owner: postProps.repo_owner,
Expand All @@ -37,29 +35,21 @@ const GithubIssue = ({theme, post}: GithubIssueProps) => {

const content = (
<div>
<div>
<button
style={{...style.button, ...style.other_buttons}}
className='btn btn-primary'
onClick={() => {
dispatch(attachCommentIssueModal(issue));
}}
onClick={() => dispatch(attachCommentIssueModal(issue))}
>{'Comment'}</button>
<button
style={{...style.button, ...style.other_buttons}}
Nityanand13 marked this conversation as resolved.
Show resolved Hide resolved
className='btn btn-primary'
onClick={() => {
dispatch(editIssueModal(issue));
}}
onClick={() => dispatch(editIssueModal(issue))}
>{'Edit'}</button>
<button
style={{...style.button, ...updateStyleForCloseOrReopenButton()}}
className={buttonClassName}
onClick={() => {
dispatch(closeOrReopenIssueModal(issue));
}}
onClick={() => dispatch(closeOrReopenIssueModal(issue))}
>{postProps.status}</button>
</div>
</div>
);

Expand Down Expand Up @@ -114,7 +104,7 @@ const getStyle = makeStyleFromTheme((theme) => ({
color: theme.buttonColor,
},
close_or_reopen_button: {
backgroundColor: theme.buttonBg,
backgroundColor: '#dc3545',
Nityanand13 marked this conversation as resolved.
Show resolved Hide resolved
},
other_buttons: {
backgroundColor: theme.buttonBg,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ export default class AttachIssueModal extends PureComponent {
onChange={this.handleIssueCommentChange}
value={comment}
/>

</div>
) : (
<div>
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/modals/close_reopen_issue/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ const getStyle = (theme: Theme) => ({
color: '#000',
},
radioButtons: {
margin: '7px 10px',
margin: '0.4em 0.6em',
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export default class CreateOrUpdateIssueModal extends PureComponent {
/>

<Input
id={'title'}
id='title'
label='Title for the GitHub Issue'
type='input'
required={true}
Expand Down Expand Up @@ -253,7 +253,7 @@ export default class CreateOrUpdateIssueModal extends PureComponent {
/>

<Input
id={'title'}
id='title'
label='Title for the GitHub Issue'
type='input'
required={true}
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/sidebar_right/github_items.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ const getStyle = makeStyleFromTheme((theme) => ({
fontWeight: 'bold',
},
subtitle: {
margin: '5px 0 0 0',
marginTop: '5px',
fontSize: '13px',
},
subtitleSecondLine: {
Expand Down