Skip to content

Commit

Permalink
BC-8887 Remove all code regarding nexboard (#3582)
Browse files Browse the repository at this point in the history
  • Loading branch information
dyedwiper authored Feb 5, 2025
1 parent fef6115 commit a27ceb6
Show file tree
Hide file tree
Showing 14 changed files with 12 additions and 303 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,9 @@ data:
defaultSrc: 'https://www10-fms.hpi.uni-potsdam.de https://cloud-instances.s3.hidrive.strato.com',
},
'^/courses': {
defaultSrc: 'https://nexboard.nexenio.com https://lti.tools {{ BETTERMARKS_SCHOOL_URL | default("") }}',
defaultSrc: 'https://lti.tools {{ BETTERMARKS_SCHOOL_URL | default("") }}',
fontSrc: 'https://vjs.zencdn.net https://cdn.jsdelivr.net',
styleSrc: 'https://vjs.zencdn.net',
frameSrc: 'https://nexboard.nexenio.com',
},
'^/teams': {
fontSrc: 'https://vjs.zencdn.net',
Expand Down
3 changes: 0 additions & 3 deletions ansible/roles/schulcloud-client-core/templates/secret.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ metadata:
namespace: {{ NAMESPACE }}
type: Opaque
data:
# Nexboard
NEXBOARD_API_KEY: "{{ NEXBOARD_API_KEY | b64encode }"
NEXBOARD_USER_ID: "{{ NEXBOARD_USER_ID | b64encode }}"
REDIS_URI: "{{ REDIS_URI|default("redis://redis-svc", true) | b64encode }}"
{% if FEATURE_TSP_ENABLED %}
FEATURE_TSP_ENABLED: "true"
Expand Down
6 changes: 0 additions & 6 deletions config/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ const {
NOTIFICATION_SERVICE_ENABLED,
FEATURE_TEAMS_ENABLED = 'true',
LIBRE_OFFICE_CLIENT_URL,
NEXBOARD_USER_ID,
NEXBOARD_API_KEY,
FEATURE_EXTENSIONS_ENABLED,
SHOW_VERSION,
SW_ENABLED,
Expand All @@ -29,7 +27,6 @@ const {
FEATURE_JWT_EXTENDED_TIMEOUT_ENABLED,
FEATURE_CONTACT_FORM_ATTACHMENTS_ENABLED,
FEATURE_MINT_PAGES_ENABLED,
FEATURE_NEXBOARD_ENABLED,
SC_DEMO_USER_PASSWORD = 'Schulcloud1!',
SC_DEMO_USER_NAME = '[email protected]',
SC_SUPERHERO_USER_PASSWORD = 'Schulcloud1!',
Expand Down Expand Up @@ -58,8 +55,6 @@ const exp = {
NOTIFICATION_SERVICE_ENABLED,
FEATURE_TEAMS_ENABLED,
LIBRE_OFFICE_CLIENT_URL,
NEXBOARD_USER_ID,
NEXBOARD_API_KEY,
FEATURE_EXTENSIONS_ENABLED,
SHOW_VERSION,
SW_ENABLED,
Expand All @@ -69,7 +64,6 @@ const exp = {
FEATURE_JWT_EXTENDED_TIMEOUT_ENABLED,
FEATURE_CONTACT_FORM_ATTACHMENTS_ENABLED,
FEATURE_MINT_PAGES_ENABLED,
FEATURE_NEXBOARD_ENABLED,
SC_DEMO_USER_PASSWORD,
SC_DEMO_USER_NAME,
SC_SUPERHERO_USER_PASSWORD,
Expand Down
2 changes: 1 addition & 1 deletion config/http-headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const config = {
defaultSrc: 'https://www10-fms.hpi.uni-potsdam.de https://cloud-instances.s3.hidrive.strato.com',
},
'^/courses': {
defaultSrc: 'https://nexboard.nexenio.com https://www.geogebra.org https://lti.tools https://acc.bettermarks.com',
defaultSrc: 'https://www.geogebra.org https://lti.tools https://acc.bettermarks.com',
fontSrc: 'https://vjs.zencdn.net https://cdn.jsdelivr.net',
styleSrc: 'https://vjs.zencdn.net',
},
Expand Down
73 changes: 0 additions & 73 deletions controllers/topics.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const shortId = require('shortid');
const { randomBytes } = require('crypto');
const { decode } = require('html-entities');
const { Configuration } = require('@hpi-schul-cloud/commons');
const Nexboard = require('../helpers/nexboard');
const api = require('../api');
const apiEditor = require('../apiEditor');
const authHelper = require('../helpers/authentication');
Expand All @@ -13,11 +12,6 @@ const filesStoragesHelper = require('../helpers/files-storage');

const router = express.Router({ mergeParams: true });

const {
NEXBOARD_USER_ID,
NEXBOARD_API_KEY,
} = require('../config/global');

const editTopicHandler = (req, res, next) => {
const context = req.originalUrl.split('/')[1];
let lessonPromise;
Expand Down Expand Up @@ -182,69 +176,6 @@ const getPadIdFromUrl = (path) => {
return path.substring(path.lastIndexOf('/') + 1);
};

const getNexBoardAPI = () => {
if (!NEXBOARD_USER_ID && !NEXBOARD_API_KEY) {
logger.error('nexBoard env is currently not defined.');
}
return new Nexboard(NEXBOARD_API_KEY, NEXBOARD_USER_ID);
};

const getNexBoardProjectFromUser = async (req, user) => {
const preferences = user.preferences || {};
if (typeof preferences.nexBoardProjectID === 'undefined') {
const project = await getNexBoardAPI().createProject(user._id, user._id);
preferences.nexBoardProjectID = project.id;
await api(req).patch(`/users/${user._id}`, { json: { preferences } });
}
return preferences.nexBoardProjectID;
};

async function createNewNexBoards(req, res, contents = [], next) {
// eslint-disable-next-line no-return-await
return await Promise.all(contents.map(async (content) => {
if (content.component === 'neXboard' && content.content.board === '0') {
try {
const nextboardProject = await getNexBoardProjectFromUser(req, res.locals.currentUser);
const board = await getNexBoardAPI().createBoard(
content.content.title,
content.content.description,
nextboardProject,
'schulcloud',
);

content.content.title = board.title;
content.content.board = board.id;
content.content.url = board.publicLink;
content.content.description = board.description;

return content;
} catch (err) {
next(err);

return undefined;
}
} else {
return content;
}
}));
}

const getNexBoards = (req, res, next) => {
api(req).get('/lessons/contents/neXboard', {
qs: {
type: 'neXboard',
user: res.locals.currentUser._id,
},
})
.then((boards) => {
res.json(boards);
});
};

router.get('/:topicId/nexboard/boards', getNexBoards);

router.get('/nexboard/boards', getNexBoards);

// secure routes
router.use(authHelper.authChecker);

Expand All @@ -261,8 +192,6 @@ router.post('/', async (req, res, next) => {

// Check for etherpad component
data.contents = await createNewEtherpad(req, res, data.contents, data.courseId);
// Check for neXboard compontent
data.contents = await createNewNexBoards(req, res, data.contents, next);

data.contents = data.contents.filter((c) => c !== undefined);

Expand Down Expand Up @@ -424,8 +353,6 @@ router.patch('/:topicId', async (req, res, next) => {

// create new Etherpads when necessary, if not simple hidden or position patch
if (data.contents) data.contents = await createNewEtherpad(req, res, data.contents, data.courseId);
// create new Nexboard when necessary, if not simple hidden or position patch
if (data.contents) data.contents = await createNewNexBoards(req, res, data.contents, next);

if (data.contents) { data.contents = data.contents.filter((c) => c !== undefined); }

Expand Down
98 changes: 0 additions & 98 deletions helpers/nexboard.js

This file was deleted.

8 changes: 2 additions & 6 deletions locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@
"descriptionArchivedCourses": "Kurse, deren Enddatum erreicht ist, findest du hier. Du kannst archivierte Kurse als Vorlage für das neue Schuljahr wiederverwenden, einen Kurs importieren oder einen ganz neuen Kurs erstellen.",
"descriptionCourseManagement": "Du kannst archivierte Kurse kopieren und als Vorlage für das neue Schuljahr verwenden, einen Kurs importieren oder einen ganz neuen Kurs erstellen.",
"finishImport": "Schließe den Import ab. Lege im nächsten Schritt einen neuen Kurstermin fest und füge Schüler:innen hinzu.",
"importCourseAttentionTools": "Achtung: Tausche im Thema enthaltene, mit Nutzerdaten befüllte Tools (z.B. neXboard, Etherpad, GeoGebra) nachträglich manuell aus, da Änderungen daran sich sonst auf den Original-Kurs auswirken! Dateien (Bilder, Videos, Audio) sowie verlinktes Material sind nicht betroffen und können unverändert bleiben.",
"importCourseAttentionTools": "Achtung: Tausche im Thema enthaltene, mit Nutzerdaten befüllte Tools (z.B. Etherpad, GeoGebra) nachträglich manuell aus, da Änderungen daran sich sonst auf den Original-Kurs auswirken! Dateien (Bilder, Videos, Audio) sowie verlinktes Material sind nicht betroffen und können unverändert bleiben.",
"importedCourseWithQR": "Du hast einen Kurs über einen QR-Code importiert.",
"insertCodeToImport": "Füge einen Code ein, um Kursinhalte anderer Nutzer:innen zu importieren.",
"noAttendees": "Keine Teilnehmer:innen",
Expand Down Expand Up @@ -3201,21 +3201,17 @@
"input": {
"brainstormAboutXYZ": "Brainstorming zum Thema XYZ",
"createsListInEtherpad": "Erstellt im nachfolgenden Etherpad eine Pro-Contra-Liste zum Thema XYC",
"createsListInNeXboard": "Erstellt im nachfolgendem Whiteboard eine Pro-Contra-Liste zum Thema XYC",
"GeoGebraEnterId": "GeoGebra Material-ID eingeben, z.B. kEBfU7AR",
"sectionTitle": "Titel des Abschnitts"
},
"label": {
"descriptionEtherpad": "Beschreibung des Etherpads",
"descriptionNeXboard": "Beschreibung des Whiteboards",
"internalLink": "URL der Aufgabe",
"lockSection": "Abschnitt sperren",
"nameOfEtherpad": "Name des Etherpads",
"nameOfNeXboard": "Name des Whiteboards",
"openSection": "Abschnitt entsperren",
"theLinkHasToBeginWith": "Der Link muss mit '{{- baseUrl}}/homework' beginnen! Die Schüler:innen müssen Zugriff auf die Aufgabe haben, um diese hier eingebunden zu sehen. Achtung: Wenn du dieses Thema oder den ganzen Kurs per Sharing-Code mit einer anderen Lehrkraft teilst, werden die auf diese Weise eingebundenen Aufgaben derzeit nicht berücksichtigt.",
"youllFindTheIdOn": "Die Material-ID finden Sie in der URL zu dem GeoGebra-Arbeitsblatt, was sie online abgespeichert haben. Bei z.B. https://www.geogebra.org/m/e6g4adXp ist die Material-ID 'e6g4adXp'",
"nexboardInfo": "Wie angekündigt, wurde das Whiteboard-Tool neXboard am 23. April 2024 von unserer Plattform entfernt. Als Ersatz ist nun das innovative Whiteboard-Tool tldraw im Spaltenboard verfügbar. Besuchen Sie unseren Blogbeitrag für detaillierte Anleitungen und Informationen."
"youllFindTheIdOn": "Die Material-ID finden Sie in der URL zu dem GeoGebra-Arbeitsblatt, was sie online abgespeichert haben. Bei z.B. https://www.geogebra.org/m/e6g4adXp ist die Material-ID 'e6g4adXp'"
}
}
},
Expand Down
8 changes: 2 additions & 6 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@
"descriptionArchivedCourses": "Courses whose end date has been reached can be found here. You can reuse archived courses as templates for the new school year, import a course or create a completely new course.",
"descriptionCourseManagement": "You can copy archived courses and use them as templates for the new school year, import a course, or create a brand new course.",
"finishImport": "Complete the import. In the next step, set a new course date and add students.",
"importCourseAttentionTools": "Attention: Manually replace tools with user data which are included in the topic subsequently (e.g. neXboard, Etherpad, GeoGebra), because changes to this will otherwise affect the original course! Files (images, videos, audio) and linked material are not affected and can remain unchanged.",
"importCourseAttentionTools": "Attention: Manually replace tools with user data which are included in the topic subsequently (e.g. Etherpad, GeoGebra), because changes to this will otherwise affect the original course! Files (images, videos, audio) and linked material are not affected and can remain unchanged.",
"importedCourseWithQR": "You have imported a course via a QR Code.",
"insertCodeToImport": "Insert a code to import course content from other users.",
"noAttendees": "No participants",
Expand Down Expand Up @@ -3201,21 +3201,17 @@
"input": {
"brainstormAboutXYZ": "Brainstorming on the topic XYZ",
"createsListInEtherpad": "Creates in the following Etherpad a Pro-Contra list on the topic XYC",
"createsListInNeXboard": "Create a pro-con list on the topic of XYC on the following whiteboard",
"GeoGebraEnterId": "Enter GeoGebra Material ID, e.g. kEBfU7AR",
"sectionTitle": "Title of the section"
},
"label": {
"descriptionEtherpad": "Description of the Etherpad",
"descriptionNeXboard": "Description of the whiteboard",
"internalLink": "URL of task",
"lockSection": "Lock section",
"nameOfEtherpad": "Name of the Etherpad",
"nameOfNeXboard": "Name of the whiteboard",
"openSection": "Unlock section",
"theLinkHasToBeginWith": "The link must begin with '{{- baseUrl}} / task'! Students must have access to the task to see it included here. Attention: If you share this topic or the entire course with another teacher using a sharing code, the tasks integrated in this way will currently not be considered.",
"youllFindTheIdOn": "You can find the material ID in the URL to the GeoGebra worksheet, which you have saved online. At e.g. https://www.geogebra.org/m/e6g4adXp the material ID is 'e6g4adXp'",
"nexboardInfo": "As announced, the whiteboard tool neXboard was removed from our platform on 23 April 2024. As a replacement, the innovative whiteboard tool tldraw is now available in the column board. Visit our blog post for detailed instructions and information."
"youllFindTheIdOn": "You can find the material ID in the URL to the GeoGebra worksheet, which you have saved online. At e.g. https://www.geogebra.org/m/e6g4adXp the material ID is 'e6g4adXp'"
}
}
},
Expand Down
8 changes: 2 additions & 6 deletions locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@
"descriptionArchivedCourses": "Los cursos que ya han finalizado se pueden encontrar aquí. Puedes volver a utilizar cursos archivados como plantillas para el nuevo año escolar, importar un curso o crear un curso completamente nuevo.",
"descriptionCourseManagement": "Puedes copiar cursos archivados y usarlos como plantillas para el nuevo año escolar, importar un curso o crear un curso nuevo.",
"finishImport": "Completa la importación. En el siguiente paso, establece una nueva fecha de curso y añade estudiantes.",
"importCourseAttentionTools": "Atención: reemplaza manualmente las herramientas con datos de usuario que se incluyen en el tema posteriormente (por ejemplo, nexBoard, Etherpad, GeoGebra), ya que los cambios en esto afectarán al curso original. Los archivos (imágenes, vídeos y audios) y el material vinculado no se ven afectados y pueden permanecer sin cambios.",
"importCourseAttentionTools": "Atención: reemplaza manualmente las herramientas con datos de usuario que se incluyen en el tema posteriormente (por ejemplo, Etherpad, GeoGebra), ya que los cambios en esto afectarán al curso original. Los archivos (imágenes, vídeos y audios) y el material vinculado no se ven afectados y pueden permanecer sin cambios.",
"importedCourseWithQR": "Has importado un curso a través de un código QR.",
"insertCodeToImport": "Inserta un código para importar el contenido del curso de otros usuarios.",
"noAttendees": "No hay participantes",
Expand Down Expand Up @@ -3201,21 +3201,17 @@
"input": {
"brainstormAboutXYZ": "Lluvia de ideas sobre el tema XYZ",
"createsListInEtherpad": "Crea en el siguiente Etherpad una lista Pro-Contra sobre el tema XYC",
"createsListInNeXboard": "Crea una lista de pros y contras sobre el tema de XYC en la siguiente pizarra",
"GeoGebraEnterId": "Introduce el ID del material de GeoGebra, por ejemplo, kEBfU7AR",
"sectionTitle": "Título de la sección"
},
"label": {
"descriptionEtherpad": "Descripción de Etherpad",
"descriptionNeXboard": "Descripción de la pizarra",
"internalLink": "URL de la tarea",
"lockSection": "Bloquear sección",
"nameOfEtherpad": "Nombre de Etherpad",
"nameOfNeXboard": "Nombre de la pizzara",
"openSection": "Desbloquear sección",
"theLinkHasToBeginWith": "El enlace debe comenzar con '{{- baseUrl}} / ¡tareas! Los estudiantes deben tener acceso a las tareas para verlas incluidas aquí. Atención: si compartes este tema o todo el curso con otro profesor usando un código para compartir, las tareas integradas de esta manera no se tendrán en cuenta.",
"youllFindTheIdOn": "Puedes encontrar la ID del material en la URL de la hoja de trabajo de GeoGebra que has guardado en línea. Por ejemplo, en https://www.geogebra.org/m/e6g4adXp, la ID del material es 'e6g4adXp'",
"nexboardInfo": "Como se anunció, la herramienta de pizarra neXboard se eliminó de nuestra plataforma el 23 de abril de 2024. Como reemplazo, la innovadora herramienta de pizarra blanca tldraw está ahora disponible en el tablero de columnas. Visite nuestra entrada del blog para obtener instrucciones e información detalladas."
"youllFindTheIdOn": "Puedes encontrar la ID del material en la URL de la hoja de trabajo de GeoGebra que has guardado en línea. Por ejemplo, en https://www.geogebra.org/m/e6g4adXp, la ID del material es 'e6g4adXp'"
}
}
},
Expand Down
Loading

0 comments on commit a27ceb6

Please sign in to comment.