From 4c16b37e104c596a6bd699be4e821c48f3779767 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Janis=20Daniel=20Da=CC=88hne?=
 <janis.daehne2@student.uni-halle.de>
Date: Fri, 1 Nov 2019 14:26:36 +0100
Subject: [PATCH] - fixed issue where no permission on edit exercise would give
 us an invalid state - fixed typo

---
 src/components/404internal/Chat404.tsx                       | 2 +-
 .../sites/manageOwnOrGroupExerciseComponents/listView.tsx    | 5 +++++
 src/constants.ts                                             | 2 +-
 .../reducers/exerciseEditorSite/getEditorExerciseReducer.ts  | 3 ++-
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/components/404internal/Chat404.tsx b/src/components/404internal/Chat404.tsx
index bbcc6ac3..674b4c06 100644
--- a/src/components/404internal/Chat404.tsx
+++ b/src/components/404internal/Chat404.tsx
@@ -339,7 +339,7 @@ const conversion: ReadonlyArray<ChatMessage> = [
     kind: 'message',
     name: 'Steffen',
     withLoading: true,
-    message: 'Jaja, von wegen keine Fehler. Ich habe dir aber doch gleich gesagt, dass wir einen vernünftigen 404-Seite brauchen!'
+    message: 'Jaja, von wegen keine Fehler. Ich habe dir aber doch gleich gesagt, dass wir einen vernünftige 404-Seite brauchen!'
   },
   {
     kind: 'message',
diff --git a/src/components/sites/manageOwnOrGroupExerciseComponents/listView.tsx b/src/components/sites/manageOwnOrGroupExerciseComponents/listView.tsx
index 83c5b6c4..fa379443 100644
--- a/src/components/sites/manageOwnOrGroupExerciseComponents/listView.tsx
+++ b/src/components/sites/manageOwnOrGroupExerciseComponents/listView.tsx
@@ -27,6 +27,7 @@ import Spinner from '../../helpers/spinner'
 import {copyExercise} from '../../../communicationLayer/exerciseEditorLayer'
 import Logger from '../../../helpers/logger'
 import history from '../../../routerHistory'
+import {debugOriginUrl, isProduction} from '../../../../debug'
 
 
 //const css = require('./styles.styl');
@@ -675,6 +676,10 @@ class TableView extends React.Component<Props, any> {
                             newExerciseId = await copyExercise(exercisePreview.id)
                           } catch (err) {
 
+                            if (!isProduction) {
+                              Logger.warn(`could not create exercise copy: ${err.message}`, err)
+                            }
+
                             Logger.warn('could not create exercise copy')
                             errorDialog(getI18n(this.props.langId, "Error"),
                                         getI18n(this.props.langId, "Could not copy exercise"), this.props.langId
diff --git a/src/constants.ts b/src/constants.ts
index cfcd9b0e..a018fa08 100644
--- a/src/constants.ts
+++ b/src/constants.ts
@@ -13,7 +13,7 @@ import Logger from './helpers/logger'
  * y - breaking changes / new features
  * z - fixes, small changes
  */
-export const versionString = '2.5.4'
+export const versionString = '2.5.5'
 
 
 export const supportMail = 'yapex@informatik.uni-halle.de'
diff --git a/src/state/reducers/exerciseEditorSite/getEditorExerciseReducer.ts b/src/state/reducers/exerciseEditorSite/getEditorExerciseReducer.ts
index a2e9c9c8..b1ebfb4f 100644
--- a/src/state/reducers/exerciseEditorSite/getEditorExerciseReducer.ts
+++ b/src/state/reducers/exerciseEditorSite/getEditorExerciseReducer.ts
@@ -9,6 +9,7 @@ import {EditorExerciseFromBackend} from "../../../types/exerciseEditor";
 import {convertEditorExerciseFromBackendToFrontend} from "../../../helpers/convertersAndTransformers";
 import {AceEditorsStorageHelper} from '../../../components/codeEditors/aceEditors/aceEditorsStorageHelper'
 import {editExerciseExerciseDescriptionEditorPanelViewEditorId} from '../../../constants'
+import {initial as initialEditorExercise} from './editorExerciseReducer'
 
 
 export interface GET_editorExerciseAction
@@ -78,7 +79,7 @@ export function reducer(state: State = initial(), action: AllActions): State {
       return {
         ...state,
         isLoading: false,
-        editorExercise: null
+        editorExercise: initialEditorExercise()
       }
 
     default:
-- 
GitLab