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 {
};
},
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() {
return this.sortedNodes.map((snapshot) => dateFormat(snapshot.endTime, dateFormats.month));
......
......@@ -6,6 +6,9 @@ query devopsAdoptionEnabledNamespaces(
devopsAdoptionEnabledNamespaces(displayNamespaceId: $displayNamespaceId) {
nodes {
id
namespace {
id
}
snapshots(endTimeBefore: $endDate, endTimeAfter: $startDate) {
nodes {
endTime
......
......@@ -25,7 +25,8 @@ describe('DevopsAdoptionOverviewChart', () => {
wrapper = shallowMount(DevopsAdoptionOverviewChart, {
localVue,
provide: {
groupGid: 'gid:123',
groupGid:
namespaceWithSnapotsData.data.devopsAdoptionEnabledNamespaces.nodes[0].namespace.id,
},
apolloProvider: createMockApollo(handlers),
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