diff --git a/src/components/organisms/administration/PrivacySettings.unit.js b/src/components/organisms/administration/PrivacySettings.unit.js index 31a407b284..0653289122 100644 --- a/src/components/organisms/administration/PrivacySettings.unit.js +++ b/src/components/organisms/administration/PrivacySettings.unit.js @@ -28,6 +28,7 @@ const searchStrings = { learnStore: "admin-school-toggle-learning-store", rocketChat: "toggle_chat", videoconference: "toggle_video_conference", + aiTutor: "toggle_ai_tutor", }; const getWrapper = (props = generateProps()) => { @@ -171,6 +172,34 @@ describe("PrivacySettings", () => { }); }); + describe("when env var for aiTutor is true", () => { + it("should display aiTutor feature switch", () => { + const envs = envsFactory.build({ + FEATURE_AI_TUTOR_ENABLED: true, + }); + envConfigModule.setEnvs(envs); + const wrapper = getWrapper(); + + expect( + wrapper.findAll(`[data-testid=${searchStrings.aiTutor}]`) + ).toHaveLength(1); + }); + }); + + describe("when env var for aiTutor is false", () => { + it("should hide aiTutor feature switch", () => { + const envs = envsFactory.build({ + FEATURE_AI_TUTOR_ENABLED: false, + }); + envConfigModule.setEnvs(envs); + const wrapper = getWrapper(); + + expect( + wrapper.findAll(`[data-testid=${searchStrings.aiTutor}]`) + ).toHaveLength(0); + }); + }); + describe("when env var for rocketchat is true", () => { it("should display rocketchat feature switch", () => { const envs = envsFactory.build({ diff --git a/src/components/organisms/administration/PrivacySettings.vue b/src/components/organisms/administration/PrivacySettings.vue index 79a9e6f60b..1fdc343158 100644 --- a/src/components/organisms/administration/PrivacySettings.vue +++ b/src/components/organisms/administration/PrivacySettings.vue @@ -127,6 +127,36 @@

+ + + +

+ {{ + $t( + "pages.administration.school.index.privacySettings.longText.aiTutor" + ) + }} +

+
+
@@ -164,6 +194,10 @@ const videoConferenceEnabled = computed( () => envConfigModule.getEnv.FEATURE_VIDEOCONFERENCE_ENABLED ); +const aiTutorEnabled = computed( + () => envConfigModule.getEnv.FEATURE_AI_TUTOR_ENABLED +); + const rocketChatEnabled = computed( () => envConfigModule.getEnv.ROCKETCHAT_SERVICE_ENABLED ); diff --git a/src/locales/de.ts b/src/locales/de.ts index 1d35f02c64..e4636e3051 100644 --- a/src/locales/de.ts +++ b/src/locales/de.ts @@ -1121,6 +1121,8 @@ export default { "Sichtbarkeit von Schüler:innen für Lehrkräfte aktivieren", "pages.administration.school.index.privacySettings.labels.videoConference": "Videokonferenzen für Kurse und Teams aktivieren", + "pages.administration.school.index.privacySettings.labels.aiTutor": + "KI-Tutor an Schule aktivieren", "pages.administration.school.index.privacySettings.longText.chatFunction": "Sind Chats an deiner Schule aktiviert, können Team-Admins im jeweiligen Team die Chatfunktion gezielt freischalten.", "pages.administration.school.index.privacySettings.longText.configurabilityInfoText": @@ -1135,6 +1137,8 @@ export default { "Wenn diese Option nicht aktiviert ist, können die Lehrkräfte ausschließlich die Klassen sowie deren Schülerinnen und Schüler sehen, in denen sie Mitglied sind.", "pages.administration.school.index.privacySettings.longText.videoConference": "Sind Videokonferenzen an deiner Schule aktiviert, können Lehrkräfte ihrem Kurs im Bereich Tools das Videokonferenz-Tool hinzufügen und dann von dort aus Videokonferenzen für alle Kursteilnehmer:innen starten. Team-Admins können die Videokonferenzfunktion im jeweiligen Team aktivieren. Team-Leiter:innen und Team-Admins können dann Videokonferenzen zu Terminen hinzufügen und starten.", + "pages.administration.school.index.privacySettings.longText.aiTutor": + "Ist der KI-Tutor an deiner Schule aktiviert, können Lehrkräfte in ihren Bereichen den KI-Tutor hinzufügen.", "pages.administration.school.index.privacySettings": "Datenschutzeinstellungen", "pages.administration.school.index.schoolIsCurrentlyDrawing": diff --git a/src/locales/en.ts b/src/locales/en.ts index ca93f95e5b..2be9ffe6e0 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -1112,6 +1112,8 @@ export default { "Activate student visibility for teachers", "pages.administration.school.index.privacySettings.labels.videoConference": "Activate video conferencing for courses and teams", + "pages.administration.school.index.privacySettings.labels.aiTutor": + "Activate AI tutor at school", "pages.administration.school.index.privacySettings.longText.chatFunction": "If chats are enabled at your school, team administrators can selectively unlock the chat function respectively for their team.", "pages.administration.school.index.privacySettings.longText.configurabilityInfoText": @@ -1126,6 +1128,8 @@ export default { "If this option is not enabled, teachers can only see the classes and their students in which they are members.", "pages.administration.school.index.privacySettings.longText.videoConference": "If video conferencing is enabled at your school, teachers can add the video conferencing tool to their course in the Tools section and then start video conferencing for all course participants from there. Team administrators can activate the video conference function in the respective team. Team leaders and team admins can then add and start video conferences for appointments.", + "pages.administration.school.index.privacySettings.longText.aiTutor": + "If AI Tutor is activated at your school, teachers can add the AI Tutor in their areas.", "pages.administration.school.index.privacySettings": "Privacy Settings", "pages.administration.school.index.schoolIsCurrentlyDrawing": "Your school is currently getting", diff --git a/src/locales/es.ts b/src/locales/es.ts index 2cc0295d92..53518cfa57 100644 --- a/src/locales/es.ts +++ b/src/locales/es.ts @@ -1143,6 +1143,8 @@ export default { "Activar la visibilidad de los estudiantes para los profesores", "pages.administration.school.index.privacySettings.labels.videoConference": "Activar videoconferencias para cursos y equipos", + "pages.administration.school.index.privacySettings.labels.aiTutor": + "Activar tutor de IA en la escuela", "pages.administration.school.index.privacySettings.longText.chatFunction": "Si los chats están habilitados en tu escuela, los administradores del equipo pueden desbloquear la función de chat de manera selectiva y respectivamente para su equipo.", "pages.administration.school.index.privacySettings.longText.configurabilityInfoText": @@ -1157,6 +1159,8 @@ export default { "Si esta opción no está activada, los profesores sólo podrán ver las clases y sus alumnos de las que son miembros.", "pages.administration.school.index.privacySettings.longText.videoConference": "Si la videoconferencia está habilitada en tu escuela, los profesores pueden añadir la herramienta de videoconferencia a su curso en la sección Herramientas y entonces podrán iniciar desde allí videoconferencias para todos los participantes del curso. Los administradores del equipo pueden activar la función de videoconferencia en el equipo respectivo. Los líderes de equipo y los administradores de equipo pueden añadir e iniciar videoconferencias para citas.", + "pages.administration.school.index.privacySettings.longText.aiTutor": + "Si AI Tutor está activado en tu escuela, los profesores pueden agregar AI Tutor en sus áreas.", "pages.administration.school.index.privacySettings": "Configuración de la privacidad", "pages.administration.school.index.schoolIsCurrentlyDrawing": diff --git a/src/locales/uk.ts b/src/locales/uk.ts index e3ab98893f..cead7ffe0f 100644 --- a/src/locales/uk.ts +++ b/src/locales/uk.ts @@ -1127,6 +1127,8 @@ export default { "Активувати видимість учнів для вчителів", "pages.administration.school.index.privacySettings.labels.videoConference": "Активувати відеоконференції для курсів і команд", + "pages.administration.school.index.privacySettings.labels.aiTutor": + "Активуйте репетитора ШІ в школі", "pages.administration.school.index.privacySettings.longText.chatFunction": "Якщо у вашому навчальному закладі увімкнені чати, адміністратори команд можуть вибірково увімкнути функцію чату для своєї команди.", "pages.administration.school.index.privacySettings.longText.configurabilityInfoText": @@ -1141,6 +1143,8 @@ export default { "Якщо цю опцію не ввімкнено, вчителі бачитимуть лише ті класи та учнів, учасниками яких вони є.", "pages.administration.school.index.privacySettings.longText.videoConference": "Якщо у вашій школі увімкнено відеоконференцію, викладачі можуть додати інструмент для відеоконференцій до свого курсу у розділі «Інструменти», а потім запустити відеоконференцію для всіх учасників курсу. Адміністратори команд можуть активувати функцію відеоконференції у відповідній команді. Після цього керівники команд та адміністратори команд зможуть додавати та розпочинати відеоконференції для зустрічей.", + "pages.administration.school.index.privacySettings.longText.aiTutor": + "Якщо AI Tutor активовано у вашій школі, вчителі можуть додати AI Tutor у своїх областях.", "pages.administration.school.index.privacySettings": "Параметри конфіденційності", "pages.administration.school.index.schoolIsCurrentlyDrawing": diff --git a/src/serverApi/v3/api.ts b/src/serverApi/v3/api.ts index 19b13fbcb1..e7c40bedd9 100644 --- a/src/serverApi/v3/api.ts +++ b/src/serverApi/v3/api.ts @@ -1138,6 +1138,12 @@ export interface ConfigResponse { * @memberof ConfigResponse */ FEATURE_SCHULCONNEX_MEDIA_LICENSE_ENABLED: boolean; + /** + * + * @type {boolean} + * @memberof ConfigResponse + */ + FEATURE_AI_TUTOR_ENABLED: boolean; } /** * @@ -6316,7 +6322,8 @@ export enum SchoolFeature { LdapUniventionMigrationSchool = 'ldapUniventionMigrationSchool', OauthProvisioningEnabled = 'oauthProvisioningEnabled', ShowOutdatedUsers = 'showOutdatedUsers', - EnableLdapSyncDuringMigration = 'enableLdapSyncDuringMigration' + EnableLdapSyncDuringMigration = 'enableLdapSyncDuringMigration', + AiTutor = 'aiTutor' } /** diff --git a/src/store/env-config-defaults.ts b/src/store/env-config-defaults.ts index e13fe251ab..4d111f7c3e 100644 --- a/src/store/env-config-defaults.ts +++ b/src/store/env-config-defaults.ts @@ -70,4 +70,5 @@ export const defaultConfigEnvs: ConfigResponse = { FEATURE_MEDIA_SHELF_ENABLED: false, BOARD_COLLABORATION_URI: "ws://localhost:4450", FEATURE_SCHULCONNEX_MEDIA_LICENSE_ENABLED: false, + FEATURE_AI_TUTOR_ENABLED: false, }; diff --git a/src/store/schools.ts b/src/store/schools.ts index 6202fe5a67..33bf921fcc 100644 --- a/src/store/schools.ts +++ b/src/store/schools.ts @@ -2,6 +2,7 @@ import { FederalStateResponse, SchoolApiFactory, SchoolApiInterface, + SchoolFeature, SchoolResponse, SchoolSystemResponse, SchoolUpdateBodyParams, @@ -57,14 +58,15 @@ export default class SchoolsModule extends VuexModule { purpose: undefined, features: [], featureObject: { - rocketChat: false, - videoconference: false, - studentVisibility: false, - ldapUniventionMigrationSchool: false, - showOutdatedUsers: false, - enableLdapSyncDuringMigration: false, - oauthProvisioningEnabled: false, - nextcloud: false, + [SchoolFeature.RocketChat]: false, + [SchoolFeature.Videoconference]: false, + [SchoolFeature.StudentVisibility]: false, + [SchoolFeature.LdapUniventionMigrationSchool]: false, + [SchoolFeature.ShowOutdatedUsers]: false, + [SchoolFeature.EnableLdapSyncDuringMigration]: false, + [SchoolFeature.OauthProvisioningEnabled]: false, + [SchoolFeature.Nextcloud]: false, + [SchoolFeature.AiTutor]: false, }, instanceFeatures: [], permissions: {}, diff --git a/src/store/schools.unit.ts b/src/store/schools.unit.ts index 6552eda7b3..3025ebf4b8 100644 --- a/src/store/schools.unit.ts +++ b/src/store/schools.unit.ts @@ -1,5 +1,5 @@ import * as serverApi from "@/serverApi/v3/api"; -import { SystemsApiInterface } from "@/serverApi/v3/api"; +import { SchoolFeature, SystemsApiInterface } from "@/serverApi/v3/api"; import { authModule, envConfigModule } from "@/store"; import { initializeAxios } from "@/utils/api"; import { envsFactory, meResponseFactory } from "@@/tests/test-utils"; @@ -8,7 +8,7 @@ import { schoolSystemResponseFactory } from "@@/tests/test-utils/factory/schoolS import { mockApiResponse } from "@@/tests/test-utils/mockApiResponse"; import { mockSchool } from "@@/tests/test-utils/mockObjects"; import setupStores from "@@/tests/test-utils/setupStores"; -import { DeepMocked, createMock } from "@golevelup/ts-jest"; +import { createMock, DeepMocked } from "@golevelup/ts-jest"; import { AxiosError, AxiosInstance } from "axios"; import AuthModule from "./auth"; import EnvConfigModule from "./env-config"; @@ -99,7 +99,7 @@ describe("schools module", () => { ); const schoolsModule = new SchoolsModule({}); - const expectedFeatureObject = { + const expectedFeatureObject: Record = { rocketChat: true, videoconference: true, studentVisibility: false, @@ -108,6 +108,7 @@ describe("schools module", () => { enableLdapSyncDuringMigration: false, oauthProvisioningEnabled: false, nextcloud: false, + aiTutor: false, }; await schoolsModule.fetchSchool(); diff --git a/tests/test-utils/mockObjects.ts b/tests/test-utils/mockObjects.ts index efeefb395f..9acbc0dca1 100644 --- a/tests/test-utils/mockObjects.ts +++ b/tests/test-utils/mockObjects.ts @@ -1,3 +1,4 @@ +import { SchoolFeature } from "@/serverApi/v3"; import { School } from "@/store/types/schools"; export const mockSchool: School = { @@ -33,14 +34,15 @@ export const mockSchool: School = { purpose: undefined, features: [], featureObject: { - rocketChat: false, - videoconference: false, - studentVisibility: false, - ldapUniventionMigrationSchool: false, - showOutdatedUsers: false, - enableLdapSyncDuringMigration: false, - nextcloud: false, - oauthProvisioningEnabled: false, + [SchoolFeature.RocketChat]: false, + [SchoolFeature.Videoconference]: false, + [SchoolFeature.StudentVisibility]: false, + [SchoolFeature.LdapUniventionMigrationSchool]: false, + [SchoolFeature.ShowOutdatedUsers]: false, + [SchoolFeature.EnableLdapSyncDuringMigration]: false, + [SchoolFeature.OauthProvisioningEnabled]: false, + [SchoolFeature.Nextcloud]: false, + [SchoolFeature.AiTutor]: false, }, instanceFeatures: [], permissions: {},