From 1f09f0b35da4ee6d09e8960fcb6da9e73ea4386c Mon Sep 17 00:00:00 2001 From: erangi-ar Date: Tue, 24 Feb 2026 21:07:22 +0530 Subject: [PATCH 1/5] feat: bulk refresh --- ...e_source_files_to_scraping_by_base_ids.sql | 60 ++++++++++++++++ .../ckb/POST/source-file/refresh-multiple.yml | 68 +++++++++++++++++++ GUI/src/pages/ScrapedFiles/index.tsx | 52 ++++++++++++-- GUI/src/services/files.ts | 6 ++ GUI/translations/en/common.json | 4 ++ GUI/translations/et/common.json | 4 ++ 6 files changed, 188 insertions(+), 6 deletions(-) create mode 100644 DSL/Resql/ckb/POST/source_file/update_source_files_to_scraping_by_base_ids.sql create mode 100644 DSL/Ruuter/ckb/POST/source-file/refresh-multiple.yml diff --git a/DSL/Resql/ckb/POST/source_file/update_source_files_to_scraping_by_base_ids.sql b/DSL/Resql/ckb/POST/source_file/update_source_files_to_scraping_by_base_ids.sql new file mode 100644 index 0000000..976d801 --- /dev/null +++ b/DSL/Resql/ckb/POST/source_file/update_source_files_to_scraping_by_base_ids.sql @@ -0,0 +1,60 @@ +/* +declaration: + version: 0.1 + description: "Get multiple source files by base IDs and mark them as running" + method: post + returns: json + namespace: source_file + allowlist: + body: + - field: base_ids + type: array + items: + type: string + description: "array of base ids of source files" + response: + fields: + - field: id + type: string + description: "base id of source_file" + - field: urls + type: array + items: + type: string + description: "urls to run" + - field: hash + type: string + description: "current scraped data hash" +*/ +WITH ids AS ( + SELECT json_array_elements_text(COALESCE(ARRAY_TO_JSON(ARRAY[:base_ids]), '[]'::json)) AS base_id_text +), +latest AS ( + SELECT sf.* + FROM data_collection.source_file sf + JOIN ( + SELECT base_id, MAX(updated_at) AS max_updated + FROM data_collection.source_file + GROUP BY base_id + ) m ON sf.base_id = m.base_id AND sf.updated_at = m.max_updated + JOIN ids ON sf.base_id::text = ids.base_id_text + WHERE sf.is_deleted = FALSE + AND (sf.type = 'scraped_file' OR sf.type = 'api_file') +) +SELECT + copy_row_with_modifications( + 'data_collection.source_file', + 'id', '::UUID', latest.id::VARCHAR, + ARRAY[ + 'status', '::SOURCE_FILE_STATUS_TYPE', 'scraping', + 'updated_at', '::TIMESTAMP WITH TIME ZONE', NOW()::VARCHAR + ]::VARCHAR[] + ) as copy_result, + latest.base_id as id, + latest.url, + latest.original_data_hash as hash, + latest.source_base_id, + latest.agency_base_id, + latest.type, + latest.external_id +FROM latest; \ No newline at end of file diff --git a/DSL/Ruuter/ckb/POST/source-file/refresh-multiple.yml b/DSL/Ruuter/ckb/POST/source-file/refresh-multiple.yml new file mode 100644 index 0000000..8e687ef --- /dev/null +++ b/DSL/Ruuter/ckb/POST/source-file/refresh-multiple.yml @@ -0,0 +1,68 @@ +declaration: + call: declare + version: 0.1 + description: "refresh multiple source files by base IDs" + method: post + accepts: json + returns: json + namespace: source-file + allowlist: + body: + - field: baseIds + type: array + items: + type: string + description: "Array of Base IDs of the source-files" + +extractRequestData: + assign: + base_ids: "${incoming.body.baseIds}" + +getSourceFiles: + call: http.post + args: + url: "[#CKB_RESQL]/source_file/update_source_files_to_scraping_by_base_ids" + contentType: json + body: + base_ids: ${base_ids} + result: sourceFilesToRun + +checkIfSourceFilesFound: + switch: + - condition: ${sourceFilesToRun.response.body.length == 0} + next: returnNoFilesFound + next: checkFirstFileType + +checkFirstFileType: + switch: + - condition: ${sourceFilesToRun.response.body[0].type == "api_file"} + next: triggerApiPipeline + next: triggerScrapedPipeline + +triggerApiPipeline: + template: "[#CKB_PROJECT_LAYER]/pipeline/trigger-scrapper-eesti-api-specified-files" + requestType: templates + body: + source_id: ${sourceFilesToRun.response.body[0].sourceBaseId} + agency_id: ${sourceFilesToRun.response.body[0].agencyBaseId} + source_files: ${sourceFilesToRun.response.body} + result: pipelineResult + next: returnSuccess + +triggerScrapedPipeline: + template: "[#CKB_PROJECT_LAYER]/pipeline/trigger-scrapper-specified-pages" + requestType: templates + body: + source_id: ${sourceFilesToRun.response.body[0].sourceBaseId} + agency_id: ${sourceFilesToRun.response.body[0].agencyBaseId} + source_files: ${sourceFilesToRun.response.body} + result: pipelineResult + next: returnSuccess + +returnSuccess: + return: "OK" + next: end + +returnNoFilesFound: + return: "No valid source files found to refresh" + next: end \ No newline at end of file diff --git a/GUI/src/pages/ScrapedFiles/index.tsx b/GUI/src/pages/ScrapedFiles/index.tsx index 7fc516a..96da92e 100644 --- a/GUI/src/pages/ScrapedFiles/index.tsx +++ b/GUI/src/pages/ScrapedFiles/index.tsx @@ -39,6 +39,7 @@ import { getScrapedFiles, updateFileExclusion, refreshScrapedFile, + bulkRefreshFiles, deleteFile, bulkDeleteFiles, downloadFile, @@ -176,6 +177,43 @@ const ScrapedFiles: FC = () => { }, }); + // Bulk refresh files mutation + const bulkRefreshMutation = useMutation({ + mutationFn: (fileIds: string[]) => bulkRefreshFiles(fileIds), + onSuccess: async (_: void, fileIds: string[]) => { + const count = fileIds.length; + setBulkRefreshConfirm(null); + + toast.open({ + type: 'success', + title: t('global.notification'), + message: t('global.bulkRefreshSuccess', { + count: count, + unit: count === 1 ? t('knowledgeBase.file') : t('knowledgeBase.files'), + }), + }); + + // Use refetch to force a fresh data fetch + const result = await refetch(); + + // Clear selections after refetch completes and new data is available + if (result.isSuccess) { + setRowSelection({}); + } + }, + onError: (error: any, fileIds: string[]) => { + const count = fileIds.length; + toast.open({ + type: 'error', + title: t('global.notificationError'), + message: error.message || t('global.bulkRefreshError', { + count: count, + unit: count === 1 ? t('knowledgeBase.file') : t('knowledgeBase.files'), + }), + }); + }, + }); + // Delete file mutation const deleteMutation = useMutation({ mutationFn: deleteFile, @@ -471,9 +509,7 @@ const ScrapedFiles: FC = () => { const confirmBulkRefresh = () => { if (!bulkRefreshConfirm) return; const selectedIds = bulkRefreshConfirm.map(row => row.original.baseId); - console.log('Refresh selected files:', selectedIds); - // TODO: Implement bulk refresh API call - setBulkRefreshConfirm(null); + bulkRefreshMutation.mutate(selectedIds); }; const handleBulkInclude = (selectedRows: Row[]) => { @@ -898,21 +934,25 @@ const ScrapedFiles: FC = () => { )} > {t('global.confirmBulkRefresh', { count: bulkRefreshConfirm.length, - unit: bulkRefreshConfirm.length === 1 ? t('global.file') : t('global.files') + unit: bulkRefreshConfirm.length === 1 ? t('knowledgeBase.file') : t('knowledgeBase.files') })} )} @@ -979,4 +1019,4 @@ const ScrapedFiles: FC = () => { ); }; -export default ScrapedFiles; +export default ScrapedFiles; \ No newline at end of file diff --git a/GUI/src/services/files.ts b/GUI/src/services/files.ts index 5a2fc92..36484a7 100644 --- a/GUI/src/services/files.ts +++ b/GUI/src/services/files.ts @@ -171,6 +171,12 @@ export const refreshScrapedFile = async (fileId: string): Promise => { }); }; +export const bulkRefreshFiles = async (fileIds: string[]): Promise => { + await apiDev.post('/source-file/refresh-multiple', { + baseIds: fileIds, + }); +}; + /** * Delete a file */ diff --git a/GUI/translations/en/common.json b/GUI/translations/en/common.json index 88b8d15..b9f26da 100644 --- a/GUI/translations/en/common.json +++ b/GUI/translations/en/common.json @@ -8,6 +8,8 @@ "loading": "Loading...", "delete": "Delete", "deleting": "Deleting", + "refresh": "Refresh", + "refreshing": "Refreshing", "cancel": "Cancel", "continue": "Continue", "modifiedAt": "Last modified at", @@ -43,6 +45,8 @@ "confirmBulkRefresh": "Are you sure you want to refresh {{count}} selected {{unit}}?", "confirmBulkInclude": "Are you sure you want to include {{count}} selected {{unit}}?", "confirmBulkExclude": "Are you sure you want to exclude {{count}} selected {{unit}}?", + "bulkRefreshError": "An error occurred while refreshing {{count}} {{unit}}. Please try again.", + "bulkRefreshSuccess": "Successfully refreshed {{count}} {{unit}}.", "name": "Name", "idCode": "ID code", "status": "Status", diff --git a/GUI/translations/et/common.json b/GUI/translations/et/common.json index 753bef6..53d20b2 100644 --- a/GUI/translations/et/common.json +++ b/GUI/translations/et/common.json @@ -8,6 +8,8 @@ "loading": "Laadimine...", "delete": "Kustuta", "deleting": "Kustutamine", + "refresh": "Värskenda", + "refreshing": "Värskendamine", "cancel": "Tühista", "continue": "Jätka", "modifiedAt": "Viimati muudetud", @@ -43,6 +45,8 @@ "confirmBulkRefresh": "Kas oled kindel, et soovid värskendada {{count}} valitud {{unit}}?", "confirmBulkInclude": "Kas oled kindel, et soovid kaasata {{count}} valitud {{unit}}?", "confirmBulkExclude": "Kas oled kindel, et soovid välistada {{count}} valitud {{unit}}?", + "bulkRefreshError": "Tekkis viga {{count}} {{unit}} värskendamisel. Palun proovi uuesti.", + "bulkRefreshSuccess": "{{count}} {{unit}} edukalt värskendatud", "name": "Nimi", "idCode": "Isikukood", "status": "Staatus", From 9cab8a0b378d750fa8d865dd75d08ae9dde85414 Mon Sep 17 00:00:00 2001 From: ruwinirathnamalala Date: Wed, 15 Apr 2026 18:25:28 +0530 Subject: [PATCH 2/5] Implemented - Changing user view after entering a new URL --- GUI/src/pages/Agency/Agency.tsx | 14 +++++++------- GUI/src/pages/ScrapedFiles/index.tsx | 3 +++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/GUI/src/pages/Agency/Agency.tsx b/GUI/src/pages/Agency/Agency.tsx index adb638c..2350318 100644 --- a/GUI/src/pages/Agency/Agency.tsx +++ b/GUI/src/pages/Agency/Agency.tsx @@ -1,7 +1,7 @@ import { FC, useState, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; -import { useParams, Link } from 'react-router-dom'; +import { useParams, Link, useNavigate } from 'react-router-dom'; import { MdOutlineDeleteOutline, MdAccessTime, @@ -76,6 +76,7 @@ const Agency: FC = () => { const toast = useToast(); const queryClient = useQueryClient(); const { id: agencyBaseId } = useParams<{ id: string }>(); + const navigate = useNavigate(); const [uploadProgress, setUploadProgress] = useState({ isUploading: false, currentFile: 0, @@ -266,15 +267,14 @@ const Agency: FC = () => { // URL addition mutation const addUrlMutation = useMutation({ mutationFn: createSourceUrl, - onSuccess: () => { - toast.open({ - type: 'success', - title: t('global.notification'), - message: t('knowledgeBase.urlSuccess'), - }); + onSuccess: (data: any) => { + const sourceId = data?.baseId; setAddUrlModal(false); setFormData(getInitialFormData); queryClient.invalidateQueries(['sources']); + if (sourceId) { + navigate(`/source/${sourceId}/files`); + } }, onError: (error: any) => { toast.open({ diff --git a/GUI/src/pages/ScrapedFiles/index.tsx b/GUI/src/pages/ScrapedFiles/index.tsx index 8aaf0f7..3459a50 100644 --- a/GUI/src/pages/ScrapedFiles/index.tsx +++ b/GUI/src/pages/ScrapedFiles/index.tsx @@ -108,7 +108,9 @@ const ScrapedFiles: FC = () => { queryKey: ['source', sourceId], queryFn: () => getSource(sourceId!), enabled: !!sourceId, + refetchInterval: (data: any) => data?.status === 'running' ? 5000 : false, }); + const [sorting, setSorting] = useState([]); const [columnFilters, setColumnFilters] = useState([]); @@ -176,6 +178,7 @@ const ScrapedFiles: FC = () => { queryFn: () => getScrapedFiles(queryParams), enabled: !!sourceId, keepPreviousData: true, + refetchInterval: sourceData?.status === 'running' ? 5000 : false, }); // Clear row selection when data changes From 7c44216eff292b71ef29bbcfb8374b79a02656c2 Mon Sep 17 00:00:00 2001 From: ruwinirathnamalala Date: Thu, 11 Jun 2026 18:52:54 +0530 Subject: [PATCH 3/5] 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 4/5] 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 5/5] 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 ---
{/* */}