Skip to content

Commit

Permalink
fix scripts shipping by scaffolding (#2931) (#2934)
Browse files Browse the repository at this point in the history
* remove bootstrap3 and update jquery

* update jquery files

* update remaining files
  • Loading branch information
deepchoudhery authored Aug 20, 2024
1 parent 2f19959 commit 6c97177
Show file tree
Hide file tree
Showing 177 changed files with 1,424 additions and 32,131 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class CommandLineGeneratorModel : CommonCommandLineModel
[Option(Name = "readWriteActions", ShortName = "actions", Description = "Specify this switch to generate Controller with read/write actions when a Model class is not used")]
public bool GenerateReadWriteActions { get; set; }

[Option(Name = "bootstrapVersion", ShortName = "b", Description = "Specify the bootstrap version. Valid values: '3', '4'. Default is 4.")]
[Option(Name = "bootstrapVersion", ShortName = "b", Description = "Specify the bootstrap version. Valid values: '4', '5'. Default is 5.")]
public string BootstrapVersion { get; set; }

public CommandLineGeneratorModel()
Expand Down
10 changes: 4 additions & 6 deletions src/Scaffolding/VS.Web.CG.Mvc/Identity/IdentityGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,11 @@ public class IdentityGenerator : ICodeGenerator
// Also, with a list this small, the lookup perf hit will be largely irrelevant.
internal static readonly IReadOnlyList<string> ValidBootstrapVersions = new List<string>()
{
"3",
"4",
"5"
};

internal static readonly string ContentVersionDefault = "Default";
internal static readonly string ContentVersionBootstrap3 = "Bootstrap3";
internal static readonly string ContentVersionBootstrap4 = "Bootstrap4";

internal static readonly string DefaultContentRelativeBaseDir = "Identity";
Expand Down Expand Up @@ -105,7 +103,7 @@ private IEnumerable<string> GetTemplateFoldersForContentVersion(IdentityGenerato

// For non-default bootstrap versions, the content is packaged under "Identity_Versioned\[Version_Identifier]\*"
// Note: In the future, if content gets pivoted on things other than bootstrap, this logic will need enhancement.
if (string.Equals(templateModel2.ContentVersion, ContentVersionBootstrap3, StringComparison.Ordinal) ||
if (string.Equals(templateModel2.ContentVersion, ContentVersionBootstrap4, StringComparison.Ordinal) ||
string.Equals(templateModel2.ContentVersion, ContentVersionBootstrap4, StringComparison.Ordinal))
{
return TemplateFoldersUtilities.GetTemplateFolders(
Expand Down Expand Up @@ -133,7 +131,7 @@ private string GetTemplateFolderRootForContentVersion(IdentityGeneratorTemplateM
{
relativePath = DefaultContentRelativeBaseDir;
}
else if (string.Equals(templateModel2.ContentVersion, ContentVersionBootstrap3, StringComparison.Ordinal))
else if (string.Equals(templateModel2.ContentVersion, ContentVersionBootstrap4, StringComparison.Ordinal))
{
// Note: In the future, if content gets pivoted on things other than bootstrap, this logic will need enhancement.
relativePath = Path.Combine(VersionedContentRelativeBaseDir, $"Bootstrap{templateModel2.BootstrapVersion}");
Expand Down Expand Up @@ -349,8 +347,8 @@ internal static string EditIdentityStrings(string stringToModify, string dbConte

private void ShowFileList(string commandBootstrapVersion)
{
string contentVersion = string.Equals(commandBootstrapVersion, "3", StringComparison.Ordinal)
? ContentVersionBootstrap3
string contentVersion = string.Equals(commandBootstrapVersion, "4", StringComparison.Ordinal)
? ContentVersionBootstrap4
: ContentVersionDefault;

_logger.LogMessage("File List:");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class IdentityGeneratorCommandLineModel
[Option(Name = "generateLayout", ShortName = "gl", Description = "Use this option to generate a new _Layout.cshtml")]
public bool GenerateLayout { get; set; }

[Option(Name = "bootstrapVersion", ShortName = "b", Description = "Specify the bootstrap version. Valid values: '3', '4', '5'. Default is 5.")]
[Option(Name = "bootstrapVersion", ShortName = "b", Description = "Specify the bootstrap version. Valid values: '4', '5'. Default is 5.")]
public string BootstrapVersion { get; set; }

[Option(Name = "excludeFiles", ShortName = "exf", Description = "Use this option to overwrite all but list of semicolon separated files. Use the --listFiles option to see the available options.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ private static List<IdentityGeneratorFile> GetDataModelFiles(IdentityGeneratorTe
// Maps the valid values for ContentVersion to the filename prefix for the appropriate {prefix}_identitygeneratorfilesconfig.json
private static readonly IReadOnlyDictionary<string, string> _contentVersionToConfigPrefixMap = new Dictionary<string, string>()
{
{ IdentityGenerator.ContentVersionBootstrap3, "bootstrap3" },
{ IdentityGenerator.ContentVersionBootstrap4, "bootstrap4" },
{ IdentityGenerator.ContentVersionDefault, "bootstrap5" },
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,6 @@ private string DetermineContentVersion(IdentityGeneratorTemplateModel templateMo
{
return IdentityGenerator.ContentVersionDefault;
}
else if (string.Equals(templateModel2.BootstrapVersion, "3", StringComparison.Ordinal))
{
return IdentityGenerator.ContentVersionBootstrap3;
}
else if (string.Equals(templateModel2.BootstrapVersion, "4", StringComparison.Ordinal))
{
return IdentityGenerator.ContentVersionBootstrap4;
Expand Down
Loading

0 comments on commit 6c97177

Please sign in to comment.