Tasks 184281, 184799, 184800, 184801 and 184802

Align .editorconfig files

Move Controller logic to DMO classes

GlobalVars.AppSettings = Models.AppSettings.GetFromConfigurationManager();

Question EditorConfig
Project level editorconfig
Format White Spaces
AppSetting when EnvironmentVariable not set
Corrective Actions Tests
Schedule Actions Tests
DMO Tests
Controller Tests

Get ready to use VSCode IDE
This commit is contained in:
2024-12-04 11:58:13 -07:00
parent 538b1f817e
commit b1c6903c1c
150 changed files with 29146 additions and 33456 deletions

View File

@ -0,0 +1,31 @@
#### .NET Coding Conventions ####
# Organize usings
dotnet_separate_import_directive_groups = true
dotnet_sort_system_directives_first = true
# New line preferences
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false
csharp_style_allow_embedded_statements_on_same_line_experimental = true
#### C# Formatting Rules ####
# New line preferences
csharp_new_line_before_catch = false
csharp_new_line_before_else = false
csharp_new_line_before_finally = false
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_open_brace = none
csharp_new_line_between_query_expression_clauses = true
####
insert_final_newline = false
csharp_style_namespace_declarations = file_scoped:warning
dotnet_diagnostic.IDE0161.severity = warning # Question - Namespace declaration preferences
dotnet_diagnostic.IDE2000.severity = error # IDE2000: Allow multiple blank lines

View File

@ -1,66 +1,58 @@
using System.Web;
using System.Web.Optimization;
namespace Fab2ApprovalSystem
{
public class BundleConfig
{
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js",
"~/Scripts/jquery-ui-{version}.js")
);
namespace Fab2ApprovalSystem;
//bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
// "~/Scripts/jquery.validate*"));
public class BundleConfig {
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles) {
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js",
"~/Scripts/jquery-ui-{version}.js")
);
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.unobtrusive*",
"~/Scripts/jquery.validate*"));
//bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
// "~/Scripts/jquery.validate*"));
// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.unobtrusive*",
"~/Scripts/jquery.validate*"));
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js",
"~/Scripts/respond.min.js",
"~/Scripts/common.js"));
// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js",
"~/Scripts/respond.min.js",
"~/Scripts/common.js"));
bundles.Add(new ScriptBundle("~/bundles/kendo").Include(
"~/Scripts/kendo/kendo.all.min.js",
"~/Scripts/kendo/kendo.aspnetmvc.min.js"));
bundles.Add(new ScriptBundle("~/bundles/kendo").Include(
"~/Scripts/kendo/kendo.all.min.js",
"~/Scripts/kendo/kendo.aspnetmvc.min.js"));
bundles.Add(new StyleBundle("~/Content/kendo/css").Include(
"~/Content/kendo/kendo.common-bootstrap.min.css",
"~/Content/kendo/kendo.bootstrap.min.css"));
bundles.Add(new StyleBundle("~/Content/kendo/css").Include(
"~/Content/kendo/kendo.common-bootstrap.min.css",
"~/Content/kendo/kendo.bootstrap.min.css"));
bundles.Add(new StyleBundle("~/Content/jqw/css").Include(
"~/Scripts/jqwidgets/styles/jqx.base.css",
"~/Scripts/jqwidgets/styles/jqx.energyblue.css",
"~/Scripts/jqwidgets/styles/jqx.arctic.css",
"~/Scripts/jqwidgets/styles/jqx.energyblue.css"));
bundles.Add(new StyleBundle("~/Content/jqw/css").Include(
"~/Scripts/jqwidgets/styles/jqx.base.css",
"~/Scripts/jqwidgets/styles/jqx.energyblue.css",
"~/Scripts/jqwidgets/styles/jqx.arctic.css",
"~/Scripts/jqwidgets/styles/jqx.energyblue.css"));
bundles.Add(new ScriptBundle("~/Content/jqw/jq").Include(
"~/Scripts/jqwidgets/jqxcore.js",
"~/Scripts/jqwidgets/jqxdata.js",
"~/Scripts/jqwidgets/jqxbuttons.js",
"~/Scripts/jqwidgets/jqxscrollbar.js",
"~/Scripts/jqwidgets/jqxlistbox.js",
"~/Scripts/jqwidgets/jqxpanel.js",
"~/Scripts/jqwidgets/jqxtree.js"));
bundles.Add(new ScriptBundle("~/Content/jqw/jq").Include(
"~/Scripts/jqwidgets/jqxcore.js",
"~/Scripts/jqwidgets/jqxdata.js",
"~/Scripts/jqwidgets/jqxbuttons.js",
"~/Scripts/jqwidgets/jqxscrollbar.js",
"~/Scripts/jqwidgets/jqxlistbox.js",
"~/Scripts/jqwidgets/jqxpanel.js",
"~/Scripts/jqwidgets/jqxtree.js"));
bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/bootstrap.min.css",
"~/Content/site.css",
"~/Content/jquery-ui.css"));
}
bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/bootstrap.min.css",
"~/Content/site.css",
"~/Content/jquery-ui.css"));
}
}
}

View File

@ -1,13 +1,10 @@
using System.Web;
using System.Web.Mvc;
namespace Fab2ApprovalSystem
{
public class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
namespace Fab2ApprovalSystem;
public class FilterConfig {
public static void RegisterGlobalFilters(GlobalFilterCollection filters) {
filters.Add(new HandleErrorAttribute());
}
}
}

View File

@ -6,27 +6,24 @@ using System.Web.Http;
using System.Web.Mvc;
using System.Web.Routing;
namespace Fab2ApprovalSystem
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
namespace Fab2ApprovalSystem;
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
// fixing hyperlinks so that the login page will redirect to them
// set the default route to the desired landing page, instead of the login page
// otherwise MVC generates the wrong form action url
defaults: new { controller = "Home", action = "MyTasks", id = UrlParameter.Optional }
);
//routes.MapHttpRoute(
// name: "ApiRoute",
// routeTemplate: "api/{controller}/{id}",
// defaults: new { id = RouteParameter.Optional }
//);
}
public class RouteConfig {
public static void RegisterRoutes(RouteCollection routes) {
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
// fixing hyperlinks so that the login page will redirect to them
// set the default route to the desired landing page, instead of the login page
// otherwise MVC generates the wrong form action url
defaults: new { controller = "Home", action = "MyTasks", id = UrlParameter.Optional }
);
//routes.MapHttpRoute(
// name: "ApiRoute",
// routeTemplate: "api/{controller}/{id}",
// defaults: new { id = RouteParameter.Optional }
//);
}
}
}

View File

@ -1,38 +1,35 @@
using Microsoft.AspNet.Identity;
using Microsoft.Owin;
using Microsoft.Owin.Security.Cookies;
using Owin;
namespace Fab2ApprovalSystem
{
public partial class Startup
{
// For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864
public void ConfigureAuth(IAppBuilder app)
{
// Enable the application to use a cookie to store information for the signed in user
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login")
});
// Use a cookie to temporarily store information about a user logging in with a third party login provider
// app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
namespace Fab2ApprovalSystem;
// Uncomment the following lines to enable logging in with third party login providers
//app.UseMicrosoftAccountAuthentication(
// clientId: "",
// clientSecret: "");
public partial class Startup {
// For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864
public void ConfigureAuth(IAppBuilder app) {
// Enable the application to use a cookie to store information for the signed in user
app.UseCookieAuthentication(new CookieAuthenticationOptions {
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login")
});
// Use a cookie to temporarily store information about a user logging in with a third party login provider
// app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
//app.UseTwitterAuthentication(
// consumerKey: "",
// consumerSecret: "");
// Uncomment the following lines to enable logging in with third party login providers
//app.UseMicrosoftAccountAuthentication(
// clientId: "",
// clientSecret: "");
//app.UseFacebookAuthentication(
// appId: "",
// appSecret: "");
//app.UseTwitterAuthentication(
// consumerKey: "",
// consumerSecret: "");
//app.UseGoogleAuthentication();
}
//app.UseFacebookAuthentication(
// appId: "",
// appSecret: "");
//app.UseGoogleAuthentication();
}
}
}

View File

@ -1,17 +1,15 @@
using System.Web.Http;
namespace Fab2ApprovalSystem {
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
config.MapHttpAttributeRoutes();
namespace Fab2ApprovalSystem;
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
}
public static class WebApiConfig {
public static void Register(HttpConfiguration config) {
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
}
}
}