fix: added handling for show cli
This commit is contained in:
@@ -1004,6 +1004,12 @@ async function displayTaskById(tasksPath, taskId, complexityReportPath = null) {
|
|||||||
chalk.cyan.bold('Status:'),
|
chalk.cyan.bold('Status:'),
|
||||||
getStatusWithColor(task.status || 'pending', true)
|
getStatusWithColor(task.status || 'pending', true)
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
chalk.cyan.bold('Complexity:'),
|
||||||
|
task.complexityScore
|
||||||
|
? getComplexityWithColor(task.complexityScore)
|
||||||
|
: chalk.gray('N/A')
|
||||||
|
],
|
||||||
[
|
[
|
||||||
chalk.cyan.bold('Description:'),
|
chalk.cyan.bold('Description:'),
|
||||||
task.description || 'No description provided.'
|
task.description || 'No description provided.'
|
||||||
@@ -1177,6 +1183,12 @@ async function displayTaskById(tasksPath, taskId, complexityReportPath = null) {
|
|||||||
complexityReport
|
complexityReport
|
||||||
) // Pass complexityReport
|
) // Pass complexityReport
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
chalk.cyan.bold('Complexity:'),
|
||||||
|
task.complexityScore
|
||||||
|
? getComplexityWithColor(task.complexityScore)
|
||||||
|
: chalk.gray('N/A')
|
||||||
|
],
|
||||||
[chalk.cyan.bold('Description:'), task.description]
|
[chalk.cyan.bold('Description:'), task.description]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -281,14 +281,16 @@ function findTaskById(tasks, taskId, complexityReport = null) {
|
|||||||
if (taskResult && complexityReport) {
|
if (taskResult && complexityReport) {
|
||||||
if (complexityReport && complexityReport.complexityAnalysis) {
|
if (complexityReport && complexityReport.complexityAnalysis) {
|
||||||
// For a main task, look for a direct match
|
// For a main task, look for a direct match
|
||||||
if (!taskResult.isSubtask) {
|
const taskId = taskResult.isSubtask
|
||||||
const taskAnalysis = complexityReport.complexityAnalysis.find(
|
? taskResult.parentTask.id
|
||||||
(analysis) => analysis.taskId === taskResult.id
|
: taskResult.id;
|
||||||
);
|
|
||||||
|
|
||||||
if (taskAnalysis) {
|
const taskAnalysis = complexityReport.complexityAnalysis.find(
|
||||||
taskResult.complexityScore = taskAnalysis.complexityScore;
|
(analysis) => analysis.taskId === taskId
|
||||||
}
|
);
|
||||||
|
|
||||||
|
if (taskAnalysis) {
|
||||||
|
taskResult.complexityScore = taskAnalysis.complexityScore;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user