Skip to content

Commit

Permalink
Merge pull request #1604 from chrissolanilla/1598/title-length-limit
Browse files Browse the repository at this point in the history
checks the length of the title before saving(base: dev/10.3.0)
  • Loading branch information
clpetersonucf authored Sep 9, 2024
2 parents 087030c + bc07c5c commit 549f736
Showing 1 changed file with 12 additions and 1 deletion.
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

0 comments on commit 549f736

Please sign in to comment.