Skip to content

Commit ee72d68

Browse files
committed
fix: sending projectGroupId
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
1 parent b48b954 commit ee72d68

3 files changed

Lines changed: 6 additions & 9 deletions

File tree

frontend/src/modules/activity/config/filters/activityType/ActivityTypeFilter.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
} from '@/shared/modules/filters/types/filterTypes/MultiSelectFilterConfig';
1515
import { CustomFilterConfig } from '@/shared/modules/filters/types/filterTypes/CustomFilterConfig';
1616
import { useActivityTypeStore } from '@/modules/activity/store/type';
17-
import { getSegmentsFromProjectGroup } from '@/utils/segments';
1817
import { useLfSegmentsStore } from '@/modules/lf/segments/store';
1918
import { lfIdentities } from '@/config/identities';
2019
import useIntegrationsHelpers from '@/config/integrations/integrations.helpers';
@@ -77,6 +76,6 @@ watch([types, activeIntegrations], ([typesValue, activeIntegrationsValue]) => {
7776
});
7877
7978
onMounted(async () => {
80-
await store.dispatch('integration/doFetch', getSegmentsFromProjectGroup(selectedProjectGroup.value));
79+
await store.dispatch('integration/doFetch', selectedProjectGroup.value?.id ? [selectedProjectGroup.value.id] : []);
8180
});
8281
</script>

frontend/src/modules/member/config/filters/activityType/ActivityTypeFilter.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
} from '@/shared/modules/filters/types/filterTypes/MultiSelectFilterConfig';
1515
import { CustomFilterConfig } from '@/shared/modules/filters/types/filterTypes/CustomFilterConfig';
1616
import { useActivityTypeStore } from '@/modules/activity/store/type';
17-
import { getSegmentsFromProjectGroup } from '@/utils/segments';
1817
import { useLfSegmentsStore } from '@/modules/lf/segments/store';
1918
import useIntegrationsHelpers from '@/config/integrations/integrations.helpers';
2019
import { lfIntegrations } from '@/config/integrations';
@@ -77,6 +76,6 @@ watch([types, activeIntegrations], ([typesValue, activeIntegrationsValue]) => {
7776
});
7877
7978
onMounted(async () => {
80-
await store.dispatch('integration/doFetch', getSegmentsFromProjectGroup(selectedProjectGroup.value));
79+
await store.dispatch('integration/doFetch', selectedProjectGroup.value?.id ? [selectedProjectGroup.value.id] : []);
8180
});
8281
</script>

frontend/src/shared/axios/auth-axios.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { stringify } from 'qs';
33
import config from '@/config';
44
import { storeToRefs } from 'pinia';
55
import { useLfSegmentsStore } from '@/modules/lf/segments/store';
6-
import { getSegmentsFromProjectGroup } from '@/utils/segments';
76
import { AuthService } from '@/modules/auth/services/auth.service';
87
import { dateHelper } from '@/shared/date-helper/date-helper';
98

@@ -47,10 +46,10 @@ authAxios.interceptors.request.use(
4746
segments = options.data.segments;
4847
} else if (hasSegmentsQueryParams) {
4948
segments = options.params.segments;
50-
// If neither body or query params have segments
51-
// Use selected project group segment ids
52-
} else if (selectedProjectGroup.value.projects.length) {
53-
segments = getSegmentsFromProjectGroup(selectedProjectGroup.value, options, options.method === 'get');
49+
// If neither body or query params have segments, use the selected project group id.
50+
// The backend segment middleware resolves it to the correct leaf sub-projects.
51+
} else if (selectedProjectGroup.value?.id) {
52+
segments = [selectedProjectGroup.value.id];
5453
}
5554

5655
if (options.method === 'get') {

0 commit comments

Comments
 (0)