diff --git a/frontend/src/config/integrations/github/components/settings/github-settings-drawer.vue b/frontend/src/config/integrations/github/components/settings/github-settings-drawer.vue index e9f8ac77b8..1e56cbd71e 100644 --- a/frontend/src/config/integrations/github/components/settings/github-settings-drawer.vue +++ b/frontend/src/config/integrations/github/components/settings/github-settings-drawer.vue @@ -116,6 +116,7 @@ const subprojects = ref([]); const organizations = ref([]); const repositories = ref([]); const repoMappings = ref>({}); +const initialRepoMappings = ref>({}); // Drawer visibility const isDrawerVisible = computed({ @@ -157,7 +158,10 @@ const buildSettings = (): GitHubSettings => { .map((r) => ({ name: r.name, url: r.url, - updatedAt: r.updatedAt || dayjs().toISOString(), + updatedAt: (props.integration + && repoMappings.value[r.url] !== initialRepoMappings.value[r.url]) + ? dayjs().toISOString() + : r.updatedAt || dayjs().toISOString(), })), }), ); @@ -167,6 +171,7 @@ const buildSettings = (): GitHubSettings => { const connect = () => { let integration: any = null; const settings: GitHubSettings = buildSettings(); + (props.integration?.id ? IntegrationService.update(props.integration.id, { settings, @@ -219,13 +224,16 @@ const fetchGithubMappings = () => { if (!props.integration) return; IntegrationService.fetchGitHubMappings(props.integration).then( (res: any[]) => { - repoMappings.value = res.reduce( + const mappings = res.reduce( (rm, mapping) => ({ ...rm, [mapping.url]: mapping.segment.id, }), {}, ); + // Create new objects to ensure no reference sharing + repoMappings.value = { ...mappings }; + initialRepoMappings.value = { ...mappings }; }, ); };