From 7c44216eff292b71ef29bbcfb8374b79a02656c2 Mon Sep 17 00:00:00 2001 From: ruwinirathnamalala Date: Thu, 11 Jun 2026 18:52:54 +0530 Subject: [PATCH 1/8] Sync ckb menu header --- DSL/Ruuter/ckb/GET/accounts/user-role.yml | 38 +++++++++++++++++++++++ GUI/.env.development | 5 +-- GUI/package-lock.json | 17 +++++----- GUI/package.json | 4 +-- GUI/src/components/CKBLayout/index.tsx | 21 +++++++++++-- GUI/src/store/index.ts | 4 +++ docker-compose.yml | 3 +- 7 files changed, 76 insertions(+), 16 deletions(-) create mode 100644 DSL/Ruuter/ckb/GET/accounts/user-role.yml diff --git a/DSL/Ruuter/ckb/GET/accounts/user-role.yml b/DSL/Ruuter/ckb/GET/accounts/user-role.yml new file mode 100644 index 0000000..381f69f --- /dev/null +++ b/DSL/Ruuter/ckb/GET/accounts/user-role.yml @@ -0,0 +1,38 @@ +declaration: + call: declare + version: 0.1 + description: "Get user roles dynamically from TIM" + method: get + accepts: json + returns: json + namespace: backoffice + allowlist: + headers: + - field: cookie + type: string + description: "Cookie field" + +get_user_info: + call: http.post + args: + url: "[#CKB_TIM]/jwt/custom-jwt-userinfo" + contentType: plaintext + headers: + cookie: ${incoming.headers.cookie} + plaintext: "customJwtCookie" + result: res + next: check_user_info_response + +check_user_info_response: + switch: + - condition: ${200 <= res.response.statusCodeValue && res.response.statusCodeValue < 300} + next: return_result + next: return_empty_array + +return_result: + return: ${res.response.body.authorities} + next: end + +return_empty_array: + return: success + next: end diff --git a/GUI/.env.development b/GUI/.env.development index d5ddfc9..f2062e7 100644 --- a/GUI/.env.development +++ b/GUI/.env.development @@ -13,7 +13,8 @@ REACT_APP_SHOW_HISTORY_EMAIL=false REACT_APP_SHOW_HISTORY_SORTING=false REACT_APP_SERVICE_ID=conversations,settings,monitoring REACT_APP_NOTIFICATION_NODE_URL=http://localhost:4040 -REACT_APP_CSP="upgrade-insecure-requests; default-src 'self'; font-src 'self' data:; img-src * data:; script-src 'self' 'unsafe-eval' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; object-src 'none'; connect-src 'self' http://localhost:8086 http://localhost:8085 http://localhost:4040 https://admin.dev.buerokratt.ee/chat/menu.json https://*.s3.amazonaws.com;" +REACT_APP_CSP="default-src 'self'; font-src 'self' data:; img-src * data:; script-src 'self' 'unsafe-eval' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; object-src 'none'; connect-src 'self' http://localhost:8086 http://localhost:8085 http://localhost:4040 http://localhost:9000 http://host.docker.internal:9000 https://host.docker.internal:9000 https://admin.dev.buerokratt.ee/chat/menu.json https://*.s3.amazonaws.com;" REACT_APP_ENABLE_HIDDEN_FEATURES=TRUE REACT_APP_VALIDATIONS_ENABLED=FALSE -REACT_APP_MENU_JSON=[{"id":"conversations","label":{"et":"Vestlused","en":"Conversations"},"path":"/chat","children":[{"label":{"et":"Vastamata","en":"Unanswered"},"path":"/unanswered"},{"label":{"et":"Aktiivsed","en":"Active"},"path":"/active"},{"label":{"et":"Ootel","en":"Pending"},"path":"/pending"},{"label":{"et":"Ajalugu","en":"History"},"path":"/history"}]},{"id":"training","label":{"et":"Treening","en":"Training"},"path":"/training","children":[{"label":{"et":"Treening","en":"Training"},"path":"/training","children":[{"label":{"et":"Teemad","en":"Themes"},"path":"/training/intents"},{"label":{"et":"Avalikud teemad","en":"Public themes"},"path":"/training/common-intents"},{"label":{"et":"Teemade järeltreenimine","en":"Post training themes"},"path":"/training/intents-followup-training"},{"label":{"et":"Vastused","en":"Answers"},"path":"/training/responses"},{"label":{"et":"Reeglid","en":"Rules"},"path":"/training/rules"},{"label":{"et":"Konfiguratsioon","en":"Configuration"},"path":"/training/configuration"},{"label":{"et":"Vormid","en":"Forms"},"path":"/training/forms"},{"label":{"et":"Mälukohad","en":"Slots"},"path":"/training/slots"},{"label":{"et":"Automatic Teenused","en":"Automatic Services"},"path":"/auto-services"}]},{"label":{"et":"Ajaloolised vestlused","en":"Historical conversations"},"path":"/history","children":[{"label":{"et":"Ajalugu","en":"History"},"path":"/history/history"},{"label":{"et":"Pöördumised","en":"Appeals"},"path":"/history/appeal"}]},{"label":{"et":"Mudelipank ja analüütika","en":"Modelbank and analytics"},"path":"/analytics","children":[{"label":{"et":"Teemade ülevaade","en":"Overview of topics"},"path":"/analytics/overview"},{"label":{"et":"Mudelite võrdlus","en":"Comparison of models"},"path":"/analytics/models"},{"label":{"et":"Testlood","en":"testTracks"},"path":"/analytics/testcases"}]},{"label":{"et":"Treeni uus mudel","en":"Train new model"},"path":"/train-new-model"}]},{"id":"analytics","label":{"et":"Analüütika","en":"Analytics"},"path":"/analytics","children":[{"label":{"et":"Ülevaade","en":"Overview"},"path":"/overview"},{"label":{"et":"Vestlused","en":"Chats"},"path":"/chats"},{"label":{"et":"Tagasiside","en":"Feedback"},"path":"/feedback"},{"label":{"et":"Nõustajad","en":"Advisors"},"path":"/advisors"},{"label":{"et":"Avaandmed","en":"Reports"},"path":"/reports"}]},{"id":"services","label":{"et":"Teenused","en":"Services"},"path":"/services","children":[{"label":{"et":"Ülevaade","en":"Overview"},"path":"/overview"},{"label":{"et":"Uus teenus","en":"New Service"},"path":"/newService"},{"label":{"et":"Automatic Teenused","en":"Automatic Services"},"path":"/auto-services"},{"label":{"et":"Probleemsed teenused","en":"Faulty Services"},"path":"/faultyServices"}]},{"id":"settings","label":{"et":"Haldus","en":"Administration"},"path":"/settings","children":[{"label":{"et":"Kasutajad","en":"Users"},"path":"/users"},{"label":{"et":"Vestlusbot","en":"Chatbot"},"path":"/chatbot","children":[{"label":{"et":"Seaded","en":"Settings"},"path":"/chatbot/settings"},{"label":{"et":"Tervitussõnum","en":"Welcome message"},"path":"/chatbot/welcome-message"},{"label":{"et":"Välimus ja käitumine","en":"Appearance and behavior"},"path":"/chatbot/appearance"},{"label":{"et":"Erakorralised teated","en":"Emergency notices"},"path":"/chatbot/emergency-notices"}]},{"label":{"et":"Asutuse tööaeg","en":"Office opening hours"},"path":"/working-time"},{"label":{"et":"Sessiooni pikkus","en":"Session length"},"path":"/session-length"},{"label":{"et":"Vestluse Kustutamine","en":"Delete Conversations"},"path":"/delete-conversations"}]},{"id":"monitoring","label":{"et":"Seire","en":"Monitoring"},"path":"/monitoring","children":[{"label":{"et":"Aktiivaeg","en":"Working hours"},"path":"/uptime"}]}] +REACT_APP_MENU_JSON=[{"id":"conversations","label":{"et":"Vestlused","en":"Conversations"},"path":"/chat","children":[{"label":{"et":"Vastamata","en":"Unanswered"},"path":"/unanswered"},{"label":{"et":"Aktiivsed","en":"Active"},"path":"/active"},{"label":{"et":"Ootel","en":"Pending"},"path":"/pending"},{"label":{"et":"Ajalugu","en":"History"},"path":"/history"},{"label":{"et":"Valideerimised","en":"Validations"},"path":"/validations"}]},{"id":"training","label":{"et":"Treening","en":"Training"},"path":"/training","children":[{"label":{"et":"Treening","en":"Training"},"path":"/training","children":[{"label":{"et":"Teemad","en":"Themes"},"path":"/training/intents"},{"label":{"et":"Avalikud teemad","en":"Public themes"},"path":"/training/common-intents"},{"label":{"et":"Teemade järeltreenimine","en":"Post training themes"},"path":"/training/intents-followup-training"},{"label":{"et":"Vastused","en":"Answers"},"path":"/training/responses"},{"label":{"et":"Reeglid","en":"Rules"},"path":"/training/rules"},{"label":{"et":"Konfiguratsioon","en":"Configuration"},"path":"/training/configuration"},{"label":{"et":"Vormid","en":"Forms"},"path":"/training/forms"},{"label":{"et":"Mälukohad","en":"Slots"},"path":"/training/slots"},{"label":{"et":"Automatic Teenused","en":"Automatic Services"},"path":"/auto-services"}]},{"label":{"et":"Ajaloolised vestlused","en":"Historical conversations"},"path":"/history","children":[{"label":{"et":"Ajalugu","en":"History"},"path":"/history/history"},{"label":{"et":"Pöördumised","en":"Appeals"},"path":"/history/appeal"}]},{"label":{"et":"Mudelipank ja analüütika","en":"Modelbank and analytics"},"path":"/analytics","children":[{"label":{"et":"Teemade ülevaade","en":"Overview of topics"},"path":"/analytics/overview"},{"label":{"et":"Mudelite võrdlus","en":"Comparison of models"},"path":"/analytics/models"},{"label":{"et":"Testlood","en":"testTracks"},"path":"/analytics/testcases"}]},{"label":{"et":"Treeni uus mudel","en":"Train new model"},"path":"/train-new-model"}]},{"id":"analytics","label":{"et":"Analüütika","en":"Analytics"},"path":"/analytics","children":[{"label":{"et":"Ülevaade","en":"Overview"},"path":"/overview"},{"label":{"et":"Vestlused","en":"Chats"},"path":"/chats"},{"label":{"et":"Tagasiside","en":"Feedback"},"path":"/feedback"},{"label":{"et":"Nõustajad","en":"Advisors"},"path":"/advisors"},{"label":{"et":"Avaandmed","en":"Reports"},"path":"/reports"}]},{"id":"services","label":{"et":"Teenused","en":"Services"},"path":"/services","children":[{"label":{"et":"Ülevaade","en":"Overview"},"path":"/overview"},{"label":{"et":"Uus teenus","en":"New Service"},"path":"/newService"},{"label":{"et":"Automatic Teenused","en":"Automatic Services"},"path":"/auto-services"},{"label":{"et":"Probleemsed teenused","en":"Faulty Services"},"path":"/faultyServices"}]},{"label":{"et":"Teadmusbaas","en":"Knowledge Base"},"path":"/ckb","children":[{"label":{"et":"Andmed","en":"Data"},"path":"/agency"},{"label":{"et":"Aruanded","en":"Reports"},"path":"/reports"},{"label":{"et":"API Integratsioonid","en":"API Integrations"},"path":"/api"}]},{"id":"settings","label":{"et":"Haldus","en":"Administration"},"path":"/settings","children":[{"label":{"et":"Kasutajad","en":"Users"},"path":"/users"},{"label":{"et":"Vestlusbot","en":"Chatbot"},"path":"/chatbot","children":[{"label":{"et":"Seaded","en":"Settings"},"path":"/chatbot/settings"},{"label":{"et":"Tervitussõnum","en":"Welcome message"},"path":"/chatbot/welcome-message"},{"label":{"et":"Välimus ja käitumine","en":"Appearance and behavior"},"path":"/chatbot/appearance"},{"label":{"et":"Erakorralised teated","en":"Emergency notices"},"path":"/chatbot/emergency-notices"}]},{"label":{"et":"Asutuse tööaeg","en":"Office opening hours"},"path":"/working-time"},{"label":{"et":"Vestluse Kustutamine","en":"Delete Conversations"},"path":"/delete-conversations"},{"label":{"et":"Sessiooni pikkus","en":"Session length"},"path":"/session-length"},{"label":{"et":"SKMi konfiguratsioon","en":"SKM Configuration"},"path":"/skm-configuration"}]},{"id":"monitoring","label":{"et":"Seire","en":"Monitoring"},"path":"/monitoring","children":[{"label":{"et":"Aktiivaeg","en":"Working hours"},"path":"/uptime"}]}] +REACT_APP_ENABLE_MULTI_DOMAIN=FALSE \ No newline at end of file diff --git a/GUI/package-lock.json b/GUI/package-lock.json index beff26f..3770d72 100644 --- a/GUI/package-lock.json +++ b/GUI/package-lock.json @@ -9,8 +9,8 @@ "version": "0.0.0", "dependencies": { "@buerokratt-ria/common-gui-components": "^0.0.17", - "@buerokratt-ria/header": "^0.1.35", - "@buerokratt-ria/menu": "^0.2.6", + "@buerokratt-ria/header": "^0.1.52", + "@buerokratt-ria/menu": "^0.2.15", "@buerokratt-ria/styles": "^0.0.1", "@fontsource/roboto": "^4.5.8", "@formkit/auto-animate": "^1.0.0-beta.5", @@ -2015,9 +2015,9 @@ } }, "node_modules/@buerokratt-ria/header": { - "version": "0.1.47", - "resolved": "https://registry.npmjs.org/@buerokratt-ria/header/-/header-0.1.47.tgz", - "integrity": "sha512-O937+HVqsVJTC5PLDbHadWiUxEvrqGiSeY7RVNPNm4H5R3wvkPOzd52J0fUvs0CjZlPFkMnrOSdRvkRbr19cEg==", + "version": "0.1.52", + "resolved": "https://registry.npmjs.org/@buerokratt-ria/header/-/header-0.1.52.tgz", + "integrity": "sha512-4k9Ekym6UqQpyF2nEIIT0n3wdp6Ax9sTvWK4HeZ7xuwf9YdgYnYRARRnZxcfsJCMm54JUQ8IKV9Y5i5ULVk1Bg==", "license": "ISC", "dependencies": { "@buerokratt-ria/styles": "^0.0.1", @@ -2055,9 +2055,10 @@ } }, "node_modules/@buerokratt-ria/menu": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/@buerokratt-ria/menu/-/menu-0.2.7.tgz", - "integrity": "sha512-b5Qs/voXy2VAKQJ3jIQ85wgF8sQkuiJWZDZWR3zSiMX1EZtexxnOdZjLk180QoehZbIG5SLAB+eLY38qiRXOYw==", + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/@buerokratt-ria/menu/-/menu-0.2.15.tgz", + "integrity": "sha512-xtjIyD/3Mdg2UZ7A6Yv/3ZsZX8LGUFGpYtr3LaYeyfhv5FsLWfDwXNPL2ViooOdpPJaD4hmKURrBF2VgpmBfUw==", + "license": "ISC", "dependencies": { "@buerokratt-ria/styles": "^0.0.1", "@types/react": "^18.2.21", diff --git a/GUI/package.json b/GUI/package.json index eb30418..b8d8df9 100644 --- a/GUI/package.json +++ b/GUI/package.json @@ -11,8 +11,8 @@ "prettier": "prettier --write \"{,!(node_modules)/**/}*.{ts,tsx,js,json,css,less,scss}\"" }, "dependencies": { - "@buerokratt-ria/header": "^0.1.35", - "@buerokratt-ria/menu": "^0.2.6", + "@buerokratt-ria/header": "^0.1.52", + "@buerokratt-ria/menu": "^0.2.15", "@buerokratt-ria/styles": "^0.0.1", "@buerokratt-ria/common-gui-components": "^0.0.17", "@fontsource/roboto": "^4.5.8", diff --git a/GUI/src/components/CKBLayout/index.tsx b/GUI/src/components/CKBLayout/index.tsx index cf35920..83bc977 100644 --- a/GUI/src/components/CKBLayout/index.tsx +++ b/GUI/src/components/CKBLayout/index.tsx @@ -1,14 +1,18 @@ import React, { FC } from 'react'; import useStore from 'store'; import { Outlet } from 'react-router-dom'; -import { NavigationSidebar, Header } from 'components'; +import { NavigationSidebar} from 'components'; import { useToast } from '../../hooks/useToast'; import './Layout.scss'; import { MdOutlineStorage, MdOutlineAssessment, MdApi } from 'react-icons/md'; import { useTranslation } from 'react-i18next'; +import { MainNavigation } from '@buerokratt-ria/menu'; +import { Header, useMenuCountConf } from '@buerokratt-ria/header'; const Layout: FC = () => { const { t } = useTranslation(); + const domainBarShowing = import.meta.env.REACT_APP_ENABLE_MULTI_DOMAIN?.toLowerCase() === 'true'; + const menuItems = [ { id: 'data', @@ -31,11 +35,22 @@ const Layout: FC = () => { icon: , }, ]; + + const menuCountConf = useMenuCountConf(); + return ( + console.log('Menu count configuration:', menuCountConf), // Debug log to check the menu count configuration --- IGNORE --- + console.log('Domain selector visibility:', domainBarShowing), // Debug log to check if the domain selector is visible --- IGNORE ---
- + {/* */} +
-
+
diff --git a/GUI/src/store/index.ts b/GUI/src/store/index.ts index eeffd1c..cd363bc 100644 --- a/GUI/src/store/index.ts +++ b/GUI/src/store/index.ts @@ -31,6 +31,8 @@ interface StoreState { getGroupedUnansweredChats: () => GroupedChat; loadPendingChats: () => Promise; getGroupedPendingChats: () => GroupedPendingChat; + userDomains: string[]; + setUserDomains: (domains: string[]) => void; } const useStore = create((set, get, store) => ({ @@ -73,6 +75,8 @@ const useStore = create((set, get, store) => ({ }, unansweredChatsLength: () => get().unansweredChats().length, forwordedChatsLength: () => get().forwordedChats().length, + userDomains: [], + setUserDomains: (domains: string[]) => set({ userDomains: domains }), loadActiveChats: async () => { const res = await apiDev.get('agents/chats/active'); diff --git a/docker-compose.yml b/docker-compose.yml index 5e6dce6..7970575 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -276,7 +276,8 @@ services: REACT_APP_SERVICE_ID: ckb REACT_APP_ENABLE_HIDDEN_FEATURES: true REACT_APP_VALIDATIONS_ENABLED: FALSE - # - REACT_APP_MENU_JSON=[{"id":"conversations","label":{"et":"Vestlused","en":"Conversations"},"path":"/chat","children":[{"label":{"et":"Vastamata","en":"Unanswered"},"path":"/unanswered"},{"label":{"et":"Aktiivsed","en":"Active"},"path":"/active"},{"label":{"et":"Ootel","en":"Pending"},"path":"/pending"},{"label":{"et":"Ajalugu","en":"History"},"path":"/history"},{"label":{"et":"Valideerimised","en":"Validations"},"path":"/validations"}]},{"id":"training","label":{"et":"Treening","en":"Training"},"path":"/training","children":[{"label":{"et":"Treening","en":"Training"},"path":"/training","children":[{"label":{"et":"Teemad","en":"Themes"},"path":"/training/intents"},{"label":{"et":"Avalikud teemad","en":"Public themes"},"path":"/training/common-intents"},{"label":{"et":"Teemade järeltreenimine","en":"Post training themes"},"path":"/training/intents-followup-training"},{"label":{"et":"Vastused","en":"Answers"},"path":"/training/responses"},{"label":{"et":"Reeglid","en":"Rules"},"path":"/training/rules"},{"label":{"et":"Konfiguratsioon","en":"Configuration"},"path":"/training/configuration"},{"label":{"et":"Vormid","en":"Forms"},"path":"/training/forms"},{"label":{"et":"Mälukohad","en":"Slots"},"path":"/training/slots"},{"label":{"et":"Automatic Teenused","en":"Automatic Services"},"path":"/auto-services"}]},{"label":{"et":"Ajaloolised vestlused","en":"Historical conversations"},"path":"/history","children":[{"label":{"et":"Ajalugu","en":"History"},"path":"/history/history"},{"label":{"et":"Pöördumised","en":"Appeals"},"path":"/history/appeal"}]},{"label":{"et":"Mudelipank ja analüütika","en":"Modelbank and analytics"},"path":"/analytics","children":[{"label":{"et":"Teemade ülevaade","en":"Overview of topics"},"path":"/analytics/overview"},{"label":{"et":"Mudelite võrdlus","en":"Comparison of models"},"path":"/analytics/models"},{"label":{"et":"Testlood","en":"testTracks"},"path":"/analytics/testcases"}]},{"label":{"et":"Treeni uus mudel","en":"Train new model"},"path":"/train-new-model"}]},{"id":"analytics","label":{"et":"Analüütika","en":"Analytics"},"path":"/analytics","children":[{"label":{"et":"Ülevaade","en":"Overview"},"path":"/overview"},{"label":{"et":"Vestlused","en":"Chats"},"path":"/chats"},{"label":{"et":"Tagasiside","en":"Feedback"},"path":"/feedback"},{"label":{"et":"Nõustajad","en":"Advisors"},"path":"/advisors"},{"label":{"et":"Avaandmed","en":"Reports"},"path":"/reports"}]},{"id":"services","label":{"et":"Teenused","en":"Services"},"path":"/services","children":[{"label":{"et":"Ülevaade","en":"Overview"},"path":"/overview"},{"label":{"et":"Uus teenus","en":"New Service"},"path":"/newService"},{"label":{"et":"Automatic Teenused","en":"Automatic Services"},"path":"/auto-services"},{"label":{"et":"Probleemsed teenused","en":"Faulty Services"},"path":"/faultyServices"}]},{"id":"settings","label":{"et":"Haldus","en":"Administration"},"path":"/settings","children":[{"label":{"et":"Kasutajad","en":"Users"},"path":"/users"},{"label":{"et":"Vestlusbot","en":"Chatbot"},"path":"/chatbot","children":[{"label":{"et":"Seaded","en":"Settings"},"path":"/chatbot/settings"},{"label":{"et":"Tervitussõnum","en":"Welcome message"},"path":"/chatbot/welcome-message"},{"label":{"et":"Välimus ja käitumine","en":"Appearance and behavior"},"path":"/chatbot/appearance"},{"label":{"et":"Erakorralised teated","en":"Emergency notices"},"path":"/chatbot/emergency-notices"}]},{"label":{"et":"Asutuse tööaeg","en":"Office opening hours"},"path":"/working-time"},{"label":{"et":"Vestluse Kustutamine","en":"Delete Conversations"},"path":"/delete-conversations"},{"label":{"et":"Sessiooni pikkus","en":"Session length"},"path":"/session-length"},{"label":{"et":"SKMi konfiguratsioon","en":"SKM Configuration"},"path":"/skm-configuration"}]},{"id":"monitoring","label":{"et":"Seire","en":"Monitoring"},"path":"/monitoring","children":[{"label":{"et":"Aktiivaeg","en":"Working hours"},"path":"/uptime"}]}] + REACT_APP_ENABLE_MULTI_DOMAIN: TRUE + REACT_APP_MENU_JSON: '[{"id":"conversations","label":{"et":"Vestlused","en":"Conversations"},"path":"/chat","children":[{"label":{"et":"Vastamata","en":"Unanswered"},"path":"/unanswered"},{"label":{"et":"Aktiivsed","en":"Active"},"path":"/active"},{"label":{"et":"Ootel","en":"Pending"},"path":"/pending"},{"label":{"et":"Ajalugu","en":"History"},"path":"/history"},{"label":{"et":"Valideerimised","en":"Validations"},"path":"/validations"}]},{"id":"training","label":{"et":"Treening","en":"Training"},"path":"/training","children":[{"label":{"et":"Treening","en":"Training"},"path":"/training","children":[{"label":{"et":"Teemad","en":"Themes"},"path":"/training/intents"},{"label":{"et":"Avalikud teemad","en":"Public themes"},"path":"/training/common-intents"},{"label":{"et":"Teemade järeltreenimine","en":"Post training themes"},"path":"/training/intents-followup-training"},{"label":{"et":"Vastused","en":"Answers"},"path":"/training/responses"},{"label":{"et":"Reeglid","en":"Rules"},"path":"/training/rules"},{"label":{"et":"Konfiguratsioon","en":"Configuration"},"path":"/training/configuration"},{"label":{"et":"Vormid","en":"Forms"},"path":"/training/forms"},{"label":{"et":"Mälukohad","en":"Slots"},"path":"/training/slots"},{"label":{"et":"Automatic Teenused","en":"Automatic Services"},"path":"/auto-services"}]},{"label":{"et":"Ajaloolised vestlused","en":"Historical conversations"},"path":"/history","children":[{"label":{"et":"Ajalugu","en":"History"},"path":"/history/history"},{"label":{"et":"Pöördumised","en":"Appeals"},"path":"/history/appeal"}]},{"label":{"et":"Mudelipank ja analüütika","en":"Modelbank and analytics"},"path":"/analytics","children":[{"label":{"et":"Teemade ülevaade","en":"Overview of topics"},"path":"/analytics/overview"},{"label":{"et":"Mudelite võrdlus","en":"Comparison of models"},"path":"/analytics/models"},{"label":{"et":"Testlood","en":"testTracks"},"path":"/analytics/testcases"}]},{"label":{"et":"Treeni uus mudel","en":"Train new model"},"path":"/train-new-model"}]},{"id":"analytics","label":{"et":"Analüütika","en":"Analytics"},"path":"/analytics","children":[{"label":{"et":"Ülevaade","en":"Overview"},"path":"/overview"},{"label":{"et":"Vestlused","en":"Chats"},"path":"/chats"},{"label":{"et":"Tagasiside","en":"Feedback"},"path":"/feedback"},{"label":{"et":"Nõustajad","en":"Advisors"},"path":"/advisors"},{"label":{"et":"Avaandmed","en":"Reports"},"path":"/reports"}]},{"id":"services","label":{"et":"Teenused","en":"Services"},"path":"/services","children":[{"label":{"et":"Ülevaade","en":"Overview"},"path":"/overview"},{"label":{"et":"Uus teenus","en":"New Service"},"path":"/newService"},{"label":{"et":"Automatic Teenused","en":"Automatic Services"},"path":"/auto-services"},{"label":{"et":"Probleemsed teenused","en":"Faulty Services"},"path":"/faultyServices"}]},{"id":"settings","label":{"et":"Haldus","en":"Administration"},"path":"/settings","children":[{"label":{"et":"Kasutajad","en":"Users"},"path":"/users"},{"label":{"et":"Vestlusbot","en":"Chatbot"},"path":"/chatbot","children":[{"label":{"et":"Seaded","en":"Settings"},"path":"/chatbot/settings"},{"label":{"et":"Tervitussõnum","en":"Welcome message"},"path":"/chatbot/welcome-message"},{"label":{"et":"Välimus ja käitumine","en":"Appearance and behavior"},"path":"/chatbot/appearance"},{"label":{"et":"Erakorralised teated","en":"Emergency notices"},"path":"/chatbot/emergency-notices"}]},{"label":{"et":"Asutuse tööaeg","en":"Office opening hours"},"path":"/working-time"},{"label":{"et":"Vestluse Kustutamine","en":"Delete Conversations"},"path":"/delete-conversations"},{"label":{"et":"Sessiooni pikkus","en":"Session length"},"path":"/session-length"},{"label":{"et":"SKMi konfiguratsioon","en":"SKM Configuration"},"path":"/skm-configuration"}]},{"id":"monitoring","label":{"et":"Seire","en":"Monitoring"},"path":"/monitoring","children":[{"label":{"et":"Aktiivaeg","en":"Working hours"},"path":"/uptime"}]}]' # # for production use this one: # - REACT_APP_MENU_JSON=[{"id":"conversations","label":{"et":"Vestlused","en":"Conversations"},"path":"/chat","children":[{"label":{"et":"Vastamata","en":"Unanswered"},"path":"/unanswered"},{"label":{"et":"Aktiivsed","en":"Active"},"path":"/active"},{"label":{"et":"Ootel","en":"Pending"},"path":"/pending"},{"label":{"et":"Ajalugu","en":"History"},"path":"/history"},{"label":{"et":"Valideerimised","en":"Validations"},"path":"/validations"}]},{"id":"training","label":{"et":"Treening","en":"Training"},"path":"/training","children":[{"label":{"et":"Treening","en":"Training"},"path":"/training","children":[{"label":{"et":"Teemad","en":"Themes"},"path":"/training/intents"},{"hidden":true,"label":{"et":"Avalikud teemad","en":"Public themes"},"path":"/training/common-intents"},{"label":{"et":"Teemade järeltreenimine","en":"Post training themes"},"path":"/training/intents-followup-training"},{"label":{"et":"Vastused","en":"Answers"},"path":"/training/responses"},{"label":{"et":"Reeglid","en":"Rules"},"path":"/training/rules"},{"hidden":true,"label":{"et":"Konfiguratsioon","en":"Configuration"},"path":"/training/configuration"},{"label":{"et":"Vormid","en":"Forms"},"path":"/training/forms"},{"label":{"et":"Mälukohad","en":"Slots"},"path":"/training/slots"},{"hidden":true,"label":{"et":"Automatic Teenused","en":"Automatic Services"},"path":"/auto-services"}]},{"label":{"et":"Ajaloolised vestlused","en":"Historical conversations"},"path":"/history","children":[{"label":{"et":"Ajalugu","en":"History"},"path":"/history/history"},{"hidden":true,"label":{"et":"Pöördumised","en":"Appeals"},"path":"/history/appeal"}]},{"label":{"et":"Mudelipank ja analüütika","en":"Modelbank and analytics"},"path":"/analytics","children":[{"label":{"et":"Teemade ülevaade","en":"Overview of topics"},"path":"/analytics/overview"},{"label":{"et":"Mudelite võrdlus","en":"Comparison of models"},"path":"/analytics/models"},{"hidden":true,"label":{"et":"Testlood","en":"testTracks"},"path":"/analytics/testcases"}]},{"label":{"et":"Treeni uus mudel","en":"Train new model"},"path":"/train-new-model"}]},{"id":"analytics","label":{"et":"Analüütika","en":"Analytics"},"path":"/analytics","children":[{"label":{"et":"Ülevaade","en":"Overview"},"path":"/overview"},{"label":{"et":"Vestlused","en":"Chats"},"path":"/chats"},{"label":{"et":"Tagasiside","en":"Feedback"},"path":"/feedback"},{"label":{"et":"Nõustajad","en":"Advisors"},"path":"/advisors"},{"label":{"et":"Avaandmed","en":"Reports"},"path":"/reports"}]},{"id":"services","hidden":true,"label":{"et":"Teenused","en":"Services"},"path":"/services","children":[{"label":{"et":"Ülevaade","en":"Overview"},"path":"/overview"},{"label":{"et":"Uus teenus","en":"New Service"},"path":"/newService"},{"label":{"et":"Automatic Teenused","en":"Automatic Services"},"path":"/auto-services"},{"label":{"et":"Probleemsed teenused","en":"Faulty Services"},"path":"/faultyServices"}]},{"id":"settings","label":{"et":"Haldus","en":"Administration"},"path":"/settings","children":[{"label":{"et":"Kasutajad","en":"Users"},"path":"/users"},{"label":{"et":"Vestlusbot","en":"Chatbot"},"path":"/chatbot","children":[{"label":{"et":"Seaded","en":"Settings"},"path":"/chatbot/settings"},{"label":{"et":"Tervitussõnum","en":"Welcome message"},"path":"/chatbot/welcome-message"},{"label":{"et":"Välimus ja käitumine","en":"Appearance and behavior"},"path":"/chatbot/appearance"},{"label":{"et":"Erakorralised teated","en":"Emergency notices"},"path":"/chatbot/emergency-notices"}]},{"label":{"et":"Asutuse tööaeg","en":"Office opening hours"},"path":"/working-time"},{"label":{"et":"Sessiooni pikkus","en":"Session length"},"path":"/session-length"},{"label":{"et":"SKMi konfiguratsioon","en":"SKM Configuration"},"path":"/skm-configuration"}]},{"id":"monitoring","hidden":true,"label":{"et":"Seire","en":"Monitoring"},"path":"/monitoring","children":[{"label":{"et":"Aktiivaeg","en":"Working hours"},"path":"/uptime"}]}] build: From c364a52a25d290394b6c8c2a28a8c3a337d368e3 Mon Sep 17 00:00:00 2001 From: ruwinirathnamalala Date: Mon, 15 Jun 2026 11:04:41 +0530 Subject: [PATCH 2/8] Synced side menu - (Changes got from Ahmed) --- ...t-customer-support-activity-by-id-code.sql | 4 ++ DSL/Resql/users/POST/get-user-domains.sql | 7 +++ .../users/POST/get-user-profile-settings.sql | 13 ++++ DSL/Resql/users/POST/get-widget-domains.sql | 17 +++++ .../accounts/customer-support-activity.yml | 52 +++++++++++++++ DSL/Ruuter/ckb/GET/accounts/settings.yml | 63 +++++++++++++++++++ DSL/Ruuter/ckb/GET/accounts/widget-data.yml | 49 +++++++++++++++ GUI/.env.development | 3 +- GUI/src/components/CKBHeader/Header.scss | 26 -------- GUI/src/components/CKBHeader/index.tsx | 57 ----------------- GUI/src/components/Drawer/Drawer.scss | 2 +- GUI/src/components/Section/Section.scss | 2 +- GUI/src/components/index.tsx | 2 - GUI/translations/en/common.json | 10 +++ GUI/translations/et/common.json | 10 +++ README.md | 7 ++- docker-compose.yml | 7 ++- 17 files changed, 237 insertions(+), 94 deletions(-) create mode 100644 DSL/Resql/users/POST/get-customer-support-activity-by-id-code.sql create mode 100644 DSL/Resql/users/POST/get-user-domains.sql create mode 100644 DSL/Resql/users/POST/get-user-profile-settings.sql create mode 100644 DSL/Resql/users/POST/get-widget-domains.sql create mode 100644 DSL/Ruuter/ckb/GET/accounts/customer-support-activity.yml create mode 100644 DSL/Ruuter/ckb/GET/accounts/settings.yml create mode 100644 DSL/Ruuter/ckb/GET/accounts/widget-data.yml delete mode 100644 GUI/src/components/CKBHeader/Header.scss delete mode 100644 GUI/src/components/CKBHeader/index.tsx diff --git a/DSL/Resql/users/POST/get-customer-support-activity-by-id-code.sql b/DSL/Resql/users/POST/get-customer-support-activity-by-id-code.sql new file mode 100644 index 0000000..b8f2438 --- /dev/null +++ b/DSL/Resql/users/POST/get-customer-support-activity-by-id-code.sql @@ -0,0 +1,4 @@ +SELECT id_code, active, status, status_comment +FROM customer_support_agent_activity +WHERE id_code = :customerSupportId + AND id IN (SELECT max(id) FROM customer_support_agent_activity WHERE id_code = :customerSupportId) diff --git a/DSL/Resql/users/POST/get-user-domains.sql b/DSL/Resql/users/POST/get-user-domains.sql new file mode 100644 index 0000000..b8b42cc --- /dev/null +++ b/DSL/Resql/users/POST/get-user-domains.sql @@ -0,0 +1,7 @@ +SELECT DISTINCT ON (user_login) + user_login, + domain_id AS domains, + selected_domains as selected +FROM user_widget_domains +WHERE user_login = :user_login +ORDER BY user_login, created DESC \ No newline at end of file diff --git a/DSL/Resql/users/POST/get-user-profile-settings.sql b/DSL/Resql/users/POST/get-user-profile-settings.sql new file mode 100644 index 0000000..2da6ef6 --- /dev/null +++ b/DSL/Resql/users/POST/get-user-profile-settings.sql @@ -0,0 +1,13 @@ +SELECT + user_id, + forwarded_chat_popup_notifications, + forwarded_chat_sound_notifications, + forwarded_chat_email_notifications, + new_chat_popup_notifications, + new_chat_sound_notifications, + new_chat_email_notifications, + use_autocorrect +FROM user_profile_settings +WHERE user_id=:userId +ORDER BY id DESC +LIMIT 1; diff --git a/DSL/Resql/users/POST/get-widget-domains.sql b/DSL/Resql/users/POST/get-widget-domains.sql new file mode 100644 index 0000000..432b8b2 --- /dev/null +++ b/DSL/Resql/users/POST/get-widget-domains.sql @@ -0,0 +1,17 @@ +SELECT name, + url, + domain_id, + active +FROM ( + SELECT DISTINCT ON (domain_id) + name, + url, + domain_id, + active + FROM widget_domains + ORDER BY + domain_id, + created DESC, + id DESC + ) AS latest_per_domain +WHERE active = TRUE; \ No newline at end of file diff --git a/DSL/Ruuter/ckb/GET/accounts/customer-support-activity.yml b/DSL/Ruuter/ckb/GET/accounts/customer-support-activity.yml new file mode 100644 index 0000000..42d7137 --- /dev/null +++ b/DSL/Ruuter/ckb/GET/accounts/customer-support-activity.yml @@ -0,0 +1,52 @@ +declaration: + call: declare + version: 0.1 + description: "Decription placeholder for 'CUSTOMER-SUPPORT-ACTIVITY'" + method: get + accepts: json + returns: json + namespace: backoffice + allowlist: + header: + - field: cookie + type: string + description: "Cookie field" + +get_user_info: + call: http.post + args: + url: "[#CKB_TIM]/jwt/custom-jwt-userinfo" + contentType: plaintext + headers: + cookie: ${incoming.headers.cookie} + plaintext: + "customJwtCookie" + result: res + next: check_user_info_response + +check_user_info_response: + switch: + - condition: ${200 <= res.response.statusCodeValue && res.response.statusCodeValue < 300} + next: assignIdCode + next: return_bad_request + +assignIdCode: + assign: + idCode: ${res.response.body.idCode} + next: getCustomerSupportActivity + +getCustomerSupportActivity: + call: http.post + args: + url: "[#CKB_USERS_RESQL]/get-customer-support-activity-by-id-code" + body: + customerSupportId: ${idCode} + result: res + +return_result: + return: ${res.response.body[0]} + next: end + +return_bad_request: + return: "bad_request" + next: end diff --git a/DSL/Ruuter/ckb/GET/accounts/settings.yml b/DSL/Ruuter/ckb/GET/accounts/settings.yml new file mode 100644 index 0000000..9a4414e --- /dev/null +++ b/DSL/Ruuter/ckb/GET/accounts/settings.yml @@ -0,0 +1,63 @@ +declaration: + call: declare + version: 0.1 + description: "Decription placeholder for 'USER-PROFILE-SETTINGS'" + method: get + accepts: json + returns: json + namespace: backoffice + allowlist: + header: + - field: cookie + type: string + description: "Cookie field" + +get_user_info: + call: http.post + args: + url: "[#CKB_TIM]/jwt/custom-jwt-userinfo" + contentType: plaintext + headers: + cookie: ${incoming.headers.cookie} + plaintext: + "customJwtCookie" + result: res + next: check_user_info_response + +check_user_info_response: + switch: + - condition: ${200 <= res.response.statusCodeValue && res.response.statusCodeValue < 300} + next: assignIdCode + next: return_bad_request + +assignIdCode: + assign: + idCode: ${res.response.body.idCode} + next: getUserSettings + +getUserSettings: + call: http.post + args: + url: "[#CKB_USERS_RESQL]/get-user-profile-settings" + body: + userId: ${idCode} + result: getUserSettingsResult + next: validateUserSettingsResultExists + +validateUserSettingsResultExists: + switch: + - condition: "${getUserSettingsResult.response.body.length > 0}" + next: returnSuccess + next: return_not_found + +returnSuccess: + return: ${getUserSettingsResult.response.body} + next: end + +return_bad_request: + return: "bad_request" + next: end + +return_not_found: + return: "user_not_found" + next: end diff --git a/DSL/Ruuter/ckb/GET/accounts/widget-data.yml b/DSL/Ruuter/ckb/GET/accounts/widget-data.yml new file mode 100644 index 0000000..dbc99b6 --- /dev/null +++ b/DSL/Ruuter/ckb/GET/accounts/widget-data.yml @@ -0,0 +1,49 @@ +declaration: + call: declare + version: 0.1 + description: "Decription placeholder for 'WIDGET-DATA'" + method: get + accepts: json + returns: json + namespace: backoffice + allowlist: + params: + - field: user_id + type: string + description: "Body field 'user_id'" + +checkV: + log: ${incoming.params} + +extractRequestData: + assign: + user_id: ${incoming.params.user_id} + +getDomains: + call: http.post + args: + url: "[#CKB_USERS_RESQL]/get-widget-domains" + result: domains + +getUserDomains: + call: http.post + args: + url: "[#CKB_USERS_RESQL]/get-user-domains" + body: + user_login: ${user_id} + result: user_domains + +mapDomainsData: + call: http.post + args: + url: "[#CKB_DMAPPER]/utils/map-domains-data" + body: + domains: ${domains.response.body} + userDomains: ${user_domains.response.body[0]} + result: mappedDomains + +returnSuccess: + return: ${mappedDomains.response.body} + wrapper: false + next: end + diff --git a/GUI/.env.development b/GUI/.env.development index f2062e7..3f3201a 100644 --- a/GUI/.env.development +++ b/GUI/.env.development @@ -1,4 +1,5 @@ REACT_APP_RUUTER_API_URL=http://localhost:8086/ckb +REACT_APP_RUUTER_PRIVATE_API_URL: http://localhost:8086/ckb REACT_APP_BUEROKRATT_CHATBOT_URL=http://buerokratt-chat:8086/backoffice REACT_APP_MENU_URL=https://admin.dev.buerokratt.ee REACT_APP_MENU_PATH=/chat/menu.json @@ -16,5 +17,5 @@ REACT_APP_NOTIFICATION_NODE_URL=http://localhost:4040 REACT_APP_CSP="default-src 'self'; font-src 'self' data:; img-src * data:; script-src 'self' 'unsafe-eval' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; object-src 'none'; connect-src 'self' http://localhost:8086 http://localhost:8085 http://localhost:4040 http://localhost:9000 http://host.docker.internal:9000 https://host.docker.internal:9000 https://admin.dev.buerokratt.ee/chat/menu.json https://*.s3.amazonaws.com;" REACT_APP_ENABLE_HIDDEN_FEATURES=TRUE REACT_APP_VALIDATIONS_ENABLED=FALSE -REACT_APP_MENU_JSON=[{"id":"conversations","label":{"et":"Vestlused","en":"Conversations"},"path":"/chat","children":[{"label":{"et":"Vastamata","en":"Unanswered"},"path":"/unanswered"},{"label":{"et":"Aktiivsed","en":"Active"},"path":"/active"},{"label":{"et":"Ootel","en":"Pending"},"path":"/pending"},{"label":{"et":"Ajalugu","en":"History"},"path":"/history"},{"label":{"et":"Valideerimised","en":"Validations"},"path":"/validations"}]},{"id":"training","label":{"et":"Treening","en":"Training"},"path":"/training","children":[{"label":{"et":"Treening","en":"Training"},"path":"/training","children":[{"label":{"et":"Teemad","en":"Themes"},"path":"/training/intents"},{"label":{"et":"Avalikud teemad","en":"Public themes"},"path":"/training/common-intents"},{"label":{"et":"Teemade järeltreenimine","en":"Post training themes"},"path":"/training/intents-followup-training"},{"label":{"et":"Vastused","en":"Answers"},"path":"/training/responses"},{"label":{"et":"Reeglid","en":"Rules"},"path":"/training/rules"},{"label":{"et":"Konfiguratsioon","en":"Configuration"},"path":"/training/configuration"},{"label":{"et":"Vormid","en":"Forms"},"path":"/training/forms"},{"label":{"et":"Mälukohad","en":"Slots"},"path":"/training/slots"},{"label":{"et":"Automatic Teenused","en":"Automatic Services"},"path":"/auto-services"}]},{"label":{"et":"Ajaloolised vestlused","en":"Historical conversations"},"path":"/history","children":[{"label":{"et":"Ajalugu","en":"History"},"path":"/history/history"},{"label":{"et":"Pöördumised","en":"Appeals"},"path":"/history/appeal"}]},{"label":{"et":"Mudelipank ja analüütika","en":"Modelbank and analytics"},"path":"/analytics","children":[{"label":{"et":"Teemade ülevaade","en":"Overview of topics"},"path":"/analytics/overview"},{"label":{"et":"Mudelite võrdlus","en":"Comparison of models"},"path":"/analytics/models"},{"label":{"et":"Testlood","en":"testTracks"},"path":"/analytics/testcases"}]},{"label":{"et":"Treeni uus mudel","en":"Train new model"},"path":"/train-new-model"}]},{"id":"analytics","label":{"et":"Analüütika","en":"Analytics"},"path":"/analytics","children":[{"label":{"et":"Ülevaade","en":"Overview"},"path":"/overview"},{"label":{"et":"Vestlused","en":"Chats"},"path":"/chats"},{"label":{"et":"Tagasiside","en":"Feedback"},"path":"/feedback"},{"label":{"et":"Nõustajad","en":"Advisors"},"path":"/advisors"},{"label":{"et":"Avaandmed","en":"Reports"},"path":"/reports"}]},{"id":"services","label":{"et":"Teenused","en":"Services"},"path":"/services","children":[{"label":{"et":"Ülevaade","en":"Overview"},"path":"/overview"},{"label":{"et":"Uus teenus","en":"New Service"},"path":"/newService"},{"label":{"et":"Automatic Teenused","en":"Automatic Services"},"path":"/auto-services"},{"label":{"et":"Probleemsed teenused","en":"Faulty Services"},"path":"/faultyServices"}]},{"label":{"et":"Teadmusbaas","en":"Knowledge Base"},"path":"/ckb","children":[{"label":{"et":"Andmed","en":"Data"},"path":"/agency"},{"label":{"et":"Aruanded","en":"Reports"},"path":"/reports"},{"label":{"et":"API Integratsioonid","en":"API Integrations"},"path":"/api"}]},{"id":"settings","label":{"et":"Haldus","en":"Administration"},"path":"/settings","children":[{"label":{"et":"Kasutajad","en":"Users"},"path":"/users"},{"label":{"et":"Vestlusbot","en":"Chatbot"},"path":"/chatbot","children":[{"label":{"et":"Seaded","en":"Settings"},"path":"/chatbot/settings"},{"label":{"et":"Tervitussõnum","en":"Welcome message"},"path":"/chatbot/welcome-message"},{"label":{"et":"Välimus ja käitumine","en":"Appearance and behavior"},"path":"/chatbot/appearance"},{"label":{"et":"Erakorralised teated","en":"Emergency notices"},"path":"/chatbot/emergency-notices"}]},{"label":{"et":"Asutuse tööaeg","en":"Office opening hours"},"path":"/working-time"},{"label":{"et":"Vestluse Kustutamine","en":"Delete Conversations"},"path":"/delete-conversations"},{"label":{"et":"Sessiooni pikkus","en":"Session length"},"path":"/session-length"},{"label":{"et":"SKMi konfiguratsioon","en":"SKM Configuration"},"path":"/skm-configuration"}]},{"id":"monitoring","label":{"et":"Seire","en":"Monitoring"},"path":"/monitoring","children":[{"label":{"et":"Aktiivaeg","en":"Working hours"},"path":"/uptime"}]}] +REACT_APP_MENU_JSON='[{"id":"conversations","label":{"et":"Vestlused","en":"Conversations"},"path":"/chat","children":[{"label":{"et":"Vastamata","en":"Unanswered"},"path":"/unanswered"},{"label":{"et":"Aktiivsed","en":"Active"},"path":"/active"},{"label":{"et":"Ootel","en":"Pending"},"path":"/pending"},{"label":{"et":"Ajalugu","en":"History"},"path":"/history"},{"label":{"et":"Valideerimised","en":"Validations"},"path":"/validations"}]},{"id":"training","label":{"et":"Treening","en":"Training"},"path":"/training","children":[{"label":{"et":"Treening","en":"Training"},"path":"/training","children":[{"label":{"et":"Teemad","en":"Themes"},"path":"/training/intents"},{"hidden":true,"label":{"et":"Avalikud teemad","en":"Public themes"},"path":"/training/common-intents"},{"label":{"et":"Teemade järeltreenimine","en":"Post training themes"},"path":"/training/intents-followup-training"},{"label":{"et":"Vastused","en":"Answers"},"path":"/training/responses"},{"label":{"et":"Reeglid","en":"Rules"},"path":"/training/rules"},{"hidden":true,"label":{"et":"Konfiguratsioon","en":"Configuration"},"path":"/training/configuration"},{"label":{"et":"Vormid","en":"Forms"},"path":"/training/forms"},{"label":{"et":"Mälukohad","en":"Slots"},"path":"/training/slots"}]},{"label":{"et":"Ajaloolised vestlused","en":"Historical conversations"},"path":"/history","children":[{"label":{"et":"Ajalugu","en":"History"},"path":"/history/history"},{"hidden":true,"label":{"et":"Pöördumised","en":"Appeals"},"path":"/history/appeal"}]},{"label":{"et":"Mudelipank ja analüütika","en":"Modelbank and analytics"},"path":"/analytics","children":[{"label":{"et":"Teemade ülevaade","en":"Overview of topics"},"path":"/analytics/overview"},{"label":{"et":"Mudelite võrdlus","en":"Comparison of models"},"path":"/analytics/models"},{"hidden":true,"label":{"et":"Testlood","en":"testTracks"},"path":"/analytics/testcases"}]},{"label":{"et":"Treeni uus mudel","en":"Train new model"},"path":"/train-new-model"}]},{"id":"analytics","label":{"et":"Analüütika","en":"Analytics"},"path":"/analytics","children":[{"label":{"et":"Ülevaade","en":"Overview"},"path":"/overview"},{"label":{"et":"Vestlused","en":"Chats"},"path":"/chats"},{"label":{"et":"Tagasiside","en":"Feedback"},"path":"/feedback"},{"label":{"et":"Avaandmed","en":"Reports"},"path":"/reports"}]},{"id":"services","hidden":true,"label":{"et":"Teenused","en":"Services"},"path":"/services","children":[{"label":{"et":"Ülevaade","en":"Overview"},"path":"/overview"},{"label":{"et":"Uus teenus","en":"New Service"},"path":"/newService"},{"label":{"et":"Probleemsed teenused","en":"Faulty Services"},"path":"/faultyServices"}]},{"id":"knowledge-center","label":{"et":"Teadmuskeskus","en":"Knowledge Center"},"path":"/knowledge-center","children":[{"id":"rag-search","label":{"et":"Mudelid ja seadistused","en":"Models management"},"path":"/rag-search","children":[{"label":{"et":"Mudelite ühendused","en":"LLM connections"},"path":"/rag-search/llm-connections"},{"label":{"et":"Viiba Seaded","en":"Prompt Configurations"},"path":"/rag-search/prompt-configurations"},{"label":{"et":"Testi mudelit","en":"Test LLM"},"path":"/rag-search/test-llm"}]},{"id":"ckb","label":{"et":"Teadmusbaas","en":"Knowledge Base"},"path":"/ckb","children":[{"label":{"et":"Agentuur","en":"Agency"},"path":"/agency"},{"label":{"et":"Aruanded","en":"Reports"},"path":"/reports"},{"label":{"et":"API Integratsioonid","en":"API Integrations"},"path":"/api"}]}]},{"id":"settings","label":{"et":"Haldus","en":"Administration"},"path":"/settings","children":[{"label":{"et":"Kasutajad","en":"Users"},"path":"/users"},{"label":{"et":"Vestlusbot","en":"Chatbot"},"path":"/chatbot","children":[{"label":{"et":"Seaded","en":"Settings"},"path":"/chatbot/settings"},{"label":{"et":"Tervitussõnum","en":"Welcome message"},"path":"/chatbot/welcome-message"},{"label":{"et":"Välimus ja käitumine","en":"Appearance and behavior"},"path":"/chatbot/appearance"},{"label":{"et":"Erakorralised teated","en":"Emergency notices"},"path":"/chatbot/emergency-notices"},{"label":{"et":"Tagasiside","en":"Feedback"},"path":"/chatbot/feedback"}]},{"label":{"et":"Vestluste analüüs","en":"Chat analysis"},"path":"/chat-analysis"},{"label":{"et":"Asutuse tööaeg","en":"Office opening hours"},"path":"/working-time"},{"label":{"et":"Vestluse Kustutamine","en":"Delete Conversations"},"path":"/delete-conversations"},{"label":{"et":"Sessiooni pikkus","en":"Session length"},"path":"/session-length"},{"label":{"et":"SKMi konfiguratsioon","en":"SKM Configuration"},"path":"/skm-configuration"},{"label":{"et":"Anonümiseerija","en":"Anonymizer"},"path":"/anonymizer"}]},{"id":"monitoring","hidden":true,"label":{"et":"Seire","en":"Monitoring"},"path":"/monitoring","children":[{"label":{"et":"Aktiivaeg","en":"Working hours"},"path":"/uptime"}]}]' REACT_APP_ENABLE_MULTI_DOMAIN=FALSE \ No newline at end of file diff --git a/GUI/src/components/CKBHeader/Header.scss b/GUI/src/components/CKBHeader/Header.scss deleted file mode 100644 index fb0cdbd..0000000 --- a/GUI/src/components/CKBHeader/Header.scss +++ /dev/null @@ -1,26 +0,0 @@ -.header { - background: white; - border-bottom: 1px solid #e5e7eb; - padding: 0 24px; - position: sticky; - top: 0; - z-index: 100; - min-width: 1000px; - - &__container { - display: flex; - align-items: center; - justify-content: space-between; - height: 80px; - margin: 0 auto; - } - - &__logout { - text-decoration: underline; - color: #005AA3; - - &:hover { - color: #003662; - } - } - } \ No newline at end of file diff --git a/GUI/src/components/CKBHeader/index.tsx b/GUI/src/components/CKBHeader/index.tsx deleted file mode 100644 index a721fcc..0000000 --- a/GUI/src/components/CKBHeader/index.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import { FC } from 'react'; -import { useTranslation } from 'react-i18next'; -import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; -import { Button } from 'components'; -import { useToast } from 'hooks/useToast'; -import { ReactComponent as BykLogo } from 'assets/logo.svg'; -import { apiDev } from 'services/api'; -import { AxiosError } from 'axios'; -import './Header.scss'; - -const Header: FC = () => { - const { t } = useTranslation(); - const toast = useToast(); - - const logoutMutation = useMutation({ - mutationFn: () => apiDev.get('accounts/logout'), - onSuccess(_: any) { - window.location.href = import.meta.env.REACT_APP_CUSTOMER_SERVICE_LOGIN; - }, - onError: async (error: AxiosError) => { - toast.open({ - type: 'error', - title: t('global.notificationError'), - message: error.message, - }); - }, - }); - - const handleLogout = () => { - // Clear any stored tokens/session data - localStorage.clear(); - sessionStorage.clear(); - - // Redirect to login page - window.location.href = import.meta.env.REACT_APP_LOGIN_URL || '/login'; - }; - - return ( -
-
- - -
-
- ); -}; - -export default Header; diff --git a/GUI/src/components/Drawer/Drawer.scss b/GUI/src/components/Drawer/Drawer.scss index df7bc71..fb5cc97 100644 --- a/GUI/src/components/Drawer/Drawer.scss +++ b/GUI/src/components/Drawer/Drawer.scss @@ -21,7 +21,7 @@ display: flex; align-items: center; gap: get-spacing(haapsalu); - padding: get-spacing(haapsalu); + padding: get-spacing(haapsalu) !important; border-bottom: 1px solid get-color(black-coral-2); .icon { diff --git a/GUI/src/components/Section/Section.scss b/GUI/src/components/Section/Section.scss index cdbb136..c48ae73 100644 --- a/GUI/src/components/Section/Section.scss +++ b/GUI/src/components/Section/Section.scss @@ -3,7 +3,7 @@ @import 'src/styles/settings/variables/typography'; .section { - padding: get-spacing(haapsalu); + padding: get-spacing(haapsalu) !important; &:not(:last-child) { border-bottom: 1px solid get-color(black-coral-2); diff --git a/GUI/src/components/index.tsx b/GUI/src/components/index.tsx index 4de7581..42466b4 100644 --- a/GUI/src/components/index.tsx +++ b/GUI/src/components/index.tsx @@ -33,7 +33,6 @@ import Editor from './Editor'; import FileUploader from './FileUploader/FileUploader'; import NavigationSidebar from './NavigationSidebar'; import CKBLayout from './CKBLayout'; -import Header from './CKBHeader'; export { // Layout, @@ -69,7 +68,6 @@ export { Editor, NavigationSidebar, CKBLayout, - Header, }; // Export types that might be needed diff --git a/GUI/translations/en/common.json b/GUI/translations/en/common.json index 490f65f..3bfff3e 100644 --- a/GUI/translations/en/common.json +++ b/GUI/translations/en/common.json @@ -94,6 +94,16 @@ "reports": "Reports", "apiIntegrations": "API integrations" }, + "multiDomains": { + "addNew": "Add new", + "title": "Multidomains", + "domains": "Domains", + "domainName": "Domain name", + "selectDomains": "Select Domains", + "chooseDomain": "Select domain:", + "allDomains": "All", + "noDomains": "No domains available. Please contact your system administrator." + }, "chat": { "userTyping": "User Typing", "chatForwardedTo": "Chat forwarded to", diff --git a/GUI/translations/et/common.json b/GUI/translations/et/common.json index 63449cb..7f1cbcc 100644 --- a/GUI/translations/et/common.json +++ b/GUI/translations/et/common.json @@ -94,6 +94,16 @@ "reports": "Aruanded", "apiIntegrations": "API integratsioonid" }, + "multiDomains": { + "addNew": "Lisa uus", + "title": "Multidomeenid", + "domains": "Domeenid", + "domainName": "Domeeni nimi", + "selectDomains": "Vali Domeenid", + "chooseDomain": "Vali domeen:", + "allDomains": "Kõik", + "noDomains": "Domeene ei ole saadaval. Palun võtke ühendust süsteemiadministraatoriga." + }, "chat": { "userTyping": "Kasutaja kirjutab", "chatForwardedTo": "Vestlus edastati aadressile", diff --git a/README.md b/README.md index 3816827..f295a79 100644 --- a/README.md +++ b/README.md @@ -465,9 +465,10 @@ Resql provides type-safe database operations: ```bash # Login to get JWT token -curl -X POST http://localhost:8080/ckb/auth/login \ - -H "Content-Type: application/json" \ - -d '{"username": "user", "password": "pass"}' +curl -X POST -H "Content-Type: application/json" -d '{ + "login": "EE30303039914", + "password": "OK" +}' http://localhost:8086/ckb/auth/login # Use token in subsequent requests curl -H "Authorization: Bearer " \ diff --git a/docker-compose.yml b/docker-compose.yml index 7970575..8fa1ea3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -267,6 +267,7 @@ services: NODE_ENV: development BASE_URL: http://localhost:8080/ckb REACT_APP_RUUTER_API_URL: http://localhost:8086/ckb + REACT_APP_RUUTER_PRIVATE_API_URL: http://localhost:8086/ckb REACT_APP_CUSTOMER_SERVICE_LOGIN: http://localhost:3004/et/dev-auth REACT_APP_CSP: "upgrade-insecure-requests; default-src 'self'; font-src 'self' data:; img-src * data:; script-src 'self' 'unsafe-eval' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; object-src 'none'; connect-src 'self' http://localhost:8086 http://localhost:8085 http://localhost:4040 https://admin.dev.buerokratt.ee/chat/menu.json https://*.s3.amazonaws.com;" DEBUG_ENABLED: true @@ -276,10 +277,10 @@ services: REACT_APP_SERVICE_ID: ckb REACT_APP_ENABLE_HIDDEN_FEATURES: true REACT_APP_VALIDATIONS_ENABLED: FALSE - REACT_APP_ENABLE_MULTI_DOMAIN: TRUE - REACT_APP_MENU_JSON: '[{"id":"conversations","label":{"et":"Vestlused","en":"Conversations"},"path":"/chat","children":[{"label":{"et":"Vastamata","en":"Unanswered"},"path":"/unanswered"},{"label":{"et":"Aktiivsed","en":"Active"},"path":"/active"},{"label":{"et":"Ootel","en":"Pending"},"path":"/pending"},{"label":{"et":"Ajalugu","en":"History"},"path":"/history"},{"label":{"et":"Valideerimised","en":"Validations"},"path":"/validations"}]},{"id":"training","label":{"et":"Treening","en":"Training"},"path":"/training","children":[{"label":{"et":"Treening","en":"Training"},"path":"/training","children":[{"label":{"et":"Teemad","en":"Themes"},"path":"/training/intents"},{"label":{"et":"Avalikud teemad","en":"Public themes"},"path":"/training/common-intents"},{"label":{"et":"Teemade järeltreenimine","en":"Post training themes"},"path":"/training/intents-followup-training"},{"label":{"et":"Vastused","en":"Answers"},"path":"/training/responses"},{"label":{"et":"Reeglid","en":"Rules"},"path":"/training/rules"},{"label":{"et":"Konfiguratsioon","en":"Configuration"},"path":"/training/configuration"},{"label":{"et":"Vormid","en":"Forms"},"path":"/training/forms"},{"label":{"et":"Mälukohad","en":"Slots"},"path":"/training/slots"},{"label":{"et":"Automatic Teenused","en":"Automatic Services"},"path":"/auto-services"}]},{"label":{"et":"Ajaloolised vestlused","en":"Historical conversations"},"path":"/history","children":[{"label":{"et":"Ajalugu","en":"History"},"path":"/history/history"},{"label":{"et":"Pöördumised","en":"Appeals"},"path":"/history/appeal"}]},{"label":{"et":"Mudelipank ja analüütika","en":"Modelbank and analytics"},"path":"/analytics","children":[{"label":{"et":"Teemade ülevaade","en":"Overview of topics"},"path":"/analytics/overview"},{"label":{"et":"Mudelite võrdlus","en":"Comparison of models"},"path":"/analytics/models"},{"label":{"et":"Testlood","en":"testTracks"},"path":"/analytics/testcases"}]},{"label":{"et":"Treeni uus mudel","en":"Train new model"},"path":"/train-new-model"}]},{"id":"analytics","label":{"et":"Analüütika","en":"Analytics"},"path":"/analytics","children":[{"label":{"et":"Ülevaade","en":"Overview"},"path":"/overview"},{"label":{"et":"Vestlused","en":"Chats"},"path":"/chats"},{"label":{"et":"Tagasiside","en":"Feedback"},"path":"/feedback"},{"label":{"et":"Nõustajad","en":"Advisors"},"path":"/advisors"},{"label":{"et":"Avaandmed","en":"Reports"},"path":"/reports"}]},{"id":"services","label":{"et":"Teenused","en":"Services"},"path":"/services","children":[{"label":{"et":"Ülevaade","en":"Overview"},"path":"/overview"},{"label":{"et":"Uus teenus","en":"New Service"},"path":"/newService"},{"label":{"et":"Automatic Teenused","en":"Automatic Services"},"path":"/auto-services"},{"label":{"et":"Probleemsed teenused","en":"Faulty Services"},"path":"/faultyServices"}]},{"id":"settings","label":{"et":"Haldus","en":"Administration"},"path":"/settings","children":[{"label":{"et":"Kasutajad","en":"Users"},"path":"/users"},{"label":{"et":"Vestlusbot","en":"Chatbot"},"path":"/chatbot","children":[{"label":{"et":"Seaded","en":"Settings"},"path":"/chatbot/settings"},{"label":{"et":"Tervitussõnum","en":"Welcome message"},"path":"/chatbot/welcome-message"},{"label":{"et":"Välimus ja käitumine","en":"Appearance and behavior"},"path":"/chatbot/appearance"},{"label":{"et":"Erakorralised teated","en":"Emergency notices"},"path":"/chatbot/emergency-notices"}]},{"label":{"et":"Asutuse tööaeg","en":"Office opening hours"},"path":"/working-time"},{"label":{"et":"Vestluse Kustutamine","en":"Delete Conversations"},"path":"/delete-conversations"},{"label":{"et":"Sessiooni pikkus","en":"Session length"},"path":"/session-length"},{"label":{"et":"SKMi konfiguratsioon","en":"SKM Configuration"},"path":"/skm-configuration"}]},{"id":"monitoring","label":{"et":"Seire","en":"Monitoring"},"path":"/monitoring","children":[{"label":{"et":"Aktiivaeg","en":"Working hours"},"path":"/uptime"}]}]' + REACT_APP_ENABLE_MULTI_DOMAIN: FALSE + REACT_APP_MENU_JSON: '[{"id":"conversations","label":{"et":"Vestlused","en":"Conversations"},"path":"/chat","children":[{"label":{"et":"Vastamata","en":"Unanswered"},"path":"/unanswered"},{"label":{"et":"Aktiivsed","en":"Active"},"path":"/active"},{"label":{"et":"Ootel","en":"Pending"},"path":"/pending"},{"label":{"et":"Ajalugu","en":"History"},"path":"/history"},{"label":{"et":"Valideerimised","en":"Validations"},"path":"/validations"}]},{"id":"training","label":{"et":"Treening","en":"Training"},"path":"/training","children":[{"label":{"et":"Treening","en":"Training"},"path":"/training","children":[{"label":{"et":"Teemad","en":"Themes"},"path":"/training/intents"},{"hidden":true,"label":{"et":"Avalikud teemad","en":"Public themes"},"path":"/training/common-intents"},{"label":{"et":"Teemade järeltreenimine","en":"Post training themes"},"path":"/training/intents-followup-training"},{"label":{"et":"Vastused","en":"Answers"},"path":"/training/responses"},{"label":{"et":"Reeglid","en":"Rules"},"path":"/training/rules"},{"hidden":true,"label":{"et":"Konfiguratsioon","en":"Configuration"},"path":"/training/configuration"},{"label":{"et":"Vormid","en":"Forms"},"path":"/training/forms"},{"label":{"et":"Mälukohad","en":"Slots"},"path":"/training/slots"}]},{"label":{"et":"Ajaloolised vestlused","en":"Historical conversations"},"path":"/history","children":[{"label":{"et":"Ajalugu","en":"History"},"path":"/history/history"},{"hidden":true,"label":{"et":"Pöördumised","en":"Appeals"},"path":"/history/appeal"}]},{"label":{"et":"Mudelipank ja analüütika","en":"Modelbank and analytics"},"path":"/analytics","children":[{"label":{"et":"Teemade ülevaade","en":"Overview of topics"},"path":"/analytics/overview"},{"label":{"et":"Mudelite võrdlus","en":"Comparison of models"},"path":"/analytics/models"},{"hidden":true,"label":{"et":"Testlood","en":"testTracks"},"path":"/analytics/testcases"}]},{"label":{"et":"Treeni uus mudel","en":"Train new model"},"path":"/train-new-model"}]},{"id":"analytics","label":{"et":"Analüütika","en":"Analytics"},"path":"/analytics","children":[{"label":{"et":"Ülevaade","en":"Overview"},"path":"/overview"},{"label":{"et":"Vestlused","en":"Chats"},"path":"/chats"},{"label":{"et":"Tagasiside","en":"Feedback"},"path":"/feedback"},{"label":{"et":"Avaandmed","en":"Reports"},"path":"/reports"}]},{"id":"services","hidden":true,"label":{"et":"Teenused","en":"Services"},"path":"/services","children":[{"label":{"et":"Ülevaade","en":"Overview"},"path":"/overview"},{"label":{"et":"Uus teenus","en":"New Service"},"path":"/newService"},{"label":{"et":"Probleemsed teenused","en":"Faulty Services"},"path":"/faultyServices"}]},{"id":"knowledge-center","label":{"et":"Teadmuskeskus","en":"Knowledge Center"},"path":"/knowledge-center","children":[{"id":"rag-search","label":{"et":"Mudelid ja seadistused","en":"Models management"},"path":"/rag-search","children":[{"label":{"et":"Mudelite ühendused","en":"LLM connections"},"path":"/rag-search/llm-connections"},{"label":{"et":"Viiba Seaded","en":"Prompt Configurations"},"path":"/rag-search/prompt-configurations"},{"label":{"et":"Testi mudelit","en":"Test LLM"},"path":"/rag-search/test-llm"}]},{"id":"ckb","label":{"et":"Teadmusbaas","en":"Knowledge Base"},"path":"/ckb","children":[{"label":{"et":"Agentuur","en":"Agency"},"path":"/agency"},{"label":{"et":"Aruanded","en":"Reports"},"path":"/reports"},{"label":{"et":"API Integratsioonid","en":"API Integrations"},"path":"/api"}]}]},{"id":"settings","label":{"et":"Haldus","en":"Administration"},"path":"/settings","children":[{"label":{"et":"Kasutajad","en":"Users"},"path":"/users"},{"label":{"et":"Vestlusbot","en":"Chatbot"},"path":"/chatbot","children":[{"label":{"et":"Seaded","en":"Settings"},"path":"/chatbot/settings"},{"label":{"et":"Tervitussõnum","en":"Welcome message"},"path":"/chatbot/welcome-message"},{"label":{"et":"Välimus ja käitumine","en":"Appearance and behavior"},"path":"/chatbot/appearance"},{"label":{"et":"Erakorralised teated","en":"Emergency notices"},"path":"/chatbot/emergency-notices"},{"label":{"et":"Tagasiside","en":"Feedback"},"path":"/chatbot/feedback"}]},{"label":{"et":"Vestluste analüüs","en":"Chat analysis"},"path":"/chat-analysis"},{"label":{"et":"Asutuse tööaeg","en":"Office opening hours"},"path":"/working-time"},{"label":{"et":"Vestluse Kustutamine","en":"Delete Conversations"},"path":"/delete-conversations"},{"label":{"et":"Sessiooni pikkus","en":"Session length"},"path":"/session-length"},{"label":{"et":"SKMi konfiguratsioon","en":"SKM Configuration"},"path":"/skm-configuration"},{"label":{"et":"Anonümiseerija","en":"Anonymizer"},"path":"/anonymizer"}]},{"id":"monitoring","hidden":true,"label":{"et":"Seire","en":"Monitoring"},"path":"/monitoring","children":[{"label":{"et":"Aktiivaeg","en":"Working hours"},"path":"/uptime"}]}]' # # for production use this one: - # - REACT_APP_MENU_JSON=[{"id":"conversations","label":{"et":"Vestlused","en":"Conversations"},"path":"/chat","children":[{"label":{"et":"Vastamata","en":"Unanswered"},"path":"/unanswered"},{"label":{"et":"Aktiivsed","en":"Active"},"path":"/active"},{"label":{"et":"Ootel","en":"Pending"},"path":"/pending"},{"label":{"et":"Ajalugu","en":"History"},"path":"/history"},{"label":{"et":"Valideerimised","en":"Validations"},"path":"/validations"}]},{"id":"training","label":{"et":"Treening","en":"Training"},"path":"/training","children":[{"label":{"et":"Treening","en":"Training"},"path":"/training","children":[{"label":{"et":"Teemad","en":"Themes"},"path":"/training/intents"},{"hidden":true,"label":{"et":"Avalikud teemad","en":"Public themes"},"path":"/training/common-intents"},{"label":{"et":"Teemade järeltreenimine","en":"Post training themes"},"path":"/training/intents-followup-training"},{"label":{"et":"Vastused","en":"Answers"},"path":"/training/responses"},{"label":{"et":"Reeglid","en":"Rules"},"path":"/training/rules"},{"hidden":true,"label":{"et":"Konfiguratsioon","en":"Configuration"},"path":"/training/configuration"},{"label":{"et":"Vormid","en":"Forms"},"path":"/training/forms"},{"label":{"et":"Mälukohad","en":"Slots"},"path":"/training/slots"},{"hidden":true,"label":{"et":"Automatic Teenused","en":"Automatic Services"},"path":"/auto-services"}]},{"label":{"et":"Ajaloolised vestlused","en":"Historical conversations"},"path":"/history","children":[{"label":{"et":"Ajalugu","en":"History"},"path":"/history/history"},{"hidden":true,"label":{"et":"Pöördumised","en":"Appeals"},"path":"/history/appeal"}]},{"label":{"et":"Mudelipank ja analüütika","en":"Modelbank and analytics"},"path":"/analytics","children":[{"label":{"et":"Teemade ülevaade","en":"Overview of topics"},"path":"/analytics/overview"},{"label":{"et":"Mudelite võrdlus","en":"Comparison of models"},"path":"/analytics/models"},{"hidden":true,"label":{"et":"Testlood","en":"testTracks"},"path":"/analytics/testcases"}]},{"label":{"et":"Treeni uus mudel","en":"Train new model"},"path":"/train-new-model"}]},{"id":"analytics","label":{"et":"Analüütika","en":"Analytics"},"path":"/analytics","children":[{"label":{"et":"Ülevaade","en":"Overview"},"path":"/overview"},{"label":{"et":"Vestlused","en":"Chats"},"path":"/chats"},{"label":{"et":"Tagasiside","en":"Feedback"},"path":"/feedback"},{"label":{"et":"Nõustajad","en":"Advisors"},"path":"/advisors"},{"label":{"et":"Avaandmed","en":"Reports"},"path":"/reports"}]},{"id":"services","hidden":true,"label":{"et":"Teenused","en":"Services"},"path":"/services","children":[{"label":{"et":"Ülevaade","en":"Overview"},"path":"/overview"},{"label":{"et":"Uus teenus","en":"New Service"},"path":"/newService"},{"label":{"et":"Automatic Teenused","en":"Automatic Services"},"path":"/auto-services"},{"label":{"et":"Probleemsed teenused","en":"Faulty Services"},"path":"/faultyServices"}]},{"id":"settings","label":{"et":"Haldus","en":"Administration"},"path":"/settings","children":[{"label":{"et":"Kasutajad","en":"Users"},"path":"/users"},{"label":{"et":"Vestlusbot","en":"Chatbot"},"path":"/chatbot","children":[{"label":{"et":"Seaded","en":"Settings"},"path":"/chatbot/settings"},{"label":{"et":"Tervitussõnum","en":"Welcome message"},"path":"/chatbot/welcome-message"},{"label":{"et":"Välimus ja käitumine","en":"Appearance and behavior"},"path":"/chatbot/appearance"},{"label":{"et":"Erakorralised teated","en":"Emergency notices"},"path":"/chatbot/emergency-notices"}]},{"label":{"et":"Asutuse tööaeg","en":"Office opening hours"},"path":"/working-time"},{"label":{"et":"Sessiooni pikkus","en":"Session length"},"path":"/session-length"},{"label":{"et":"SKMi konfiguratsioon","en":"SKM Configuration"},"path":"/skm-configuration"}]},{"id":"monitoring","hidden":true,"label":{"et":"Seire","en":"Monitoring"},"path":"/monitoring","children":[{"label":{"et":"Aktiivaeg","en":"Working hours"},"path":"/uptime"}]}] + # REACT_APP_MENU_JSON: '[{"id":"conversations","label":{"et":"Vestlused","en":"Conversations"},"path":"/chat","children":[{"label":{"et":"Vastamata","en":"Unanswered"},"path":"/unanswered"},{"label":{"et":"Aktiivsed","en":"Active"},"path":"/active"},{"label":{"et":"Ootel","en":"Pending"},"path":"/pending"},{"label":{"et":"Ajalugu","en":"History"},"path":"/history"},{"label":{"et":"Valideerimised","en":"Validations"},"path":"/validations"}]},{"id":"training","label":{"et":"Treening","en":"Training"},"path":"/training","children":[{"label":{"et":"Treening","en":"Training"},"path":"/training","children":[{"label":{"et":"Teemad","en":"Themes"},"path":"/training/intents"},{"hidden":true,"label":{"et":"Avalikud teemad","en":"Public themes"},"path":"/training/common-intents"},{"label":{"et":"Teemade järeltreenimine","en":"Post training themes"},"path":"/training/intents-followup-training"},{"label":{"et":"Vastused","en":"Answers"},"path":"/training/responses"},{"label":{"et":"Reeglid","en":"Rules"},"path":"/training/rules"},{"hidden":true,"label":{"et":"Konfiguratsioon","en":"Configuration"},"path":"/training/configuration"},{"label":{"et":"Vormid","en":"Forms"},"path":"/training/forms"},{"label":{"et":"Mälukohad","en":"Slots"},"path":"/training/slots"}]},{"label":{"et":"Ajaloolised vestlused","en":"Historical conversations"},"path":"/history","children":[{"label":{"et":"Ajalugu","en":"History"},"path":"/history/history"},{"hidden":true,"label":{"et":"Pöördumised","en":"Appeals"},"path":"/history/appeal"}]},{"label":{"et":"Mudelipank ja analüütika","en":"Modelbank and analytics"},"path":"/analytics","children":[{"label":{"et":"Teemade ülevaade","en":"Overview of topics"},"path":"/analytics/overview"},{"label":{"et":"Mudelite võrdlus","en":"Comparison of models"},"path":"/analytics/models"},{"hidden":true,"label":{"et":"Testlood","en":"testTracks"},"path":"/analytics/testcases"}]},{"label":{"et":"Treeni uus mudel","en":"Train new model"},"path":"/train-new-model"}]},{"id":"analytics","label":{"et":"Analüütika","en":"Analytics"},"path":"/analytics","children":[{"label":{"et":"Ülevaade","en":"Overview"},"path":"/overview"},{"label":{"et":"Vestlused","en":"Chats"},"path":"/chats"},{"label":{"et":"Tagasiside","en":"Feedback"},"path":"/feedback"},{"label":{"et":"Avaandmed","en":"Reports"},"path":"/reports"}]},{"id":"services","hidden":true,"label":{"et":"Teenused","en":"Services"},"path":"/services","children":[{"label":{"et":"Ülevaade","en":"Overview"},"path":"/overview"},{"label":{"et":"Uus teenus","en":"New Service"},"path":"/newService"},{"label":{"et":"Probleemsed teenused","en":"Faulty Services"},"path":"/faultyServices"}]},{"id":"knowledge-center","label":{"et":"Teadmuskeskus","en":"Knowledge Center"},"path":"/knowledge-center","children":[{"id":"rag-search","label":{"et":"Mudelid ja seadistused","en":"Models management"},"path":"/rag-search","children":[{"label":{"et":"Mudelite ühendused","en":"LLM connections"},"path":"/rag-search/llm-connections"},{"label":{"et":"Viiba Seaded","en":"Prompt Configurations"},"path":"/rag-search/prompt-configurations"},{"label":{"et":"Testi mudelit","en":"Test LLM"},"path":"/rag-search/test-llm"}]},{"id":"ckb","label":{"et":"Teadmusbaas","en":"Knowledge Base"},"path":"/ckb","children":[{"label":{"et":"Agentuur","en":"Agency"},"path":"/agency"},{"label":{"et":"Aruanded","en":"Reports"},"path":"/reports"},{"label":{"et":"API Integratsioonid","en":"API Integrations"},"path":"/api"}]}]},{"id":"settings","label":{"et":"Haldus","en":"Administration"},"path":"/settings","children":[{"label":{"et":"Kasutajad","en":"Users"},"path":"/users"},{"label":{"et":"Vestlusbot","en":"Chatbot"},"path":"/chatbot","children":[{"label":{"et":"Seaded","en":"Settings"},"path":"/chatbot/settings"},{"label":{"et":"Tervitussõnum","en":"Welcome message"},"path":"/chatbot/welcome-message"},{"label":{"et":"Välimus ja käitumine","en":"Appearance and behavior"},"path":"/chatbot/appearance"},{"label":{"et":"Erakorralised teated","en":"Emergency notices"},"path":"/chatbot/emergency-notices"},{"label":{"et":"Tagasiside","en":"Feedback"},"path":"/chatbot/feedback"}]},{"label":{"et":"Vestluste analüüs","en":"Chat analysis"},"path":"/chat-analysis"},{"label":{"et":"Asutuse tööaeg","en":"Office opening hours"},"path":"/working-time"},{"label":{"et":"Sessiooni pikkus","en":"Session length"},"path":"/session-length"},{"label":{"et":"SKMi konfiguratsioon","en":"SKM Configuration"},"path":"/skm-configuration"},{"label":{"et":"Anonümiseerija","en":"Anonymizer"},"path":"/anonymizer"}]},{"id":"monitoring","hidden":true,"label":{"et":"Seire","en":"Monitoring"},"path":"/monitoring","children":[{"label":{"et":"Aktiivaeg","en":"Working hours"},"path":"/uptime"}]}]' build: context: ./GUI dockerfile: Dockerfile.dev From 2d1eceeaa2455f3721f647633c80cd7dd2aaecdc Mon Sep 17 00:00:00 2001 From: ruwinirathnamalala Date: Mon, 15 Jun 2026 11:05:18 +0530 Subject: [PATCH 3/8] Synced side menu - removed console logs --- GUI/src/components/CKBLayout/index.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/GUI/src/components/CKBLayout/index.tsx b/GUI/src/components/CKBLayout/index.tsx index 83bc977..bb83d06 100644 --- a/GUI/src/components/CKBLayout/index.tsx +++ b/GUI/src/components/CKBLayout/index.tsx @@ -39,8 +39,6 @@ const Layout: FC = () => { const menuCountConf = useMenuCountConf(); return ( - console.log('Menu count configuration:', menuCountConf), // Debug log to check the menu count configuration --- IGNORE --- - console.log('Domain selector visibility:', domainBarShowing), // Debug log to check if the domain selector is visible --- IGNORE ---
{/* */} From a1840d6ca7adfe73e01058dc3f02d2446bb4040f Mon Sep 17 00:00:00 2001 From: ffrose <119657383+ffrose@users.noreply.github.com> Date: Mon, 15 Jun 2026 16:24:24 +0300 Subject: [PATCH 4/8] Update .env.dev --- .env.dev | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.dev b/.env.dev index 9ffc9a5..4aaa15c 100644 --- a/.env.dev +++ b/.env.dev @@ -1,4 +1,4 @@ RELEASE=dev VERSION=1 BUILD=2 -FIX=5 +FIX=6 From 088861ad73337434c001dd91c59dc8b7029e6ac1 Mon Sep 17 00:00:00 2001 From: kittask <43972531+ckittask@users.noreply.github.com> Date: Wed, 8 Jul 2026 13:49:27 +0300 Subject: [PATCH 5/8] Cleaning: dedicated .txt / .md flow (#191) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Cleaning: dedicated .txt / .md flow Plain-text inputs previously fell through to clean_any_file(), which calls unstructured.partition() and treats each line as a Title element. For real .txt content the output is noisy and pointless; for HTML mistakenly saved as .txt the output is the raw markup wrapped as "titles" — neither is useful. Add clean_plain_text() that just reads the file as UTF-8 with errors="replace" and returns the contents verbatim. The existing normalize_newlines() pass collapses whitespace at the call site, so we don't need any extraction step for formats that are already plain text. Route .txt and .md to the new helper. Other extensions still go through unstructured / pymupdf / trafilatura as before. Tests cover: - reading contents verbatim - bad UTF-8 bytes don't crash - .txt routes to clean_plain_text and NOT clean_any_file - .md routes the same way Co-Authored-By: Claude Opus 4.7 (1M context) * Tests: explicit utf-8 encoding on read/write_text calls Per Copilot review on #191: Path.read_text() / write_text() default to the platform locale, which is fine on Linux CI but would break the new plain-text tests on Windows (cp1252). Pin encoding="utf-8" on all three call sites so the tests are deterministic across platforms. Co-Authored-By: Claude Opus 4.7 (1M context) --------- Co-authored-by: Claudia kittask Co-authored-by: Claude Opus 4.7 (1M context) --- cleaning/worker/tasks.py | 16 +++++++ tests/test_tasks.py | 95 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+) diff --git a/cleaning/worker/tasks.py b/cleaning/worker/tasks.py index f417708..6c02333 100644 --- a/cleaning/worker/tasks.py +++ b/cleaning/worker/tasks.py @@ -349,6 +349,19 @@ def clean_any_file(entity: EntityToClean) -> str: return _elements_to_markdown(partitioned) +def clean_plain_text(entity: EntityToClean) -> str: + """ + Read a plain-text file (.txt / .md) as UTF-8 and return its contents. + + No extraction is performed — the file *is* the text. Whitespace + normalisation is applied by the caller via normalize_newlines(). + Invalid bytes are replaced rather than raising so a single bad byte + in a long file doesn't kill the whole job. + """ + with entity.file_path.open("r", encoding="utf-8", errors="replace") as f: + return f.read() + + # --------------------------------------------------------------------------- # Image extraction # --------------------------------------------------------------------------- @@ -668,6 +681,9 @@ def clean_file_task(entity: EntityToClean) -> None: logger.info( f"Cleaned as PPTX (unstructured) for {entity.file_path.as_posix()}" ) + elif file_type in (".txt", ".md"): + cleaned_text = clean_plain_text(entity) + logger.info(f"Cleaned as plain text for {entity.file_path.as_posix()}") else: cleaned_text = clean_any_file(entity) logger.info( diff --git a/tests/test_tasks.py b/tests/test_tasks.py index d2915b2..6ec5dfa 100644 --- a/tests/test_tasks.py +++ b/tests/test_tasks.py @@ -453,6 +453,101 @@ def test_no_duplicate_file_handlers(self, tmp_path: Path) -> None: assert paths.count(log_file.resolve()) <= 1 +# --------------------------------------------------------------------------- +# Plain-text routing (.txt, .md) +# --------------------------------------------------------------------------- + + +class TestPlainTextRouting: + """ + .txt and .md files must bypass unstructured.partition() and read the + file verbatim. Previously they fell through to clean_any_file(), which + treats each line as a Title element and produces useless output — + especially for files where the content happens to be HTML markup. + """ + + def test_clean_plain_text_returns_file_contents_verbatim( + self, tmp_path: Path + ) -> None: + from worker.tasks import clean_plain_text + + body = "First line.\nSecond line.\n\nThird paragraph after blank line.\n" + entity = _make_entity(tmp_path, ".txt", body) + + assert clean_plain_text(entity) == body + + def test_clean_plain_text_replaces_invalid_utf8(self, tmp_path: Path) -> None: + from worker.tasks import clean_plain_text + + source = tmp_path / "source.txt" + source.write_bytes(b"good bytes \xff\xfe bad bytes ok\n") + meta = tmp_path / "source.meta.json" + meta.write_text( + json.dumps({"file_type": ".txt", "metadata": {}}), encoding="utf-8" + ) + + entity = MagicMock() + entity.file_path = source + entity.meta_data_path = meta + entity.directory_path = tmp_path + entity.use_llm = False + + out = clean_plain_text(entity) + assert "good bytes" in out + assert "bad bytes ok" in out + + def test_txt_routes_to_plain_text_not_unstructured(self, tmp_path: Path) -> None: + """ + clean_file_task with file_type=".txt" must call clean_plain_text + and must NOT call clean_any_file (which would invoke unstructured). + """ + from worker.tasks import clean_file_task + + body = "Some real text content for a .txt source.\n" + entity = _make_entity(tmp_path, ".txt", body, use_llm=False) + + with ( + patch("worker.tasks.requests.post") as mock_post, + patch("worker.tasks.cleanup_directory"), + patch("worker.tasks.clean_any_file") as mock_any, + ): + mock_resp = MagicMock() + mock_resp.json.return_value = {"response": "http://mock/file"} + mock_resp.raise_for_status.return_value = None + mock_post.return_value = mock_resp + + clean_file_task(entity) + + assert mock_any.call_count == 0, ( + ".txt must not be routed through clean_any_file()" + ) + cleaned = (tmp_path / "cleaned.txt").read_text(encoding="utf-8") + assert "Some real text content" in cleaned + + def test_md_routes_to_plain_text(self, tmp_path: Path) -> None: + from worker.tasks import clean_file_task + + body = "# Heading\n\nParagraph with **bold** text.\n" + entity = _make_entity(tmp_path, ".md", body, use_llm=False) + + with ( + patch("worker.tasks.requests.post") as mock_post, + patch("worker.tasks.cleanup_directory"), + patch("worker.tasks.clean_any_file") as mock_any, + ): + mock_resp = MagicMock() + mock_resp.json.return_value = {"response": "http://mock/file"} + mock_resp.raise_for_status.return_value = None + mock_post.return_value = mock_resp + + clean_file_task(entity) + + assert mock_any.call_count == 0 + cleaned = (tmp_path / "cleaned.txt").read_text(encoding="utf-8") + assert "# Heading" in cleaned + assert "**bold**" in cleaned + + # --------------------------------------------------------------------------- # Metadata mutation # --------------------------------------------------------------------------- From ba560be4b05e0ddfe01d84f14a08c6287f0ace11 Mon Sep 17 00:00:00 2001 From: Varmo <101868197+varmoh@users.noreply.github.com> Date: Wed, 8 Jul 2026 14:42:09 +0300 Subject: [PATCH 6/8] Update .env.cleaner --- .env.cleaner | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.cleaner b/.env.cleaner index 1f72f68..cf1cdd9 100644 --- a/.env.cleaner +++ b/.env.cleaner @@ -1,4 +1,4 @@ RELEASE=dev VERSION=1 BUILD=3 -FIX=6 +FIX=7 From 8356376dc875b97f781f600cf28c2f2be607d4bf Mon Sep 17 00:00:00 2001 From: Varmo <101868197+varmoh@users.noreply.github.com> Date: Wed, 8 Jul 2026 14:50:38 +0300 Subject: [PATCH 7/8] Update .env.scrapper --- .env.scrapper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.scrapper b/.env.scrapper index 5b2cf5e..82954df 100644 --- a/.env.scrapper +++ b/.env.scrapper @@ -1,4 +1,4 @@ RELEASE=dev VERSION=1 BUILD=3 -FIX=5 +FIX=6 From 806e3cf05ae8d984f4cef4c12eb7b421c261b8f1 Mon Sep 17 00:00:00 2001 From: Varmo <101868197+varmoh@users.noreply.github.com> Date: Wed, 8 Jul 2026 14:51:42 +0300 Subject: [PATCH 8/8] Update FIX value from 6 to 7 in .env.dev --- .env.dev | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.dev b/.env.dev index 4aaa15c..6f536cf 100644 --- a/.env.dev +++ b/.env.dev @@ -1,4 +1,4 @@ RELEASE=dev VERSION=1 BUILD=2 -FIX=6 +FIX=7