Skip to content

Commit 5e02ab2

Browse files
author
pixelbyaj
committed
changes to xpath to maintain the original name
1 parent 65df4bd commit 5e02ab2

File tree

8 files changed

+19
-177
lines changed

8 files changed

+19
-177
lines changed

projects/ngx-iso-app/src/app/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class AppComponent implements OnInit {
2020
jsonSchema = {
2121
camt: [
2222
{ id: 'camt.052.001.11', activated: false },
23-
{ id: 'camt.053.001.11', activated: false },
23+
{ id: 'camt.053.001.10', activated: false },
2424
{ id: 'camt.054.001.11', activated: false }],
2525
pacs: [
2626
{ id: 'pacs.002.001.12', activated: false },

projects/ngx-iso-app/src/app/app.module.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import { MatListModule } from '@angular/material/list';
1010
import { RouterModule } from '@angular/router';
1111
import { MatIconModule } from '@angular/material/icon';
1212
import { MatButtonModule } from '@angular/material/button';
13-
//import { NgxIsoFormModule } from 'projects/ngx-iso-form/src/public-api';
14-
import { NgxIsoFormModule } from 'ngx-iso-form';
13+
import { NgxIsoFormModule } from 'projects/ngx-iso-form/src/public-api';
14+
//import { NgxIsoFormModule } from 'ngx-iso-form';
1515
import { ReadonlyComponent } from './readonly.component';
1616
import { IsoComponent } from './component/iso.component';
1717
import { MatFormFieldModule } from '@angular/material/form-field';
@@ -43,7 +43,7 @@ export function HttpLoaderFactory(http: HttpClient) {
4343
MatFormFieldModule,
4444
MatInputModule,
4545
RouterModule.forRoot([
46-
{ path: '**', component: ReadonlyComponent }
46+
{ path: '**', component: IsoComponent }
4747
], { useHash: true }),
4848
TranslateModule.forRoot({
4949
defaultLanguage: 'en',

projects/ngx-iso-app/src/app/component/iso.component.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
</mat-nav-list>
3535
</as-split-area>
3636
<as-split-area [size]="75">
37+
<textarea [(ngModel)]="formData"></textarea>
38+
<button (click)="getForm()">Get Form Data</button>
39+
<button (click)="initForm()">Show the form</button>
3740
<h3>{{selectedSchema}}</h3>
3841
<ngx-iso-form [schema]="schema" [form]="form"></ngx-iso-form>
3942
</as-split-area>

projects/ngx-iso-app/src/app/component/iso.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ export class IsoComponent implements OnInit {
1717
form: IsoForm;
1818
schema: SchemaElement;
1919
selectedSchema: string;
20+
formData:string;
2021
jsonSchema = {
2122
camt: [
2223
{ id: 'camt.052.001.11', activated: false },
23-
{ id: 'camt.053.001.11', activated: false },
24+
{ id: 'camt.053.001.10', activated: false },
2425
{ id: 'camt.054.001.11', activated: false }],
2526
pacs: [
2627
{ id: 'pacs.002.001.12', activated: false },
@@ -73,9 +74,12 @@ export class IsoComponent implements OnInit {
7374
});
7475
}
7576
}
77+
initForm(){
78+
this.form = new IsoForm(JSON.parse(this.formData));
79+
}
7680
getForm() {
7781
const data = this.form.getFormModel();
78-
console.log(JSON.stringify(data));
82+
this.formData = JSON.stringify(data)
7983
}
8084

8185
}

projects/ngx-iso-app/src/assets/iso20022/camt.053.001.10.json

Lines changed: 1 addition & 165 deletions
Large diffs are not rendered by default.

projects/ngx-iso-form/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ Please declare all your translation rules under 'iso' object.
129129
"GrpHdr":{
130130
"label": "Group Header"
131131
},
132-
"document_bktocstmrstmt_grphdr_credttm": {
132+
"Document_BkToCstmrStmt_GrpHdr_CreDtTm": {
133133
"label": "Create Datetime",
134134
"general":{
135135
"format":"YYYY-MM-DDThh:mm:ss.sss+/-"

projects/ngx-iso-form/src/lib/ngx-iso-form.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ export class NgxIsoFormComponent implements OnChanges {
197197
}
198198

199199
protected getFormControl(node: SchemaModel): FormControl {
200-
debugger
201200
return this.service.getFormControl('');
202201
}
203202

projects/ngx-iso-form/src/lib/ngx-iso-form.service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,17 +281,17 @@ export class NgxIsoService {
281281
const ccy = structuredClone(item);
282282
const amt = structuredClone(item);
283283

284-
ccy.id = `${ccy.id}_ccy`;
284+
ccy.id = `${ccy.id}_Ccy`;
285285
ccy.name = 'Ccy';
286286
ccy.fractionDigits = '';
287287
ccy.totalDigits = '';
288288
ccy.maxLength = '3';
289-
ccy.xpath = `${ccy.xpath}@ccy`;
289+
ccy.xpath = `${ccy.xpath}@Ccy`;
290290
ccy.isCurrency = false;
291291
elements.push(ccy);
292292

293-
amt.id = `${amt.id}_amt`;
294-
amt.xpath = `${amt.xpath}/amt`;
293+
amt.id = `${amt.id}_Amt`;
294+
amt.xpath = `${amt.xpath}/Amt`;
295295
amt.isCurrency = false;
296296
amt.pattern = '';
297297
elements.push(amt);

0 commit comments

Comments
 (0)