Skip to content

Commit c6314ab

Browse files
committed
[O2B-1491] Remove 'MIXED' status and filtering by 'UNKNOWN'
As a result of PR comments removed the status mixed from possible statuses ENUM. Also removed filtering by the 'UNKNOWN' status given it is an unreachable status.
1 parent 661e4dc commit c6314ab

4 files changed

Lines changed: 8 additions & 13 deletions

File tree

lib/domain/enums/StatusAcronyms.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const statusAcronyms = Object.freeze({
1818
CONFIGURED: 'C',
1919
RUNNING: 'R',
2020
ERROR: 'E',
21-
MIXED: 'M',
2221
DESTROYED: 'X',
2322
DONE: 'X',
2423
});

lib/public/domain/enums/statusAcronym.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export const StatusAcronym = Object.freeze({
1818
CONFIGURED: 'C',
1919
RUNNING: 'R',
2020
ERROR: 'E',
21-
MIXED: 'M',
2221
DESTROYED: 'X',
2322
DONE: 'X',
2423
});

lib/public/views/Environments/Overview/EnvironmentOverviewModel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class EnvironmentOverviewModel extends OverviewPageModel {
3737
value: status,
3838
label: coloredEnvironmentStatusComponent(status),
3939
rawLabel: status,
40-
})).concat({ value: 'UNKNOWN', label: coloredEnvironmentStatusComponent('UNKNOWN'), rawLabel: 'UNKNOWN' }),
40+
})),
4141
}),
4242
ids: new RawTextFilterModel(),
4343
});

lib/usecases/environment/GetAllEnvironmentsUseCase.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,18 @@ const { statusAcronyms } = require('../../domain/enums/StatusAcronyms.js');
2626
* Subquery to select the latest history item for each environment.
2727
* It orders the history items by updatedAt DESC and selects to have the latests
2828
* history item on top. Then it limits the result to 1, so only
29-
* the latest history item is selected. If the environment has no history
30-
* items, it returns 'UNKNOWN' to indicate the environment has never had a status.
29+
* the latest history item is selected.
3130
*
3231
* Environment refers to the current environment in the main query,
3332
* because this query is a sub query that is executed for every environment.
3433
*/
3534
const ENVIRONMENT_LATEST_HISTORY_ITEM_SUBQUERY = `
36-
(CASE
37-
WHEN EXISTS(SELECT 1 FROM environments_history_items AS h WHERE h.environment_id = Environment.id) THEN
38-
(SELECT h.status
39-
FROM environments_history_items AS h WHERE h.environment_id = Environment.id
40-
ORDER BY h.updated_at DESC
41-
LIMIT 1)
42-
ELSE 'UNKNOWN'
43-
END)`;
35+
(SELECT h.status
36+
FROM environments_history_items AS h
37+
WHERE h.environment_id = Environment.id
38+
ORDER BY h.updated_at DESC
39+
LIMIT 1
40+
)`;
4441

4542
/**
4643
* Subquery to select the status history for each environment.

0 commit comments

Comments
 (0)