From 1ca60312019a11b46cd742046b03687da3c44f1e Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Tue, 4 Jun 2019 11:56:53 +0300 Subject: [PATCH 1/4] =?UTF-8?q?change=20>=3D=20to=20=E2=89=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StudyProgramme/ThroughputTable/index.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/services/oodikone2-frontend/src/components/StudyProgramme/ThroughputTable/index.jsx b/services/oodikone2-frontend/src/components/StudyProgramme/ThroughputTable/index.jsx index 46f4a9af4b..e1ebf005be 100644 --- a/services/oodikone2-frontend/src/components/StudyProgramme/ThroughputTable/index.jsx +++ b/services/oodikone2-frontend/src/components/StudyProgramme/ThroughputTable/index.jsx @@ -89,11 +89,11 @@ const ThroughputTable = ({ history, throughput, thesis, loading, error, studypro Graduated overall Graduated in time {renderCountries ? countries.map(country => ) : null} - - - - - + + + + + {thesisTypes.includes('MASTER') && ( )} From 4491bd52254a3a8f7d3aeb24b3a8a13fc83c9d45 Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Tue, 4 Jun 2019 12:16:16 +0300 Subject: [PATCH 2/4] Fix sorting, make sure prop types prevent sort errors in future --- .../oodikone2-frontend/src/components/SortableTable/index.jsx | 2 +- .../StudyProgramme/StudyProgrammeSelector/index.jsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/services/oodikone2-frontend/src/components/SortableTable/index.jsx b/services/oodikone2-frontend/src/components/SortableTable/index.jsx index 315f2552cc..cbd5becebf 100644 --- a/services/oodikone2-frontend/src/components/SortableTable/index.jsx +++ b/services/oodikone2-frontend/src/components/SortableTable/index.jsx @@ -100,7 +100,7 @@ SortableTable.propTypes = { key: string, title: oneOfType([element, string]), headerProps: shape({}), - getRowVal: func, + getRowVal: func.isRequired, getRowContent: func, getCellProps: func, cellProps: shape({}), diff --git a/services/oodikone2-frontend/src/components/StudyProgramme/StudyProgrammeSelector/index.jsx b/services/oodikone2-frontend/src/components/StudyProgramme/StudyProgrammeSelector/index.jsx index 919150de19..a7e4aeed2b 100644 --- a/services/oodikone2-frontend/src/components/StudyProgramme/StudyProgrammeSelector/index.jsx +++ b/services/oodikone2-frontend/src/components/StudyProgramme/StudyProgrammeSelector/index.jsx @@ -34,12 +34,12 @@ class StudyProgrammeSelector extends Component { { key: 'name', title: 'name', - getRowContent: prog => getTextIn(prog.name, language) + getRowVal: prog => getTextIn(prog.name, language) }, { key: 'code', title: 'code', - getRowContent: prog => prog.code + getRowVal: prog => prog.code } ] if (studyprogrammes == null) { From c310ccc5c4d1eb42f3204cff575bbf0f444b3335 Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Tue, 4 Jun 2019 12:27:17 +0300 Subject: [PATCH 3/4] Fix student search sometimes not finding anything --- services/oodikone2-frontend/src/redux/students.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/oodikone2-frontend/src/redux/students.js b/services/oodikone2-frontend/src/redux/students.js index 68f86b2269..13a91dc6a3 100644 --- a/services/oodikone2-frontend/src/redux/students.js +++ b/services/oodikone2-frontend/src/redux/students.js @@ -39,6 +39,7 @@ const reducer = (state = { data: [] }, action) => { pending: false, error: true, selected: state.selected, + lastSearch: state.lastSearch, data: state.data } case 'FIND_STUDENTS_SUCCESS': @@ -46,6 +47,7 @@ const reducer = (state = { data: [] }, action) => { pending: false, error: false, selected: state.selected, + lastSearch: state.lastSearch, data: state.lastSearch === action.query ? [...state.data.filter(student => student.fetched), ...action.response] : state.data @@ -55,6 +57,7 @@ const reducer = (state = { data: [] }, action) => { pending: false, error: false, selected: action.response.studentNumber, + lastSearch: state.lastSearch, data: [...state.data.filter(student => student.studentNumber !== action.response.studentNumber), { ...action.response, ...{ fetched: true } } From 9c2a27047575685057ac61dbaa3d8a6cbac8a41b Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Tue, 4 Jun 2019 13:53:02 +0300 Subject: [PATCH 4/4] Require key in sortabletable props --- .../oodikone2-frontend/src/components/SortableTable/index.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/oodikone2-frontend/src/components/SortableTable/index.jsx b/services/oodikone2-frontend/src/components/SortableTable/index.jsx index cbd5becebf..8523c50e9f 100644 --- a/services/oodikone2-frontend/src/components/SortableTable/index.jsx +++ b/services/oodikone2-frontend/src/components/SortableTable/index.jsx @@ -97,10 +97,10 @@ SortableTable.propTypes = { getRowKey: func.isRequired, getRowProps: func, columns: arrayOf(shape({ - key: string, + key: string.isRequired, title: oneOfType([element, string]), headerProps: shape({}), - getRowVal: func.isRequired, + getRowVal: func, getRowContent: func, getCellProps: func, cellProps: shape({}),