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

@@ -0,0 +1,40 @@
<template>
<SetupDataSharingAndNewsletter
@setup-complete="(status: boolean) => (isDataSharingAndNewsletterSetup = status)"
/>
</template>
<script setup lang="ts">
import { ref, watch } from 'vue';
import { useRouter } from 'vue-router';
import { useI18n } from '~/composables/i18n';
import { useToast } from '~/composables/toast';
import { auth } from '~/helpers/auth';
const t = useI18n();
const toast = useToast();
const router = useRouter();
const isDataSharingAndNewsletterSetup = ref(false);
// Watcher is added for future proofing as we can have multiple setup steps in future
watch(
() => isDataSharingAndNewsletterSetup.value,
async (status) => {
if (status) {
const result = await auth.updateFirstTimeInfraSetupStatus();
if (result) {
toast.success(t('state.setup_success'));
router.push('/dashboard');
} else {
toast.error(t('state.setup_failure'));
}
}
}
);
</script>
<route lang="yaml">
meta:
layout: empty
</route>