Commit 0f207b4d authored by Martin Wortschack's avatar Martin Wortschack

Merge branch 'ensure-da-overview-chart-selects-correct-group' into 'master'

Ensure correct group for DA chart

See merge request gitlab-org/gitlab!72176
parents 8dc00d41 0065f5a8
...@@ -81,7 +81,11 @@ export default { ...@@ -81,7 +81,11 @@ export default {
}; };
}, },
sortedNodes() { sortedNodes() {
return [...this.devopsAdoptionEnabledNamespaces?.nodes[0].snapshots?.nodes].reverse(); const correctNode = this.devopsAdoptionEnabledNamespaces?.nodes.find(
(node) => node.namespace?.id === this.groupGid,
);
return [...correctNode?.snapshots?.nodes].reverse();
}, },
groupBy() { groupBy() {
return this.sortedNodes.map((snapshot) => dateFormat(snapshot.endTime, dateFormats.month)); return this.sortedNodes.map((snapshot) => dateFormat(snapshot.endTime, dateFormats.month));
......
...@@ -6,6 +6,9 @@ query devopsAdoptionEnabledNamespaces( ...@@ -6,6 +6,9 @@ query devopsAdoptionEnabledNamespaces(
devopsAdoptionEnabledNamespaces(displayNamespaceId: $displayNamespaceId) { devopsAdoptionEnabledNamespaces(displayNamespaceId: $displayNamespaceId) {
nodes { nodes {
id id
namespace {
id
}
snapshots(endTimeBefore: $endDate, endTimeAfter: $startDate) { snapshots(endTimeBefore: $endDate, endTimeAfter: $startDate) {
nodes { nodes {
endTime endTime
......
...@@ -25,7 +25,8 @@ describe('DevopsAdoptionOverviewChart', () => { ...@@ -25,7 +25,8 @@ describe('DevopsAdoptionOverviewChart', () => {
wrapper = shallowMount(DevopsAdoptionOverviewChart, { wrapper = shallowMount(DevopsAdoptionOverviewChart, {
localVue, localVue,
provide: { provide: {
groupGid: 'gid:123', groupGid:
namespaceWithSnapotsData.data.devopsAdoptionEnabledNamespaces.nodes[0].namespace.id,
}, },
apolloProvider: createMockApollo(handlers), apolloProvider: createMockApollo(handlers),
data() { data() {
......
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