Skip to content
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

Add Downstream API option for Blazor WASM code modifier config #1871

Merged
merged 4 commits into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"Files": [
{
"FileName": "Program.cs",
"Options": [ "MinimalApp" ],
"Options": [
"MinimalApp"
],
"Methods": {
"Global": {
"CodeChanges": [
Expand All @@ -19,7 +21,7 @@
"WebApplication.CreateBuilder.Services.AddRazorPages",
"WebApplication.CreateBuilder.Build"
],
"CodeFormatting": {
"LeadingTrivia": {
"Newline": true
}
},
Expand All @@ -30,15 +32,15 @@
"WebApplication.CreateBuilder.Services.AddAuthorization",
"WebApplication.CreateBuilder.Services.AddRazorPages"
],
"CodeFormatting": {
"LeadingTrivia": {
"Newline": true
}
},
{
"Block": "AddMicrosoftIdentityWebApp(builder.Configuration.GetSection(\"AzureAd\"))",
"Parent": "WebApplication.CreateBuilder.Services.AddAuthentication",
"CodeChangeType": "MemberAccess",
"CodeFormatting": {
"LeadingTrivia": {
"Newline": true
}
},
Expand All @@ -49,16 +51,16 @@
"WebApplication.CreateBuilder.Services.AddAuthorization",
"WebApplication.CreateBuilder.Services.AddRazorPages",
"WebApplication.CreateBuilder.Build"
],
"CodeFormatting": {
],
"LeadingTrivia": {
"Newline": true
}
},
{
"Block": "AddMicrosoftIdentityUI()",
"Parent": "WebApplication.CreateBuilder.Services.AddControllersWithViews",
"CodeChangeType":"MemberAccess",
"CodeFormatting": {
"CodeChangeType": "MemberAccess",
"LeadingTrivia": {
"Newline": true
}
},
Expand All @@ -70,7 +72,7 @@
"DownstreamApi"
],
"Block": "EnableTokenAcquisitionToCallDownstreamApi(initialScopes)",
"CodeFormatting": {
"LeadingTrivia": {
"NumberOfSpaces": 8,
"Newline": true
}
Expand All @@ -81,28 +83,32 @@
"Options": [
"MicrosoftGraph"
],
"Block": "AddMicrosoftGraph(builder.Configuration.GetSection(\"MicrosoftGraph\"))\r\n .AddInMemoryTokenCaches()",
"CodeFormatting": {
"NumberOfSpaces": 12,
"MultiLineBlock": [
" AddMicrosoftGraph(builder.Configuration.GetSection(\"MicrosoftGraph\"))",
" .AddInMemoryTokenCaches()"
],
"LeadingTrivia": {
"Newline": true
}
},
{
"Parent": "EnableTokenAcquisitionToCallDownstreamApi(initialScopes)",
"Parent": "EnableTokenAcquisitionToCallDownstreamApi",
"CodeChangeType": "MemberAccess",
"Options": [
"DownstreamApi"
],
"Block": "AddDownstreamWebApi(\"DownstreamApi\",builder.Configuration.GetSection(\"DownstreamApi\"))\r\n .AddInMemoryTokenCaches()",
"CodeFormatting": {
"NumberOfSpaces": 12,
"MultiLineBlock": [
" AddDownstreamWebApi(\"DownstreamApi\",builder.Configuration.GetSection(\"DownstreamApi\"))",
" .AddInMemoryTokenCaches()"
],
"LeadingTrivia": {
"Newline": true
}
},
{
"Block": "WebApplication.CreateBuilder.Services.AddAuthorization()",
"InsertAfter": "WebApplication.CreateBuilder.Services.AddControllersWithViews",
"CodeFormatting": {
"LeadingTrivia": {
"Newline": true
}
},
Expand All @@ -111,7 +117,7 @@
"Parameter": "options",
"CodeChangeType": "Lambda",
"Parent": "WebApplication.CreateBuilder.Services.AddAuthorization",
"CodeFormatting": {
"LeadingTrivia": {
"Newline": true,
"NumberOfSpaces": 4
}
Expand All @@ -120,29 +126,29 @@
"Block": "AddMicrosoftIdentityConsentHandler()",
"Parent": "WebApplication.CreateBuilder.Services.AddServerSideBlazor()",
"CodeChangeType": "MemberAccess",
"CodeFormatting":{
"LeadingTrivia": {
"Newline": true,
"NumberOfSpaces": 4
}
},
{
"Block": "app.UseAuthentication()",
"InsertAfter": "app.UseRouting()",
"CodeFormatting": {
"LeadingTrivia": {
"Newline": true
}
},
{
"Block": "app.UseAuthorization()",
"InsertAfter": "app.UseAuthentication()",
"CodeFormatting": {
"LeadingTrivia": {
"Newline": true
}
},
{
"Block": "app.MapControllers()",
"InsertAfter": "app.UseAuthorization",
"CodeFormatting": {
"LeadingTrivia": {
"Newline": true
}
}
Expand All @@ -162,12 +168,22 @@
"FileName": "App.razor",
"Replacements": [
{
"Block": "<CascadingAuthenticationState>\r\n <Router AppAssembly=\"@typeof(App).Assembly\">",
"ReplaceSnippet": "<Router AppAssembly=\"@typeof(App).Assembly\">"
"MultiLineBlock": [
"<CascadingAuthenticationState>",
" <Router AppAssembly=\"@typeof(App).Assembly\">"
],
"ReplaceSnippet": [
"<Router AppAssembly=\"@typeof(App).Assembly\">"
]
},
{
"Block":" </Router>\r\n</CascadingAuthenticationState>",
"ReplaceSnippet": "</Router>"
"MultiLineBlock": [
" </Router>",
"</CascadingAuthenticationState>"
],
"ReplaceSnippet": [
"</Router>"
]
}
]
},
Expand All @@ -179,15 +195,38 @@
],
"Replacements": [
{
"Block": "</NavLink>\r\n </div>\r\n <div class=\"nav-item px-3\">\r\n <NavLink class=\"nav-link\" href=\"showprofile\">\r\n <span class=\"oi oi-list-rich\" aria-hidden=\"true\"></span> Show profile\r\n </NavLink>\r\n </div>\r\n </nav>\r\n</div>",
"ReplaceSnippet": "</NavLink>\r\n </div>\r\n </nav>\r\n</div>",
"MultiLineBlock": [
"</NavLink>",
" </div>",
" <div class=\"nav-item px-3\">",
" <NavLink class=\"nav-link\" href=\"showprofile\">",
" <span class=\"oi oi-person\" aria-hidden=\"true\"></span> Show profile",
" </NavLink>",
" </div>",
" </nav>",
"</div>"
],
"ReplaceSnippet": [
"</NavLink>",
" </div>",
" </nav>",
"</div>"
],
"Options": [
"MicrosoftGraph"
]
},
{
"Block": "</NavLink>\r\n </div>\r\n <div class=\"nav-item px-3\">\r\n <NavLink class=\"nav-link\" href=\"callwebapi\">\r\n <span class=\"oi oi-list-rich\" aria-hidden=\"true\"></span> Call Web API\r\n </NavLink>\r\n </div>\r\n </nav>\r\n</div>",
"ReplaceSnippet": "</NavLink>\r\n </div>\r\n </nav>\r\n</div>",
"MultiLineBlock": [
"<NavLink class=\"nav-link\" href=\"callwebapi\">",
" <span class=\"oi oi-list-rich\" aria-hidden=\"true\"></span> Call Web API",
" </NavLink>"
],
"ReplaceSnippet": [
"<NavLink class=\"nav-link\" href=\"fetchdata\">",
" <span class=\"oi oi-list-rich\" aria-hidden=\"true\"></span> Fetch data",
" </NavLink>"
],
"Options": [
"DownstreamApi"
]
Expand All @@ -198,8 +237,15 @@
"FileName": "MainLayout.razor",
"Replacements": [
{
"Block": " <main>\r\n <div class=\"top-row px-4 auth\">\r\n <LoginDisplay />",
"ReplaceSnippet": " <main>\r\n <div class=\"top-row px-4\">"
"MultiLineBlock": [
" <main>",
" <div class=\"top-row px-4 auth\">",
" <LoginDisplay />"
],
"ReplaceSnippet": [
" <main>",
" <div class=\"top-row px-4\">"
]
}
]
},
Expand All @@ -222,4 +268,4 @@
]
}
]
}
}
Loading