feat: new data sharing component that replaces the data component

This commit is contained in:
Joel Jacob Stephen
2024-02-23 12:30:43 +05:30
parent 08992089f7
commit 6d1e8c4eeb
2 changed files with 8 additions and 16 deletions

View File

@@ -17,19 +17,13 @@ declare module '@vue/runtime-core' {
HoppButtonPrimary: typeof import('@hoppscotch/ui')['HoppButtonPrimary']
HoppButtonSecondary: typeof import('@hoppscotch/ui')['HoppButtonSecondary']
HoppSmartAnchor: typeof import('@hoppscotch/ui')['HoppSmartAnchor']
HoppSmartAutoComplete: typeof import('@hoppscotch/ui')['HoppSmartAutoComplete']
HoppSmartConfirmModal: typeof import('@hoppscotch/ui')['HoppSmartConfirmModal']
HoppSmartInput: typeof import('@hoppscotch/ui')['HoppSmartInput']
HoppSmartItem: typeof import('@hoppscotch/ui')['HoppSmartItem']
HoppSmartLink: typeof import('@hoppscotch/ui')['HoppSmartLink']
HoppSmartModal: typeof import('@hoppscotch/ui')['HoppSmartModal']
HoppSmartPicture: typeof import('@hoppscotch/ui')['HoppSmartPicture']
HoppSmartSpinner: typeof import('@hoppscotch/ui')['HoppSmartSpinner']
HoppSmartTab: typeof import('@hoppscotch/ui')['HoppSmartTab']
HoppSmartTable: typeof import('@hoppscotch/ui')['HoppSmartTable']
HoppSmartTabs: typeof import('@hoppscotch/ui')['HoppSmartTabs']
HoppSmartToggle: typeof import('@hoppscotch/ui')['HoppSmartToggle']
IconLucideChevronDown: typeof import('~icons/lucide/chevron-down')['default']
IconLucideInbox: typeof import('~icons/lucide/inbox')['default']
SettingsAuthProvider: typeof import('./components/settings/AuthProvider.vue')['default']
SettingsConfigurations: typeof import('./components/settings/Configurations.vue')['default']
@@ -37,6 +31,7 @@ declare module '@vue/runtime-core' {
SettingsReset: typeof import('./components/settings/Reset.vue')['default']
SettingsServerRestart: typeof import('./components/settings/ServerRestart.vue')['default']
SettingsSmtpConfiguration: typeof import('./components/settings/SmtpConfiguration.vue')['default']
SetupDataSharing: typeof import('./components/setup/DataSharing.vue')['default']
TeamsAdd: typeof import('./components/teams/Add.vue')['default']
TeamsDetails: typeof import('./components/teams/Details.vue')['default']
TeamsInvite: typeof import('./components/teams/Invite.vue')['default']

View File

@@ -70,7 +70,6 @@
<script setup lang="ts">
import { useMutation } from '@urql/vue';
import { ref } from 'vue';
import { useRouter } from 'vue-router';
import { useI18n } from '~/composables/i18n';
import { useToast } from '~/composables/toast';
import { auth } from '~/helpers/auth';
@@ -85,9 +84,12 @@ import IconShieldQuestion from '~icons/lucide/shield-question';
const t = useI18n();
const toast = useToast();
const router = useRouter();
const user = auth.getCurrentUser();
const emit = defineEmits<{
(event: 'onSetupComplete', status: boolean): void;
}>();
const shareData = ref(true);
const shareEmail = ref(true);
@@ -95,9 +97,9 @@ const submitSelection = async () => {
const dataSharingResult = shareData.value && (await toggleDataSharing());
const newsletterResult = shareEmail.value && (await toggleNewsletter());
if (dataSharingResult && newsletterResult) {
router.push('/');
}
// if (dataSharingResult && newsletterResult) {
emit('onSetupComplete', true);
// }
};
const dataSharingMutation = useMutation(ToggleAnalyticsCollectionDocument);
@@ -132,8 +134,3 @@ const toggleNewsletter = async () => {
}
};
</script>
<route lang="yaml">
meta:
layout: empty
</route>