diff --git a/src/layouts/components/main-layout-header-bar.vue b/src/layouts/components/main-layout-header-bar.vue
index 01af21c..5ad6d39 100644
--- a/src/layouts/components/main-layout-header-bar.vue
+++ b/src/layouts/components/main-layout-header-bar.vue
@@ -3,14 +3,8 @@
setup
>
import { useUiStore } from 'src/stores/ui-store';
- import { useAuthStore } from 'src/stores/auth-store';
- import { useChatbotStore } from 'src/stores/chatbot-store';
-
- // import HeaderBarNotification from './main-layout-header-bar-notification.vue';
const uiStore = useUiStore();
- const chatbot_store = useChatbotStore();
- const auth_store = useAuthStore();
@@ -37,19 +31,6 @@
/>
-
-
-
-
-
diff --git a/src/layouts/main-layout.vue b/src/layouts/main-layout.vue
index 67c31b3..4ae920f 100644
--- a/src/layouts/main-layout.vue
+++ b/src/layouts/main-layout.vue
@@ -37,7 +37,7 @@
-
+
diff --git a/src/modules/chatbot/components/chatbot-drawer.vue b/src/modules/chatbot/components/chatbot-drawer.vue
index 3ad5725..380c991 100644
--- a/src/modules/chatbot/components/chatbot-drawer.vue
+++ b/src/modules/chatbot/components/chatbot-drawer.vue
@@ -12,10 +12,13 @@
const chatbot_store = useChatbotStore();
const text = ref('');
+ const is_showing_right_drawer = ref(true);
+ const drawer_width = ref(85);
const handleSend = async () => {
const message = text.value.trim();
text.value = '';
+ console.log('message: ', message, ', length: ', message.length);
await chatbot_api.sendMessage(message);
};
@@ -26,53 +29,79 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/modules/chatbot/components/dialogue-content.vue b/src/modules/chatbot/components/dialogue-content.vue
index 53a6993..f9f80dd 100644
--- a/src/modules/chatbot/components/dialogue-content.vue
+++ b/src/modules/chatbot/components/dialogue-content.vue
@@ -20,11 +20,11 @@
-
+
message.text.includes('chatbot.') ? t(message.text) : message.text)
- const is_error = computed(() => message.text.includes('NO_REPLY_RECEIVED') || message.text.includes('NO_REPLY_RECEIVED'));
+ const is_error = computed(() => message.text.includes('NO_REPLY_RECEIVED') || message.text.includes('SEND_MESSAGE_FAILED'));
+
// Initialize Markdown parser
// const md = new MarkdownIt({
// // breaks: false, // Support line breaks
@@ -48,6 +49,24 @@
+
+
+ {{ message_text }}
+
+
+
+ = {
+export const PageContexts: Record = {
"login": null,
"login-success": null,
"error": null,
diff --git a/src/modules/chatbot/services/chatbot.service.ts b/src/modules/chatbot/services/chatbot.service.ts
index b68f6b4..0a297ed 100644
--- a/src/modules/chatbot/services/chatbot.service.ts
+++ b/src/modules/chatbot/services/chatbot.service.ts
@@ -1,28 +1,28 @@
-import type { chatbotPageContext } from "src/modules/chatbot/models/page-context.model";
+import type { ChatbotPageContext } from "src/modules/chatbot/models/page-context.model";
import type { Message } from "src/modules/chatbot/models/dialogue-message.model";
import { api } from "src/boot/axios";
export const chatbotService = {
// Function to send the message to the backend
- sendChatMessage: async (userInput: string): Promise => {
- const response = await api.post("/chatbot", { userInput });
+ sendChatMessage: async (userInput: string, pageContext: ChatbotPageContext | undefined): Promise => {
+ const response = await api.post("/chatbot", { userInput, pageContext });
return response.data as Message;
},
- // Function to send context to backend
- sendPageContext: async (context: chatbotPageContext): Promise => {
- const response = await api.post("/chatbot/context", context);
- return response.data;
- },
+ // // Function to send context to backend
+ // sendPageContext: async (context: chatbotPageContext): Promise => {
+ // const response = await api.post("/chatbot/context", context);
+ // return response.data;
+ // },
- // Function to send user credentials to the backend to communicate with n8n.
- sendUserCredentials: async (email: string, role: string): Promise => {
- const response = await api.post("/chatbot/user", { email, role });
- return response.data;
- },
+ // // Function to send user credentials to the backend to communicate with n8n.
+ // sendUserCredentials: async (email: string, role: string): Promise => {
+ // const response = await api.post("/chatbot/user", { email, role });
+ // return response.data;
+ // },
- retrieveCustomerDiagnostics: async (id: string): Promise => {
- const response = await api.get(`/chat/customer/${id}`);
- return response.data;
- },
+ // retrieveCustomerDiagnostics: async (id: string): Promise => {
+ // const response = await api.get(`/chat/customer/${id}`);
+ // return response.data;
+ // },
};
diff --git a/src/modules/timesheet-approval/components/overview-list-filters.vue b/src/modules/timesheet-approval/components/overview-list-filters.vue
index 9290348..588dab1 100644
--- a/src/modules/timesheet-approval/components/overview-list-filters.vue
+++ b/src/modules/timesheet-approval/components/overview-list-filters.vue
@@ -14,7 +14,6 @@
onMounted(() => {
Object.values(overview_column_names).map(column => column_options.value.push({ label: `timesheet_approvals.table.${column}`, value: column as OverviewColumns }))
column_options.value = column_options.value.filter(column => !EXCLUDED_COLUMNS.includes(column.value));
- console.log('filter column values: ', column_options.value )
})
diff --git a/src/modules/timesheets/components/timesheet-wrapper.vue b/src/modules/timesheets/components/timesheet-wrapper.vue
index 5949338..00318ba 100644
--- a/src/modules/timesheets/components/timesheet-wrapper.vue
+++ b/src/modules/timesheets/components/timesheet-wrapper.vue
@@ -30,7 +30,7 @@
const is_timesheets_approved = computed(() => timesheet_store.timesheets.every(timesheet => timesheet.is_approved))
const total_hours = computed(() => timesheet_store.timesheets.reduce((sum, timesheet) =>
- sum + timesheet.weekly_hours.regular
+ sum += timesheet.weekly_hours.regular
+ timesheet.weekly_hours.evening
+ timesheet.weekly_hours.emergency
+ timesheet.weekly_hours.overtime,
diff --git a/src/stores/chatbot-store.ts b/src/stores/chatbot-store.ts
index 3b66c21..b0fc645 100644
--- a/src/stores/chatbot-store.ts
+++ b/src/stores/chatbot-store.ts
@@ -2,19 +2,20 @@ import { ref } from "vue";
import { defineStore } from "pinia";
import { chatbotService } from "src/modules/chatbot/services/chatbot.service";
import type { Message } from "src/modules/chatbot/models/dialogue-message.model";
+import { type ChatbotPageContext, PageContexts } from "src/modules/chatbot/models/page-context.model";
import type { RouteNames } from "src/router/router-constants";
-import { PageContexts } from "src/modules/chatbot/models/page-context.model";
export const useChatbotStore = defineStore("chatbot", () => {
const messages = ref([]);
const has_shown_instructions = ref(false);
const is_showing_chatbot = ref(false);
+ const current_page_context = ref(undefined);
const sendChatMessage = async (user_message: string) => {
const last_chatbot_message = messages.value.at(messages.value.length - 1)!;
try {
- const chatbot_response = await chatbotService.sendChatMessage(user_message);
+ const chatbot_response = await chatbotService.sendChatMessage(user_message, current_page_context.value);
if (chatbot_response) {
last_chatbot_message.text = chatbot_response.text;
last_chatbot_message.isThinking = false;
@@ -30,11 +31,9 @@ export const useChatbotStore = defineStore("chatbot", () => {
}
};
- const updatePageContext = async (page_name: RouteNames) => {
- const chatbot_page_context = PageContexts[page_name];
-
- if (chatbot_page_context)
- await chatbotService.sendPageContext(chatbot_page_context);
+ const updatePageContext = (page_name: RouteNames) => {
+ current_page_context.value = PageContexts[page_name] ?? undefined;
+
};
const showInstructionsOnce = () => {