Browse Source
Remove `LeptonXFooter` if current theme is not `LeptonX`.
pull/20039/head
maliming
2 years ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
4 changed files with
21 additions and
5 deletions
-
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/RemoveFileStep.cs
-
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppNoLayersTemplateBase.cs
-
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs
-
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceTemplateBase.cs
|
|
|
@ -1,18 +1,21 @@ |
|
|
|
using System; |
|
|
|
|
|
|
|
namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps; |
|
|
|
namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps; |
|
|
|
|
|
|
|
public class RemoveFileStep : ProjectBuildPipelineStep |
|
|
|
{ |
|
|
|
private readonly string _filePath; |
|
|
|
public RemoveFileStep(string filePath) |
|
|
|
private readonly bool _fullPath; |
|
|
|
|
|
|
|
public RemoveFileStep(string filePath, bool fullPath = true) |
|
|
|
{ |
|
|
|
_filePath = filePath; |
|
|
|
_fullPath = fullPath; |
|
|
|
} |
|
|
|
|
|
|
|
public override void Execute(ProjectBuildContext context) |
|
|
|
{ |
|
|
|
var fileToRemove = context.Files.Find(x => x.Name == _filePath);; |
|
|
|
var fileToRemove = _fullPath |
|
|
|
? context.Files.Find(x => x.Name == _filePath) |
|
|
|
: context.Files.Find(x => x.Name.EndsWith(_filePath)); |
|
|
|
if (fileToRemove != null) |
|
|
|
{ |
|
|
|
context.Files.Remove(fileToRemove); |
|
|
|
|
|
|
|
@ -249,6 +249,11 @@ public abstract class AppNoLayersTemplateBase : TemplateInfo |
|
|
|
steps.Add(new ChangeThemeStyleStep()); |
|
|
|
} |
|
|
|
|
|
|
|
if (context.BuildArgs.Theme != Theme.LeptonX) |
|
|
|
{ |
|
|
|
steps.Add(new RemoveFileStep("LeptonXFooter.razor", false)); |
|
|
|
} |
|
|
|
|
|
|
|
RemoveThemeLogoFolders(context, steps); |
|
|
|
|
|
|
|
if (IsDefaultThemeForTemplate(context.BuildArgs)) |
|
|
|
|
|
|
|
@ -235,6 +235,10 @@ public abstract class AppTemplateBase : TemplateInfo |
|
|
|
{ |
|
|
|
steps.Add(new ChangeThemeStyleStep()); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
steps.Add(new RemoveFileStep("LeptonXFooter.razor", false)); |
|
|
|
} |
|
|
|
|
|
|
|
RemoveThemeLogoFolders(context, steps); |
|
|
|
|
|
|
|
|
|
|
|
@ -49,6 +49,10 @@ public abstract class MicroserviceTemplateBase : TemplateInfo |
|
|
|
steps.Add(new ChangeThemeStyleStep()); |
|
|
|
return; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
steps.Add(new RemoveFileStep("LeptonXFooter.razor", false)); |
|
|
|
} |
|
|
|
|
|
|
|
steps.Add(new ChangeThemeStep()); |
|
|
|
ReplaceLeptonXThemePackagesFromPackageJsonFiles(steps, uiFramework: context.BuildArgs.UiFramework, theme: context.BuildArgs.Theme, version: context.BuildArgs.Version ?? context.TemplateFile.Version); |
|
|
|
|