Skip to content

Commit

Permalink
Add AddTenantReloadWarningWrapper() helpful extension (#16532)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeAlhayek authored Aug 7, 2024
1 parent 51dfdd5 commit 166daf6
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public override async Task<IDisplayResult> EditAsync(ISite site, EmailSettings s
return null;
}

context.Shape.Metadata.Wrappers.Add("Settings_Wrapper__Reload");
context.AddTenantReloadWarningWrapper();

return Initialize<EmailSettingsViewModel>("EmailSettings_Edit", async model =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public override async Task<IDisplayResult> EditAsync(ISite site, HttpsSettings s
return null;
}

context.Shape.Metadata.Wrappers.Add("Settings_Wrapper__Reload");
context.AddTenantReloadWarningWrapper();

return Initialize<HttpsSettingsViewModel>("HttpsSettings_Edit", async model =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public override async Task<IDisplayResult> EditAsync(ISite site, LocalizationSet
return null;
}

context.Shape.Metadata.Wrappers.Add("Settings_Wrapper__Reload");
context.AddTenantReloadWarningWrapper();

return Initialize<LocalizationSettingsViewModel>("LocalizationSettings_Edit", model =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public override async Task<IDisplayResult> EditAsync(ISite site, OpenIdClientSet
return null;
}

context.Shape.Metadata.Wrappers.Add("Settings_Wrapper__Reload");
context.AddTenantReloadWarningWrapper();

return Initialize<OpenIdClientSettingsViewModel>("OpenIdClientSettings_Edit", model =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public OpenIdServerSettingsDisplayDriver(IOpenIdServerService serverService)

public override IDisplayResult Edit(OpenIdServerSettings settings, BuildEditorContext context)
{
context.Shape.Metadata.Wrappers.Add("Settings_Wrapper__Reload");
context.AddTenantReloadWarningWrapper();

return Initialize<OpenIdServerSettingsViewModel>("OpenIdServerSettings_Edit", async model =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public OpenIdValidationSettingsDisplayDriver(IShellHost shellHost)

public override IDisplayResult Edit(OpenIdValidationSettings settings, BuildEditorContext context)
{
context.Shape.Metadata.Wrappers.Add("Settings_Wrapper__Reload");
context.AddTenantReloadWarningWrapper();

return Initialize<OpenIdValidationSettingsViewModel>("OpenIdValidationSettings_Edit", async model =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public override async Task<IDisplayResult> EditAsync(ISite site, ReCaptchaSettin
return null;
}

context.Shape.Metadata.Wrappers.Add("Settings_Wrapper__Reload");
context.AddTenantReloadWarningWrapper();

return Initialize<ReCaptchaSettingsViewModel>("ReCaptchaSettings_Edit", model =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public override async Task<IDisplayResult> EditAsync(ISite site, ReverseProxySet
return null;
}

context.Shape.Metadata.Wrappers.Add("Settings_Wrapper__Reload");
context.AddTenantReloadWarningWrapper();

return Initialize<ReverseProxySettingsViewModel>("ReverseProxySettings_Edit", model =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public override async Task<IDisplayResult> EditAsync(ISite site, SecuritySetting
return null;
}

context.Shape.Metadata.Wrappers.Add("Settings_Wrapper__Reload");
context.AddTenantReloadWarningWrapper();

return Initialize<SecuritySettingsViewModel>("SecurityHeadersSettings_Edit", model =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public override IDisplayResult Edit(ISite site, BuildEditorContext context)
return null;
}

context.Shape.Metadata.Wrappers.Add("Settings_Wrapper__Reload");
context.AddTenantReloadWarningWrapper();

var result = Combine(
Initialize<SiteSettingsViewModel>("Settings_Edit__Site", model => PopulateProperties(site, model))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace OrchardCore.DisplayManagement.Handlers;

public static class BuildShapeContextExtensions
{
public static void AddTenantReloadWarningWrapper(this BuildShapeContext context)
=> context.Shape.Metadata.Wrappers.Add("Settings_Wrapper__Reload");
}

0 comments on commit 166daf6

Please sign in to comment.