Skip to content

Commit ef0a011

Browse files
authored
Feat(Data Mapper): Able to connect 'if' and 'for' connections with duplicate keys (#6552)
* switching contexts * quick fix for repeat problem * semi-working soluiton * prevent empty arr * working tests * more test fixes * starting deserialization * temp disable deser changes for vsix build * some deserialization works, added standalone * simple test cases work * if works * temp disable for build * test improvements * fixed tests * fixed broken v1 test
1 parent 4de69c2 commit ef0a011

File tree

22 files changed

+2688
-223
lines changed

22 files changed

+2688
-223
lines changed

apps/Standalone/src/dataMapperV1/components/DevToolbox.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { comprehensiveMapDefinition, fullTranscriptMapDefinitionString, transcriptJsonMapDefinitionString } from '../mapDefinitions';
1+
import { comprehensiveMapDefinition, fullTranscriptMapDefinitionString, transcriptJsonMapDefinitionString, x12MapDefinitionString } from '../mapDefinitions';
22
import { testMetadata } from '../mapMetadata';
33
import { LoadingMethod, dataMapDataLoaderSlice, loadDataMap } from '../state/DataMapDataLoader';
44
import { loadSourceSchema, loadTargetSchema, schemaDataLoaderSlice } from '../state/SchemaDataLoader';
@@ -42,7 +42,11 @@ const mapDefinitionDropdownOptions: MapDefDropdownOption[] = [
4242
key: 'jsonTranscriptMapDefinition',
4343
text: 'JSON Transcript',
4444
data: { mapDefinitionString: transcriptJsonMapDefinitionString, associatedSchemaIdx: 3 },
45-
},
45+
},{
46+
key: 'x12MapDefinition',
47+
text: 'X12',
48+
data: { mapDefinitionString: x12MapDefinitionString, associatedSchemaIdx: 5 },
49+
}
4650
];
4751

4852
interface SchemaFileData {
@@ -55,13 +59,15 @@ const sourceSchemaFileOptions: SchemaFileData[] = [
5559
{ filename: 'ComprehensiveSourceSchema.json', schemaFormat: SchemaFileFormat.XML },
5660
{ filename: 'SourceSchemaJson.json', schemaFormat: SchemaFileFormat.JSON },
5761
{ filename: 'ProjectRequest.json', schemaFormat: SchemaFileFormat.XML },
62+
{ filename: 'x12.json', schemaFormat: SchemaFileFormat.XML },
5863
];
5964
const targetSchemaFileOptions: SchemaFileData[] = [
6065
{ filename: 'PlaygroundTargetSchema.json', schemaFormat: SchemaFileFormat.XML },
6166
{ filename: 'TargetSchema.json', schemaFormat: SchemaFileFormat.XML },
6267
{ filename: 'ComprehensiveTargetSchema.json', schemaFormat: SchemaFileFormat.XML },
6368
{ filename: 'TargetSchemaJson.json', schemaFormat: SchemaFileFormat.JSON },
6469
{ filename: 'OebsProjectRequest.json', schemaFormat: SchemaFileFormat.XML },
70+
{ filename: 'x12.json', schemaFormat: SchemaFileFormat.XML },
6571
];
6672
const mapSchemaFileOptionsToDropdownOptions = (schemaFileData: SchemaFileData[]) =>
6773
schemaFileData.map<IDropdownOption>((schemaOpt) => ({
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
export const x12MapDefinitionString = `
2+
$version: 1
3+
$input: XML
4+
$output: XML
5+
$sourceSchema: X12_00401_856 Custom2.xsd
6+
$targetSchema: X12_00401_856 Custom2.xsd
7+
$sourceNamespaces:
8+
btsedi: http://schemas.microsoft.com/BizTalk/2005/EdiSchemaEditorExtension
9+
b: http://schemas.microsoft.com/BizTalk/2003
10+
ns0: http://schemas.microsoft.com/BizTalk/EDI/X12/2006
11+
xs: http://www.w3.org/2001/XMLSchema
12+
$targetNamespaces:
13+
btsedi: http://schemas.microsoft.com/BizTalk/2005/EdiSchemaEditorExtension
14+
b: http://schemas.microsoft.com/BizTalk/2003
15+
ns0: http://schemas.microsoft.com/BizTalk/EDI/X12/2006
16+
xs: http://www.w3.org/2001/XMLSchema
17+
ns0:X12_00401_856:
18+
ST:
19+
ST01: /ns0:X12_00401_856/ST/ST01
20+
ST02: /ns0:X12_00401_856/ST/ST02
21+
$for(/ns0:X12_00401_856/ns0:HL-SLoop):
22+
ns0:HL-SLoop:
23+
$for(ns0:HL):
24+
ns0:HL:
25+
HL01: HL01
26+
$for(ns0:HL):
27+
ns0:TD1:
28+
TD101: HL01`
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export * from './FullTranscriptMapDefinition';
22
export * from './ComprehensiveMapDefinition';
33
export * from './TranscriptJsonMapDefinition';
4+
export * from './X12Definition'

apps/Standalone/src/dataMapperV1/schemas/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ export { default as playgroundTargetSchema } from './PlaygroundTargetSchema.json
99
export { default as deepNestedSequenceAndObject } from './DeepNestedSequenceAndObj.json';
1010
export { default as projectRequest } from './ProjectRequest.json';
1111
export { default as oebsProjectRequest } from './OebsProjectRequest.json';
12+
export { default as x12 } from './x12.json';

0 commit comments

Comments
 (0)