Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move core assessments and visually separate tasks in score report #656

Merged
merged 7 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/assets/styles/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/components/RoarDataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
>
Expand All @@ -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
/>
</div>
Expand Down
18 changes: 17 additions & 1 deletion src/pages/ProgressReport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down
46 changes: 38 additions & 8 deletions src/pages/ScoreReport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Emily-ejag marked this conversation as resolved.
Show resolved Hide resolved

for (const taskId of orderedTasks) {
let colField;
const isOptional = `scores.${taskId}.optional`;
// Color needs to include a field to allow sorting.
Expand All @@ -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';
}
Emily-ejag marked this conversation as resolved.
Show resolved Hide resolved

tableColumns.push({
field: colField,
header: taskDisplayNames[taskId]?.name ?? taskId,
Expand All @@ -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;
Expand All @@ -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));
Emily-ejag marked this conversation as resolved.
Show resolved Hide resolved
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);
Emily-ejag marked this conversation as resolved.
Show resolved Hide resolved
Emily-ejag marked this conversation as resolved.
Show resolved Hide resolved

const sortedAndFilteredTaskIds = computed(() => {
return sortedTaskIds.value?.filter((taskId) => {
return tasksToDisplayGraphs.includes(taskId);
Expand Down
Loading