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

✨ OSIDB-3512: Add component column to trackers table #491

Merged
merged 3 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# OSIM Changelog

## [Unreleased]
### Added
* Add component column to trackers table (`OSIDB-3721`)

### Fixed
* Fix duplicated values on CVSS displays (`OSIDB-3658`)

Expand Down
1 change: 1 addition & 0 deletions src/components/FlawAffects/FlawAffects.vue
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ const displayedTrackers = computed(() => {
affect.trackers.map(tracker => ({
...tracker,
ps_module: affect.ps_module,
ps_component: affect.ps_component,
})),
);
});
Expand Down

Large diffs are not rendered by default.

42 changes: 11 additions & 31 deletions src/components/FlawTrackers/FlawTrackers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type { ZodTrackerType, ZodFlawType, ZodAffectType } from '@/types';
import { useSettingsStore } from '@/stores/SettingsStore';
import { trackerUrl } from '@/services/TrackerService';

type TrackerWithModule = { ps_module: string } & ZodTrackerType;
type TrackerWithModule = { ps_component: string; ps_module: string } & ZodTrackerType;

const props = defineProps<{
allTrackersCount: number;
Expand Down Expand Up @@ -209,6 +209,7 @@ const {
<tr>
<th>Bug ID</th>
<th>Module</th>
<th>Component</th>
<th>Product Stream</th>
<th>
<span class="align-bottom me-1">Status</span>
Expand Down Expand Up @@ -294,12 +295,13 @@ const {
None
</span>
</td>
<td :title="tracker.ps_module">{{ tracker.ps_module }}</td>
<td :title="tracker.ps_update_stream ?? ''">{{ tracker.ps_update_stream }}</td>
<td>{{ tracker.status?.toUpperCase() || 'EMPTY' }}</td>
<td>{{ tracker.resolution?.toUpperCase() }}</td>
<td>{{ formatDate(tracker.created_dt ?? '', true) }}</td>
<td>{{ formatDate(tracker.updated_dt ?? '', true) }}</td>
<td colspan="1" :title="tracker.ps_module">{{ tracker.ps_module }}</td>
<td colspan="1" :title="tracker.ps_component">{{ tracker.ps_component }}</td>
<td colspan="1" :title="tracker.ps_update_stream ?? ''">{{ tracker.ps_update_stream }}</td>
<td colspan="1">{{ tracker.status?.toUpperCase() || 'EMPTY' }}</td>
<td colspan="1">{{ tracker.resolution?.toUpperCase() }}</td>
<td colspan="1">{{ formatDate(tracker.created_dt ?? '', true) }}</td>
<td colspan="1">{{ formatDate(tracker.updated_dt ?? '', true) }}</td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -403,33 +405,11 @@ const {
font-size: 1rem;
}

&:nth-of-type(1) {
width: 12.5%;
}

&:nth-of-type(2) {
width: 18.5%;
}

&:nth-of-type(3) {
width: 18.5%;
}

&:nth-of-type(4) {
width: 12.5%;
}

&:nth-of-type(5) {
width: 12.5%;
}

&:nth-of-type(6) {
width: 12.5%;
&:nth-of-type(7) {
cursor: pointer;
}

&:nth-of-type(7) {
width: 12.5%;
&:nth-of-type(8) {
cursor: pointer;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/components/__tests__/FlawTrackers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,16 @@ describe('flawTrackers', () => {

let trackersTableRows = subject.findAll('.affects-trackers .osim-tracker-card table tbody tr');
let firstTracker = trackersTableRows[0];
expect(firstTracker.find('td:nth-of-type(3)').text()).toBe('xxxx-0-006');
expect(firstTracker.find('td:nth-of-type(4)').text()).toBe('xxxx-0-006');

const componentHeader = subject.find('.affects-trackers table thead tr th:nth-of-type(6)');
const componentHeader = subject.find('.affects-trackers table thead tr th:nth-of-type(7)');
expect(componentHeader.exists()).toBe(true);
expect(componentHeader.text()).toBe('Created date');
await componentHeader.trigger('click');

trackersTableRows = subject.findAll('.affects-trackers .osim-tracker-card table tbody tr');
firstTracker = trackersTableRows[0];
expect(firstTracker.find('td:nth-of-type(3)').text()).toBe('xxxx-0-001');
expect(firstTracker.find('td:nth-of-type(4)').text()).toBe('xxxx-0-001');
});

osimFullFlawTest('Trackers display functional external links', async ({ flaw }) => {
Expand Down Expand Up @@ -156,7 +156,7 @@ describe('flawTrackers', () => {
allTrackersCount: 0,
});
const trackerRow = subject.findAll('.affects-trackers .osim-tracker-card table tbody tr')[0];
const trackerModuleCell = trackerRow.find('td:nth-of-type(3)');
const trackerModuleCell = trackerRow.find('td:nth-of-type(4)');
expect(trackerModuleCell.attributes('title')).toBe('xxxx-0-006');
});

Expand Down
79 changes: 43 additions & 36 deletions src/components/__tests__/__snapshots__/FlawForm.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,7 @@ This module has no trackers associated"><i data-v-2d3c4208="" class="bi bi-excla
<tr data-v-89a61d08="">
<th data-v-89a61d08="">Bug ID</th>
<th data-v-89a61d08="">Module</th>
<th data-v-89a61d08="">Component</th>
<th data-v-89a61d08="">Product Stream</th>
<th data-v-89a61d08=""><span data-v-89a61d08="" class="align-bottom me-1">Status</span><button data-v-89a61d08="" id="status-filter" type="button" class="btn btn-sm border-0 p-0" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false"><i data-v-89a61d08="" class="bi bi-funnel" title=""></i></button>
<ul data-v-89a61d08="" class="dropdown-menu" aria-labelledby="status-filter">
Expand All @@ -754,57 +755,63 @@ This module has no trackers associated"><i data-v-2d3c4208="" class="bi bi-excla
<tbody data-v-89a61d08="">
<tr data-v-89a61d08="">
<td data-v-89a61d08=""><a data-v-89a61d08="" target="_blank">XXXX-0006 <i data-v-89a61d08="" class="bi-box-arrow-up-right"></i></a></td>
<td data-v-89a61d08="" title="openshift-5">openshift-5</td>
<td data-v-89a61d08="" title="xxxx-0-006">xxxx-0-006</td>
<td data-v-89a61d08="">CLOSED</td>
<td data-v-89a61d08=""></td>
<td data-v-89a61d08="">2024-07-01 13:05 UTC</td>
<td data-v-89a61d08="">2024-07-01 13:06 UTC</td>
<td data-v-89a61d08="" colspan="1" title="openshift-5">openshift-5</td>
<td data-v-89a61d08="" colspan="1" title="openshift-5-1">openshift-5-1</td>
<td data-v-89a61d08="" colspan="1" title="xxxx-0-006">xxxx-0-006</td>
<td data-v-89a61d08="" colspan="1">CLOSED</td>
<td data-v-89a61d08="" colspan="1"></td>
<td data-v-89a61d08="" colspan="1">2024-07-01 13:05 UTC</td>
<td data-v-89a61d08="" colspan="1">2024-07-01 13:06 UTC</td>
</tr>
<tr data-v-89a61d08="">
<td data-v-89a61d08=""><a data-v-89a61d08="" target="_blank">XXXX-0005 <i data-v-89a61d08="" class="bi-box-arrow-up-right"></i></a></td>
<td data-v-89a61d08="" title="openshift-5">openshift-5</td>
<td data-v-89a61d08="" title="xxxx-0-005">xxxx-0-005</td>
<td data-v-89a61d08="">NEW</td>
<td data-v-89a61d08=""></td>
<td data-v-89a61d08="">2024-08-01 13:05 UTC</td>
<td data-v-89a61d08="">2024-08-01 13:06 UTC</td>
<td data-v-89a61d08="" colspan="1" title="openshift-5">openshift-5</td>
<td data-v-89a61d08="" colspan="1" title="openshift-5-1">openshift-5-1</td>
<td data-v-89a61d08="" colspan="1" title="xxxx-0-005">xxxx-0-005</td>
<td data-v-89a61d08="" colspan="1">NEW</td>
<td data-v-89a61d08="" colspan="1"></td>
<td data-v-89a61d08="" colspan="1">2024-08-01 13:05 UTC</td>
<td data-v-89a61d08="" colspan="1">2024-08-01 13:06 UTC</td>
</tr>
<tr data-v-89a61d08="">
<td data-v-89a61d08=""><a data-v-89a61d08="" target="_blank">XXXX-0004 <i data-v-89a61d08="" class="bi-box-arrow-up-right"></i></a></td>
<td data-v-89a61d08="" title="openshift-1">openshift-1</td>
<td data-v-89a61d08="" title="xxxx-0-004">xxxx-0-004</td>
<td data-v-89a61d08="">CLOSED</td>
<td data-v-89a61d08=""></td>
<td data-v-89a61d08="">2024-09-01 13:05 UTC</td>
<td data-v-89a61d08="">2024-09-01 13:06 UTC</td>
<td data-v-89a61d08="" colspan="1" title="openshift-1">openshift-1</td>
<td data-v-89a61d08="" colspan="1" title="openshift-1-1">openshift-1-1</td>
<td data-v-89a61d08="" colspan="1" title="xxxx-0-004">xxxx-0-004</td>
<td data-v-89a61d08="" colspan="1">CLOSED</td>
<td data-v-89a61d08="" colspan="1"></td>
<td data-v-89a61d08="" colspan="1">2024-09-01 13:05 UTC</td>
<td data-v-89a61d08="" colspan="1">2024-09-01 13:06 UTC</td>
</tr>
<tr data-v-89a61d08="">
<td data-v-89a61d08=""><a data-v-89a61d08="" target="_blank">XXXX-0003 <i data-v-89a61d08="" class="bi-box-arrow-up-right"></i></a></td>
<td data-v-89a61d08="" title="openshift-1">openshift-1</td>
<td data-v-89a61d08="" title="xxxx-0-003">xxxx-0-003</td>
<td data-v-89a61d08="">NEW</td>
<td data-v-89a61d08=""></td>
<td data-v-89a61d08="">2024-10-01 13:05 UTC</td>
<td data-v-89a61d08="">2024-10-01 13:06 UTC</td>
<td data-v-89a61d08="" colspan="1" title="openshift-1">openshift-1</td>
<td data-v-89a61d08="" colspan="1" title="openshift-1-1">openshift-1-1</td>
<td data-v-89a61d08="" colspan="1" title="xxxx-0-003">xxxx-0-003</td>
<td data-v-89a61d08="" colspan="1">NEW</td>
<td data-v-89a61d08="" colspan="1"></td>
<td data-v-89a61d08="" colspan="1">2024-10-01 13:05 UTC</td>
<td data-v-89a61d08="" colspan="1">2024-10-01 13:06 UTC</td>
</tr>
<tr data-v-89a61d08="">
<td data-v-89a61d08=""><a data-v-89a61d08="" target="_blank">XXXX-0002 <i data-v-89a61d08="" class="bi-box-arrow-up-right"></i></a></td>
<td data-v-89a61d08="" title="openshift-1">openshift-1</td>
<td data-v-89a61d08="" title="xxxx-0-002">xxxx-0-002</td>
<td data-v-89a61d08="">CLOSED</td>
<td data-v-89a61d08=""></td>
<td data-v-89a61d08="">2024-11-01 13:05 UTC</td>
<td data-v-89a61d08="">2024-11-01 13:06 UTC</td>
<td data-v-89a61d08="" colspan="1" title="openshift-1">openshift-1</td>
<td data-v-89a61d08="" colspan="1" title="openshift-1-1">openshift-1-1</td>
<td data-v-89a61d08="" colspan="1" title="xxxx-0-002">xxxx-0-002</td>
<td data-v-89a61d08="" colspan="1">CLOSED</td>
<td data-v-89a61d08="" colspan="1"></td>
<td data-v-89a61d08="" colspan="1">2024-11-01 13:05 UTC</td>
<td data-v-89a61d08="" colspan="1">2024-11-01 13:06 UTC</td>
</tr>
<tr data-v-89a61d08="">
<td data-v-89a61d08=""><a data-v-89a61d08="" target="_blank">XXXX-0001 <i data-v-89a61d08="" class="bi-box-arrow-up-right"></i></a></td>
<td data-v-89a61d08="" title="openshift-1">openshift-1</td>
<td data-v-89a61d08="" title="xxxx-0-001">xxxx-0-001</td>
<td data-v-89a61d08="">NEW</td>
<td data-v-89a61d08=""></td>
<td data-v-89a61d08="">2024-12-01 13:05 UTC</td>
<td data-v-89a61d08="">2024-12-01 13:06 UTC</td>
<td data-v-89a61d08="" colspan="1" title="openshift-1">openshift-1</td>
<td data-v-89a61d08="" colspan="1" title="openshift-1-1">openshift-1-1</td>
<td data-v-89a61d08="" colspan="1" title="xxxx-0-001">xxxx-0-001</td>
<td data-v-89a61d08="" colspan="1">NEW</td>
<td data-v-89a61d08="" colspan="1"></td>
<td data-v-89a61d08="" colspan="1">2024-12-01 13:05 UTC</td>
<td data-v-89a61d08="" colspan="1">2024-12-01 13:06 UTC</td>
</tr>
</tbody>
</table>
Expand Down
Loading