Skip to content

Commit

Permalink
Add Unknown functional status to UI
Browse files Browse the repository at this point in the history
  • Loading branch information
jyeshe committed Nov 4, 2024
1 parent 26611c3 commit e92e60e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,14 @@ describe('InventoryItemDetailsController', function() {
expect(vm.getFunctionalStatusLabel()).toEqual('cceInventoryItemStatus.unserviceable');
});

it('should return the value of cceInventoryItemStatus.unknown for UNKNOWN', function() {
vm.inventoryItem = new FacilityProgramInventoryItemDataBuilder()
.withFunctionalStatus('UNKNOWN')
.build();

expect(vm.getFunctionalStatusLabel()).toEqual('cceInventoryItemStatus.unknown');
});

});

});
10 changes: 8 additions & 2 deletions src/cce-inventory-item-status/functional-status.constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@
FUNCTIONING: 'FUNCTIONING',
AWAITING_REPAIR: 'AWAITING_REPAIR',
UNSERVICEABLE: 'UNSERVICEABLE',
UNKNOWN: 'UNKNOWN',
getLabel: getLabel,
getStatuses: getStatuses,
getClass: getClass
},
labels = {
FUNCTIONING: 'cceInventoryItemStatus.functioning',
AWAITING_REPAIR: 'cceInventoryItemStatus.awaitingRepair',
UNSERVICEABLE: 'cceInventoryItemStatus.unserviceable'
UNSERVICEABLE: 'cceInventoryItemStatus.unserviceable',
UNKNOWN: 'cceInventoryItemStatus.unknown'
};

return FUNCTIONAL_STATUS;
Expand Down Expand Up @@ -80,7 +82,8 @@
return [
FUNCTIONAL_STATUS.FUNCTIONING,
FUNCTIONAL_STATUS.AWAITING_REPAIR,
FUNCTIONAL_STATUS.UNSERVICEABLE
FUNCTIONAL_STATUS.UNSERVICEABLE,
FUNCTIONAL_STATUS.UNKNOWN
];
}

Expand Down Expand Up @@ -108,6 +111,9 @@
case FUNCTIONAL_STATUS.UNSERVICEABLE:
statusClass = 'is-unserviceable';
break;
case FUNCTIONAL_STATUS.UNKNOWN:
statusClass = 'is-unserviceable';
break;
default:
throw 'Invalid status';
}
Expand Down
1 change: 1 addition & 0 deletions src/cce-inventory-item-status/messages_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"cceInventoryItemStatus.equipmentFunctionalStatus": "Equipment Functional Status",
"cceInventoryItemStatus.functionalityStatus": "Functionality Status",
"cceInventoryItemStatus.awaitingRepair": "Awaiting Repair",
"cceInventoryItemStatus.unknown": "Unknown",
"cceInventoryItemStatus.unserviceable": "Unserviceable",
"cceInventoryItemStatus.notInUse": "Not in use",
"cceInventoryItemStatus.decommissioned": "Decommissioned",
Expand Down

0 comments on commit e92e60e

Please sign in to comment.