Browse Source

Merge branch 'feature/bulk-import/device-credentials' of https://github.com/vvlladd28/thingsboard into feature/bulk-import/device-credentials

pull/5023/head
Viacheslav Klimov 5 years ago
parent
commit
78cc97d96b
  1. 2
      application/src/main/java/org/thingsboard/server/utils/TypeCastUtil.java
  2. 5
      ui-ngx/src/app/modules/home/components/import-export/import-dialog-csv.component.ts

2
application/src/main/java/org/thingsboard/server/utils/TypeCastUtil.java

@ -45,7 +45,7 @@ public class TypeCastUtil {
}
private static boolean isNumber(String value) {
return NumberUtils.isParsable(value.replace(',', '.'));
return NumberUtils.isNumber(value.replace(',', '.'));
}
private static boolean isSimpleDouble(String valueAsString) {

5
ui-ngx/src/app/modules/home/components/import-export/import-dialog-csv.component.ts

@ -247,11 +247,11 @@ export class ImportDialogCsvComponent extends DialogComponent<ImportDialogCsvCom
initEditor() {
if (!this.initEditorComponent) {
this.createEditor(this.failureDetailsEditorElmRef, this.statistical.errorsList.join('\n'));
this.createEditor(this.failureDetailsEditorElmRef, this.statistical.errorsList);
}
}
private createEditor(editorElementRef: ElementRef, content: string): void {
private createEditor(editorElementRef: ElementRef, contents: string[]): void {
const editorElement = editorElementRef.nativeElement;
let editorOptions: Partial<Ace.EditorOptions> = {
mode: 'ace/mode/java',
@ -268,6 +268,7 @@ export class ImportDialogCsvComponent extends DialogComponent<ImportDialogCsvCom
};
editorOptions = {...editorOptions, ...advancedOptions};
const content = contents.map(error => error.replace('\n', '')).join('\n');
getAce().subscribe(
(ace) => {
const editor = ace.edit(editorElement, editorOptions);

Loading…
Cancel
Save