Commit 06fb70fc authored by Emily Ring's avatar Emily Ring

Added default cluster status

Added default cluster status to /clusters_list/constants.js
parent 1282559c
......@@ -54,12 +54,12 @@ export default {
methods: {
...mapActions(['fetchClusters']),
statusClass(status) {
const { className } = STATUSES[status];
return className || 'disabled';
const iconClass = STATUSES[status] || STATUSES.default;
return iconClass.className;
},
statusTitle(status) {
const { title } = STATUSES[status];
return sprintf(__('Status: %{title}'), { title }, false);
const iconTitle = STATUSES[status] || STATUSES.default;
return sprintf(__('Status: %{title}'), { title: iconTitle.title }, false);
},
},
};
......
......@@ -7,6 +7,7 @@ export const CLUSTER_TYPES = {
};
export const STATUSES = {
default: { className: 'bg-white', title: __('Unknown') },
disabled: { className: 'disabled', title: __('Disabled') },
created: { className: 'bg-success', title: __('Connected') },
unreachable: { className: 'bg-danger', title: __('Unreachable') },
......
......@@ -80,6 +80,7 @@ describe('Clusters', () => {
${'authentication_failure'} | ${'bg-warning'} | ${2}
${'deleting'} | ${null} | ${3}
${'created'} | ${'bg-success'} | ${4}
${'default'} | ${'bg-white'} | ${5}
`('renders a status for each cluster', ({ statusName, className, lineNumber }) => {
const statuses = findStatuses();
const status = statuses.at(lineNumber);
......
......@@ -44,6 +44,15 @@ export const clusterList = [
cpu: '6 (100% free)',
memory: '20.12 (35% free)',
},
{
name: 'My Cluster 6',
environmentScope: '*',
size: '1',
clusterType: 'project_type',
status: 'cleanup_ongoing',
cpu: '6 (100% free)',
memory: '20.12 (35% free)',
},
];
export const apiData = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment