automated: merge branch release/2.2

This commit is contained in:
Nate McMaster 2018-09-28 17:28:07 -07:00
commit 00e2b6201e
No known key found for this signature in database
GPG Key ID: A778D9601BD78810
18 changed files with 45 additions and 27 deletions

8
run.sh
View File

@ -220,7 +220,7 @@ if [ -f "$config_file" ]; then
config_channel="$(jq -r 'select(.channel!=null) | .channel' "$config_file")" config_channel="$(jq -r 'select(.channel!=null) | .channel' "$config_file")"
config_tools_source="$(jq -r 'select(.toolsSource!=null) | .toolsSource' "$config_file")" config_tools_source="$(jq -r 'select(.toolsSource!=null) | .toolsSource' "$config_file")"
else else
_error "$config_file contains invalid JSON." __error "$config_file contains invalid JSON."
exit 1 exit 1
fi fi
elif __machine_has python ; then elif __machine_has python ; then
@ -228,7 +228,7 @@ if [ -f "$config_file" ]; then
config_channel="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['channel'] if 'channel' in obj else '')")" config_channel="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['channel'] if 'channel' in obj else '')")"
config_tools_source="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")" config_tools_source="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")"
else else
_error "$config_file contains invalid JSON." __error "$config_file contains invalid JSON."
exit 1 exit 1
fi fi
elif __machine_has python3 ; then elif __machine_has python3 ; then
@ -236,11 +236,11 @@ if [ -f "$config_file" ]; then
config_channel="$(python3 -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['channel'] if 'channel' in obj else '')")" config_channel="$(python3 -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['channel'] if 'channel' in obj else '')")"
config_tools_source="$(python3 -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")" config_tools_source="$(python3 -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")"
else else
_error "$config_file contains invalid JSON." __error "$config_file contains invalid JSON."
exit 1 exit 1
fi fi
else else
_error 'Missing required command: jq or python. Could not parse the JSON file.' __error 'Missing required command: jq or python. Could not parse the JSON file.'
exit 1 exit 1
fi fi

View File

@ -14,18 +14,20 @@ function Test-Template($templateName, $templateArgs, $templateNupkg, $isSPA) {
try { try {
Run-DotnetNew $templateArgs, "--no-restore" Run-DotnetNew $templateArgs, "--no-restore"
if($templateArgs -match 'F#') if ($templateArgs -match 'F#') {
{
$extension = "fsproj" $extension = "fsproj"
} }
else else {
{
$extension = "csproj" $extension = "csproj"
} }
$proj = "$tmpDir/$templateName.$extension" $proj = "$tmpDir/$templateName.$extension"
$projContent = Get-Content -Path $proj -Raw $projContent = Get-Content -Path $proj -Raw
$projContent = $projContent -replace ('<Project Sdk="Microsoft.NET.Sdk.Web">', "<Project Sdk=""Microsoft.NET.Sdk.Web"">`n<Import Project=""$PSScriptRoot/../test/Templates.Test/bin/Debug/netcoreapp2.2/TemplateTests.props"" />") $projContent = $projContent -replace ('<Project Sdk="Microsoft.NET.Sdk.Web">', "<Project Sdk=""Microsoft.NET.Sdk.Web"">
<Import Project=""$PSScriptRoot/../test/Templates.Test/bin/Debug/netcoreapp2.2/TemplateTests.props"" />
<ItemGroup>
<PackageReference Include=""Microsoft.NET.Sdk.Razor"" Version=""`$(MicrosoftNETSdkRazorPackageVersion)"" />
</ItemGroup>")
$projContent | Set-Content $proj $projContent | Set-Content $proj
dotnet publish --configuration Release dotnet publish --configuration Release

View File

@ -6,4 +6,4 @@ param()
. $PSScriptRoot\Custom-Hive.ps1 . $PSScriptRoot\Custom-Hive.ps1
Test-Template "razor" "razor -au Individual" "Microsoft.DotNet.Web.ProjectTemplates.2.2.2.2.0-preview3-t000.nupkg" $false Test-Template "webapp" "webapp -au Individual" "Microsoft.DotNet.Web.ProjectTemplates.2.2.2.2.0-preview3-t000.nupkg" $false

View File

@ -5,6 +5,7 @@
<TargetFramework Condition="'$(TargetFrameworkOverride)' != ''">TargetFrameworkOverride</TargetFramework> <TargetFramework Condition="'$(TargetFrameworkOverride)' != ''">TargetFrameworkOverride</TargetFramework>
<NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile> <NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile>
<AspNetCoreHostingModel>inprocess</AspNetCoreHostingModel> <AspNetCoreHostingModel>inprocess</AspNetCoreHostingModel>
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Company.WebApplication1</RootNamespace>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -5,6 +5,7 @@
<TargetFramework Condition="'$(TargetFrameworkOverride)' != ''">TargetFrameworkOverride</TargetFramework> <TargetFramework Condition="'$(TargetFrameworkOverride)' != ''">TargetFrameworkOverride</TargetFramework>
<NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile> <NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile>
<AspNetCoreHostingModel>inprocess</AspNetCoreHostingModel> <AspNetCoreHostingModel>inprocess</AspNetCoreHostingModel>
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Company.WebApplication1</RootNamespace>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -2,6 +2,7 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Company.RazorClassLibrary1</RootNamespace>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -9,6 +9,7 @@
<WebProject_DirectoryAccessLevelKey Condition="'$(OrganizationalAuth)' == 'True' AND '$(OrgReadAccess)' == 'True'">1</WebProject_DirectoryAccessLevelKey> <WebProject_DirectoryAccessLevelKey Condition="'$(OrganizationalAuth)' == 'True' AND '$(OrgReadAccess)' == 'True'">1</WebProject_DirectoryAccessLevelKey>
<NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile> <NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile>
<AspNetCoreHostingModel>inprocess</AspNetCoreHostingModel> <AspNetCoreHostingModel>inprocess</AspNetCoreHostingModel>
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Company.WebApplication1</RootNamespace>
</PropertyGroup> </PropertyGroup>
<!--#if (IndividualLocalAuth && !UseLocalDB) --> <!--#if (IndividualLocalAuth && !UseLocalDB) -->

View File

@ -9,6 +9,7 @@
<WebProject_DirectoryAccessLevelKey Condition="'$(OrganizationalAuth)' == 'True' AND '$(OrgReadAccess)' == 'True'">1</WebProject_DirectoryAccessLevelKey> <WebProject_DirectoryAccessLevelKey Condition="'$(OrganizationalAuth)' == 'True' AND '$(OrgReadAccess)' == 'True'">1</WebProject_DirectoryAccessLevelKey>
<NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile> <NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile>
<AspNetCoreHostingModel>inprocess</AspNetCoreHostingModel> <AspNetCoreHostingModel>inprocess</AspNetCoreHostingModel>
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Company.WebApplication1</RootNamespace>
</PropertyGroup> </PropertyGroup>
<!--#if (IndividualLocalAuth && !UseLocalDB) --> <!--#if (IndividualLocalAuth && !UseLocalDB) -->

View File

@ -6,6 +6,7 @@
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish> <MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
<NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile> <NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile>
<AspNetCoreHostingModel>inprocess</AspNetCoreHostingModel> <AspNetCoreHostingModel>inprocess</AspNetCoreHostingModel>
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Company.WebApplication1</RootNamespace>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -8,6 +8,7 @@
<WebProject_DirectoryAccessLevelKey Condition="'$(OrganizationalAuth)' == 'True' AND '$(OrgReadAccess)' == 'True'">1</WebProject_DirectoryAccessLevelKey> <WebProject_DirectoryAccessLevelKey Condition="'$(OrganizationalAuth)' == 'True' AND '$(OrgReadAccess)' == 'True'">1</WebProject_DirectoryAccessLevelKey>
<NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile> <NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile>
<AspNetCoreHostingModel>inprocess</AspNetCoreHostingModel> <AspNetCoreHostingModel>inprocess</AspNetCoreHostingModel>
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Company.WebApplication1</RootNamespace>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -5,6 +5,7 @@
<TargetFramework Condition="'$(TargetFrameworkOverride)' != ''">TargetFrameworkOverride</TargetFramework> <TargetFramework Condition="'$(TargetFrameworkOverride)' != ''">TargetFrameworkOverride</TargetFramework>
<NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile> <NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile>
<AspNetCoreHostingModel>inprocess</AspNetCoreHostingModel> <AspNetCoreHostingModel>inprocess</AspNetCoreHostingModel>
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Company.WebApplication1</RootNamespace>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -13,8 +13,8 @@
"precedence": "5000", "precedence": "5000",
"identity": "Microsoft.Web.RazorPages.CSharp.3.0", "identity": "Microsoft.Web.RazorPages.CSharp.3.0",
"shortName": [ "shortName": [
"razor", "webapp",
"webapp" "razor"
], ],
"thirdPartyNotices": "https://aka.ms/aspnetcore-template-3pn-210", "thirdPartyNotices": "https://aka.ms/aspnetcore-template-3pn-210",
"tags": { "tags": {

View File

@ -12,6 +12,7 @@
<!-- Set this to true if you enable server-side prerendering --> <!-- Set this to true if you enable server-side prerendering -->
<BuildServerSideRenderer>false</BuildServerSideRenderer> <BuildServerSideRenderer>false</BuildServerSideRenderer>
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Company.WebApplication1</RootNamespace>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' == ''"> <ItemGroup Condition="'$(TargetFrameworkOverride)' == ''">

View File

@ -9,6 +9,7 @@
<SpaRoot>ClientApp\</SpaRoot> <SpaRoot>ClientApp\</SpaRoot>
<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes> <DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
<NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile> <NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile>
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Company.WebApplication1</RootNamespace>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' == ''"> <ItemGroup Condition="'$(TargetFrameworkOverride)' == ''">

View File

@ -9,6 +9,7 @@
<SpaRoot>ClientApp\</SpaRoot> <SpaRoot>ClientApp\</SpaRoot>
<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes> <DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
<NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile> <NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile>
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Company.WebApplication1</RootNamespace>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition="'$(TargetFrameworkOverride)' == ''"> <ItemGroup Condition="'$(TargetFrameworkOverride)' == ''">

View File

@ -1,5 +1,6 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Collapse, Container, Navbar, NavbarBrand, NavbarToggler, NavItem, NavLink } from 'reactstrap'; import { Collapse, Container, Navbar, NavbarBrand, NavbarToggler, NavItem, NavLink } from 'reactstrap';
import { Link } from 'react-router-dom';
import './NavMenu.css'; import './NavMenu.css';
export class NavMenu extends Component { export class NavMenu extends Component {
@ -25,18 +26,18 @@ export class NavMenu extends Component {
<header> <header>
<Navbar className="navbar-expand-sm navbar-toggleable-sm ng-white border-bottom box-shadow mb-3" light> <Navbar className="navbar-expand-sm navbar-toggleable-sm ng-white border-bottom box-shadow mb-3" light>
<Container> <Container>
<NavbarBrand href="/">Company.WebApplication1</NavbarBrand> <NavbarBrand tag={Link} to="/">Company.WebApplication1</NavbarBrand>
<NavbarToggler onClick={this.toggleNavbar} className="mr-2" /> <NavbarToggler onClick={this.toggleNavbar} className="mr-2" />
<Collapse className="d-sm-inline-flex flex-sm-row-reverse" isOpen={!this.state.collapsed} navbar> <Collapse className="d-sm-inline-flex flex-sm-row-reverse" isOpen={!this.state.collapsed} navbar>
<ul className="navbar-nav flex-grow"> <ul className="navbar-nav flex-grow">
<NavItem> <NavItem>
<NavLink className="text-dark" href="/">Home</NavLink> <NavLink tag={Link} className="text-dark" to="/">Home</NavLink>
</NavItem> </NavItem>
<NavItem> <NavItem>
<NavLink className="text-dark" href="/counter">Counter</NavLink> <NavLink tag={Link} className="text-dark" to="/counter">Counter</NavLink>
</NavItem> </NavItem>
<NavItem> <NavItem>
<NavLink className="text-dark" href="/fetch-data">Fetch data</NavLink> <NavLink tag={Link} className="text-dark" to="/fetch-data">Fetch data</NavLink>
</NavItem> </NavItem>
</ul> </ul>
</Collapse> </Collapse>

View File

@ -5,15 +5,18 @@ import { Link } from 'react-router-dom';
import { actionCreators } from '../store/WeatherForecasts'; import { actionCreators } from '../store/WeatherForecasts';
class FetchData extends Component { class FetchData extends Component {
componentWillMount() { componentDidMount() {
// This method runs when the component is first added to the page // This method is called when the component is first added to the document
const startDateIndex = parseInt(this.props.match.params.startDateIndex, 10) || 0; this.ensureDataFetched();
this.props.requestWeatherForecasts(startDateIndex);
} }
componentWillReceiveProps(nextProps) { componentDidUpdate() {
// This method runs when incoming props (e.g., route params) change // This method is called when the route parameters change
const startDateIndex = parseInt(nextProps.match.params.startDateIndex, 10) || 0; this.ensureDataFetched();
}
ensureDataFetched() {
const startDateIndex = parseInt(this.props.match.params.startDateIndex, 10) || 0;
this.props.requestWeatherForecasts(startDateIndex); this.props.requestWeatherForecasts(startDateIndex);
} }

View File

@ -1,5 +1,6 @@
import React from 'react'; import React from 'react';
import { Collapse, Container, Navbar, NavbarBrand, NavbarToggler, NavItem, NavLink } from 'reactstrap'; import { Collapse, Container, Navbar, NavbarBrand, NavbarToggler, NavItem, NavLink } from 'reactstrap';
import { Link } from 'react-router-dom';
import './NavMenu.css'; import './NavMenu.css';
export default class NavMenu extends React.Component { export default class NavMenu extends React.Component {
@ -21,18 +22,18 @@ export default class NavMenu extends React.Component {
<header> <header>
<Navbar className="navbar-expand-sm navbar-toggleable-sm border-bottom box-shadow mb-3" light > <Navbar className="navbar-expand-sm navbar-toggleable-sm border-bottom box-shadow mb-3" light >
<Container> <Container>
<NavbarBrand href="/">Company.WebApplication1</NavbarBrand> <NavbarBrand tag={Link} to="/">Company.WebApplication1</NavbarBrand>
<NavbarToggler onClick={this.toggle} className="mr-2" /> <NavbarToggler onClick={this.toggle} className="mr-2" />
<Collapse className="d-sm-inline-flex flex-sm-row-reverse" isOpen={this.state.isOpen} navbar> <Collapse className="d-sm-inline-flex flex-sm-row-reverse" isOpen={this.state.isOpen} navbar>
<ul className="navbar-nav flex-grow"> <ul className="navbar-nav flex-grow">
<NavItem> <NavItem>
<NavLink className="text-dark" href="/">Home</NavLink> <NavLink tag={Link} className="text-dark" to="/">Home</NavLink>
</NavItem> </NavItem>
<NavItem> <NavItem>
<NavLink className="text-dark" href="/counter">Counter</NavLink> <NavLink tag={Link} className="text-dark" to="/counter">Counter</NavLink>
</NavItem> </NavItem>
<NavItem> <NavItem>
<NavLink className="text-dark" href="/fetch-data">Fetch data</NavLink> <NavLink tag={Link} className="text-dark" to="/fetch-data">Fetch data</NavLink>
</NavItem> </NavItem>
</ul> </ul>
</Collapse> </Collapse>