From e3406d591477cc9599d3890e137dd813938c704c Mon Sep 17 00:00:00 2001 From: emily-ejag Date: Tue, 11 Jun 2024 17:39:14 -0700 Subject: [PATCH 1/7] separate main tasks --- src/assets/styles/theme.css | 1 - src/components/RoarDataTable.vue | 3 ++- src/pages/ScoreReport.vue | 46 ++++++++++++++++++++++++++------ 3 files changed, 40 insertions(+), 10 deletions(-) diff --git a/src/assets/styles/theme.css b/src/assets/styles/theme.css index be40f3c12..d5004b1ef 100644 --- a/src/assets/styles/theme.css +++ b/src/assets/styles/theme.css @@ -3379,7 +3379,6 @@ } .p-datatable .p-datatable-tbody > tr > td { - text-align: left; border: 1px solid #f4f4f5; border-width: 0 0 1px 0; padding: 1rem 1.5rem; diff --git a/src/components/RoarDataTable.vue b/src/components/RoarDataTable.vue index 60b52b1ae..cc5e87e89 100644 --- a/src/components/RoarDataTable.vue +++ b/src/components/RoarDataTable.vue @@ -104,6 +104,7 @@ :filter-field="col?.filterField ? col.filterField : col.field" :show-add-button="col.allowMultipleFilters === true" :frozen="col.pinned" + :style="col.style" align-frozen="left" header-style="background:var(--primary-color); color:white; padding-top:0; margin-top:0; padding-bottom:0; margin-bottom:0; border:0; margin-left:0" > @@ -130,7 +131,7 @@ :severity="_get(colData, col.severityField)" :value="_get(colData, col.field)" :icon="_get(colData, col.iconField)" - :style="`min-width: 2rem; font-weight: bold`" + :style="`min-width: 2rem; font-weight: bold;`" rounded /> diff --git a/src/pages/ScoreReport.vue b/src/pages/ScoreReport.vue index 7b5e02c61..acb3aed6e 100644 --- a/src/pages/ScoreReport.vue +++ b/src/pages/ScoreReport.vue @@ -1065,7 +1065,23 @@ const scoreReportColumns = computed(() => { return -1; } }); - for (const taskId of sortedTasks) { + + const priorityTasks = ['swr', 'sre', 'pa']; + const orderedTasks = []; + + for (const task of priorityTasks) { + if (sortedTasks.includes(task)) { + orderedTasks.push(task); + } + } + + for (const task of sortedTasks) { + if (!priorityTasks.includes(task)) { + orderedTasks.push(task); + } + } + + for (const taskId of orderedTasks) { let colField; const isOptional = `scores.${taskId}.optional`; // Color needs to include a field to allow sorting. @@ -1079,6 +1095,15 @@ const scoreReportColumns = computed(() => { } else if (rawOnlyTasks.includes(taskId)) { colField = `scores.${taskId}.rawScore`; } + + let backgroundColor = ''; + + if (taskId === 'pa' || taskId === 'sre' || taskId === 'swr') { + backgroundColor = 'transparent'; + } else { + backgroundColor = '#E6E6E6'; + } + tableColumns.push({ field: colField, header: taskDisplayNames[taskId]?.name ?? taskId, @@ -1094,6 +1119,7 @@ const scoreReportColumns = computed(() => { !tasksToDisplayCorrectIncorrectDifference.includes(taskId) && (viewMode.value === 'color' || isOptional), tagColor: `scores.${taskId}.tagColor`, + style: `background-color: ${backgroundColor}; justify-content: center; margin: 0; text-align: center; `, }); } return tableColumns; @@ -1106,16 +1132,20 @@ const allTasks = computed(() => { }); const sortedTaskIds = computed(() => { - const res = Object.keys(computeAssignmentAndRunData.value.runsByTaskId).toSorted((p1, p2) => { - if (Object.keys(taskDisplayNames).includes(p1) && Object.keys(taskDisplayNames).includes(p2)) { - return taskDisplayNames[p1].order - taskDisplayNames[p2].order; - } else { - return -1; - } + const runsByTaskId = computeAssignmentAndRunData.value.runsByTaskId; + const specialTaskIds = ['swr', 'sre', 'pa'].filter((id) => Object.keys(runsByTaskId).includes(id)); + const remainingTaskIds = Object.keys(runsByTaskId).filter((id) => !specialTaskIds.includes(id)); + + remainingTaskIds.sort((p1, p2) => { + return taskDisplayNames[p1].order - taskDisplayNames[p2].order; }); - return res; + + const sortedIds = specialTaskIds.concat(remainingTaskIds); + return sortedIds; }); +console.log('sorted tasks ids', sortedTaskIds); + const sortedAndFilteredTaskIds = computed(() => { return sortedTaskIds.value?.filter((taskId) => { return tasksToDisplayGraphs.includes(taskId); From 110865d787e479aafd4a7cf80a595f6111327fe2 Mon Sep 17 00:00:00 2001 From: emily-ejag Date: Tue, 11 Jun 2024 17:50:13 -0700 Subject: [PATCH 2/7] ordering progress table --- src/pages/ProgressReport.vue | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/pages/ProgressReport.vue b/src/pages/ProgressReport.vue index 3b6d30f93..4d32ca3c9 100644 --- a/src/pages/ProgressReport.vue +++ b/src/pages/ProgressReport.vue @@ -505,7 +505,23 @@ const progressReportColumns = computed(() => { return -1; } }); - for (const taskId of sortedTasks) { + + const priorityTasks = ['swr', 'sre', 'pa']; + const orderedTasks = []; + + for (const task of priorityTasks) { + if (sortedTasks.includes(task)) { + orderedTasks.push(task); + } + } + + for (const task of sortedTasks) { + if (!priorityTasks.includes(task)) { + orderedTasks.push(task); + } + } + + for (const taskId of orderedTasks) { tableColumns.push({ field: `progress.${taskId}.value`, filterField: `progress.${taskId}.tags`, From b22806205fed880f538b8d91219bb50b8f976044 Mon Sep 17 00:00:00 2001 From: Emily Arteaga <62304493+Emily-ejag@users.noreply.github.com> Date: Wed, 12 Jun 2024 15:42:42 -0700 Subject: [PATCH 3/7] Update src/pages/ScoreReport.vue Co-authored-by: Kyle Montville --- src/pages/ScoreReport.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/ScoreReport.vue b/src/pages/ScoreReport.vue index acb3aed6e..1acd17a8d 100644 --- a/src/pages/ScoreReport.vue +++ b/src/pages/ScoreReport.vue @@ -1098,7 +1098,7 @@ const scoreReportColumns = computed(() => { let backgroundColor = ''; - if (taskId === 'pa' || taskId === 'sre' || taskId === 'swr') { + if (priorityTasks.includes(taskId) { backgroundColor = 'transparent'; } else { backgroundColor = '#E6E6E6'; From 5a2309e1c3737846b693bb3b1c2eb30a3773a24b Mon Sep 17 00:00:00 2001 From: Emily Arteaga <62304493+Emily-ejag@users.noreply.github.com> Date: Wed, 12 Jun 2024 15:43:03 -0700 Subject: [PATCH 4/7] Update src/pages/ScoreReport.vue Co-authored-by: Kyle Montville --- src/pages/ScoreReport.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/ScoreReport.vue b/src/pages/ScoreReport.vue index 1acd17a8d..c220651d2 100644 --- a/src/pages/ScoreReport.vue +++ b/src/pages/ScoreReport.vue @@ -1133,7 +1133,7 @@ const allTasks = computed(() => { const sortedTaskIds = computed(() => { const runsByTaskId = computeAssignmentAndRunData.value.runsByTaskId; - const specialTaskIds = ['swr', 'sre', 'pa'].filter((id) => Object.keys(runsByTaskId).includes(id)); + const specialTaskIds = priorityTasks.filter((id) => Object.keys(runsByTaskId).includes(id)); const remainingTaskIds = Object.keys(runsByTaskId).filter((id) => !specialTaskIds.includes(id)); remainingTaskIds.sort((p1, p2) => { From ced12a54857e83c3484b8ebf4561191f1e9087fa Mon Sep 17 00:00:00 2001 From: Emily Arteaga <62304493+Emily-ejag@users.noreply.github.com> Date: Wed, 12 Jun 2024 15:43:36 -0700 Subject: [PATCH 5/7] Update src/pages/ScoreReport.vue Co-authored-by: Kyle Montville --- src/pages/ScoreReport.vue | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/pages/ScoreReport.vue b/src/pages/ScoreReport.vue index c220651d2..491aa761d 100644 --- a/src/pages/ScoreReport.vue +++ b/src/pages/ScoreReport.vue @@ -1069,17 +1069,10 @@ const scoreReportColumns = computed(() => { const priorityTasks = ['swr', 'sre', 'pa']; const orderedTasks = []; - for (const task of priorityTasks) { - if (sortedTasks.includes(task)) { - orderedTasks.push(task); - } - } +const filteredPriorityTasks = priorityTasks.filter( task => sortedTask.includes(task)) +const filteredSortedTasks = sortedTasks.filter( task => !priorityTasks.includes(task)) - for (const task of sortedTasks) { - if (!priorityTasks.includes(task)) { - orderedTasks.push(task); - } - } +const orderedTasks = filteredPriorityTasks.concat(filteredSortedTasks) for (const taskId of orderedTasks) { let colField; From 4b2dd21a315018bcb0a841a7b198d15ca644ffe8 Mon Sep 17 00:00:00 2001 From: Emily Arteaga <62304493+Emily-ejag@users.noreply.github.com> Date: Wed, 12 Jun 2024 15:44:15 -0700 Subject: [PATCH 6/7] Update src/pages/ScoreReport.vue --- src/pages/ScoreReport.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/ScoreReport.vue b/src/pages/ScoreReport.vue index 491aa761d..0582d7602 100644 --- a/src/pages/ScoreReport.vue +++ b/src/pages/ScoreReport.vue @@ -1137,7 +1137,6 @@ const sortedTaskIds = computed(() => { return sortedIds; }); -console.log('sorted tasks ids', sortedTaskIds); const sortedAndFilteredTaskIds = computed(() => { return sortedTaskIds.value?.filter((taskId) => { From 0363f93d47dff0a8ebfa331d03784702c0721391 Mon Sep 17 00:00:00 2001 From: emily-ejag Date: Wed, 12 Jun 2024 16:05:41 -0700 Subject: [PATCH 7/7] going back on some functions --- src/pages/ScoreReport.vue | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/pages/ScoreReport.vue b/src/pages/ScoreReport.vue index 0582d7602..794cb28f1 100644 --- a/src/pages/ScoreReport.vue +++ b/src/pages/ScoreReport.vue @@ -1069,10 +1069,17 @@ const scoreReportColumns = computed(() => { const priorityTasks = ['swr', 'sre', 'pa']; const orderedTasks = []; -const filteredPriorityTasks = priorityTasks.filter( task => sortedTask.includes(task)) -const filteredSortedTasks = sortedTasks.filter( task => !priorityTasks.includes(task)) + for (const task of priorityTasks) { + if (sortedTasks.includes(task)) { + orderedTasks.push(task); + } + } -const orderedTasks = filteredPriorityTasks.concat(filteredSortedTasks) + for (const task of sortedTasks) { + if (!priorityTasks.includes(task)) { + orderedTasks.push(task); + } + } for (const taskId of orderedTasks) { let colField; @@ -1091,7 +1098,7 @@ const orderedTasks = filteredPriorityTasks.concat(filteredSortedTasks) let backgroundColor = ''; - if (priorityTasks.includes(taskId) { + if (priorityTasks.includes(taskId)) { backgroundColor = 'transparent'; } else { backgroundColor = '#E6E6E6'; @@ -1126,7 +1133,7 @@ const allTasks = computed(() => { const sortedTaskIds = computed(() => { const runsByTaskId = computeAssignmentAndRunData.value.runsByTaskId; - const specialTaskIds = priorityTasks.filter((id) => Object.keys(runsByTaskId).includes(id)); + const specialTaskIds = ['swr', 'sre', 'pa'].filter((id) => Object.keys(runsByTaskId).includes(id)); const remainingTaskIds = Object.keys(runsByTaskId).filter((id) => !specialTaskIds.includes(id)); remainingTaskIds.sort((p1, p2) => { @@ -1137,7 +1144,6 @@ const sortedTaskIds = computed(() => { return sortedIds; }); - const sortedAndFilteredTaskIds = computed(() => { return sortedTaskIds.value?.filter((taskId) => { return tasksToDisplayGraphs.includes(taskId);