Linear integration
This commit is contained in:
@@ -5,7 +5,7 @@ import Copilot from 'dashboard/components-next/copilot/Copilot.vue';
|
||||
import CopilotActionCableConnector from 'dashboard/helpers/CopilotActionCableConnector';
|
||||
import { useMapGetter } from 'dashboard/composables/store';
|
||||
import { useUISettings } from 'dashboard/composables/useUISettings';
|
||||
|
||||
import { emitter } from 'shared/helpers/mitt';
|
||||
const store = useStore();
|
||||
const currentUser = useMapGetter('getCurrentUser');
|
||||
const assistants = useMapGetter('captainAssistants/getRecords');
|
||||
@@ -96,6 +96,13 @@ const initializeWebSocket = () => {
|
||||
content: data.response.response,
|
||||
});
|
||||
isCaptainTyping.value = false;
|
||||
} else if (data.type === 'ui_event') {
|
||||
if (data.event === 'ui:linear_ticket_create') {
|
||||
emitter.emit('ui:linear_ticket_create');
|
||||
setTimeout(() => {
|
||||
emitter.emit('ui:linear_ticket_create_data', data.response);
|
||||
}, 100);
|
||||
}
|
||||
} else {
|
||||
messages.value.push({
|
||||
id: new Date().getTime(),
|
||||
|
||||
@@ -10,6 +10,7 @@ import { parseLinearAPIErrorResponse } from 'dashboard/store/utils/api';
|
||||
import SearchableDropdown from './SearchableDropdown.vue';
|
||||
import { LINEAR_EVENTS } from 'dashboard/helper/AnalyticsHelper/events';
|
||||
import Button from 'dashboard/components-next/button/Button.vue';
|
||||
import { useEmitter } from 'dashboard/composables/emitter';
|
||||
|
||||
const props = defineProps({
|
||||
conversationId: {
|
||||
@@ -204,6 +205,12 @@ const createIssue = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
useEmitter('ui:linear_ticket_create_data', data => {
|
||||
formState.title = data.title;
|
||||
formState.description = data.description;
|
||||
formState.priority = data.priority;
|
||||
});
|
||||
|
||||
onMounted(getTeams);
|
||||
</script>
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import { useTrack } from 'dashboard/composables';
|
||||
import { LINEAR_EVENTS } from 'dashboard/helper/AnalyticsHelper/events';
|
||||
import { parseLinearAPIErrorResponse } from 'dashboard/store/utils/api';
|
||||
import Button from 'dashboard/components-next/button/Button.vue';
|
||||
import { useEmitter } from 'dashboard/composables/emitter';
|
||||
|
||||
const props = defineProps({
|
||||
conversationId: {
|
||||
@@ -94,6 +95,10 @@ watch(
|
||||
}
|
||||
);
|
||||
|
||||
useEmitter('ui:linear_ticket_create', () => {
|
||||
shouldShowPopup.value = true;
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
loadLinkedIssue();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user