Skip to content

Commit 25ddfc6

Browse files
author
Cerebro
committed
feat(locations): synthesize zero-usage capacity for bucket-only locations
Part of the implementation plan from scality/agent-task#343.
1 parent 5c3d75a commit 25ddfc6

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/react/next-architecture/domain/business/locations.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,23 @@ export const useListLocationsForCurrentAccount = ({
227227
const locationDefinition = allLocationsValue.find((l) => l.id === locationId);
228228

229229
if (locationDefinition) {
230+
const usedCapacityValue: LatestUsedCapacity =
231+
locationId in accountLocationData
232+
? accountLocationData[locationId]
233+
: {
234+
type: 'hasMetrics',
235+
usedCapacity: {
236+
current: 0,
237+
nonCurrent: 0,
238+
},
239+
measuredOn: new Date(),
240+
};
241+
230242
locations[locationId] = {
231243
...locationDefinition,
232244
usedCapacity: {
233245
status: 'success',
234-
value: accountLocationData[locationId],
246+
value: usedCapacityValue,
235247
},
236248
};
237249
}

0 commit comments

Comments
 (0)