Skip to content

Commit

Permalink
Merge branch 'main' into N21-2237-remove-legacy-lti
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinOehlerkingCap authored Feb 7, 2025
2 parents e0841b4 + a27ceb6 commit ddbf9ff
Show file tree
Hide file tree
Showing 21 changed files with 93 additions and 332 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.

13 changes: 7 additions & 6 deletions locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,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 @@ -1747,6 +1747,11 @@
"noTopicFoundWithCode": "Es wurde kein Thema für diesen Code gefunden.",
"pageMoved": "Diese Seite wurde verschoben.",
"passwordsAreDifferent": "Passwörter stimmen nicht überein.",
"hasLowerCase": "Passwort muss Kleinbuchstaben enthalten.",
"hasUpperCase": "Passwort muss Großbuchstaben enthalten.",
"hasNumber": "Passwort muss eine Zahl enthalten.",
"hasSpecialCharacter": "Passwort muss ein Sonderzeichen enthalten.",
"hasMinLength": "Passwort muss mindestens 8 Zeichen lang sein.",
"printingFailed": "Drucken ist fehlgeschlagen. Bitte probieren Sie erneut",
"qrHintText": "Lotse mit dem QR-Code andere Nutzer:innen auf diese Seite",
"requestTimeout": "Zeitüberschreitung bei der Anfrage",
Expand Down Expand Up @@ -3150,21 +3155,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
13 changes: 7 additions & 6 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,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 @@ -1747,6 +1747,11 @@
"noTopicFoundWithCode": "No topic was found for this code.",
"pageMoved": "This page has been moved.",
"passwordsAreDifferent": "Passwords do not match.",
"hasLowerCase": "Password must contain lowercase letters.",
"hasUpperCase": "Password must contain uppercase letters.",
"hasNumber": "Password must contain a number.",
"hasSpecialCharacter": "Password must contain a special character.",
"hasMinLength": "Password must be at least 8 characters long.",
"printingFailed": "Printing failed. Please try agian.",
"qrHintText": "Navigate other users to this site with the QR code",
"requestTimeout": "Request timed out",
Expand Down Expand Up @@ -3150,21 +3155,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
Loading

0 comments on commit ddbf9ff

Please sign in to comment.