From 7309a2157b3f44383c76b05209eaa7e296e8c78d Mon Sep 17 00:00:00 2001 From: William Petit Date: Thu, 30 Apr 2020 17:08:48 +0200 Subject: [PATCH] =?UTF-8?q?Correction=20cr=C3=A9ation=20de=20ticket=20sur?= =?UTF-8?q?=20la=20premi=C3=A8re=20colonne?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Voir #26 --- client/src/components/BoardPage/BoardPage.tsx | 4 +++- client/src/sass/_base.scss | 4 ++++ client/src/store/sagas/issues.ts | 7 +------ client/src/util/gitea.ts | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/client/src/components/BoardPage/BoardPage.tsx b/client/src/components/BoardPage/BoardPage.tsx index bfcc8d1..68aeda2 100644 --- a/client/src/components/BoardPage/BoardPage.tsx +++ b/client/src/components/BoardPage/BoardPage.tsx @@ -92,7 +92,9 @@ export class BoardPage extends React.Component { renderNewCardModal() { const { newCardModalActive, newCardLaneID } = this.state; const { board } = this.props; - if (!board || !newCardLaneID) return null; + + if (!board || newCardLaneID === undefined) return null; + return (
diff --git a/client/src/sass/_base.scss b/client/src/sass/_base.scss index 6e27c9f..8d158ef 100644 --- a/client/src/sass/_base.scss +++ b/client/src/sass/_base.scss @@ -11,6 +11,10 @@ html, body { margin-top: $size-normal; } +.has-padding-small { + padding: 1rem; +} + #app { display: flex; flex-direction: column; diff --git a/client/src/store/sagas/issues.ts b/client/src/store/sagas/issues.ts index 6871df4..a53d197 100644 --- a/client/src/store/sagas/issues.ts +++ b/client/src/store/sagas/issues.ts @@ -76,14 +76,9 @@ export function* createIssueSaga(action: any) { const labels = yield call(gitea.fetchProjectLabels.bind(gitea), project); 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; 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) { yield put({ type: CREATE_ISSUE_FAILURE, error }); return; diff --git a/client/src/util/gitea.ts b/client/src/util/gitea.ts index 910e369..8cfd785 100644 --- a/client/src/util/gitea.ts +++ b/client/src/util/gitea.ts @@ -61,7 +61,7 @@ export class GiteaClient { body: JSON.stringify({ title, body, - labels: [labelID], + labels: labelID ? [labelID] : undefined, }), }) .then(this.assertAuthorization)