diff --git a/src/App/App.csproj b/src/App/App.csproj index 3f8cf8a4..be117de3 100644 --- a/src/App/App.csproj +++ b/src/App/App.csproj @@ -1,25 +1,21 @@ - - + - net6.0 - Altinn.App + net8.0 + Altinn.Application Altinn.App - - + lib\$(TargetFramework)\*.xml - - - + + + - - - + + - Always @@ -31,16 +27,14 @@ PreserveNewest - true - $(NoWarn);1591 + $(NoWarn);1591;1998 - - + - + diff --git a/src/App/AppRef.csproj b/src/App/AppRef.csproj deleted file mode 100644 index 7df117f3..00000000 --- a/src/App/AppRef.csproj +++ /dev/null @@ -1,46 +0,0 @@ - - - - net6.0 - Altinn.App - Altinn.App - - - - - lib\$(TargetFramework)\*.xml - - - - - - - - true - $(NoWarn);1591 - - - - - - - - - PreserveNewest - - - - - - PreserveNewest - - - PreserveNewest - - - - - - - - diff --git a/src/App/Program.cs b/src/App/Program.cs index bdd51632..8291054c 100644 --- a/src/App/Program.cs +++ b/src/App/Program.cs @@ -52,12 +52,7 @@ void ConfigureWebHostBuilder(IWebHostBuilder builder) } void Configure() -{ - if (app.Environment.IsDevelopment()) { - app.UseDeveloperExceptionPage(); - } - string applicationId = StartupHelper.GetApplicationId(); if (!string.IsNullOrEmpty(applicationId)) { @@ -69,16 +64,5 @@ void Configure() c.RoutePrefix = applicationId + "/swagger"; }); } - - app.UseDefaultSecurityHeaders(); - app.UseRouting(); - app.UseStaticFiles('/' + applicationId); - app.UseAuthentication(); - app.UseAuthorization(); - - app.UseEndpoints(endpoints => - { - endpoints.MapControllers(); - }); - app.UseHealthChecks("/health"); + app.UseAltinnAppCommonConfiguration(); } diff --git a/src/App/appsettings.Development.json b/src/App/appsettings.Development.json index e2519ca0..9d451f53 100644 --- a/src/App/appsettings.Development.json +++ b/src/App/appsettings.Development.json @@ -9,4 +9,4 @@ "Microsoft": "Information" } } -} +} \ No newline at end of file diff --git a/src/App/appsettings.Production.json b/src/App/appsettings.Production.json index 8f1fee6d..df7dbf2a 100644 --- a/src/App/appsettings.Production.json +++ b/src/App/appsettings.Production.json @@ -2,4 +2,4 @@ "ExampleSection": { "ExampleValue": "The values in this file will overwrite values from the appsettings.json file if the current environment is Production." } -} +} \ No newline at end of file diff --git a/src/App/appsettings.Staging.json b/src/App/appsettings.Staging.json index 6669782c..f1dc68c4 100644 --- a/src/App/appsettings.Staging.json +++ b/src/App/appsettings.Staging.json @@ -2,4 +2,4 @@ "ExampleSection": { "ExampleValue": "The values in this file will overwrite values from the appsettings.json file if the current environment is Staging (TT02)." } -} +} \ No newline at end of file diff --git a/src/App/appsettings.json b/src/App/appsettings.json index 77c3b7ee..185a1abb 100644 --- a/src/App/appsettings.json +++ b/src/App/appsettings.json @@ -9,7 +9,7 @@ "AppSettings": { "OpenIdWellKnownEndpoint": "http://localhost:5101/authentication/api/v1/openid/", "RuntimeCookieName": "AltinnStudioRuntime", - "RegisterEventsWithEventsComponent": false + "RegisterEventsWithEventsComponent": false }, "GeneralSettings": { "HostName": "local.altinn.cloud", @@ -30,4 +30,4 @@ "ApplicationInsights": { "InstrumentationKey": "retrieved from environment at runtime" } -} +} \ No newline at end of file diff --git a/src/App/config/applicationmetadata.json b/src/App/config/applicationmetadata.json index 6c2b5dad..3e9c453f 100644 --- a/src/App/config/applicationmetadata.json +++ b/src/App/config/applicationmetadata.json @@ -1,22 +1,37 @@ { - "$schema": "https://altinncdn.no/schemas/json/application/application-metadata.schema.v1.json", + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/application/application-metadata.schema.v1.json", "id": "tdd/bestilling", "org": "tdd", - "created": "2019-09-16T22:22:22", - "createdBy": "username", "title": { "nb": "Bestillingseksempelapp" }, "dataTypes": [ { - "id": "vedlegg", - "allowedContentTypes": [ "application/pdf", "image/png", "image/jpeg" ], + "id": "ref-data-as-pdf", + "allowedContentTypes": ["application/pdf"], + "maxCount": 0, "minCount": 0, - "taskId": "Task_1" + "enablePdfCreation": true, + "enableFileScan": false, + "validationErrorOnPendingFileScan": false, + "enabledFileAnalysers": [], + "enabledFileValidators": [] }, { - "id": "ref-data-as-pdf", - "allowedContentTypes": [ "application/pdf" ], - "minCount": 0, - "taskId": "Task_1" + "id": "model", + "allowedContentTypes": ["application/xml"], + "appLogic": { + "autoCreate": true, + "classRef": "Altinn.App.Models.model.model", + "allowAnonymousOnStateless": false, + "autoDeleteOnProcessEnd": false + }, + "taskId": "Task_1", + "maxCount": 1, + "minCount": 1, + "enablePdfCreation": true, + "enableFileScan": false, + "validationErrorOnPendingFileScan": false, + "enabledFileAnalysers": [], + "enabledFileValidators": [] } ], "partyTypesAllowed": { @@ -25,7 +40,5 @@ "person": true, "subUnit": true }, - "onEntry": { - "show": "select-instance" - } + "autoDeleteOnProcessEnd": false } diff --git a/src/App/config/process/process.bpmn b/src/App/config/process/process.bpmn index 4036f73f..839185b5 100644 --- a/src/App/config/process/process.bpmn +++ b/src/App/config/process/process.bpmn @@ -1,45 +1,43 @@ - - - - - SequenceFlow_1n56yn5 - - - SequenceFlow_1n56yn5 - SequenceFlow_1oot28q - - - SequenceFlow_1oot28q - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + SequenceFlow_1n56yn5 + + + SequenceFlow_1n56yn5 + SequenceFlow_1oot28q + + + data + + + + + SequenceFlow_1oot28q + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/App/config/texts/resource.nb.json b/src/App/config/texts/resource.nb.json index bcbe1a8e..37af8151 100644 --- a/src/App/config/texts/resource.nb.json +++ b/src/App/config/texts/resource.nb.json @@ -1,6 +1,5 @@ { - "$schema": "https://altinncdn.no/schemas/json/text-resources/text-resources.schema.v1.json", + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/text-resources/text-resources.schema.v1.json", "language": "nb", - "resources": [ - ] + "resources": [] } diff --git a/src/App/models/model.cs b/src/App/models/model.cs new file mode 100644 index 00000000..018f429d --- /dev/null +++ b/src/App/models/model.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text.Json.Serialization; +using System.Xml.Serialization; +using Microsoft.AspNetCore.Mvc.ModelBinding; +using Newtonsoft.Json; +namespace Altinn.App.Models.model +{ + [XmlRoot(ElementName="model")] + public class model + { + [XmlElement("property1", Order = 1)] + [JsonProperty("property1")] + [JsonPropertyName("property1")] + public string property1 { get; set; } + + [XmlElement("property2", Order = 2)] + [JsonProperty("property2")] + [JsonPropertyName("property2")] + public string property2 { get; set; } + + [XmlElement("property3", Order = 3)] + [JsonProperty("property3")] + [JsonPropertyName("property3")] + public string property3 { get; set; } + + } +} diff --git a/src/App/models/model.metadata.json b/src/App/models/model.metadata.json new file mode 100644 index 00000000..92277366 --- /dev/null +++ b/src/App/models/model.metadata.json @@ -0,0 +1,101 @@ +{ + "Org": null, + "ServiceName": null, + "RepositoryName": null, + "ServiceId": null, + "TargetNamespace": null, + "elements": { + "model": { + "id": "model", + "parentElement": null, + "typeName": "model", + "name": "model", + "dataBindingName": null, + "xPath": "/model", + "restrictions": {}, + "type": 0, + "xsdValueType": null, + "texts": {}, + "customProperties": {}, + "maxOccurs": 1, + "minOccurs": 0, + "xName": "model", + "isTagContent": false, + "fixedValue": null, + "isReadOnly": false, + "xmlSchemaXPath": null, + "jsonSchemaPointer": "", + "displayString": "model : [0..1] 0", + "nillable": false + }, + "model.property1": { + "id": "model.property1", + "parentElement": "model", + "typeName": "property1", + "name": "property1", + "dataBindingName": "property1", + "xPath": "/model/property1", + "restrictions": {}, + "type": 0, + "xsdValueType": 0, + "texts": {}, + "customProperties": {}, + "maxOccurs": 1, + "minOccurs": 1, + "xName": "property1", + "isTagContent": false, + "fixedValue": null, + "isReadOnly": false, + "xmlSchemaXPath": null, + "jsonSchemaPointer": "/properties/property1", + "displayString": "model.property1 : [1..1] String", + "nillable": false + }, + "model.property2": { + "id": "model.property2", + "parentElement": "model", + "typeName": "property2", + "name": "property2", + "dataBindingName": "property2", + "xPath": "/model/property2", + "restrictions": {}, + "type": 0, + "xsdValueType": 0, + "texts": {}, + "customProperties": {}, + "maxOccurs": 1, + "minOccurs": 1, + "xName": "property2", + "isTagContent": false, + "fixedValue": null, + "isReadOnly": false, + "xmlSchemaXPath": null, + "jsonSchemaPointer": "/properties/property2", + "displayString": "model.property2 : [1..1] String", + "nillable": false + }, + "model.property3": { + "id": "model.property3", + "parentElement": "model", + "typeName": "property3", + "name": "property3", + "dataBindingName": "property3", + "xPath": "/model/property3", + "restrictions": {}, + "type": 0, + "xsdValueType": 0, + "texts": {}, + "customProperties": {}, + "maxOccurs": 1, + "minOccurs": 0, + "xName": "property3", + "isTagContent": false, + "fixedValue": null, + "isReadOnly": false, + "xmlSchemaXPath": null, + "jsonSchemaPointer": "/properties/property3", + "displayString": "model.property3 : [0..1] String", + "nillable": false + } + } +} \ No newline at end of file diff --git a/src/App/models/model.schema.json b/src/App/models/model.schema.json new file mode 100644 index 00000000..b0fe2629 --- /dev/null +++ b/src/App/models/model.schema.json @@ -0,0 +1,35 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "http://altinn-repositories:3000/bjosttveit/v4-data/App/models/model.schema.json", + "type": "object", + "info": { + "rootNode": "" + }, + "@xsdNamespaces": { + "xsd": "http://www.w3.org/2001/XMLSchema", + "xsi": "http://www.w3.org/2001/XMLSchema-instance", + "seres": "http://seres.no/xsd/forvaltningsdata" + }, + "@xsdSchemaAttributes": { + "AttributeFormDefault": "Unqualified", + "ElementFormDefault": "Qualified", + "BlockDefault": "None", + "FinalDefault": "None" + }, + "@xsdRootElement": "model", + "properties": { + "property1": { + "type": "string" + }, + "property2": { + "type": "string" + }, + "property3": { + "type": "string" + } + }, + "required": [ + "property1", + "property2" + ] +} \ No newline at end of file diff --git a/src/App/models/model.xsd b/src/App/models/model.xsd new file mode 100644 index 00000000..d13e8546 --- /dev/null +++ b/src/App/models/model.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/App/ui/Settings.json b/src/App/ui/Settings.json deleted file mode 100644 index c156fa9a..00000000 --- a/src/App/ui/Settings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "https://altinncdn.no/schemas/json/layout/layoutSettings.schema.v1.json", - "pages": { - "order": [ - ] - } -} diff --git a/src/App/ui/footer.json b/src/App/ui/footer.json index 730576f0..72c632c5 100644 --- a/src/App/ui/footer.json +++ b/src/App/ui/footer.json @@ -1,11 +1,11 @@ { - "$schema": "https://altinncdn.no/schemas/json/layout/footer.schema.v1.json", + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/footer.schema.v1.json", "footer": [ { "type": "Link", "icon": "information", "title": "general.accessibility", - "target": "https://www.altinn.no/om-altinn/tilgjengelighet/" + "target": "general.accessibility_url" } ] } diff --git a/src/App/ui/RuleHandler.js b/src/App/ui/form/RuleHandler.js similarity index 100% rename from src/App/ui/RuleHandler.js rename to src/App/ui/form/RuleHandler.js diff --git a/src/App/ui/form/Settings.json b/src/App/ui/form/Settings.json new file mode 100644 index 00000000..20016863 --- /dev/null +++ b/src/App/ui/form/Settings.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layoutSettings.schema.v1.json", + "pages": { + "order": ["Side1"] + } +} diff --git a/src/App/ui/form/layouts/Side1.json b/src/App/ui/form/layouts/Side1.json new file mode 100644 index 00000000..0909a030 --- /dev/null +++ b/src/App/ui/form/layouts/Side1.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json", + "data": { + "hidden": false, + "layout": [] + } +} diff --git a/src/App/ui/layout-sets.json b/src/App/ui/layout-sets.json new file mode 100644 index 00000000..cd59008e --- /dev/null +++ b/src/App/ui/layout-sets.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout-sets.schema.v1.json", + "sets": [ + { + "id": "form", + "dataType": "model", + "tasks": ["Task_1"] + } + ], + "uiSettings": {} +} diff --git a/src/App/views/Home/Index.cshtml b/src/App/views/Home/Index.cshtml index d850c714..353afe48 100644 --- a/src/App/views/Home/Index.cshtml +++ b/src/App/views/Home/Index.cshtml @@ -7,43 +7,18 @@ @ViewBag.Org- @ViewBag.App - - - - - - - - - - - - + -
- - -
- -
- +
+ + diff --git a/src/AppRef.sln b/src/AppRef.sln deleted file mode 100644 index 8a2168c4..00000000 --- a/src/AppRef.sln +++ /dev/null @@ -1,36 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31912.275 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "App.IntegrationTests", "App.IntegrationTests\App.IntegrationTests.csproj", "{0A5374D4-7A33-45F4-A461-9A13A89E3723}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{BE7E60DE-8BBF-4B57-A9B1-F6BCBF0194A1}" - ProjectSection(SolutionItems) = preProject - .editorconfig = .editorconfig - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppRef", "App\AppRef.csproj", "{B465D399-E618-44CB-8A91-FD972FBB0DB3}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0A5374D4-7A33-45F4-A461-9A13A89E3723}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0A5374D4-7A33-45F4-A461-9A13A89E3723}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0A5374D4-7A33-45F4-A461-9A13A89E3723}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0A5374D4-7A33-45F4-A461-9A13A89E3723}.Release|Any CPU.Build.0 = Release|Any CPU - {B465D399-E618-44CB-8A91-FD972FBB0DB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B465D399-E618-44CB-8A91-FD972FBB0DB3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B465D399-E618-44CB-8A91-FD972FBB0DB3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B465D399-E618-44CB-8A91-FD972FBB0DB3}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {4584C6E1-D5B4-40B1-A8C4-CF4620EB0896} - EndGlobalSection -EndGlobal diff --git a/src/Dockerfile b/src/Dockerfile index 1fe7f41a..60aa9858 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build WORKDIR /App COPY /App/App.csproj . @@ -8,7 +8,7 @@ COPY /App . RUN dotnet publish App.csproj --configuration Release --output /app_output -FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine AS final +FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS final EXPOSE 5005 WORKDIR /App COPY --from=build /app_output . @@ -26,4 +26,4 @@ RUN addgroup -g 3000 dotnet && adduser -u 1000 -G dotnet -D -s /bin/false dotnet USER dotnet RUN mkdir /tmp/logtelemetry -ENTRYPOINT ["dotnet", "Altinn.App.dll"] +ENTRYPOINT ["dotnet", "Altinn.Application.dll"]