-
Notifications
You must be signed in to change notification settings - Fork 76
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 split-app-contnet-library
- Loading branch information
Showing
74 changed files
with
2,020 additions
and
235 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,9 @@ | ||
using System.Runtime.Serialization; | ||
|
||
namespace Altinn.Studio.Designer.Enums | ||
{ | ||
/// <summary> | ||
/// Enum for reference types of resources in the resource registry | ||
/// </summary> | ||
public enum ReferenceType | ||
{ | ||
[EnumMember(Value = "Default")] | ||
Default = 0, | ||
|
||
[EnumMember(Value = "Uri")] | ||
Uri = 1, | ||
|
||
[EnumMember(Value = "DelegationSchemeId")] | ||
DelegationSchemeId = 2, | ||
|
||
[EnumMember(Value = "MaskinportenScope")] | ||
MaskinportenScope = 3, | ||
|
||
[EnumMember(Value = "ServiceCode")] | ||
ServiceCode = 4, | ||
|
||
[EnumMember(Value = "ServiceEditionCode")] | ||
ServiceEditionCode = 5, | ||
|
||
[EnumMember(Value = "ApplicationId")] | ||
ApplicationId = 6, | ||
LayoutSet, | ||
Layout, | ||
Component | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System.Runtime.Serialization; | ||
|
||
namespace Altinn.Studio.Designer.Enums | ||
{ | ||
/// <summary> | ||
/// Enum for reference types of resources in the resource registry | ||
/// </summary> | ||
public enum ResourceReferenceType | ||
{ | ||
[EnumMember(Value = "Default")] | ||
Default = 0, | ||
|
||
[EnumMember(Value = "Uri")] | ||
Uri = 1, | ||
|
||
[EnumMember(Value = "DelegationSchemeId")] | ||
DelegationSchemeId = 2, | ||
|
||
[EnumMember(Value = "MaskinportenScope")] | ||
MaskinportenScope = 3, | ||
|
||
[EnumMember(Value = "ServiceCode")] | ||
ServiceCode = 4, | ||
|
||
[EnumMember(Value = "ServiceEditionCode")] | ||
ServiceEditionCode = 5, | ||
|
||
[EnumMember(Value = "ApplicationId")] | ||
ApplicationId = 6, | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
backend/src/Designer/EventHandlers/ComponentDeleted/ComponentDeletedLayoutsHandler.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,27 @@ | ||
using System.Collections.Generic; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Altinn.Studio.Designer.Enums; | ||
using Altinn.Studio.Designer.Events; | ||
using Altinn.Studio.Designer.Hubs.SyncHub; | ||
using Altinn.Studio.Designer.Models; | ||
using Altinn.Studio.Designer.Services.Interfaces; | ||
using MediatR; | ||
|
||
namespace Altinn.Studio.Designer.EventHandlers.ComponentDeleted; | ||
|
||
public class ComponentDeletedLayoutsHandler(IFileSyncHandlerExecutor fileSyncHandlerExecutor, IAppDevelopmentService appDevelopmentService) : INotificationHandler<ComponentDeletedEvent> | ||
{ | ||
public async Task Handle(ComponentDeletedEvent notification, CancellationToken cancellationToken) | ||
{ | ||
await fileSyncHandlerExecutor.ExecuteWithExceptionHandlingAndConditionalNotification( | ||
notification.EditingContext, | ||
SyncErrorCodes.ComponentDeletedLayoutsSyncError, | ||
"layouts", | ||
async () => | ||
{ | ||
List<Reference> referencesToDelete = [new Reference(ReferenceType.Component, notification.LayoutSetName, notification.ComponentId)]; | ||
return await appDevelopmentService.UpdateLayoutReferences(notification.EditingContext, referencesToDelete, cancellationToken); | ||
}); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
backend/src/Designer/EventHandlers/LayoutPageDeleted/LayoutPageDeletedLayoutsHandler.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,27 @@ | ||
using System.Collections.Generic; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Altinn.Studio.Designer.Enums; | ||
using Altinn.Studio.Designer.Events; | ||
using Altinn.Studio.Designer.Hubs.SyncHub; | ||
using Altinn.Studio.Designer.Models; | ||
using Altinn.Studio.Designer.Services.Interfaces; | ||
using MediatR; | ||
|
||
namespace Altinn.Studio.Designer.EventHandlers.LayoutPageDeleted; | ||
|
||
public class LayoutPageDeletedLayoutsHandler(IFileSyncHandlerExecutor fileSyncHandlerExecutor, IAppDevelopmentService appDevelopmentService) : INotificationHandler<LayoutPageDeletedEvent> | ||
{ | ||
public async Task Handle(LayoutPageDeletedEvent notification, CancellationToken cancellationToken) | ||
{ | ||
await fileSyncHandlerExecutor.ExecuteWithExceptionHandlingAndConditionalNotification( | ||
notification.EditingContext, | ||
SyncErrorCodes.LayoutPageDeletedLayoutsSyncError, | ||
"layouts", | ||
async () => | ||
{ | ||
List<Reference> referencesToDelete = [new Reference(ReferenceType.Layout, notification.LayoutSetName, notification.LayoutName)]; | ||
return await appDevelopmentService.UpdateLayoutReferences(notification.EditingContext, referencesToDelete, cancellationToken); | ||
}); | ||
} | ||
} |
73 changes: 0 additions & 73 deletions
73
backend/src/Designer/EventHandlers/LayoutSetDeleted/LayoutSetDeletedComponentRefHandler.cs
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
backend/src/Designer/EventHandlers/LayoutSetDeleted/LayoutSetDeletedLayoutsHandler.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,27 @@ | ||
using System.Collections.Generic; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Altinn.Studio.Designer.Enums; | ||
using Altinn.Studio.Designer.Events; | ||
using Altinn.Studio.Designer.Hubs.SyncHub; | ||
using Altinn.Studio.Designer.Models; | ||
using Altinn.Studio.Designer.Services.Interfaces; | ||
using MediatR; | ||
|
||
namespace Altinn.Studio.Designer.EventHandlers.LayoutSetDeleted; | ||
|
||
public class LayoutSetDeletedLayoutsHandler(IFileSyncHandlerExecutor fileSyncHandlerExecutor, IAppDevelopmentService appDevelopmentService) : INotificationHandler<LayoutSetDeletedEvent> | ||
{ | ||
public async Task Handle(LayoutSetDeletedEvent notification, CancellationToken cancellationToken) | ||
{ | ||
await fileSyncHandlerExecutor.ExecuteWithExceptionHandlingAndConditionalNotification( | ||
notification.EditingContext, | ||
SyncErrorCodes.LayoutSetDeletedLayoutsSyncError, | ||
"layouts", | ||
async () => | ||
{ | ||
List<Reference> referencesToDelete = [new Reference(ReferenceType.LayoutSet, notification.LayoutSetName, notification.LayoutSetName)]; | ||
return await appDevelopmentService.UpdateLayoutReferences(notification.EditingContext, referencesToDelete, cancellationToken); | ||
}); | ||
} | ||
} |
Oops, something went wrong.