Skip to content

Commit

Permalink
Merge pull request #238 from bcgov/stories/ss-764-bulk-unassign-in-ma…
Browse files Browse the repository at this point in the history
…nage-duties-screen

SS-764: Show lookup code as  fallback for assignment name
  • Loading branch information
WadeBarnes authored Jun 24, 2024
2 parents b09185d + 8f9d1c5 commit a477cc7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions web/src/components/common/BulkUnassignModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,16 @@
mounted() {
this.$root.$on('bv::modal::show', (bvEvent, modalId) => {
const constructDutyBlocks: Array<dutyBlockWeekInfoType & { assignmentName: string }> = [];
this.selectedDuties.forEach((sd) => {
sd.dutyBlock?.forEach((db) => {
const assignmentId = this.dutyRostersJson.find((dr) => dr.id === db.dutyId)?.assignmentId;
const findAssignment = this.dutyRosterAssignmentsWeek.find((aw) => aw.assignmentDetail.id === assignmentId);
const assignmentName = findAssignment?.assignmentDetail?.name ? findAssignment.assignmentDetail.name : '';
let assignmentName = '';
if (findAssignment?.assignmentDetail?.name) assignmentName = findAssignment.assignmentDetail.name;
else if (findAssignment?.assignmentDetail?.lookupCode?.code) assignmentName = findAssignment.assignmentDetail.lookupCode.code;
constructDutyBlocks.push({...db, assignmentName: assignmentName});
});
Expand Down

0 comments on commit a477cc7

Please sign in to comment.