feat: Add June events for linear integration (#11007)
Fixes https://linear.app/chatwoot/issue/CW-3415/june-sdk-events
This commit is contained in:
@@ -2,11 +2,13 @@
|
|||||||
import { reactive, computed, onMounted, ref } from 'vue';
|
import { reactive, computed, onMounted, ref } from 'vue';
|
||||||
import { useVuelidate } from '@vuelidate/core';
|
import { useVuelidate } from '@vuelidate/core';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useTrack } from 'dashboard/composables';
|
||||||
import { useAlert } from 'dashboard/composables';
|
import { useAlert } from 'dashboard/composables';
|
||||||
import LinearAPI from 'dashboard/api/integrations/linear';
|
import LinearAPI from 'dashboard/api/integrations/linear';
|
||||||
import validations from './validations';
|
import validations from './validations';
|
||||||
import { parseLinearAPIErrorResponse } from 'dashboard/store/utils/api';
|
import { parseLinearAPIErrorResponse } from 'dashboard/store/utils/api';
|
||||||
import SearchableDropdown from './SearchableDropdown.vue';
|
import SearchableDropdown from './SearchableDropdown.vue';
|
||||||
|
import { LINEAR_EVENTS } from 'dashboard/helper/AnalyticsHelper/events';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
conversationId: {
|
conversationId: {
|
||||||
@@ -188,6 +190,7 @@ const createIssue = async () => {
|
|||||||
const { id: issueId } = response.data;
|
const { id: issueId } = response.data;
|
||||||
await LinearAPI.link_issue(props.conversationId, issueId, props.title);
|
await LinearAPI.link_issue(props.conversationId, issueId, props.title);
|
||||||
useAlert(t('INTEGRATION_SETTINGS.LINEAR.ADD_OR_LINK.CREATE_SUCCESS'));
|
useAlert(t('INTEGRATION_SETTINGS.LINEAR.ADD_OR_LINK.CREATE_SUCCESS'));
|
||||||
|
useTrack(LINEAR_EVENTS.CREATE_ISSUE);
|
||||||
onClose();
|
onClose();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const errorMessage = parseLinearAPIErrorResponse(
|
const errorMessage = parseLinearAPIErrorResponse(
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useTrack } from 'dashboard/composables';
|
||||||
import { useAlert } from 'dashboard/composables';
|
import { useAlert } from 'dashboard/composables';
|
||||||
import LinearAPI from 'dashboard/api/integrations/linear';
|
import LinearAPI from 'dashboard/api/integrations/linear';
|
||||||
import FilterButton from 'dashboard/components/ui/Dropdown/DropdownButton.vue';
|
import FilterButton from 'dashboard/components/ui/Dropdown/DropdownButton.vue';
|
||||||
import FilterListDropdown from 'dashboard/components/ui/Dropdown/DropdownList.vue';
|
import FilterListDropdown from 'dashboard/components/ui/Dropdown/DropdownList.vue';
|
||||||
import { parseLinearAPIErrorResponse } from 'dashboard/store/utils/api';
|
import { parseLinearAPIErrorResponse } from 'dashboard/store/utils/api';
|
||||||
|
import { LINEAR_EVENTS } from 'dashboard/helper/AnalyticsHelper/events';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
conversationId: {
|
conversationId: {
|
||||||
@@ -85,6 +87,7 @@ const linkIssue = async () => {
|
|||||||
searchQuery.value = '';
|
searchQuery.value = '';
|
||||||
issues.value = [];
|
issues.value = [];
|
||||||
onClose();
|
onClose();
|
||||||
|
useTrack(LINEAR_EVENTS.LINK_ISSUE);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const errorMessage = parseLinearAPIErrorResponse(
|
const errorMessage = parseLinearAPIErrorResponse(
|
||||||
error,
|
error,
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import { useI18n } from 'vue-i18n';
|
|||||||
import LinearAPI from 'dashboard/api/integrations/linear';
|
import LinearAPI from 'dashboard/api/integrations/linear';
|
||||||
import CreateOrLinkIssue from './CreateOrLinkIssue.vue';
|
import CreateOrLinkIssue from './CreateOrLinkIssue.vue';
|
||||||
import Issue from './Issue.vue';
|
import Issue from './Issue.vue';
|
||||||
|
import { useTrack } from 'dashboard/composables';
|
||||||
|
import { LINEAR_EVENTS } from 'dashboard/helper/AnalyticsHelper/events';
|
||||||
import { parseLinearAPIErrorResponse } from 'dashboard/store/utils/api';
|
import { parseLinearAPIErrorResponse } from 'dashboard/store/utils/api';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -56,6 +58,7 @@ const unlinkIssue = async linkId => {
|
|||||||
try {
|
try {
|
||||||
isUnlinking.value = true;
|
isUnlinking.value = true;
|
||||||
await LinearAPI.unlinkIssue(linkId);
|
await LinearAPI.unlinkIssue(linkId);
|
||||||
|
useTrack(LINEAR_EVENTS.UNLINK_ISSUE);
|
||||||
linkedIssue.value = null;
|
linkedIssue.value = null;
|
||||||
useAlert(t('INTEGRATION_SETTINGS.LINEAR.UNLINK.SUCCESS'));
|
useAlert(t('INTEGRATION_SETTINGS.LINEAR.UNLINK.SUCCESS'));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -124,3 +124,9 @@ export const SLA_EVENTS = Object.freeze({
|
|||||||
UPDATE: 'Updated an SLA',
|
UPDATE: 'Updated an SLA',
|
||||||
DELETED: 'Deleted an SLA',
|
DELETED: 'Deleted an SLA',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const LINEAR_EVENTS = Object.freeze({
|
||||||
|
CREATE_ISSUE: 'Created a linear issue',
|
||||||
|
LINK_ISSUE: 'Linked a linear issue',
|
||||||
|
UNLINK_ISSUE: 'Unlinked a linear issue',
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user