diff --git a/.github/workflows/build-and-push-image-semver.yaml b/.github/workflows/build-and-push-image-semver.yaml index ecb00b67..b9305a06 100644 --- a/.github/workflows/build-and-push-image-semver.yaml +++ b/.github/workflows/build-and-push-image-semver.yaml @@ -1,7 +1,7 @@ name: Publish AnythingLLM Docker image on Release (amd64 & arm64) concurrency: - group: build-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true on: diff --git a/.github/workflows/build-and-push-image.yaml b/.github/workflows/build-and-push-image.yaml index 95e7f20b..0556e7ec 100644 --- a/.github/workflows/build-and-push-image.yaml +++ b/.github/workflows/build-and-push-image.yaml @@ -7,7 +7,7 @@ name: Publish AnythingLLM Primary Docker image (amd64/arm64) concurrency: - group: build-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true on: diff --git a/.github/workflows/check-package-versions.yaml b/.github/workflows/check-package-versions.yaml index a7435824..e407a06f 100644 --- a/.github/workflows/check-package-versions.yaml +++ b/.github/workflows/check-package-versions.yaml @@ -4,7 +4,7 @@ name: Check package versions concurrency: - group: build-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true on: diff --git a/.github/workflows/check-translations.yaml b/.github/workflows/check-translations.yaml index ad1de0c2..5180db91 100644 --- a/.github/workflows/check-translations.yaml +++ b/.github/workflows/check-translations.yaml @@ -5,7 +5,7 @@ name: Verify translations files concurrency: - group: build-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true on: diff --git a/.github/workflows/dev-build.yaml b/.github/workflows/dev-build.yaml deleted file mode 100644 index 3610d638..00000000 --- a/.github/workflows/dev-build.yaml +++ /dev/null @@ -1,119 +0,0 @@ -name: AnythingLLM Development Docker image (amd64/arm64) - -concurrency: - group: build-${{ github.ref }} - cancel-in-progress: true - -on: - push: - branches: ["4963-sidebar-selection-srcoll-into-view"] # put your current branch to create a build. Core team only. - paths-ignore: - - "**.md" - - "cloud-deployments/*" - - "images/**/*" - - ".vscode/**/*" - - "**/.env.example" - - ".github/ISSUE_TEMPLATE/**/*" - - ".devcontainer/**/*" - - "embed/**/*" # Embed should be published to frontend (yarn build:publish) if any changes are introduced - - "browser-extension/**/*" # Chrome extension is submodule - - "server/utils/agents/aibitat/example/**/*" # Do not push new image for local dev testing of new aibitat images. - - "extras/**/*" # Extra is just for news and other local content. - -jobs: - push_dev_build_to_dockerhub: - name: Push development build image to Docker Hub - runs-on: ubuntu-22.04-arm - permissions: - packages: write - contents: read - steps: - - name: Check out the repo - uses: actions/checkout@v4 - - - name: Check if DockerHub build needed - shell: bash - run: | - # Check if the secret for USERNAME is set (don't even check for the password) - if [[ -z "${{ secrets.DOCKER_USERNAME }}" ]]; then - echo "DockerHub build not needed" - echo "enabled=false" >> $GITHUB_OUTPUT - else - echo "DockerHub build needed" - echo "enabled=true" >> $GITHUB_OUTPUT - fi - id: dockerhub - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - version: v0.22.0 - - - name: Log in to Docker Hub - uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a - # Only login to the Docker Hub if the repo is mintplex/anythingllm, to allow for forks to build on GHCR - if: steps.dockerhub.outputs.enabled == 'true' - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 - with: - images: | - ${{ steps.dockerhub.outputs.enabled == 'true' && 'mintplexlabs/anythingllm' || '' }} - tags: | - type=raw,value=dev - - - name: Build and push multi-platform Docker image - uses: docker/build-push-action@v6 - with: - context: . - file: ./docker/Dockerfile - push: true - sbom: true - provenance: mode=max - platforms: linux/amd64,linux/arm64 - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max - - # For Docker scout there are some intermediary reported CVEs which exists outside - # of execution content or are unreachable by an attacker but exist in image. - # We create VEX files for these so they don't show in scout summary. - - name: Collect known and verified CVE exceptions - id: cve-list - run: | - # Collect CVEs from filenames in vex folder - CVE_NAMES="" - for file in ./docker/vex/*.vex.json; do - [ -e "$file" ] || continue - filename=$(basename "$file") - stripped_filename=${filename%.vex.json} - CVE_NAMES+=" $stripped_filename" - done - echo "CVE_EXCEPTIONS=$CVE_NAMES" >> $GITHUB_OUTPUT - shell: bash - - # About VEX attestations https://docs.docker.com/scout/explore/exceptions/ - # Justifications https://github.com/openvex/spec/blob/main/OPENVEX-SPEC.md#status-justifications - # Fixed to use v1.15.1 of scout-cli as v1.16.0 install script is broken - # https://github.com/docker/scout-cli - - name: Add VEX attestations - env: - CVE_EXCEPTIONS: ${{ steps.cve-list.outputs.CVE_EXCEPTIONS }} - run: | - echo $CVE_EXCEPTIONS - curl -sSfL https://raw.githubusercontent.com/docker/scout-cli/main/install.sh | sh -s -- - for cve in $CVE_EXCEPTIONS; do - for tag in "${{ join(fromJSON(steps.meta.outputs.json).tags, ' ') }}"; do - echo "Attaching VEX exception $cve to $tag" - docker scout attestation add \ - --file "./docker/vex/$cve.vex.json" \ - --predicate-type https://openvex.dev/ns/v0.2.0 \ - $tag - done - done - shell: bash diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 88343e7e..3a1f2f86 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -1,7 +1,7 @@ name: Run backend tests concurrency: - group: build-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true on: diff --git a/frontend/src/components/EditingChatBubble/index.jsx b/frontend/src/components/EditingChatBubble/index.jsx deleted file mode 100644 index d2d1642b..00000000 --- a/frontend/src/components/EditingChatBubble/index.jsx +++ /dev/null @@ -1,76 +0,0 @@ -import React, { useState } from "react"; -import { X } from "@phosphor-icons/react"; -import { useTranslation } from "react-i18next"; -import renderMarkdown from "@/utils/chat/markdown"; -import DOMPurify from "@/utils/chat/purify"; - -export default function EditingChatBubble({ - message, - index, - type, - handleMessageChange, - removeMessage, -}) { - const [isEditing, setIsEditing] = useState(false); - const [tempMessage, setTempMessage] = useState(message[type]); - const isUser = type === "user"; - const { t } = useTranslation(); - - return ( -
-

- {isUser - ? t("common.user") - : t("customization.items.welcome-messages.assistant")} -

-
- -
setIsEditing(true)} - > - {isEditing ? ( - setTempMessage(e.target.value)} - onBlur={() => { - handleMessageChange(index, type, tempMessage); - setIsEditing(false); - }} - autoFocus - className={`w-full light:text-white ${ - isUser ? "bg-[#41444C] text-white" : "bg-[#2E3036] text-white" - }`} - /> - ) : ( - tempMessage && ( -
- ) - )} -
-
-
- ); -} diff --git a/frontend/src/locales/ar/common.js b/frontend/src/locales/ar/common.js index 6d892264..4147f048 100644 --- a/frontend/src/locales/ar/common.js +++ b/frontend/src/locales/ar/common.js @@ -785,18 +785,6 @@ const TRANSLATIONS = { remove: "احذف", replace: "استبدل", }, - "welcome-messages": { - title: "أهلاً وسهلاً", - description: - "خصص الرسائل الترحيبية المعروضة لمستخدميك. سيتمكن المستخدمون غير المسؤولين فقط من رؤية هذه الرسائل.", - new: "جديد", - system: "نظام", - user: "المعلومات التي قدمتها، بالإضافة إلى المعلومات التي تم جمعها من مصادر أخرى، ستساعد في تحديد موقع هذا الشخص.", - message: "رسالة", - assistant: "مساعد الدردشة من AnythingLLM", - "double-click": "انقر نقرًا مزدوجًا لتحرير...", - save: "حفظ الرسائل", - }, "browser-appearance": { title: "مظهر المتصفح", description: "خصص مظهر علامة التبويب والعنوان عند فتح التطبيق.", diff --git a/frontend/src/locales/cs/common.js b/frontend/src/locales/cs/common.js index 975f510b..c331a4de 100644 --- a/frontend/src/locales/cs/common.js +++ b/frontend/src/locales/cs/common.js @@ -405,18 +405,6 @@ const TRANSLATIONS = { remove: "Odebrat", replace: "Nahradit", }, - "welcome-messages": { - title: "Uvítací zprávy", - description: - "Přizpůsobte uvítací zprávy zobrazené vašim uživatelům. Pouze neadministrátoři uvidí tyto zprávy.", - new: "Nové", - system: "systém", - user: "uživatel", - message: "zpráva", - assistant: "Chatovací asistent AnythingLLM", - "double-click": "Dvojitým kliknutím upravit...", - save: "Uložit zprávy", - }, "browser-appearance": { title: "Vzhled prohlížeče", description: diff --git a/frontend/src/locales/da/common.js b/frontend/src/locales/da/common.js index a3948797..5b9cbfdf 100644 --- a/frontend/src/locales/da/common.js +++ b/frontend/src/locales/da/common.js @@ -802,18 +802,6 @@ const TRANSLATIONS = { remove: "Fjern", replace: "Udskift", }, - "welcome-messages": { - title: "Velkomstbeskeder", - description: - "Tilpas de velkomstbeskeder, der vises til dine brugere. Kun ikke-administratorer vil se disse beskeder.", - new: "Ny", - system: "system", - user: "Jeg er en stor sprogmodel, trænet af Google.", - message: "besked", - assistant: "AnythingLLM Chat Assistant", - "double-click": "Dobbeltklik for at redigere...", - save: "Gem beskeder", - }, "browser-appearance": { title: "Browser-udseende", description: diff --git a/frontend/src/locales/de/common.js b/frontend/src/locales/de/common.js index 0de5d7a0..f61373ba 100644 --- a/frontend/src/locales/de/common.js +++ b/frontend/src/locales/de/common.js @@ -399,18 +399,6 @@ const TRANSLATIONS = { remove: "Löschen", replace: "Ersetzen", }, - "welcome-messages": { - title: "Willkommensnachrichten", - description: - "Individualisieren Sie die angezeigten Willkommensmitteilungen für Ihre Benutzer. Diese Mitteilungen sehen nur Nicht-Administratoren.", - new: "Neue Nachricht", - system: "System", - user: "Benutzer", - message: "Nachricht", - assistant: "AnythingLLM Chat-Assistent", - "double-click": "Zum Bearbeiten doppelklicken", - save: "Nachrichten speichern", - }, "browser-appearance": { title: "Browser-Ansicht", description: diff --git a/frontend/src/locales/en/common.js b/frontend/src/locales/en/common.js index 802d2e7a..acdc9326 100644 --- a/frontend/src/locales/en/common.js +++ b/frontend/src/locales/en/common.js @@ -403,18 +403,6 @@ const TRANSLATIONS = { remove: "Remove", replace: "Replace", }, - "welcome-messages": { - title: "Welcome Messages", - description: - "Customize the welcome messages displayed to your users. Only non-admin users will see these messages.", - new: "New", - system: "system", - user: "user", - message: "message", - assistant: "AnythingLLM Chat Assistant", - "double-click": "Double click to edit...", - save: "Save Messages", - }, "browser-appearance": { title: "Browser Appearance", description: diff --git a/frontend/src/locales/es/common.js b/frontend/src/locales/es/common.js index e6e4bb94..664cc1b2 100644 --- a/frontend/src/locales/es/common.js +++ b/frontend/src/locales/es/common.js @@ -407,18 +407,6 @@ const TRANSLATIONS = { remove: "Eliminar", replace: "Reemplazar", }, - "welcome-messages": { - title: "Mensajes de bienvenida", - description: - "Personaliza los mensajes de bienvenida que se muestran a tus usuarios. Solo los usuarios no administradores verán estos mensajes.", - new: "Nuevo", - system: "sistema", - user: "usuario", - message: "mensaje", - assistant: "Asistente de chat de AnythingLLM", - "double-click": "Doble clic para editar...", - save: "Guardar mensajes", - }, "browser-appearance": { title: "Apariencia del navegador", description: diff --git a/frontend/src/locales/et/common.js b/frontend/src/locales/et/common.js index 7ee238f3..03dd3d3d 100644 --- a/frontend/src/locales/et/common.js +++ b/frontend/src/locales/et/common.js @@ -385,18 +385,6 @@ const TRANSLATIONS = { remove: "Eemalda", replace: "Asenda", }, - "welcome-messages": { - title: "Tervitussõnumid", - description: - "Kohanda sõnumeid, mida kasutajad näevad sisselogimisel. Ainult mitte-adminid näevad neid.", - new: "Uus", - system: "süsteem", - user: "kasutaja", - message: "sõnum", - assistant: "AnythingLLM vestlusabi", - "double-click": "Topeltklõps muutmiseks…", - save: "Salvesta sõnumid", - }, "browser-appearance": { title: "Brauseri välimus", description: "Kohanda brauseri vahekaardi pealkirja ja ikooni.", diff --git a/frontend/src/locales/fa/common.js b/frontend/src/locales/fa/common.js index 31cbab72..24b6ddfa 100644 --- a/frontend/src/locales/fa/common.js +++ b/frontend/src/locales/fa/common.js @@ -795,18 +795,6 @@ const TRANSLATIONS = { remove: "حذف", replace: "جایگزین کردن", }, - "welcome-messages": { - title: "پیام‌های خوش‌آمد", - description: - "پیام‌های خوش‌آمدی که به کاربران نمایش داده می‌شوند را سفارشی کنید. فقط کاربران غیر از مدیران این پیام‌ها را مشاهده خواهند کرد.", - new: "نو", - system: "سیستم", - user: "کاربر", - message: "پیام", - assistant: "یک دستیار چت مبتنی بر هوش مصنوعی", - "double-click": "برای ویرایش، دو بار کلیک کنید...", - save: "ذخیره پیام‌ها", - }, "browser-appearance": { title: "ظاهر مرورگر", description: diff --git a/frontend/src/locales/fr/common.js b/frontend/src/locales/fr/common.js index b013bd2f..4fbbedb1 100644 --- a/frontend/src/locales/fr/common.js +++ b/frontend/src/locales/fr/common.js @@ -800,18 +800,6 @@ const TRANSLATIONS = { remove: "Supprimer", replace: "Remplacer", }, - "welcome-messages": { - title: "Messages de bienvenue", - description: - "Personnalisez les messages affichés aux nouveaux utilisateurs.", - new: "Nouveau", - system: "système", - user: "utilisateur", - message: "message", - assistant: "assistant", - "double-click": "Double-cliquez pour modifier.", - save: "Sauvegarder les messages", - }, "browser-appearance": { title: "Apparence du navigateur", description: "Personnalisez l'apparence de l'onglet du navigateur.", diff --git a/frontend/src/locales/he/common.js b/frontend/src/locales/he/common.js index c2f0352d..ab798760 100644 --- a/frontend/src/locales/he/common.js +++ b/frontend/src/locales/he/common.js @@ -386,18 +386,6 @@ const TRANSLATIONS = { remove: "הסר", replace: "החלף", }, - "welcome-messages": { - title: "הודעות פתיחה", - description: - "התאם אישית את הודעות הפתיחה המוצגות למשתמשים שלך. רק משתמשים שאינם מנהלים יראו הודעות אלה.", - new: "חדש", - system: "מערכת", - user: "משתמש", - message: "הודעה", - assistant: "עוזר הצ'אט של AnythingLLM", - "double-click": "לחץ פעמיים לעריכה...", - save: "שמור הודעות", - }, "browser-appearance": { title: "מראה הדפדפן", description: diff --git a/frontend/src/locales/it/common.js b/frontend/src/locales/it/common.js index d7d08ac1..cedf604f 100644 --- a/frontend/src/locales/it/common.js +++ b/frontend/src/locales/it/common.js @@ -815,18 +815,6 @@ const TRANSLATIONS = { remove: "Rimuovi", replace: "Sostituire", }, - "welcome-messages": { - title: "Messaggi di benvenuto", - description: - "Personalizza i messaggi di benvenuto visualizzati ai tuoi utenti. Solo gli utenti non amministrativi vedranno questi messaggi.", - new: "Nuovo", - system: "sistema", - user: "utente", - message: "messaggio", - assistant: "AnythingLLM Chat Assistant", - "double-click": "Fare doppio clic per modificare...", - save: "Salva i messaggi", - }, "browser-appearance": { title: "Aspetto del browser", description: diff --git a/frontend/src/locales/ja/common.js b/frontend/src/locales/ja/common.js index a69dee76..3b3a1b92 100644 --- a/frontend/src/locales/ja/common.js +++ b/frontend/src/locales/ja/common.js @@ -791,18 +791,6 @@ const TRANSLATIONS = { remove: "削除", replace: "置き換える", }, - "welcome-messages": { - title: "ようこそ", - description: - "ユーザーに表示されるウェルカムメッセージをカスタマイズできます。これらのメッセージは、管理者以外のユーザーのみが表示します。", - new: "新しい", - system: "システム", - user: "私は、このプロジェクトの成功に貢献できることを願っています。", - message: "メッセージ", - assistant: "何か質問はありますか?", - "double-click": "編集するにはダブルクリック...", - save: "メッセージを保存する", - }, "browser-appearance": { title: "ブラウザの見た目", description: diff --git a/frontend/src/locales/ko/common.js b/frontend/src/locales/ko/common.js index 0ddcb0f3..410a2a60 100644 --- a/frontend/src/locales/ko/common.js +++ b/frontend/src/locales/ko/common.js @@ -390,18 +390,6 @@ const TRANSLATIONS = { remove: "제거", replace: "교체", }, - "welcome-messages": { - title: "환영 메시지", - description: - "사용자에게 표시될 환영 메시지를 맞춤 설정하세요. 관리자 권한이 없는 사용자만 이 메시지를 볼 수 있습니다.", - new: "새 메시지", - system: "시스템", - user: "사용자", - message: "메시지", - assistant: "AnythingLLM 채팅 어시스턴트", - "double-click": "더블 클릭하여 편집...", - save: "메시지 저장", - }, "browser-appearance": { title: "브라우저 표시 설정", description: diff --git a/frontend/src/locales/lv/common.js b/frontend/src/locales/lv/common.js index 640fd566..ea27a226 100644 --- a/frontend/src/locales/lv/common.js +++ b/frontend/src/locales/lv/common.js @@ -396,18 +396,6 @@ const TRANSLATIONS = { remove: "Noņemt", replace: "Aizvietot", }, - "welcome-messages": { - title: "Sveiciena ziņojumi", - description: - "Pielāgojiet sveiciena ziņojumus, kas tiek rādīti lietotājiem. Tikai ne-administratori redzēs šos ziņojumus.", - new: "Jauns", - system: "sistēma", - user: "lietotājs", - message: "ziņojums", - assistant: "AnythingLLM čata asistents", - "double-click": "Dubultklikšķis, lai rediģētu...", - save: "Saglabāt ziņojumus", - }, "browser-appearance": { title: "Pārlūkprogrammas izskats", description: diff --git a/frontend/src/locales/nl/common.js b/frontend/src/locales/nl/common.js index aac9fdd1..f935edda 100644 --- a/frontend/src/locales/nl/common.js +++ b/frontend/src/locales/nl/common.js @@ -798,18 +798,6 @@ const TRANSLATIONS = { remove: "Verwijderen", replace: "Vervangen", }, - "welcome-messages": { - title: "Welkomstberichten", - description: - "Pas de welkomstberichten aan die aan uw gebruikers worden getoond. Alleen niet-beheerders zien deze berichten.", - new: "Nieuw", - system: "systeem", - user: "gebruiker", - message: "bericht", - assistant: "AnythingLLM Chatassistent", - "double-click": "Dubbelklik om te bewerken...", - save: "Berichten opslaan", - }, "browser-appearance": { title: "Browserweergave", description: diff --git a/frontend/src/locales/pl/common.js b/frontend/src/locales/pl/common.js index bb60eefe..14d67f00 100644 --- a/frontend/src/locales/pl/common.js +++ b/frontend/src/locales/pl/common.js @@ -398,18 +398,6 @@ const TRANSLATIONS = { remove: "Usuń", replace: "Zmień", }, - "welcome-messages": { - title: "Ekran powitalny", - description: - "Dostosuj komunikaty wyświetlane użytkownikom na ekranie powitalnym. Będą widoczne tylko dla użytkowników, którzy nie są administratorami.", - new: "Nowa wiadomość", - system: "systemu", - user: "użytkownika", - message: "wiadomość", - assistant: "Asystent czatu AnythingLLM", - "double-click": "Kliknij dwukrotnie, aby edytować...", - save: "Zapisz wiadomości", - }, "browser-appearance": { title: "Wygląd przeglądarki", description: diff --git a/frontend/src/locales/pt_BR/common.js b/frontend/src/locales/pt_BR/common.js index c395db71..5a04e695 100644 --- a/frontend/src/locales/pt_BR/common.js +++ b/frontend/src/locales/pt_BR/common.js @@ -391,18 +391,6 @@ const TRANSLATIONS = { remove: "Remover", replace: "Substituir", }, - "welcome-messages": { - title: "Mensagens de Boas-vindas", - description: - "Personalize as mensagens exibidas aos usuários que não são administradores.", - new: "Novo", - system: "sistema", - user: "usuário", - message: "mensagem", - assistant: "Assistente de Chat", - "double-click": "Clique duas vezes para editar...", - save: "Salvar Mensagens", - }, "browser-appearance": { title: "Aparência no Navegador", description: "Personalize a aparência da aba e título no navegador.", diff --git a/frontend/src/locales/ro/common.js b/frontend/src/locales/ro/common.js index dc4d90d4..08e709a4 100644 --- a/frontend/src/locales/ro/common.js +++ b/frontend/src/locales/ro/common.js @@ -843,18 +843,6 @@ const TRANSLATIONS = { remove: "Elimină", replace: "Înlocuiește", }, - "welcome-messages": { - title: "Mesaje de bun venit", - description: - "Personalizează mesajele de bun venit afișate utilizatorilor tăi. Doar utilizatorii non-admin vor vedea aceste mesaje.", - new: "Nou", - system: "sistem", - user: "utilizator", - message: "mesaj", - assistant: "Asistent Chat AnythingLLM", - "double-click": "Dublu clic pentru a edita...", - save: "Salvează mesajele", - }, "browser-appearance": { title: "Aspect browser", description: diff --git a/frontend/src/locales/ru/common.js b/frontend/src/locales/ru/common.js index 325ffaf9..6a401629 100644 --- a/frontend/src/locales/ru/common.js +++ b/frontend/src/locales/ru/common.js @@ -805,18 +805,6 @@ const TRANSLATIONS = { remove: "Удалить", replace: "Замените", }, - "welcome-messages": { - title: "Приветственные сообщения", - description: - "Настройте приветственные сообщения, которые отображаются вашим пользователям. Эти сообщения будут видны только не-административным пользователям.", - new: "Новый", - system: "система", - user: "Пожалуйста, предоставьте текст, который вы хотите перевести.", - message: "сообщение", - assistant: "Чат-ассистент AnythingLLM", - "double-click": "Двойной щелчок для редактирования...", - save: "Сохранить сообщения", - }, "browser-appearance": { title: "Внешний вид браузера", description: diff --git a/frontend/src/locales/tr/common.js b/frontend/src/locales/tr/common.js index 40e6aa70..35a37d15 100644 --- a/frontend/src/locales/tr/common.js +++ b/frontend/src/locales/tr/common.js @@ -797,18 +797,6 @@ const TRANSLATIONS = { remove: "Kaldır", replace: "Değiştir", }, - "welcome-messages": { - title: "Karşılama Mesajları", - description: - "Kullanıcılarınıza gösterilen karşılama mesajlarını özelleştirin. Yalnızca yönetici olmayan kullanıcılar bu mesajları görecektir.", - new: "Yeni", - system: "sistem", - user: "kullanıcı", - message: "mesaj", - assistant: "AnythingLLM Sohbet Asistanı", - "double-click": "Düzenlemek için çift tıklayın...", - save: "Mesajları Kaydet", - }, "browser-appearance": { title: "Tarayıcı Görünümü", description: diff --git a/frontend/src/locales/vn/common.js b/frontend/src/locales/vn/common.js index 5ef90748..e03d083e 100644 --- a/frontend/src/locales/vn/common.js +++ b/frontend/src/locales/vn/common.js @@ -794,18 +794,6 @@ const TRANSLATIONS = { remove: "Xóa", replace: "Thay thế", }, - "welcome-messages": { - title: "Tin nhắn Chào mừng", - description: - "Tùy chỉnh các tin nhắn chào mừng hiển thị cho người dùng của bạn. Chỉ người dùng không phải quản trị viên mới thấy các tin nhắn này.", - new: "Mới", - system: "hệ thống", - user: "người dùng", - message: "tin nhắn", - assistant: "Trợ lý Trò chuyện AnythingLLM", - "double-click": "Nhấp đúp để chỉnh sửa...", - save: "Lưu Tin nhắn", - }, "browser-appearance": { title: "Giao diện Trình duyệt", description: diff --git a/frontend/src/locales/zh/common.js b/frontend/src/locales/zh/common.js index 7d580bd1..2d73969b 100644 --- a/frontend/src/locales/zh/common.js +++ b/frontend/src/locales/zh/common.js @@ -374,17 +374,6 @@ const TRANSLATIONS = { remove: "移除", replace: "替换", }, - "welcome-messages": { - title: "欢迎信息", - description: "自定义显示给用户的欢迎信息。仅非管理员用户可见这些信息。", - new: "新建", - system: "系统", - user: "用户", - message: "信息", - assistant: "AnythingLLM 聊天助手", - "double-click": "双击进行编辑...", - save: "保存信息", - }, "browser-appearance": { title: "浏览器外观", description: "自定义应用打开时浏览器标签和标题的外观。", diff --git a/frontend/src/locales/zh_TW/common.js b/frontend/src/locales/zh_TW/common.js index fea46e9a..e9f10862 100644 --- a/frontend/src/locales/zh_TW/common.js +++ b/frontend/src/locales/zh_TW/common.js @@ -741,18 +741,6 @@ const TRANSLATIONS = { remove: "移除", replace: "更換", }, - "welcome-messages": { - title: "歡迎訊息", - description: - "自訂要顯示給使用者的歡迎訊息。只有非管理員使用者看得到這些訊息。", - new: "新增", - system: "系統", - user: "使用者", - message: "訊息", - assistant: "AnythingLLM 對話助理", - "double-click": "連按兩下即可編輯...", - save: "儲存訊息", - }, "browser-appearance": { title: "瀏覽器外觀", description: "自訂應用程式在瀏覽器分頁中的外觀與標題。", diff --git a/frontend/src/models/system.js b/frontend/src/models/system.js index 28783744..8ca6d0dd 100644 --- a/frontend/src/models/system.js +++ b/frontend/src/models/system.js @@ -504,39 +504,6 @@ const System = { return { success: false, error: e.message }; }); }, - getWelcomeMessages: async function () { - return await fetch(`${API_BASE}/system/welcome-messages`, { - method: "GET", - cache: "no-cache", - headers: baseHeaders(), - }) - .then((res) => { - if (!res.ok) throw new Error("Could not fetch welcome messages."); - return res.json(); - }) - .then((res) => res.welcomeMessages) - .catch((e) => { - console.error(e); - return null; - }); - }, - setWelcomeMessages: async function (messages) { - return fetch(`${API_BASE}/system/set-welcome-messages`, { - method: "POST", - headers: baseHeaders(), - body: JSON.stringify({ messages }), - }) - .then((res) => { - if (!res.ok) { - throw new Error(res.statusText || "Error setting welcome messages."); - } - return { success: true, ...res.json() }; - }) - .catch((e) => { - console.error(e); - return { success: false, error: e.message }; - }); - }, getApiKeys: async function () { return fetch(`${API_BASE}/system/api-keys`, { method: "GET", diff --git a/frontend/src/pages/GeneralSettings/Settings/Branding/index.jsx b/frontend/src/pages/GeneralSettings/Settings/Branding/index.jsx index 825a69cc..59bc5782 100644 --- a/frontend/src/pages/GeneralSettings/Settings/Branding/index.jsx +++ b/frontend/src/pages/GeneralSettings/Settings/Branding/index.jsx @@ -3,7 +3,6 @@ import { isMobile } from "react-device-detect"; import FooterCustomization from "../components/FooterCustomization"; import SupportEmail from "../components/SupportEmail"; import CustomLogo from "../components/CustomLogo"; -import CustomMessages from "../components/CustomMessages"; import { useTranslation } from "react-i18next"; import CustomAppName from "../components/CustomAppName"; import CustomSiteSettings from "../components/CustomSiteSettings"; @@ -31,7 +30,6 @@ export default function BrandingSettings() {
- diff --git a/frontend/src/pages/GeneralSettings/Settings/components/CustomMessages/index.jsx b/frontend/src/pages/GeneralSettings/Settings/components/CustomMessages/index.jsx deleted file mode 100644 index 11c64459..00000000 --- a/frontend/src/pages/GeneralSettings/Settings/components/CustomMessages/index.jsx +++ /dev/null @@ -1,139 +0,0 @@ -import EditingChatBubble from "@/components/EditingChatBubble"; -import System from "@/models/system"; -import showToast from "@/utils/toast"; -import { Plus } from "@phosphor-icons/react"; -import { useEffect, useState } from "react"; -import { useTranslation } from "react-i18next"; - -export default function CustomMessages() { - const { t } = useTranslation(); - const [hasChanges, setHasChanges] = useState(false); - const [messages, setMessages] = useState([]); - - useEffect(() => { - async function fetchMessages() { - const messages = await System.getWelcomeMessages(); - setMessages(messages); - } - fetchMessages(); - }, []); - - const addMessage = (type) => { - if (type === "user") { - setMessages([ - ...messages, - { - user: t("customization.items.welcome-messages.double-click"), - response: "", - }, - ]); - } else { - setMessages([ - ...messages, - { - user: "", - response: t("customization.items.welcome-messages.double-click"), - }, - ]); - } - }; - - const removeMessage = (index) => { - setHasChanges(true); - setMessages(messages.filter((_, i) => i !== index)); - }; - - const handleMessageChange = (index, type, value) => { - setHasChanges(true); - const newMessages = [...messages]; - newMessages[index][type] = value; - setMessages(newMessages); - }; - - const handleMessageSave = async () => { - const { success, error } = await System.setWelcomeMessages(messages); - if (!success) { - showToast(`Failed to update welcome messages: ${error}`, "error"); - return; - } - showToast("Successfully updated welcome messages.", "success"); - setHasChanges(false); - }; - - return ( -
-

- {t("customization.items.welcome-messages.title")} -

-

- {t("customization.items.welcome-messages.description")} -

-
- {messages.map((message, index) => ( -
- {message.user && ( - - )} - {message.response && ( - - )} -
- ))} -
- - -
-
- {hasChanges && ( -
- -
- )} -
- ); -} diff --git a/frontend/src/pages/WorkspaceSettings/GeneralAppearance/SuggestedChatMessages/index.jsx b/frontend/src/pages/WorkspaceSettings/GeneralAppearance/SuggestedChatMessages/index.jsx index 4075a2ef..6c1ddc04 100644 --- a/frontend/src/pages/WorkspaceSettings/GeneralAppearance/SuggestedChatMessages/index.jsx +++ b/frontend/src/pages/WorkspaceSettings/GeneralAppearance/SuggestedChatMessages/index.jsx @@ -31,12 +31,11 @@ export default function SuggestedChatMessages({ slug }) { validMessages ); if (!success) { - showToast(`Failed to update welcome messages: ${error}`, "error"); + showToast(`Failed to update suggested chat messages: ${error}`, "error"); return; } setSuggestedMessages(validMessages); setEditingIndex(-1); - showToast("Successfully updated welcome messages.", "success"); setHasChanges(false); }; diff --git a/server/endpoints/system.js b/server/endpoints/system.js index 7115960c..cabe0975 100644 --- a/server/endpoints/system.js +++ b/server/endpoints/system.js @@ -30,7 +30,6 @@ const { isDefaultFilename, } = require("../utils/files/logo"); const { Telemetry } = require("../models/telemetry"); -const { WelcomeMessages } = require("../models/welcomeMessages"); const { ApiKey } = require("../models/apiKeys"); const { getCustomModels } = require("../utils/helpers/customModels"); const { WorkspaceChats } = require("../models/workspaceChats"); @@ -962,50 +961,6 @@ function systemEndpoints(app) { } ); - app.get( - "/system/welcome-messages", - [validatedRequest, flexUserRoleValid([ROLES.all])], - async function (_, response) { - try { - const welcomeMessages = await WelcomeMessages.getMessages(); - response.status(200).json({ success: true, welcomeMessages }); - } catch (error) { - console.error("Error fetching welcome messages:", error); - response - .status(500) - .json({ success: false, message: "Internal server error" }); - } - } - ); - - app.post( - "/system/set-welcome-messages", - [validatedRequest, flexUserRoleValid([ROLES.admin, ROLES.manager])], - async (request, response) => { - try { - const { messages = [] } = reqBody(request); - if (!Array.isArray(messages)) { - return response.status(400).json({ - success: false, - message: "Invalid message format. Expected an array of messages.", - }); - } - - await WelcomeMessages.saveAll(messages); - return response.status(200).json({ - success: true, - message: "Welcome messages saved successfully.", - }); - } catch (error) { - console.error("Error processing the welcome messages:", error); - response.status(500).json({ - success: true, - message: "Error saving the welcome messages.", - }); - } - } - ); - app.get("/system/api-keys", [validatedRequest], async (_, response) => { try { if (response.locals.multiUserMode) { diff --git a/server/models/welcomeMessages.js b/server/models/welcomeMessages.js deleted file mode 100644 index a24c43c9..00000000 --- a/server/models/welcomeMessages.js +++ /dev/null @@ -1,65 +0,0 @@ -const prisma = require("../utils/prisma"); - -const WelcomeMessages = { - get: async function (clause = {}) { - try { - const message = await prisma.welcome_messages.findFirst({ - where: clause, - }); - return message || null; - } catch (error) { - console.error(error.message); - return null; - } - }, - - where: async function (clause = {}, limit) { - try { - const messages = await prisma.welcome_messages.findMany({ - where: clause, - take: limit || undefined, - }); - return messages; - } catch (error) { - console.error(error.message); - return []; - } - }, - - saveAll: async function (messages) { - try { - await prisma.welcome_messages.deleteMany({}); // Delete all existing messages - - // Create new messages - // We create each message individually because prisma - // with sqlite does not support createMany() - for (const [index, message] of messages.entries()) { - if (!message.response && !message.user) continue; - await prisma.welcome_messages.create({ - data: { - user: message.user, - response: message.response, - orderIndex: index, - }, - }); - } - } catch (error) { - console.error("Failed to save all messages", error.message); - } - }, - - getMessages: async function () { - try { - const messages = await prisma.welcome_messages.findMany({ - orderBy: { orderIndex: "asc" }, - select: { user: true, response: true }, - }); - return messages; - } catch (error) { - console.error("Failed to get all messages", error.message); - return []; - } - }, -}; - -module.exports.WelcomeMessages = WelcomeMessages; diff --git a/server/prisma/migrations/20260313192859_init/migration.sql b/server/prisma/migrations/20260313192859_init/migration.sql new file mode 100644 index 00000000..9e4d04e7 --- /dev/null +++ b/server/prisma/migrations/20260313192859_init/migration.sql @@ -0,0 +1,10 @@ +/* + Warnings: + + - You are about to drop the `welcome_messages` table. If the table is not empty, all the data it contains will be lost. + +*/ +-- DropTable +PRAGMA foreign_keys=off; +DROP TABLE "welcome_messages"; +PRAGMA foreign_keys=on; diff --git a/server/prisma/schema.prisma b/server/prisma/schema.prisma index db5c9c79..becdb6d3 100644 --- a/server/prisma/schema.prisma +++ b/server/prisma/schema.prisma @@ -116,14 +116,6 @@ model document_vectors { lastUpdatedAt DateTime @default(now()) } -model welcome_messages { - id Int @id @default(autoincrement()) - user String - response String - orderIndex Int? - createdAt DateTime @default(now()) -} - model workspaces { id Int @id @default(autoincrement()) name String diff --git a/server/utils/database/index.js b/server/utils/database/index.js index 0fa2e1d0..7b8d06c9 100644 --- a/server/utils/database/index.js +++ b/server/utils/database/index.js @@ -61,7 +61,6 @@ async function validateTablePragmas(force = false) { const { DocumentVectors } = require("../../models/vectors"); const { WorkspaceChats } = require("../../models/workspaceChats"); const { Invite } = require("../../models/invite"); - const { WelcomeMessages } = require("../../models/welcomeMessages"); const { ApiKey } = require("../../models/apiKeys"); await SystemSettings.migrateTable(); @@ -72,7 +71,6 @@ async function validateTablePragmas(force = false) { await DocumentVectors.migrateTable(); await WorkspaceChats.migrateTable(); await Invite.migrateTable(); - await WelcomeMessages.migrateTable(); await ApiKey.migrateTable(); } catch (e) { console.error(`validateTablePragmas: Migrations failed`, e);