-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update interface to include sub form prop (#477)
* add property for allowing a datatype to be used in a sub form * migration changes * fix test issue * Revert "migration changes" This reverts commit 5ca3c75.
- Loading branch information
Showing
5 changed files
with
134 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
test/Altinn.Platform.Storage.Interface.Tests/AllowInSubform/AllowInSubformTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System.Linq; | ||
using Altinn.Platform.Storage.Interface.Models; | ||
using FluentAssertions; | ||
using Xunit; | ||
|
||
namespace Altinn.Platform.Storage.Interface.Tests.AllowInSubform; | ||
|
||
public class AllowInSubformTests | ||
{ | ||
[Fact] | ||
public void MetadataWithoutShadowFields_ShouldBeFalse() | ||
{ | ||
Application applicationBefore = TestdataHelper.LoadDataFromEmbeddedResourceAsType<Application>("AllowInSubform.applicationMetadata_beforeChange.json"); | ||
|
||
applicationBefore.DataTypes.First(d => d.Id == "Veileder").AppLogic.AllowInSubform.Should().BeFalse(); | ||
} | ||
|
||
[Fact] | ||
public void MetadataWithShadowFields_ShouldBeTrue() | ||
{ | ||
Application applicationBefore = TestdataHelper.LoadDataFromEmbeddedResourceAsType<Application>("AllowInSubform.applicationMetadata_afterChange.json"); | ||
|
||
applicationBefore.DataTypes.First(d => d.Id == "Veileder").AppLogic.AllowInSubform.Should().BeTrue(); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
...tinn.Platform.Storage.Interface.Tests/AllowInSubform/applicationMetadata_afterChange.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"id": "ttd/anonymous-stateless", | ||
"org": "ttd", | ||
"title": { | ||
"nb": "anonymous-stateless", | ||
"en": "Oppstart av bedrift" | ||
}, | ||
"dataTypes": [ | ||
{ | ||
"id": "ref-data-as-pdf", | ||
"allowedContentTypes": [ | ||
"application/pdf" | ||
], | ||
"maxCount": 0, | ||
"minCount": 0, | ||
"enablePdfCreation": true | ||
}, | ||
{ | ||
"id": "Veileder", | ||
"allowedContentTypes": [ | ||
"application/xml" | ||
], | ||
"appLogic": { | ||
"autoCreate": true, | ||
"classRef": "Altinn.App.Models.StarteBedrift", | ||
"allowUserCreate": true, | ||
"allowUserDelete": true, | ||
"allowInSubform": true | ||
}, | ||
"taskId": "Task_1", | ||
"maxCount": 1, | ||
"minCount": 1, | ||
"enablePdfCreation": true | ||
} | ||
], | ||
"onEntry": { | ||
"show": "stateless" | ||
}, | ||
"partyTypesAllowed": { | ||
"bankruptcyEstate": false, | ||
"organisation": false, | ||
"person": false, | ||
"subUnit": false | ||
}, | ||
"autoDeleteOnProcessEnd": false, | ||
"created": "2022-04-27T08:00:46.5336752Z", | ||
"createdBy": "Ronny", | ||
"lastChanged": "2022-04-27T08:00:46.533678Z", | ||
"lastChangedBy": "Ronny" | ||
} |
49 changes: 49 additions & 0 deletions
49
...inn.Platform.Storage.Interface.Tests/AllowInSubform/applicationMetadata_beforeChange.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"id": "ttd/anonymous-stateless", | ||
"org": "ttd", | ||
"title": { | ||
"nb": "anonymous-stateless", | ||
"en": "Oppstart av bedrift" | ||
}, | ||
"dataTypes": [ | ||
{ | ||
"id": "ref-data-as-pdf", | ||
"allowedContentTypes": [ | ||
"application/pdf" | ||
], | ||
"maxCount": 0, | ||
"minCount": 0, | ||
"enablePdfCreation": true | ||
}, | ||
{ | ||
"id": "Veileder", | ||
"allowedContentTypes": [ | ||
"application/xml" | ||
], | ||
"appLogic": { | ||
"autoCreate": true, | ||
"classRef": "Altinn.App.Models.StarteBedrift", | ||
"allowUserCreate": true, | ||
"allowUserDelete": true | ||
}, | ||
"taskId": "Task_1", | ||
"maxCount": 1, | ||
"minCount": 1, | ||
"enablePdfCreation": true | ||
} | ||
], | ||
"onEntry": { | ||
"show": "stateless" | ||
}, | ||
"partyTypesAllowed": { | ||
"bankruptcyEstate": false, | ||
"organisation": false, | ||
"person": false, | ||
"subUnit": false | ||
}, | ||
"autoDeleteOnProcessEnd": false, | ||
"created": "2022-04-27T08:00:46.5336752Z", | ||
"createdBy": "Ronny", | ||
"lastChanged": "2022-04-27T08:00:46.533678Z", | ||
"lastChangedBy": "Ronny" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters