-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extending ISetupEventHandler
with new events
#14184
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
db8e4f5
Replacing `ISetupEventHandler` with `ITenantSetupHandler`.
MikeAlhayek e4c3ddc
Update setup services
MikeAlhayek c70d779
Cleanup
MikeAlhayek 5c45a55
Adding FailedAsync
MikeAlhayek 9881a9c
Cleanup SetupService
MikeAlhayek 55bbd65
Cleanup SetupServices
MikeAlhayek 57c48b5
remove unnecessary const
MikeAlhayek b6c3fdf
minor cleanup
MikeAlhayek f0030db
Revent some changes
MikeAlhayek ffbbf74
Minor changes
MikeAlhayek 384d65d
Reventing the ToLowerInvariant change
MikeAlhayek 6e6acfe
More cleanup
MikeAlhayek 80aff3a
fine tuning
MikeAlhayek ee18656
Return executionId
MikeAlhayek 8dbb929
Reverting some lines
MikeAlhayek 7ee5c36
adding log check
MikeAlhayek 7da6245
Adding interface with default implementation
MikeAlhayek eeb9d8a
Minor cleanup
MikeAlhayek 93a554a
remove the base class
MikeAlhayek 278a414
new line
MikeAlhayek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
36 changes: 27 additions & 9 deletions
36
src/OrchardCore/OrchardCore.Setup.Abstractions/Events/ISetupEventHandler.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 |
---|---|---|
@@ -1,17 +1,35 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using OrchardCore.Setup.Services; | ||
|
||
namespace OrchardCore.Setup.Events | ||
namespace OrchardCore.Setup.Events; | ||
|
||
public interface ISetupEventHandler | ||
{ | ||
[Obsolete($"This method is obsolete and will be removed in future releases. Please use '{nameof(SetupAsync)}' instead.", false)] | ||
Task Setup(IDictionary<string, object> properties, Action<string, string> reportError) | ||
=> Task.CompletedTask; | ||
|
||
/// <summary> | ||
/// Called during the process of setting up a new tenant. | ||
/// </summary> | ||
/// <param name="context"></param> | ||
/// <returns></returns> | ||
Task SetupAsync(SetupContext context) | ||
=> Task.CompletedTask; | ||
|
||
/// <summary> | ||
/// Called when a tenant fails to setup. | ||
/// </summary> | ||
/// <returns></returns> | ||
Task FailedAsync(SetupContext context) | ||
=> Task.CompletedTask; | ||
|
||
/// <summary> | ||
/// Contract that is called when a tenant is set up. | ||
/// Called when a new tenant is successfully setup. | ||
/// </summary> | ||
public interface ISetupEventHandler | ||
{ | ||
Task Setup( | ||
IDictionary<string, object> properties, | ||
Action<string, string> reportError | ||
); | ||
} | ||
/// <returns></returns> | ||
Task SucceededAsync() | ||
=> Task.CompletedTask; | ||
} |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the meantime I will approve
But as a last idea the default implementation of
SetupAsync()
could be to callSetup()
so that we don't need to call the obsoleteSetup()
from theSetupService
and only use the rule pragma here, all in one place.Something like this, quickly written so may need to be tweaked.