|
|
@ -80,6 +80,11 @@ async function reuseOrSave( |
|
|
|
return res; |
|
|
|
return res; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const nc_sanitizeName = (name) => { |
|
|
|
|
|
|
|
// replace all special characters by _
|
|
|
|
|
|
|
|
return name.replace(/\W+/g, '_').trim(); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
@Injectable() |
|
|
|
@Injectable() |
|
|
|
export class ColumnsService { |
|
|
|
export class ColumnsService { |
|
|
|
constructor( |
|
|
|
constructor( |
|
|
@ -127,6 +132,10 @@ export class ColumnsService { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isVirtualCol(param.column)) { |
|
|
|
|
|
|
|
param.column.column_name = nc_sanitizeName(param.column.column_name); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ( |
|
|
|
if ( |
|
|
|
!isVirtualCol(param.column) && |
|
|
|
!isVirtualCol(param.column) && |
|
|
|
!(await Column.checkTitleAvailable({ |
|
|
|
!(await Column.checkTitleAvailable({ |
|
|
@ -1045,6 +1054,10 @@ export class ColumnsService { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isVirtualCol(param.column)) { |
|
|
|
|
|
|
|
param.column.column_name = nc_sanitizeName(param.column.column_name); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ( |
|
|
|
if ( |
|
|
|
!isVirtualCol(param.column) && |
|
|
|
!isVirtualCol(param.column) && |
|
|
|
!(await Column.checkTitleAvailable({ |
|
|
|
!(await Column.checkTitleAvailable({ |
|
|
|