File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
services/static-webserver/client/source/class/osparc Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -1169,7 +1169,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
11691169 __newStudyBtnClicked : function ( button ) {
11701170 button . setValue ( false ) ;
11711171 const minStudyData = osparc . data . model . Study . createMinStudyObject ( ) ;
1172- const title = osparc . utils . Utils . getUniqueStudyName ( minStudyData . name , this . _resourcesList ) ;
1172+ const title = osparc . utils . Utils . getUniqueName ( minStudyData . name , this . _resourcesList ) ;
11731173 minStudyData [ "name" ] = title ;
11741174 minStudyData [ "workspaceId" ] = this . getCurrentWorkspaceId ( ) ;
11751175 minStudyData [ "folderId" ] = this . getCurrentFolderId ( ) ;
@@ -1189,7 +1189,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
11891189 __newPlanBtnClicked : function ( templateData , newStudyName ) {
11901190 // do not override cached template data
11911191 const templateCopyData = osparc . utils . Utils . deepCloneObject ( templateData ) ;
1192- const title = osparc . utils . Utils . getUniqueStudyName ( newStudyName , this . _resourcesList ) ;
1192+ const title = osparc . utils . Utils . getUniqueName ( newStudyName , this . _resourcesList ) ;
11931193 templateCopyData . name = title ;
11941194 this . _showLoadingPage ( this . tr ( "Creating " ) + ( newStudyName || osparc . product . Utils . getStudyAlias ( ) ) ) ;
11951195 const contextProps = {
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ qx.Class.define("osparc.study.Utils", {
116116 newStudyLabel = metadata [ "name" ] ;
117117 }
118118 if ( existingStudies ) {
119- const title = osparc . utils . Utils . getUniqueStudyName ( newStudyLabel , existingStudies ) ;
119+ const title = osparc . utils . Utils . getUniqueName ( newStudyLabel , existingStudies ) ;
120120 minStudyData [ "name" ] = title ;
121121 } else {
122122 minStudyData [ "name" ] = newStudyLabel ;
Original file line number Diff line number Diff line change @@ -277,9 +277,9 @@ qx.Class.define("osparc.utils.Utils", {
277277 return reloadButton ;
278278 } ,
279279
280- getUniqueStudyName : function ( preferredName , list ) {
280+ getUniqueName : function ( preferredName , list , key = "name" ) {
281281 let title = preferredName ;
282- const existingTitles = list . map ( study => study . name ) ;
282+ const existingTitles = list . map ( study => study [ key ] ) ;
283283 if ( existingTitles . includes ( title ) ) {
284284 let cont = 1 ;
285285 while ( existingTitles . includes ( `${ title } (${ cont } )` ) ) {
You can’t perform that action at this time.
0 commit comments