From 467074452fca896871a5e89f8744decf576f4c34 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Janis=20Daniel=20Da=CC=88hne?=
 <janis.daehne2@student.uni-halle.de>
Date: Wed, 9 Oct 2019 16:31:26 +0200
Subject: [PATCH] - added more precise tooltips for manage asset file dialogs
 where the files come from

---
 i18n/en.ts                                            |  6 +++++-
 i18n/i18nRoot.ts                                      |  6 +++++-
 .../dialog/customTestsDialog/changeCustomTestView.tsx |  1 +
 .../dialogs/changeTestDialog/changeTestView.tsx       |  1 +
 .../editCustomProjectSite/editCustomProjectSite.tsx   |  1 +
 .../addAssetFilesModal/addAssetFilesModal.tsx         | 11 ++++++++---
 .../sites/exerciseEditorSite/exerciseEditorSite.tsx   |  2 ++
 .../exerciseTestsPanel/dialogs/changeTestView.tsx     |  2 ++
 src/constants.ts                                      |  2 +-
 9 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/i18n/en.ts b/i18n/en.ts
index fc4f55ec..624172dd 100644
--- a/i18n/en.ts
+++ b/i18n/en.ts
@@ -898,7 +898,11 @@ export const lang_en: LangObj = {
   "Manage asset files" : "Manage asset files",
   "Attached Files" : "Attached Files",
   "All Files": "All Files",
-  "These are all files where you have access to. For exercises or exercise tests you need permission to change the exercise." : "These are all files where you have access to. For exercises or exercise tests you need permission to change the exercise.",
+
+  "These are all files from custom projects and custom exercise tests." : "These are all files from custom projects and custom exercise tests.",
+  "These are all files from exercise tests where you have the group permission to change the exercise and the exercise is visible to all." : "These are all files from exercise tests where you have the group permission to change the exercise and the exercise is visible to all.",
+  "These are all files from exercise descriptions where you have the group permission to change the exercise and the exercise is visible to all." : "These are all files from exercise descriptions where you have the group permission to change the exercise and the exercise is visible to all.",
+
   "Note that when you detach a file and it has no connection to another exercise, it will get deleted!" : "Note that when you detach a file and it has no connection to another exercise then it will get deleted!",
   "Managing assets is only allowed for saved exercises (not for new exercises)": "Managing assets is only allowed for saved exercises (not for new exercises)",
   "All changes to assets are applied immediately in the backend (saving is not needed for this)!": "All changes to assets are applied immediately in the backend (saving is not needed for this)!",
diff --git a/i18n/i18nRoot.ts b/i18n/i18nRoot.ts
index 069fe7cb..bb0ab77d 100644
--- a/i18n/i18nRoot.ts
+++ b/i18n/i18nRoot.ts
@@ -903,7 +903,11 @@ export interface LangObj {
   "Manage asset files": string
   "Attached Files" : string
   "All Files": string
-  "These are all files where you have access to. For exercises or exercise tests you need permission to change the exercise." : string
+
+  "These are all files from custom projects and custom exercise tests." : string
+  "These are all files from exercise tests where you have the group permission to change the exercise and the exercise is visible to all." : string
+  "These are all files from exercise descriptions where you have the group permission to change the exercise and the exercise is visible to all." : string
+
   "Note that when you detach a file and it has no connection to another exercise, it will get deleted!": string
   "Managing assets is only allowed for saved exercises (not for new exercises)": string
   "All changes to assets are applied immediately in the backend (saving is not needed for this)!": string
diff --git a/src/components/sites/doExerciseSite/customTestsPanel/dialog/customTestsDialog/changeCustomTestView.tsx b/src/components/sites/doExerciseSite/customTestsPanel/dialog/customTestsDialog/changeCustomTestView.tsx
index fe2d0f18..8b538896 100644
--- a/src/components/sites/doExerciseSite/customTestsPanel/dialog/customTestsDialog/changeCustomTestView.tsx
+++ b/src/components/sites/doExerciseSite/customTestsPanel/dialog/customTestsDialog/changeCustomTestView.tsx
@@ -243,6 +243,7 @@ class ChangeCustomTestView extends React.Component<Props, any> {
           title={getI18n(this.props.langId, "Manage asset files")}
           isDisplayed={this.props.isAddCustomTestAssetFilesModalDisplayed}
           isBusy={this.props.isAddCustomTestAssetFilesModalBusy}
+          filePreviewsListSourcesTooltip={"These are all files from custom projects and custom exercise tests."}
 
           uploadPercentage={this.props.addCustomTestAssetFilesModalUploadPercentage}
           uploadInputId={'do-exercise-custom-test-upload'}
diff --git a/src/components/sites/editCustomProjectSite/dialogs/changeTestDialog/changeTestView.tsx b/src/components/sites/editCustomProjectSite/dialogs/changeTestDialog/changeTestView.tsx
index 079aa6f8..8ffb27e3 100644
--- a/src/components/sites/editCustomProjectSite/dialogs/changeTestDialog/changeTestView.tsx
+++ b/src/components/sites/editCustomProjectSite/dialogs/changeTestDialog/changeTestView.tsx
@@ -266,6 +266,7 @@ class ChangeTestView extends React.Component<Props, any> {
             isBusy={this.props.isAddCustomProjectCustomTestAssetFilesModalBusy}
             uploadPercentage={this.props.addCustomProjectCustomTestAssetFilesModalUploadPercentage}
             uploadInputId={'custom-project-custom-test-upload'}
+            filePreviewsListSourcesTooltip={"These are all files from custom projects and custom exercise tests."}
             onUploadFile={async (file) => {
 
               this.props.setIsAddCustomProjectCustomTestAssetFilesModalDisplayed(true, true)
diff --git a/src/components/sites/editCustomProjectSite/editCustomProjectSite.tsx b/src/components/sites/editCustomProjectSite/editCustomProjectSite.tsx
index 3f083fce..03a34b97 100644
--- a/src/components/sites/editCustomProjectSite/editCustomProjectSite.tsx
+++ b/src/components/sites/editCustomProjectSite/editCustomProjectSite.tsx
@@ -319,6 +319,7 @@ class editCustomProjectSite extends React.Component<Props & RouteComponentProps<
           isBusy={this.props.isAddCustomProjectAssetFilesModalBusy}
           uploadPercentage={this.props.addCustomProjectAssetFilesModalUploadPercentage}
           uploadInputId={'custom-project-description-upload'}
+          filePreviewsListSourcesTooltip={"These are all files from custom projects and custom exercise tests."}
 
           onUploadFile={async (file) => {
 
diff --git a/src/components/sites/exerciseEditorSite/addAssetFilesModal/addAssetFilesModal.tsx b/src/components/sites/exerciseEditorSite/addAssetFilesModal/addAssetFilesModal.tsx
index a01739ce..24116f60 100644
--- a/src/components/sites/exerciseEditorSite/addAssetFilesModal/addAssetFilesModal.tsx
+++ b/src/components/sites/exerciseEditorSite/addAssetFilesModal/addAssetFilesModal.tsx
@@ -7,7 +7,7 @@ import {connect} from "react-redux";
 import {bindActionCreators, Dispatch} from "redux";
 import {returntypeof} from 'react-redux-typescript';
 import {RootState} from '../../../../state/reducers'
-import {getI18n} from '../../../../../i18n/i18nRoot'
+import {getI18n, LangObj} from '../../../../../i18n/i18nRoot'
 import {Button, Header, Icon, List, Modal} from 'semantic-ui-react'
 import {FilePreviewFromBackend} from '../../../../types/exerciseEditor'
 import {convertSizeToHumanReadableSize} from '../../../../helpers/convertersAndTransformers'
@@ -106,6 +106,12 @@ export interface MyProps {
    */
   readonly onClose: () => void
 
+  /**
+   * the tooltip for the file list where the files come from
+   * e.g only custom files or only from exercise tests...
+   */
+  readonly filePreviewsListSourcesTooltip: keyof LangObj
+
 }
 
 const mapStateToProps = (rootState: RootState, props: MyProps) => {
@@ -194,8 +200,7 @@ class addAssetFilesModal extends React.Component<Props, any> {
                                                             "All Files"
                     )} ({this.props.allAssetFilePreviews.length})</h3>
                     <HelpPopup
-                      defaultText={getI18n(this.props.langId,
-                                           "These are all files where you have access to. For exercises or exercise tests you need permission to change the exercise."
+                      defaultText={getI18n(this.props.langId, this.props.filePreviewsListSourcesTooltip
                       )}/>
                   </div>
 
diff --git a/src/components/sites/exerciseEditorSite/exerciseEditorSite.tsx b/src/components/sites/exerciseEditorSite/exerciseEditorSite.tsx
index 3cb02ac3..98a3afd0 100644
--- a/src/components/sites/exerciseEditorSite/exerciseEditorSite.tsx
+++ b/src/components/sites/exerciseEditorSite/exerciseEditorSite.tsx
@@ -289,6 +289,8 @@ class exerciseEditorSite extends React.Component<Props & RouteComponentProps<Mat
             isBusy={this.props.isAddAssetFilesModalBusy}
             uploadInputId={'exercise-description-upload'}
 
+            filePreviewsListSourcesTooltip={"These are all files from exercise descriptions where you have the group permission to change the exercise and the exercise is visible to all."}
+
             onUploadFile={async (file) => {
 
               this.props.setIsAddAssetFilesModalDisplayed(true, true)
diff --git a/src/components/sites/exerciseEditorSite/exerciseTestsPanel/dialogs/changeTestView.tsx b/src/components/sites/exerciseEditorSite/exerciseTestsPanel/dialogs/changeTestView.tsx
index 0eb6992e..6d53efa8 100644
--- a/src/components/sites/exerciseEditorSite/exerciseTestsPanel/dialogs/changeTestView.tsx
+++ b/src/components/sites/exerciseEditorSite/exerciseTestsPanel/dialogs/changeTestView.tsx
@@ -258,6 +258,8 @@ class ChangeTestView extends React.Component<Props, any> {
             uploadInputId={'exercise-test-upload'}
             uploadPercentage={this.props.addTestAssetFilesModalUploadPercentage}
 
+            filePreviewsListSourcesTooltip={"These are all files from exercise tests where you have the group permission to change the exercise and the exercise is visible to all."}
+
             onUploadFile={async (file) => {
 
               this.props.setIsAddTestAssetFilesModalDisplayed(true, true)
diff --git a/src/constants.ts b/src/constants.ts
index b3fed1f7..b3456130 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.1'
+export const versionString = '2.5.2'
 
 
 export const supportMail = 'yapex@informatik.uni-halle.de'
-- 
GitLab