Skip to content

Commit

Permalink
Update to v4/v8 (#210)
Browse files Browse the repository at this point in the history
* remove link to altinn-din font

* remove links to fort awesome

* remove unecessary classes and containers

* use language for accessibility url

* update schemas and clean up index.cshtml

* add layout set and default datamodel

* upgrade to v8

* rename default datamodel to model

* remove appref

* update layout-sets

* clean

* be nice to studio preview

* rename default layout set

---------

Co-authored-by: Bjørnar Østtveit <bjosttveit@Bjrnar-DIGDIR.local>
  • Loading branch information
bjosttveit and Bjørnar Østtveit authored Mar 6, 2024
1 parent 4c3a470 commit d139462
Show file tree
Hide file tree
Showing 23 changed files with 309 additions and 228 deletions.
30 changes: 12 additions & 18 deletions src/App/App.csproj
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AssemblyName>Altinn.App</AssemblyName>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>Altinn.Application</AssemblyName>
<RootNamespace>Altinn.App</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Altinn.App.Api" Version="7.15.3">
<PackageReference Include="Altinn.App.Api" Version="8.0.0">
<CopyToOutputDirectory>lib\$(TargetFramework)\*.xml</CopyToOutputDirectory>
</PackageReference>
<PackageReference Include="Altinn.App.Core" Version="7.15.3"/>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="6.0.0"/>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0"/>
<PackageReference Include="Altinn.App.Core" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
</ItemGroup>

<ItemGroup>
<Folder Include="wwwroot\css\"/>
<Folder Include="wwwroot\script\"/>
<Folder Include="wwwroot\css\" />
<Folder Include="wwwroot\script\" />
</ItemGroup>

<ItemGroup>
<None Update="config\process\process.bpmn">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
Expand All @@ -31,16 +27,14 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
<NoWarn>$(NoWarn);1591;1998</NoWarn>
</PropertyGroup>

<Target Name="CopyXMLFromPackagesForBuild" AfterTargets="Build">
<ItemGroup>
<PackageReferenceFiles Condition="%(PackageReference.CopyToOutputDirectory) != ''" Include="$(NugetPackageRoot)$([MSBuild]::Escape('%(PackageReference.Identity)').ToLower())/%(PackageReference.Version)/%(PackageReference.CopyToOutputDirectory)"/>
<PackageReferenceFiles Condition="%(PackageReference.CopyToOutputDirectory) != ''" Include="$(NugetPackageRoot)$([MSBuild]::Escape('%(PackageReference.Identity)').ToLower())/%(PackageReference.Version)/%(PackageReference.CopyToOutputDirectory)" />
</ItemGroup>
<Copy SourceFiles="@(PackageReferenceFiles)" DestinationFolder="$(OutDir)"/>
<Copy SourceFiles="@(PackageReferenceFiles)" DestinationFolder="$(OutDir)" />
</Target>
</Project>
46 changes: 0 additions & 46 deletions src/App/AppRef.csproj

This file was deleted.

18 changes: 1 addition & 17 deletions src/App/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,7 @@ void ConfigureWebHostBuilder(IWebHostBuilder builder)
}

void Configure()
{
if (app.Environment.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}

string applicationId = StartupHelper.GetApplicationId();
if (!string.IsNullOrEmpty(applicationId))
{
Expand All @@ -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();
}
2 changes: 1 addition & 1 deletion src/App/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"Microsoft": "Information"
}
}
}
}
2 changes: 1 addition & 1 deletion src/App/appsettings.Production.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
}
}
2 changes: 1 addition & 1 deletion src/App/appsettings.Staging.json
Original file line number Diff line number Diff line change
Expand Up @@ -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)."
}
}
}
4 changes: 2 additions & 2 deletions src/App/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"AppSettings": {
"OpenIdWellKnownEndpoint": "http://localhost:5101/authentication/api/v1/openid/",
"RuntimeCookieName": "AltinnStudioRuntime",
"RegisterEventsWithEventsComponent": false
"RegisterEventsWithEventsComponent": false
},
"GeneralSettings": {
"HostName": "local.altinn.cloud",
Expand All @@ -30,4 +30,4 @@
"ApplicationInsights": {
"InstrumentationKey": "retrieved from environment at runtime"
}
}
}
39 changes: 26 additions & 13 deletions src/App/config/applicationmetadata.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand All @@ -25,7 +40,5 @@
"person": true,
"subUnit": true
},
"onEntry": {
"show": "select-instance"
}
"autoDeleteOnProcessEnd": false
}
88 changes: 43 additions & 45 deletions src/App/config/process/process.bpmn
Original file line number Diff line number Diff line change
@@ -1,45 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions id="Altinn_SingleDataTask_Process_Definition"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:altinn="http://altinn.no"
xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
targetNamespace="http://bpmn.io/schema/bpmn" >
<bpmn:process id="SingleDataTask" isExecutable="false">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>SequenceFlow_1n56yn5</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:task id="Task_1" name="Utfylling" altinn:tasktype="data">
<bpmn:incoming>SequenceFlow_1n56yn5</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1oot28q</bpmn:outgoing>
</bpmn:task>
<bpmn:endEvent id="EndEvent_1">
<bpmn:incoming>SequenceFlow_1oot28q</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_1n56yn5" sourceRef="StartEvent_1" targetRef="Task_1" />
<bpmn:sequenceFlow id="SequenceFlow_1oot28q" sourceRef="Task_1" targetRef="EndEvent_1" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="SingleDataTask">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="156" y="81" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_1_di" bpmnElement="Task_1">
<dc:Bounds x="300" y="59" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_1_di" bpmnElement="EndEvent_1">
<dc:Bounds x="512" y="81" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1n56yn5_di" bpmnElement="SequenceFlow_1n56yn5">
<di:waypoint x="192" y="99" />
<di:waypoint x="300" y="99" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1oot28q_di" bpmnElement="SequenceFlow_1oot28q">
<di:waypoint x="400" y="99" />
<di:waypoint x="512" y="99" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
<?xml version="1.0" encoding="utf-8"?>
<bpmn:definitions id="Altinn_SingleDataTask_Process_Definition" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:altinn="http://altinn.no/process" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" targetNamespace="http://bpmn.io/schema/bpmn">
<bpmn:process id="SingleDataTask" isExecutable="false">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>SequenceFlow_1n56yn5</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:task id="Task_1" name="Utfylling">
<bpmn:incoming>SequenceFlow_1n56yn5</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1oot28q</bpmn:outgoing>
<bpmn:extensionElements>
<altinn:taskExtension>
<altinn:taskType>data</altinn:taskType>
</altinn:taskExtension>
</bpmn:extensionElements>
</bpmn:task>
<bpmn:endEvent id="EndEvent_1">
<bpmn:incoming>SequenceFlow_1oot28q</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_1n56yn5" sourceRef="StartEvent_1" targetRef="Task_1" />
<bpmn:sequenceFlow id="SequenceFlow_1oot28q" sourceRef="Task_1" targetRef="EndEvent_1" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="SingleDataTask">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="156" y="81" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_1_di" bpmnElement="Task_1">
<dc:Bounds x="300" y="59" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_1_di" bpmnElement="EndEvent_1">
<dc:Bounds x="512" y="81" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1n56yn5_di" bpmnElement="SequenceFlow_1n56yn5">
<di:waypoint x="192" y="99" />
<di:waypoint x="300" y="99" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1oot28q_di" bpmnElement="SequenceFlow_1oot28q">
<di:waypoint x="400" y="99" />
<di:waypoint x="512" y="99" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
5 changes: 2 additions & 3 deletions src/App/config/texts/resource.nb.json
Original file line number Diff line number Diff line change
@@ -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": []
}
30 changes: 30 additions & 0 deletions src/App/models/model.cs
Original file line number Diff line number Diff line change
@@ -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; }

}
}
Loading

0 comments on commit d139462

Please sign in to comment.