Skip to content

Commit

Permalink
Fixed issue: Proper error message when you save a question with wrong…
Browse files Browse the repository at this point in the history
… code
  • Loading branch information
lime-marc committed Jan 9, 2020
1 parent 6fd8cee commit 897cdf8
Show file tree
Hide file tree
Showing 7 changed files with 2,594 additions and 2,592 deletions.
2 changes: 1 addition & 1 deletion assets/packages/questioneditor/build.min/css/main.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions assets/packages/questioneditor/build.min/js/questionedit.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

5,165 changes: 2,583 additions & 2,582 deletions assets/packages/questioneditor/build/js/questionedit.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/packages/questioneditor/src/App.vue
Expand Up @@ -388,7 +388,7 @@ export default {
this.loading = false;
this.$log.error(rejected);
if(rejected.data != undefined) {
window.LS.notifyFader(rejected.data.message, 'well-lg bg-danger text-center', {timeout: 5500});
window.LS.notifyFader(rejected.data.message, 'well-lg bg-danger text-center', undefined, {timeout: 5500});
}
}
)
Expand Down
5 changes: 3 additions & 2 deletions assets/packages/questioneditor/src/storage/getters.js
Expand Up @@ -25,8 +25,9 @@ export default {

hasTitleSet: (state) => {
const isNotEmpty = !isEmpty(state.currentQuestion.title);
const startingWithALetter = /[a-zA-Z]/.test(state.currentQuestion.title.substring(0,1));
return isNotEmpty && startingWithALetter;
const startingWithALetter = /^[a-z]/i.test(state.currentQuestion.title);
const onlyLettersAndNumbers = /^[a-z0-9]+$/i.test(state.currentQuestion.title);
return isNotEmpty && startingWithALetter && onlyLettersAndNumbers;
},
hasIndividualSubquestionTitles: (state) => {
return reduce(
Expand Down

0 comments on commit 897cdf8

Please sign in to comment.