2
0
mirror of https://github.com/frappe/books.git synced 2024-12-22 19:09:01 +00:00

incr: log setup wizard events

This commit is contained in:
18alantom 2023-06-28 12:26:01 +05:30
parent e8041b7d9c
commit 243c41cff4
3 changed files with 13 additions and 2 deletions

View File

@ -3,6 +3,8 @@ export type UniqueId = string;
export type Timestamp = string; export type Timestamp = string;
export enum Verb { export enum Verb {
Started = 'started',
Completed = 'completed',
Created = 'created', Created = 'created',
Deleted = 'deleted', Deleted = 'deleted',
Submitted = 'submitted', Submitted = 'submitted',

View File

@ -216,6 +216,7 @@
<script lang="ts"> <script lang="ts">
import { setupDummyInstance } from 'dummy'; import { setupDummyInstance } from 'dummy';
import { t } from 'fyo'; import { t } from 'fyo';
import { Verb } from 'fyo/telemetry/types';
import { DateTime } from 'luxon'; import { DateTime } from 'luxon';
import Button from 'src/components/Button.vue'; import Button from 'src/components/Button.vue';
import LanguageSelector from 'src/components/Controls/LanguageSelector.vue'; import LanguageSelector from 'src/components/Controls/LanguageSelector.vue';
@ -334,7 +335,7 @@ export default defineComponent({
updateConfigFiles(fyo); updateConfigFiles(fyo);
await fyo.purgeCache(); await fyo.purgeCache();
await this.setFiles(); await this.setFiles();
this.fyo.telemetry.log(Verb.Created, 'dummy-instance');
this.creatingDemo = false; this.creatingDemo = false;
}, },
async setFiles() { async setFiles() {

View File

@ -47,7 +47,7 @@
<p v-if="loading" class="text-base text-gray-600"> <p v-if="loading" class="text-base text-gray-600">
{{ t`Loading instance...` }} {{ t`Loading instance...` }}
</p> </p>
<Button v-if="!loading" class="w-24" @click="$emit('setup-canceled')">{{ <Button v-if="!loading" class="w-24" @click="cancel">{{
t`Cancel` t`Cancel`
}}</Button> }}</Button>
<Button <Button
@ -72,6 +72,8 @@
<script lang="ts"> <script lang="ts">
import { DocValue } from 'fyo/core/types'; import { DocValue } from 'fyo/core/types';
import { Doc } from 'fyo/model/doc'; import { Doc } from 'fyo/model/doc';
import { Verb } from 'fyo/telemetry/types';
import { ModelNameEnum } from 'models/types';
import { Field } from 'schemas/types'; import { Field } from 'schemas/types';
import Button from 'src/components/Button.vue'; import Button from 'src/components/Button.vue';
import FormContainer from 'src/components/FormContainer.vue'; import FormContainer from 'src/components/FormContainer.vue';
@ -153,6 +155,7 @@ export default defineComponent({
// @ts-ignore // @ts-ignore
window.sw = this; window.sw = this;
} }
this.fyo.telemetry.log(Verb.Started, ModelNameEnum.SetupWizard);
}, },
methods: { methods: {
async fill() { async fill() {
@ -198,8 +201,13 @@ export default defineComponent({
} }
this.loading = true; this.loading = true;
this.fyo.telemetry.log(Verb.Completed, ModelNameEnum.SetupWizard);
this.$emit('setup-complete', this.doc.getValidDict()); this.$emit('setup-complete', this.doc.getValidDict());
}, },
cancel() {
this.fyo.telemetry.log(Verb.Cancelled, ModelNameEnum.SetupWizard);
this.$emit('setup-canceled');
},
}, },
}); });
</script> </script>