parent
79a12e89f7
commit
7309a2157b
|
@ -92,7 +92,9 @@ export class BoardPage extends React.Component<BoardPageProps> {
|
||||||
renderNewCardModal() {
|
renderNewCardModal() {
|
||||||
const { newCardModalActive, newCardLaneID } = this.state;
|
const { newCardModalActive, newCardLaneID } = this.state;
|
||||||
const { board } = this.props;
|
const { board } = this.props;
|
||||||
if (!board || !newCardLaneID) return null;
|
|
||||||
|
if (!board || newCardLaneID === undefined) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal active={newCardModalActive}>
|
<Modal active={newCardModalActive}>
|
||||||
<div className="new-card-modal">
|
<div className="new-card-modal">
|
||||||
|
|
|
@ -11,6 +11,10 @@ html, body {
|
||||||
margin-top: $size-normal;
|
margin-top: $size-normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.has-padding-small {
|
||||||
|
padding: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
#app {
|
#app {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
|
@ -76,14 +76,9 @@ export function* createIssueSaga(action: any) {
|
||||||
const labels = yield call(gitea.fetchProjectLabels.bind(gitea), project);
|
const labels = yield call(gitea.fetchProjectLabels.bind(gitea), project);
|
||||||
const giteaLabel = labels.find((l: any) => l.name === label)
|
const giteaLabel = labels.find((l: any) => l.name === label)
|
||||||
|
|
||||||
if (!giteaLabel) {
|
|
||||||
yield put({ type: CREATE_ISSUE_FAILURE, error: new Error(`Label "${label}" not found !`) });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let issue;
|
let issue;
|
||||||
try {
|
try {
|
||||||
issue = yield call(gitea.createIssue.bind(gitea), project, title, body, giteaLabel.id);
|
issue = yield call(gitea.createIssue.bind(gitea), project, title, body, giteaLabel ? giteaLabel.id : null);
|
||||||
} catch(error) {
|
} catch(error) {
|
||||||
yield put({ type: CREATE_ISSUE_FAILURE, error });
|
yield put({ type: CREATE_ISSUE_FAILURE, error });
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -61,7 +61,7 @@ export class GiteaClient {
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
title,
|
title,
|
||||||
body,
|
body,
|
||||||
labels: [labelID],
|
labels: labelID ? [labelID] : undefined,
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
.then(this.assertAuthorization)
|
.then(this.assertAuthorization)
|
||||||
|
|
Loading…
Reference in New Issue