fix: bug fixes (#2607)

* fix: module card issue count fix

* fix: project kanban view add issue bug fix

* fix: draft issue modal button alignment fix
This commit is contained in:
Anmol Singh Bhatia 2023-11-02 16:03:03 +05:30 committed by GitHub
parent 0072160891
commit 7f3dbe298c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 12 deletions

View File

@ -73,7 +73,7 @@ export const ConfirmIssueDiscard: React.FC<Props> = (props) => {
Discard
</Button>
</div>
<div className="space-x-2">
<div className="flex items-center gap-2">
<Button variant="neutral-primary" onClick={onClose}>
Cancel
</Button>

View File

@ -105,6 +105,7 @@ export const KanBanLayout: React.FC = observer(() => {
displayProperties={displayProperties}
kanBanToggle={issueKanBanViewStore?.kanBanToggle}
handleKanBanToggle={handleKanBanToggle}
enableQuickIssueCreate
/>
) : (
<KanBanSwimLanes

View File

@ -37,7 +37,14 @@ export const ModuleCardItem: React.FC<Props> = observer((props) => {
const { module: moduleStore } = useMobxStore();
const completionPercentage = (module.completed_issues / module.total_issues) * 100;
const moduleTotalIssues =
module.backlog_issues +
module.unstarted_issues +
module.started_issues +
module.completed_issues +
module.cancelled_issues;
const completionPercentage = (module.completed_issues / moduleTotalIssues) * 100;
const endDate = new Date(module.target_date ?? "");
const startDate = new Date(module.start_date ?? "");
@ -47,15 +54,13 @@ export const ModuleCardItem: React.FC<Props> = observer((props) => {
const moduleStatus = MODULE_STATUS.find((status) => status.value === module.status);
const issueCount =
module.completed_issues && module.total_issues
? module.total_issues === 0
moduleTotalIssues === 0
? "0 Issue"
: module.total_issues === module.completed_issues
? module.total_issues > 1
? `${module.total_issues} Issues`
: `${module.total_issues} Issue`
: `${module.completed_issues}/${module.total_issues} Issues`
: "0 Issue";
: moduleTotalIssues === module.completed_issues
? moduleTotalIssues > 1
? `${moduleTotalIssues} Issues`
: `${moduleTotalIssues} Issue`
: `${module.completed_issues}/${moduleTotalIssues} Issues`;
const handleAddToFavorites = (e: React.MouseEvent<HTMLButtonElement>) => {
e.stopPropagation();
@ -158,7 +163,7 @@ export const ModuleCardItem: React.FC<Props> = observer((props) => {
<div className="flex items-center justify-between">
<div className="flex items-center gap-1.5 text-custom-text-200">
<LayersIcon className="h-4 w-4 text-custom-text-300" />
<span className="text-xs text-custom-text-300">{issueCount}</span>
<span className="text-xs text-custom-text-300">{issueCount ?? "0 Issue"}</span>
</div>
{module.members_detail.length > 0 && (
<Tooltip tooltipContent={`${module.members_detail.length} Members`}>