Skip to content

Commit e90c7da

Browse files
committed
Changing the number field to have comma as separator.
1 parent f02ac4d commit e90c7da

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

eform-client/src/app/modules/cases/components/case-edit/case-edit.component.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,14 @@ export class CaseEditComponent implements OnInit, OnDestroy {
6969
}
7070

7171
loadCase() {
72-
if (!this.id || this.id == 0) {
72+
if (!this.id || this.id === 0) {
7373
return;
7474
}
7575
this.casesService.getById(this.id, this.currentTemplate.id).subscribe(operation => {
7676
if (operation && operation.success) {
7777
this.replyElement = operation.model;
7878
}
79+
this.spinnerStatus = false;
7980
});
8081
}
8182

@@ -111,7 +112,7 @@ export class CaseEditComponent implements OnInit, OnDestroy {
111112
this.loadEformPermissions(this.currentTemplate.id);
112113
this.loadCase();
113114
}
114-
this.spinnerStatus = false;
115+
// this.spinnerStatus = false; // This is commented as loadCase is in 99% of the time the slowest
115116
});
116117
}
117118
}
@@ -155,11 +156,11 @@ export class CaseEditComponent implements OnInit, OnDestroy {
155156
this.spinnerStatus = true;
156157
this.securityGroupEformsService.getEformsSimplePermissions().subscribe((data => {
157158
if (data && data.success) {
158-
let foundTemplates = this.securityGroupEformsService.mapEformsSimplePermissions(data.model);
159+
const foundTemplates = this.securityGroupEformsService.mapEformsSimplePermissions(data.model);
159160
if (foundTemplates.length) {
160161
this.eformPermissionsSimpleModel = foundTemplates.find(x => x.templateId == templateId);
161162
}
162-
this.spinnerStatus = false;
163+
// this.spinnerStatus = false; // This is commented as loadCase is in 99% of the time the slowest
163164
}
164165
}));
165166
}

eform-client/src/app/modules/cases/components/case-elements/element-number/element-number.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export class ElementNumberComponent {
1616

1717
set fieldValue(val) {
1818
this.fieldValueObj = val;
19+
this.fieldValueObj.value = val.value.replace('.', ',');
1920
}
2021

2122
constructor() {
@@ -24,7 +25,7 @@ export class ElementNumberComponent {
2425

2526
validateInput(e): boolean {
2627
const value = e.target.value + String.fromCharCode(e.keyCode);
27-
const rgx = /^(\d+\.?(?:\d+\.|\d*)+)$/;
28+
const rgx = /^(\d+,?(?:\d+,|\d*)+)$/;
2829
return !!value.match(rgx);
2930
}
3031
}

0 commit comments

Comments
 (0)