Skip to content

Commit ba1a314

Browse files
[WEB-1412]fix: split labels in kanban board (#6253)
* fix: split labels in kanban board * chore: incresaed labels max render and moved labels to end of properties chore: refactored label render component
1 parent 3a6a8e3 commit ba1a314

File tree

6 files changed

+461
-307
lines changed

6 files changed

+461
-307
lines changed

web/core/components/issues/issue-layouts/properties/all-properties.tsx

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export const IssueProperties: React.FC<IIssueProperties> = observer((props) => {
9696
);
9797

9898
const handleState = (stateId: string) => {
99-
updateIssue &&
99+
if (updateIssue)
100100
updateIssue(issue.project_id, issue.id, { state_id: stateId }).then(() => {
101101
captureIssueEvent({
102102
eventName: ISSUE_UPDATED,
@@ -111,7 +111,7 @@ export const IssueProperties: React.FC<IIssueProperties> = observer((props) => {
111111
};
112112

113113
const handlePriority = (value: TIssuePriorities) => {
114-
updateIssue &&
114+
if (updateIssue)
115115
updateIssue(issue.project_id, issue.id, { priority: value }).then(() => {
116116
captureIssueEvent({
117117
eventName: ISSUE_UPDATED,
@@ -126,7 +126,7 @@ export const IssueProperties: React.FC<IIssueProperties> = observer((props) => {
126126
};
127127

128128
const handleLabel = (ids: string[]) => {
129-
updateIssue &&
129+
if (updateIssue)
130130
updateIssue(issue.project_id, issue.id, { label_ids: ids }).then(() => {
131131
captureIssueEvent({
132132
eventName: ISSUE_UPDATED,
@@ -141,7 +141,7 @@ export const IssueProperties: React.FC<IIssueProperties> = observer((props) => {
141141
};
142142

143143
const handleAssignee = (ids: string[]) => {
144-
updateIssue &&
144+
if (updateIssue)
145145
updateIssue(issue.project_id, issue.id, { assignee_ids: ids }).then(() => {
146146
captureIssueEvent({
147147
eventName: ISSUE_UPDATED,
@@ -195,7 +195,7 @@ export const IssueProperties: React.FC<IIssueProperties> = observer((props) => {
195195
);
196196

197197
const handleStartDate = (date: Date | null) => {
198-
updateIssue &&
198+
if (updateIssue)
199199
updateIssue(issue.project_id, issue.id, { start_date: date ? renderFormattedPayloadDate(date) : null }).then(
200200
() => {
201201
captureIssueEvent({
@@ -212,7 +212,7 @@ export const IssueProperties: React.FC<IIssueProperties> = observer((props) => {
212212
};
213213

214214
const handleTargetDate = (date: Date | null) => {
215-
updateIssue &&
215+
if (updateIssue)
216216
updateIssue(issue.project_id, issue.id, { target_date: date ? renderFormattedPayloadDate(date) : null }).then(
217217
() => {
218218
captureIssueEvent({
@@ -229,7 +229,7 @@ export const IssueProperties: React.FC<IIssueProperties> = observer((props) => {
229229
};
230230

231231
const handleEstimate = (value: string | undefined) => {
232-
updateIssue &&
232+
if (updateIssue)
233233
updateIssue(issue.project_id, issue.id, { estimate_point: value }).then(() => {
234234
captureIssueEvent({
235235
eventName: ISSUE_UPDATED,
@@ -304,21 +304,6 @@ export const IssueProperties: React.FC<IIssueProperties> = observer((props) => {
304304
</div>
305305
</WithDisplayPropertiesHOC>
306306

307-
{/* label */}
308-
<WithDisplayPropertiesHOC displayProperties={displayProperties} displayPropertyKey="labels">
309-
<div className="h-5" onClick={handleEventPropagation}>
310-
<IssuePropertyLabels
311-
projectId={issue?.project_id || null}
312-
value={issue?.label_ids || null}
313-
defaultOptions={defaultLabelOptions}
314-
onChange={handleLabel}
315-
disabled={isReadOnly}
316-
renderByDefault={isMobile}
317-
hideDropdownArrow
318-
/>
319-
</div>
320-
</WithDisplayPropertiesHOC>
321-
322307
{/* start date */}
323308
<WithDisplayPropertiesHOC displayProperties={displayProperties} displayPropertyKey="start_date">
324309
<div className="h-5" onClick={handleEventPropagation}>
@@ -511,6 +496,20 @@ export const IssueProperties: React.FC<IIssueProperties> = observer((props) => {
511496
</div>
512497
</Tooltip>
513498
</WithDisplayPropertiesHOC>
499+
500+
{/* label */}
501+
<WithDisplayPropertiesHOC displayProperties={displayProperties} displayPropertyKey="labels">
502+
<IssuePropertyLabels
503+
projectId={issue?.project_id || null}
504+
value={issue?.label_ids || null}
505+
defaultOptions={defaultLabelOptions}
506+
onChange={handleLabel}
507+
disabled={isReadOnly}
508+
renderByDefault={isMobile}
509+
hideDropdownArrow
510+
maxRender={3}
511+
/>
512+
</WithDisplayPropertiesHOC>
514513
</div>
515514
);
516515
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export * from "./labels";
22
export * from "./all-properties";
3+
export * from "./label-dropdown";

0 commit comments

Comments
 (0)