Skip to content

Commit

Permalink
#260 Add Support for Arrays on Page Extensions (#261)
Browse files Browse the repository at this point in the history
* #260 Add Support for Arrays on Page Extensions

* remove spaces
  • Loading branch information
pri-kise authored Dec 20, 2022
1 parent 21375f1 commit 04bf557
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/NAVObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ class NAVPageField {
private _suffix: string;

public static fieldRegEx(): RegExp {
return /.*(field\( *"?([ a-zA-Z0-9._/&%\/()-]+)"? *; *([" a-zA-Z0-9._/&%\/()-]+) *\))/g;
return /.*(field\( *"?([ a-zA-Z0-9._/&%\/()-]+)"? *; *([" a-zA-Z0-9._/&%\/()-]+(\[([1-9]\d*)\])?) *\))/g;
}

get nameFixed(): string {
Expand Down
4 changes: 2 additions & 2 deletions src/test/suite/NAVObject.PrefexAndSuffix.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ suite("NAVObject ObjectNamePrefix Tests", () => {
let navObject = new NAVObject(navTestObject.ObjectText, testSettings, navTestObject.ObjectFileName)

assert.strictEqual(navObject.pageGroups.length, 2);
assert.strictEqual(navObject.pageFields.length, 3);
assert.strictEqual(navObject.pageFields.length, 5);
navObject.pageFields.forEach(field => {
assert.strictEqual(field.nameFixed.startsWith(testSettings[Settings.ObjectNamePrefix]), true)
})
Expand All @@ -128,7 +128,7 @@ suite("NAVObject ObjectNamePrefix Tests", () => {
let navObject = new NAVObject(navTestObject.ObjectText, testSettings, navTestObject.ObjectFileName)

assert.strictEqual(navObject.pageGroups.length, 2);
assert.strictEqual(navObject.pageFields.length, 3);
assert.strictEqual(navObject.pageFields.length, 5);
navObject.pageFields.forEach(field => {
assert.strictEqual(field.nameFixed.endsWith(testSettings[Settings.ObjectNameSuffix]), true)
})
Expand Down
28 changes: 28 additions & 0 deletions src/test/suite/NAVTestObjectLibrary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,34 @@ export function getPageExtensionWrongFileNameWithActions(): NAVTestObject {
{
ApplicationArea = All;
}
field(ShortcutDimCode3; ShortcutDimCode[3])
{
ApplicationArea = Dimensions;
CaptionClass = '1,2,3';
TableRelation = "Dimension Value".Code WHERE("Global Dimension No." = CONST(3),
"Dimension Value Type" = CONST(Standard),
Blocked = CONST(false));
Visible = DimVisible3;
trigger OnValidate()
begin
ValidateShortcutDimension(3);
end;
}
field(ShortcutDimCode4; ShortcutDimCode[4])
{
ApplicationArea = Dimensions;
CaptionClass = '1,2,4';
TableRelation = "Dimension Value".Code WHERE("Global Dimension No." = CONST(4),
"Dimension Value Type" = CONST(Standard),
Blocked = CONST(false));
Visible = DimVisible4;
trigger OnValidate()
begin
ValidateShortcutDimension(4);
end;
}
}
}
}
Expand Down

0 comments on commit 04bf557

Please sign in to comment.