Skip to content

Commit

Permalink
✨ Provide ps module column on trackers table
Browse files Browse the repository at this point in the history
  • Loading branch information
C-Valen committed Aug 5, 2024
1 parent 8d7ac66 commit 8f05d10
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 deletions.
11 changes: 9 additions & 2 deletions src/components/FlawAffects.vue
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ function addNewAffect() {
alerts: [],
} as ZodAffectType;
emit('affect:add', affect);
affectsBeingEdited.value.push(affect);
// affectsBeingEdited.value.push(affect);
}
// Remove affects
Expand Down Expand Up @@ -503,7 +503,14 @@ const allTrackers = computed(() => allAffects.value.flatMap(affect => affect.tra
const affectsManaging = ref<ZodAffectType[]>();
const displayedTrackers = computed(() => {
return sortedAffects.value.flatMap(affect => affect.trackers);
const aux = sortedAffects.value.flatMap(affect =>
affect.trackers.map(tracker => ({
...tracker,
ps_module: affect.ps_module
}))
);
console.log(aux);
return aux;
});
function fileTrackersForAffects(affects: ZodAffectType[]) {
Expand Down
28 changes: 18 additions & 10 deletions src/components/FlawTrackers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import type { ZodAffectType, ZodTrackerType } from '@/types/zodAffect';
import { ascend, descend, sortWith } from 'ramda';
import AffectsTrackers from '@/components/AffectsTrackers.vue';
type TrackerWithModule = ZodTrackerType & { ps_module: string };
const props = defineProps<{
flawId: string;
displayedTrackers: ZodTrackerType[];
displayedTrackers: TrackerWithModule[];
affectsNotBeingDeleted: ZodAffectType[];
allTrackersCount: number;
}>();
Expand Down Expand Up @@ -42,19 +44,19 @@ const setSort = (key: sortKeys) => {
}
};
function sortTrackers(affects: ZodTrackerType[]): ZodTrackerType[] {
function sortTrackers(trackers: TrackerWithModule[]): TrackerWithModule[] {
const customSortKey = sortKey.value;
const order = sortOrder.value;
const customSortFn = (affect: ZodTrackerType) => {
const customSortFn = (affect: TrackerWithModule) => {
return affect[customSortKey] || 0;
};
const comparator = [order<ZodTrackerType>(customSortFn)];
const comparator = [order<TrackerWithModule>(customSortFn)];
return sortWith([
...comparator
])(affects);
])(trackers);
}
// Trackers filters by field
Expand Down Expand Up @@ -178,6 +180,7 @@ function changePage(page: number) {
<thead class="sticky-top" style="z-index: 1;">
<tr>
<th>Bug ID</th>
<th>Module</th>
<th>Product Stream</th>
<th>
<span class="align-bottom me-1">Status</span>
Expand Down Expand Up @@ -257,6 +260,7 @@ function changePage(page: number) {
</RouterLink>
</td>
<td>{{ tracker.ps_update_stream }}</td>
<td>{{ tracker.ps_module }}</td>
<td>{{ tracker.status?.toUpperCase() || 'EMPTY' }}</td>
<td>{{ formatDate(tracker.created_dt ?? '', true) }}</td>
<td>{{ formatDate(tracker.updated_dt ?? '', true) }}</td>
Expand Down Expand Up @@ -341,20 +345,24 @@ function changePage(page: number) {
}
&:nth-of-type(2) {
width: 23%;
width: 20%;
}
&:nth-of-type(3) {
width: 15%;
width: 20%;
}
&:nth-of-type(4) {
width: 20%;
cursor: pointer;
width: 15%;
}
&:nth-of-type(5) {
width: 20%;
width: 15%;
cursor: pointer;
}
&:nth-of-type(6) {
width: 15%;
cursor: pointer;
}
}
Expand Down

0 comments on commit 8f05d10

Please sign in to comment.