feat(sh-admin): introducing data analytics and newsletter configurations (#3845)

Co-authored-by: jamesgeorge007 <jamesgeorge998001@gmail.com>
Co-authored-by: nivedin <nivedinp@gmail.com>
This commit is contained in:
Joel Jacob Stephen
2024-03-06 20:06:48 +05:30
committed by GitHub
parent 4798d7bbbd
commit 919579b1da
18 changed files with 575 additions and 156 deletions

View File

@@ -22,6 +22,7 @@ import {
EnableAndDisableSsoDocument,
ResetInfraConfigsDocument,
UpdateInfraConfigsDocument,
ToggleAnalyticsCollectionDocument,
} from '~/helpers/backend/graphql';
const t = useI18n();
@@ -43,10 +44,17 @@ const updateInfraConfigsMutation = useMutation(UpdateInfraConfigsDocument);
const updateAllowedAuthProviderMutation = useMutation(
EnableAndDisableSsoDocument
);
const toggleDataSharingMutation = useMutation(
ToggleAnalyticsCollectionDocument
);
// Mutation handlers
const { updateInfraConfigs, updateAuthProvider, resetInfraConfigs } =
useConfigHandler(props.workingConfigs);
const {
updateInfraConfigs,
updateAuthProvider,
resetInfraConfigs,
updateDataSharingConfigs,
} = useConfigHandler(props.workingConfigs);
// Call relevant mutations on component mount and initiate server restart
const duration = ref(30);
@@ -80,6 +88,12 @@ onMounted(async () => {
updateAllowedAuthProviderMutation
);
if (!authResult) return;
const dataSharingResult = await updateDataSharingConfigs(
toggleDataSharingMutation
);
if (!dataSharingResult) return;
}
restart.value = true;