-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/13686-support-access-packages-in-policy…
…-editor-v1
- Loading branch information
Showing
275 changed files
with
4,512 additions
and
2,405 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
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
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
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
37 changes: 37 additions & 0 deletions
37
.github/workflows/dotnet-migrations-ensure-compatibility.yaml
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,37 @@ | ||
name: Ensure Migrations Compatibility | ||
on: | ||
pull_request: | ||
branches: [ main ] | ||
types: [opened, synchronize, reopened] | ||
paths: | ||
- 'backend/**' | ||
- '.github/workflows/dotnet-migrations-ensure-compatibility.yaml' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
ensure-migrations-compatibility: | ||
name: Try to generate script and to add a new migrations | ||
runs-on: ubuntu-latest | ||
env: | ||
OidcLoginSettings__FetchClientIdAndSecretFromRootEnvFile: 'false' | ||
OidcLoginSettings__ClientId: 'dummyRequired' | ||
OidcLoginSettings__ClientSecret: 'dummyRequired' | ||
steps: | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: | | ||
9.0.x | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install dotnet ef # Version should be the same as Migrations docker file and project | ||
run: dotnet tool install --version 8.0.7 --global dotnet-ef | ||
|
||
- name: Check if migrations script can be generated | ||
run: | | ||
dotnet ef migrations script --project backend/src/Designer | ||
- name: Check if it's possible to add a new migration | ||
run: | | ||
dotnet ef migrations add Test --project backend/src/Designer |
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
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
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
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
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
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
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
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
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
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
47 changes: 47 additions & 0 deletions
47
backend/src/Designer/EventHandlers/LayoutPageAdded/LayoutPageSubformHandler.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,47 @@ | ||
using System; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Altinn.Studio.Designer.Events; | ||
using Altinn.Studio.Designer.Hubs.SyncHub; | ||
using Altinn.Studio.Designer.Services.Interfaces; | ||
using MediatR; | ||
|
||
namespace Altinn.Studio.Designer.EventHandlers.LayoutPageAdded; | ||
|
||
public class SubformCreatedHandler( | ||
IAppDevelopmentService appDevelopmentService, | ||
IFileSyncHandlerExecutor fileSyncHandlerExecutor | ||
) : INotificationHandler<LayoutPageAddedEvent> | ||
{ | ||
public async Task Handle( | ||
LayoutPageAddedEvent notification, | ||
CancellationToken cancellationToken) | ||
{ | ||
|
||
await fileSyncHandlerExecutor.ExecuteWithExceptionHandlingAndConditionalNotification( | ||
notification.EditingContext, | ||
SyncErrorCodes.LayoutSetSubFormButtonSyncError, | ||
"layouts", | ||
async () => | ||
{ | ||
if (notification.LayoutSetConfig.Type == "subform") | ||
{ | ||
Guid guid = Guid.NewGuid(); | ||
string randomId = guid.ToString().Split('-')[0]; | ||
object buttonComponent = new | ||
{ | ||
id = $"CloseSubformButton-{randomId}", | ||
type = "CustomButton", | ||
actions = new[] { | ||
new { | ||
type = "ClientAction", | ||
id = "closeSubform" | ||
}}, | ||
}; | ||
await appDevelopmentService.AddComponentToLayout(notification.EditingContext, notification.LayoutSetConfig.Id, notification.LayoutName, buttonComponent, cancellationToken); | ||
return true; | ||
} | ||
return false; | ||
}); | ||
} | ||
} |
Oops, something went wrong.