web/satellite: added more analytics for new access grant flow

Added docs opened tracking.

Change-Id: I9b69d521347e4a26c448312661fd278329b4466b
This commit is contained in:
Vitalii 2023-02-22 15:17:43 +02:00 committed by Vitalii Shpital
parent e9c4d1151f
commit 552272d189
3 changed files with 36 additions and 0 deletions

View File

@ -7,6 +7,7 @@
:href="link"
target="_blank"
rel="noopener noreferrer"
@click="trackPageVisit"
>
<LearnIcon v-if="withIcon" />
<p class="link-button__label">{{ label }}</p>
@ -14,6 +15,8 @@
</template>
<script setup lang="ts">
import { AnalyticsHttpApi } from '@/api/analytics';
import LearnIcon from '@/../static/images/accessGrants/newCreateFlow/learn.svg';
const props = withDefaults(defineProps<{
@ -23,6 +26,15 @@ const props = withDefaults(defineProps<{
}>(), {
withIcon: false,
});
const analytics: AnalyticsHttpApi = new AnalyticsHttpApi();
/**
* Sends "trackPageVisit" event to segment.
*/
function trackPageVisit(): void {
analytics.pageVisit(props.link);
}
</script>
<style scoped lang="scss">

View File

@ -20,6 +20,7 @@
href="https://docs.storj.io/dcs/concepts/access/access-grants"
target="_blank"
rel="noopener noreferrer"
@click="() => trackPageVisit('https://docs.storj.io/dcs/concepts/access/access-grants')"
>Learn More</a>
</p>
</template>
@ -38,6 +39,7 @@
href="https://docs.storj.io/dcs/api-reference/s3-compatible-gateway"
target="_blank"
rel="noopener noreferrer"
@click="() => trackPageVisit('https://docs.storj.io/dcs/api-reference/s3-compatible-gateway')"
>Learn More</a>
</p>
</template>
@ -56,6 +58,7 @@
href="https://docs.storj.io/dcs/getting-started/quickstart-uplink-cli/generate-access-grants-and-tokens/generate-a-token"
target="_blank"
rel="noopener noreferrer"
@click="() => trackPageVisit('https://docs.storj.io/dcs/getting-started/quickstart-uplink-cli/generate-access-grants-and-tokens/generate-a-token')"
>Learn More</a>
</p>
</template>
@ -99,6 +102,7 @@
import { computed } from 'vue';
import { AccessType, FUNCTIONAL_CONTAINER_ICON_AND_TITLE, FunctionalContainer } from '@/types/createAccessGrant';
import { AnalyticsHttpApi } from '@/api/analytics';
import ContainerWithIcon from '@/components/accessGrants/newCreateFlow/components/ContainerWithIcon.vue';
import ButtonsContainer from '@/components/accessGrants/newCreateFlow/components/ButtonsContainer.vue';
@ -115,12 +119,21 @@ const props = defineProps<{
onContinue: () => void;
}>();
const analytics: AnalyticsHttpApi = new AnalyticsHttpApi();
/**
* Indicates if button should be disabled.
*/
const isButtonDisabled = computed((): boolean => {
return !props.name || !props.selectedAccessTypes.length;
});
/**
* Sends "trackPageVisit" event to segment.
*/
function trackPageVisit(link: string): void {
analytics.pageVisit(link);
}
</script>
<style lang="scss" scoped>

View File

@ -10,6 +10,7 @@
href="https://docs.storj.io/dcs/concepts/encryption-key/design-decision-server-side-encryption/"
target="_blank"
rel="noopener noreferrer"
@click="trackPageVisit"
>server-side encryption</a>.
</p>
<Toggle
@ -46,6 +47,7 @@ import { ref } from 'vue';
import { useStore } from '@/utils/hooks';
import { LocalData } from '@/utils/localData';
import { AnalyticsHttpApi } from '@/api/analytics';
import ButtonsContainer from '@/components/accessGrants/newCreateFlow/components/ButtonsContainer.vue';
import Toggle from '@/components/accessGrants/newCreateFlow/components/Toggle.vue';
@ -60,6 +62,15 @@ const store = useStore();
const isDontShow = ref<boolean>(false);
const analytics: AnalyticsHttpApi = new AnalyticsHttpApi();
/**
* Sends "trackPageVisit" event to segment.
*/
function trackPageVisit(): void {
analytics.pageVisit('https://docs.storj.io/dcs/concepts/encryption-key/design-decision-server-side-encryption/');
}
/**
* Toggles 'passphrase is saved' checkbox.
*/