Skip to content
Snippets Groups Projects

DevOps Adoption - Add an adoption table in the Overview tab

6 files
+ 215
7
Compare changes
  • Side-by-side
  • Inline
Files
6
@@ -9,12 +9,14 @@ import {
GlProgressBar,
} from '@gitlab/ui';
import {
TABLE_TEST_IDS_HEADERS,
I18N_GROUP_COL_LABEL,
I18N_TABLE_REMOVE_BUTTON_DISABLED,
I18N_TABLE_REMOVE_BUTTON,
I18N_OVERVIEW_TABLE_HEADER_GROUP,
I18N_OVERVIEW_TABLE_HEADER_SUBGROUP,
TABLE_TEST_IDS_ACTIONS,
TABLE_TEST_IDS_NAMESPACE,
DEVOPS_ADOPTION_TABLE_CONFIGURATION,
DELETE_MODAL_ID,
} from '../constants';
@@ -24,6 +26,7 @@ const thClass = ['gl-bg-white!', 'gl-text-gray-400'];
const fieldOptions = {
thClass,
thAttr: { 'data-testid': TABLE_TEST_IDS_HEADERS },
};
export default {
@@ -51,14 +54,10 @@ export default {
},
testids: {
ACTIONS: TABLE_TEST_IDS_ACTIONS,
NAMESPACE: TABLE_TEST_IDS_NAMESPACE,
},
deleteModalId: DELETE_MODAL_ID,
cols: DEVOPS_ADOPTION_TABLE_CONFIGURATION,
inject: {
groupGid: {
default: null,
},
},
props: {
data: {
type: Object,
@@ -103,7 +102,9 @@ export default {
...DEVOPS_ADOPTION_TABLE_CONFIGURATION.map((item) => ({
[item.key]: {
total: item.cols.length,
adopted: item.cols.filter((col) => Boolean(group.latestSnapshot[col.key])).length,
adopted: item.cols.filter(
(col) => group.latestSnapshot && Boolean(group.latestSnapshot[col.key]),
).length,
},
})).reduce((values, formatted) => ({ ...values, ...formatted }), {}),
}));
@@ -163,6 +164,7 @@ export default {
<div
v-if="item.latestSnapshot"
:key="col.key"
:data-testid="col.testId"
class="gl-display-flex gl-align-items-center gl-justify-content-end gl-justify-content-md-start"
>
<span class="gl-w-7 gl-mr-3">{{ formatPercentage(item, col) }}</span>
Loading