Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checks the length of the title before saving(base: dev/10.3.0) #1604

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/components/widget-creator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,17 @@ const WidgetCreator = ({instId, widgetId, minHeight='', minWidth=''}) => {
}

const save = (instanceName, qset, version = 1) => {
//cancel saving of the widget if title is too long to prevent crashing
if(instanceName.length>100) {
setAlertDialog({
enabled: true,
title: 'Title too long', //the max length for title in my testing is 100
message: 'Title must be less than 100 characters',
fatal: false,
enableLoginButton: false
});
return false;
}
let newWidget = {
widget_id: widgetId,
name: instanceName,
Expand Down Expand Up @@ -830,4 +841,4 @@ const WidgetCreator = ({instId, widgetId, minHeight='', minWidth=''}) => {

}

export default WidgetCreator
export default WidgetCreator
Loading