Skip to content

Commit

Permalink
[WEB-1412]fix: split labels in kanban board (#6253)
Browse files Browse the repository at this point in the history
* fix: split labels in kanban board

* chore: incresaed labels max render and moved labels to end of properties
chore: refactored label render component
  • Loading branch information
vamsikrishnamathala authored Dec 23, 2024
1 parent 3a6a8e3 commit ba1a314
Show file tree
Hide file tree
Showing 6 changed files with 461 additions and 307 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export const IssueProperties: React.FC<IIssueProperties> = observer((props) => {
);

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

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

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

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

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

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

const handleEstimate = (value: string | undefined) => {
updateIssue &&
if (updateIssue)
updateIssue(issue.project_id, issue.id, { estimate_point: value }).then(() => {
captureIssueEvent({
eventName: ISSUE_UPDATED,
Expand Down Expand Up @@ -304,21 +304,6 @@ export const IssueProperties: React.FC<IIssueProperties> = observer((props) => {
</div>
</WithDisplayPropertiesHOC>

{/* label */}
<WithDisplayPropertiesHOC displayProperties={displayProperties} displayPropertyKey="labels">
<div className="h-5" onClick={handleEventPropagation}>
<IssuePropertyLabels
projectId={issue?.project_id || null}
value={issue?.label_ids || null}
defaultOptions={defaultLabelOptions}
onChange={handleLabel}
disabled={isReadOnly}
renderByDefault={isMobile}
hideDropdownArrow
/>
</div>
</WithDisplayPropertiesHOC>

{/* start date */}
<WithDisplayPropertiesHOC displayProperties={displayProperties} displayPropertyKey="start_date">
<div className="h-5" onClick={handleEventPropagation}>
Expand Down Expand Up @@ -511,6 +496,20 @@ export const IssueProperties: React.FC<IIssueProperties> = observer((props) => {
</div>
</Tooltip>
</WithDisplayPropertiesHOC>

{/* label */}
<WithDisplayPropertiesHOC displayProperties={displayProperties} displayPropertyKey="labels">
<IssuePropertyLabels
projectId={issue?.project_id || null}
value={issue?.label_ids || null}
defaultOptions={defaultLabelOptions}
onChange={handleLabel}
disabled={isReadOnly}
renderByDefault={isMobile}
hideDropdownArrow
maxRender={3}
/>
</WithDisplayPropertiesHOC>
</div>
);
});
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from "./labels";
export * from "./all-properties";
export * from "./label-dropdown";
Loading

0 comments on commit ba1a314

Please sign in to comment.