Skip to content

Commit c8e489e

Browse files
Add CCE status NEEDS_ATTENTION (#10)
1 parent c648406 commit c8e489e

File tree

6 files changed

+11824
-763
lines changed

6 files changed

+11824
-763
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Upcoming Version (WIP)
22
==================
3+
* [OLMIS-8201](https://openlmis.atlassian.net/browse/OLMIS-8201): Add CCE status NEEDS_ATTENTION
34

45
1.1.8 / 2025-11-27
56
==================

src/cce-inventory-item-status/_status.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,14 @@
1616
&.is-awaiting-repair::before {
1717
color: $red;
1818
}
19+
1920
&.is-unserviceable::before {
2021
color: $gray;
2122
}
23+
24+
&.is-needs-attention::before {
25+
color: yellow;
26+
}
2227
}
2328

2429
.cce-inventory-item-update-status {

src/cce-inventory-item-status/functional-status.constant.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,16 @@
3333
FUNCTIONING: 'FUNCTIONING',
3434
AWAITING_REPAIR: 'AWAITING_REPAIR',
3535
UNSERVICEABLE: 'UNSERVICEABLE',
36+
NEEDS_ATTENTION: 'NEEDS_ATTENTION',
3637
getLabel: getLabel,
3738
getStatuses: getStatuses,
3839
getClass: getClass
3940
},
4041
labels = {
4142
FUNCTIONING: 'cceInventoryItemStatus.functioning',
4243
AWAITING_REPAIR: 'cceInventoryItemStatus.awaitingRepair',
43-
UNSERVICEABLE: 'cceInventoryItemStatus.unserviceable'
44+
UNSERVICEABLE: 'cceInventoryItemStatus.unserviceable',
45+
NEEDS_ATTENTION: 'cceInventoryItemStatus.needsAttention'
4446
};
4547

4648
return FUNCTIONAL_STATUS;
@@ -80,7 +82,8 @@
8082
return [
8183
FUNCTIONAL_STATUS.FUNCTIONING,
8284
FUNCTIONAL_STATUS.AWAITING_REPAIR,
83-
FUNCTIONAL_STATUS.UNSERVICEABLE
85+
FUNCTIONAL_STATUS.UNSERVICEABLE,
86+
FUNCTIONAL_STATUS.NEEDS_ATTENTION
8487
];
8588
}
8689

@@ -108,6 +111,9 @@
108111
case FUNCTIONAL_STATUS.UNSERVICEABLE:
109112
statusClass = 'is-unserviceable';
110113
break;
114+
case FUNCTIONAL_STATUS.NEEDS_ATTENTION:
115+
statusClass = 'is-needs-attention';
116+
break;
111117
default:
112118
throw 'Invalid status';
113119
}

src/cce-inventory-item-status/messages_en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"cceInventoryItemStatus.functionalityStatus": "Functionality Status",
88
"cceInventoryItemStatus.awaitingRepair": "Awaiting Repair",
99
"cceInventoryItemStatus.unserviceable": "Unserviceable",
10+
"cceInventoryItemStatus.needsAttention": "Needs attention",
1011
"cceInventoryItemStatus.notInUse": "Not in use",
1112
"cceInventoryItemStatus.decommissioned": "Decommissioned",
1213
"cceInventoryItemStatus.rtmAlerts.title": "RTM Alerts",

src/cce-inventory-item-status/status-update-modal.controller.spec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ describe('StatusUpdateModalController', function() {
147147
it('should return false for status that is other than FUNCTIONING', function() {
148148
expect(vm.isFunctioning(FUNCTIONAL_STATUS.UNSERVICEABLE)).toBe(false);
149149
expect(vm.isFunctioning(FUNCTIONAL_STATUS.AWAITING_REPAIR)).toBe(false);
150+
expect(vm.isFunctioning(FUNCTIONAL_STATUS.NEEDS_ATTENTION)).toBe(false);
150151
});
151152

152153
});
@@ -164,6 +165,7 @@ describe('StatusUpdateModalController', function() {
164165
it('should return false for statuses other than UNSERVICEABLE', function() {
165166
expect(vm.isUnserviceable(FUNCTIONAL_STATUS.FUNCTIONING)).toBe(false);
166167
expect(vm.isUnserviceable(FUNCTIONAL_STATUS.AWAITING_REPAIR)).toBe(false);
168+
expect(vm.isUnserviceable(FUNCTIONAL_STATUS.NEEDS_ATTENTION)).toBe(false);
167169
});
168170

169171
});

0 commit comments

Comments
 (0)