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_tools_source="$(jq -r 'select(.toolsSource!=null) | .toolsSource' "$config_file")"
else
_error "$config_file contains invalid JSON."
__error "$config_file contains invalid JSON."
exit 1
fi
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_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
_error "$config_file contains invalid JSON."
__error "$config_file contains invalid JSON."
exit 1
fi
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_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
_error "$config_file contains invalid JSON."
__error "$config_file contains invalid JSON."
exit 1
fi
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
fi

View File

@ -14,18 +14,20 @@ function Test-Template($templateName, $templateArgs, $templateNupkg, $isSPA) {
try {
Run-DotnetNew $templateArgs, "--no-restore"
if($templateArgs -match 'F#')
{
if ($templateArgs -match 'F#') {
$extension = "fsproj"
}
else
{
else {
$extension = "csproj"
}
$proj = "$tmpDir/$templateName.$extension"
$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
dotnet publish --configuration Release

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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