Normalise trailing whitespace and line endings everywhere

This commit is contained in:
SteveSandersonMS
2016-03-01 01:10:43 +00:00
parent c425137423
commit 74cac774f8
174 changed files with 782 additions and 783 deletions

View File

@@ -27,4 +27,4 @@ namespace MusicStore.Apis
return Json(artists);
}
}
}
}

View File

@@ -67,4 +67,4 @@ namespace MusicStore.Apis
return Json(albums);
}
}
}
}

View File

@@ -60,4 +60,4 @@ namespace MusicStore.Models
[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
}
}
}

View File

@@ -7,7 +7,7 @@ namespace MusicStore.Models
{
public Album()
{
// TODO: Temporary hack to populate the orderdetails until EF does this automatically.
// TODO: Temporary hack to populate the orderdetails until EF does this automatically.
OrderDetails = new List<OrderDetail>();
}
@@ -37,4 +37,4 @@ namespace MusicStore.Models
public virtual ICollection<OrderDetail> OrderDetails { get; set; }
}
}
}

View File

@@ -9,4 +9,4 @@ namespace MusicStore.Models
[Required]
public string Name { get; set; }
}
}
}

View File

@@ -18,4 +18,4 @@ namespace MusicStore.Models
public virtual Album Album { get; set; }
}
}
}

View File

@@ -21,4 +21,4 @@ namespace MusicStore.Models
[JsonIgnore]
public virtual ICollection<Album> Albums { get; set; }
}
}
}

View File

@@ -31,4 +31,4 @@ namespace MusicStore.Models
base.OnModelCreating(builder);
}
}
}
}

View File

@@ -70,4 +70,4 @@ namespace MusicStore.Models
public ICollection<OrderDetail> OrderDetails { get; set; }
}
}
}

View File

@@ -11,4 +11,4 @@
public virtual Album Album { get; set; }
public virtual Order Order { get; set; }
}
}
}

View File

@@ -42,13 +42,13 @@ namespace MusicStore.Models
{
// Query in a separate context so that we can attach existing entities as modified
List<TEntity> existingData;
using (var scope = serviceProvider.GetRequiredService<IServiceScopeFactory>().CreateScope())
using (var db = scope.ServiceProvider.GetService<MusicStoreContext>())
{
existingData = db.Set<TEntity>().ToList();
}
using (var scope = serviceProvider.GetRequiredService<IServiceScopeFactory>().CreateScope())
using (var db = scope.ServiceProvider.GetService<MusicStoreContext>())
{
@@ -65,8 +65,8 @@ namespace MusicStore.Models
private static Album[] GetAlbums(string imgUrl, Dictionary<string, Genre> genres, Dictionary<string, Artist> artists)
{
var albums = new Album[]
{
var albums = new Album[]
{
new Album { Title = "The Best Of The Men At Work", Genre = genres["Pop"], Price = 8.99M, Artist = artists["Men At Work"], AlbumArtUrl = imgUrl },
new Album { Title = "...And Justice For All", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl },
new Album { Title = "עד גבול האור", Genre = genres["World"], Price = 8.99M, Artist = artists["אריק אינשטיין"], AlbumArtUrl = imgUrl },
@@ -912,4 +912,4 @@ namespace MusicStore.Models
}
}
}
}
}

View File

@@ -123,7 +123,7 @@ namespace MusicStore.Models
public decimal GetTotal()
{
// Multiply album price by count of that album to get
// Multiply album price by count of that album to get
// the current price for each of those albums in the cart
// sum all album price totals to get the cart total
@@ -190,7 +190,7 @@ namespace MusicStore.Models
if (string.IsNullOrWhiteSpace(sessionCookie))
{
//A GUID to hold the cartId.
//A GUID to hold the cartId.
cartId = Guid.NewGuid().ToString();
// Send cart Id as a cookie to the client.
@@ -204,4 +204,4 @@ namespace MusicStore.Models
return cartId;
}
}
}
}

View File

@@ -16,4 +16,4 @@ namespace MusicStore.Infrastructure
base.OnResultExecuting(context);
}
}
}
}

View File

@@ -147,4 +147,4 @@ namespace MusicStore.Infrastructure
public int PageSize { get; set; }
}
}
}
}

View File

@@ -21,7 +21,7 @@ export default function (params: any): Promise<{ html: string }> {
const app = (
<Provider store={ store }>
<RouterContext {...renderProps} />
</Provider>
</Provider>
);
// Perform an initial render that will cause any async tasks (e.g., data access) to begin

View File

@@ -1,4 +1,4 @@
import * as React from 'react';
import * as React from 'react';
import { Navbar, Nav, NavItem, NavDropdown, MenuItem } from 'react-bootstrap';
import { Link } from 'react-router';
import { LinkContainer } from 'react-router-bootstrap';
@@ -25,7 +25,7 @@ class NavMenu extends React.Component<NavMenuProps, void> {
{genres.map(genre =>
<LinkContainer key={ genre.GenreId } to={ `/genre/${ genre.GenreId }` }>
<MenuItem>{ genre.Name }</MenuItem>
</LinkContainer>
</LinkContainer>
)}
<MenuItem divider />
<LinkContainer to={ '/genres' }><MenuItem>More</MenuItem></LinkContainer>
@@ -43,7 +43,7 @@ class NavMenu extends React.Component<NavMenuProps, void> {
// Selects which part of global state maps to this component, and defines a type for the resulting props
const provider = provide(
(state: ApplicationState) => state.genreList,
GenreList.actionCreators
GenreList.actionCreators
);
type NavMenuProps = typeof provider.allProps;
export default provider.connect(NavMenu);

View File

@@ -22,9 +22,9 @@ class AlbumDetails extends React.Component<AlbumDetailsProps, void> {
const albumData = this.props.album;
return <div>
<h2>{ albumData.Title }</h2>
<p><img alt={ albumData.Title } src={ albumData.AlbumArtUrl } /></p>
<div id="album-details">
<p>
<em>Genre:</em>

View File

@@ -1,4 +1,4 @@
import * as React from 'react';
import * as React from 'react';
import { Link } from 'react-router';
import { Album } from '../../store/FeaturedAlbums';

View File

@@ -13,7 +13,7 @@ class GenreDetails extends React.Component<GenreDetailsProps, void> {
componentWillMount() {
this.props.requestGenreDetails(parseInt(this.props.params.genreId));
}
componentWillReceiveProps(nextProps: GenreDetailsProps) {
this.props.requestGenreDetails(parseInt(nextProps.params.genreId));
}

View File

@@ -10,7 +10,7 @@ export default function configureStore(history: HistoryModule.History, initialSt
const reduxRouterMiddleware = syncHistory(history);
const middlewares = [thunk, reduxRouterMiddleware, typedToPlain];
const devToolsExtension = null;//(window as any).devToolsExtension; // If devTools is installed, connect to it
const finalCreateStore = compose(
applyMiddleware(...middlewares),
devToolsExtension ? devToolsExtension() : f => f
@@ -20,10 +20,10 @@ export default function configureStore(history: HistoryModule.History, initialSt
const allReducers = buildRootReducer(Store.reducers);
const store = finalCreateStore(allReducers, initialState) as Redux.Store;
// Required for replaying actions from devtools to work
reduxRouterMiddleware.listenForReplays(store);
// Enable Webpack hot module replacement for reducers
if (module.hot) {
module.hot.accept('./store', () => {

View File

@@ -47,7 +47,7 @@ class ReceiveAlbumDetails extends Action {
// ACTION CREATORS - These are functions exposed to UI components that will trigger a state transition.
// They don't directly mutate state, but they can have external side-effects (such as loading data).
export const actionCreators = {
export const actionCreators = {
requestAlbumDetails: (albumId: number): ActionCreator => (dispatch, getState) => {
// Only load if it's not already loaded (or currently being loaded)
if (albumId !== getState().albumDetails.requestedAlbumId) {
@@ -59,7 +59,7 @@ export const actionCreators = {
dispatch(new ReceiveAlbumDetails(album));
}
});
dispatch(new RequestAlbumDetails(albumId));
}
}

View File

@@ -42,7 +42,7 @@ export const actionCreators = {
fetch('/api/albums/mostPopular')
.then(results => results.json())
.then(albums => dispatch(new ReceiveFeaturedAlbums(albums)));
return dispatch(new RequestFeaturedAlbums());
}
}

View File

@@ -35,7 +35,7 @@ class ReceiveGenreDetails extends Action {
// ACTION CREATORS - These are functions exposed to UI components that will trigger a state transition.
// They don't directly mutate state, but they can have external side-effects (such as loading data).
export const actionCreators = {
export const actionCreators = {
requestGenreDetails: (genreId: number): ActionCreator => (dispatch, getState) => {
// Only load if it's not already loaded (or currently being loaded)
if (genreId !== getState().genreDetails.requestedGenreId) {
@@ -44,10 +44,10 @@ export const actionCreators = {
.then(albums => {
// Only replace state if it's still the most recent request
if (genreId === getState().genreDetails.requestedGenreId) {
dispatch(new ReceiveGenreDetails(genreId, albums));
dispatch(new ReceiveGenreDetails(genreId, albums));
}
});
dispatch(new RequestGenreDetails(genreId));
}
}

View File

@@ -31,7 +31,7 @@ class ReceiveGenresList extends Action {
// ACTION CREATORS - These are functions exposed to UI components that will trigger a state transition.
// They don't directly mutate state, but they can have external side-effects (such as loading data).
export const actionCreators = {
export const actionCreators = {
requestGenresList: (): ActionCreator => (dispatch, getState) => {
if (!getState().genreList.isLoaded) {
fetch('/api/genres')

View File

@@ -23,5 +23,5 @@ export const reducers = {
};
// This type can be used as a hint on action creators so that its 'dispatch' and 'getState' params are
// correctly typed to match your store.
// correctly typed to match your store.
export type ActionCreator = ActionCreatorGeneric<ApplicationState>;

View File

@@ -41,7 +41,7 @@ namespace MusicStore
// Uncomment the following line to add Web API services which makes it easier to port Web API 2 controllers.
// You will also need to add the Microsoft.AspNet.Mvc.WebApiCompatShim package to the 'dependencies' section of project.json.
// services.AddWebApiConventions();
// Add EF services to the service container
services.AddEntityFramework()
.AddSqlite()
@@ -78,7 +78,7 @@ namespace MusicStore
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole(LogLevel.Warning);
// Initialize the sample data
SampleData.InitializeMusicStoreDatabaseAsync(app.ApplicationServices).Wait();
@@ -89,7 +89,7 @@ namespace MusicStore
}
app.UseIISPlatformHandler();
// In dev mode, the JS/TS/etc is compiled and served dynamically and supports hot replacement.
// In production, we assume you've used webpack to emit the prebuilt content to disk.
if (env.IsDevelopment()) {
@@ -105,7 +105,7 @@ namespace MusicStore
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
routes.MapSpaFallbackRoute(
name: "spa-fallback",
defaults: new { controller = "Home", action = "Index" });

View File

@@ -1,11 +1,11 @@
@{
ViewData["Title"] = "Home Page";
}
<div id="react-app" asp-prerender-module="ReactApp/boot-server"
asp-prerender-webpack-config="webpack.config.js"></div>
@section scripts {
<script src="/dist/vendor.bundle.js"></script>
<script src="/dist/main.js"></script>
}
@{
ViewData["Title"] = "Home Page";
}
<div id="react-app" asp-prerender-module="ReactApp/boot-server"
asp-prerender-webpack-config="webpack.config.js"></div>
@section scripts {
<script src="/dist/vendor.bundle.js"></script>
<script src="/dist/main.js"></script>
}

View File

@@ -1,6 +1,6 @@
@{
ViewData["Title"] = "Error";
}
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@{
ViewData["Title"] = "Error";
}
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>

View File

@@ -1,12 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>@ViewData["Title"]</title>
<link rel="stylesheet" href="/dist/main.css" />
</head>
<body>
@RenderBody()
@RenderSection("scripts", required: false)
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>@ViewData["Title"]</title>
<link rel="stylesheet" href="/dist/main.css" />
</head>
<body>
@RenderBody()
@RenderSection("scripts", required: false)
</body>
</html>

View File

@@ -1,3 +1,3 @@
@using MusicStore
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"
@addTagHelper "*, Microsoft.AspNet.SpaServices"
@using MusicStore
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"
@addTagHelper "*, Microsoft.AspNet.SpaServices"

View File

@@ -1,3 +1,3 @@
@{
Layout = "_Layout";
}
@{
Layout = "_Layout";
}

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
</handlers>
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false"/>
</system.webServer>
</configuration>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
</handlers>
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false"/>
</system.webServer>
</configuration>

View File

@@ -16,14 +16,14 @@ namespace ReactExample.Controllers
}
}
}
public class PersonDto {
public string name { get; set; }
public string city { get; set; }
public string state { get; set; }
public string country { get; set; }
public string company { get; set; }
[Range(1, 10)]
public int favoriteNumber { get; set; }
}

View File

@@ -16,7 +16,7 @@ export default function renderApp (params) {
const app = <RouterContext {...renderProps} />;
// Render it as an HTML string which can be injected into the response
const html = renderToString(app);
const html = renderToString(app);
resolve({ html });
});
});

View File

@@ -5,7 +5,7 @@ export class CustomPager extends React.Component {
pageChange(event) {
this.props.setPage(parseInt(event.target.getAttribute("data-value")));
}
render() {
var previous = null;
var next = null;
@@ -47,4 +47,4 @@ CustomPager.defaultProps = {
nextText: '',
previousText: '',
currentPage: 0
};
};

View File

@@ -8,11 +8,11 @@ export class PersonEditor extends React.Component {
super();
this.state = { savedChanges: false };
}
onChange() {
this.setState({ savedChanges: false });
}
submit(model, reset, setErrors) {
PersonEditor.sendJson('put', `/api/people/${ this.props.params.personId }`, model).then(response => {
if (response.ok) {
@@ -23,7 +23,7 @@ export class PersonEditor extends React.Component {
}
});
}
render() {
var personId = parseInt(this.props.params.personId);
var person = fakeData.filter(p => p.id === personId)[0];
@@ -46,12 +46,12 @@ export class PersonEditor extends React.Component {
</Formsy.Form>
</div>;
}
static sendJson(method, url, object) {
return fetch(url, {
method: method,
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(object)
body: JSON.stringify(object)
});
}
}

View File

@@ -6,7 +6,7 @@ import { PersonEditor } from './PersonEditor.jsx';
export const routes = <Route>
<Route path="/" component={ PeopleGrid } />
<Route path="/:pageIndex" component={ PeopleGrid } />
<Route path="/edit/:personId" component={ PersonEditor } />
<Route path="/edit/:personId" component={ PersonEditor } />
</Route>;
export class ReactApp extends React.Component {

View File

@@ -16,4 +16,4 @@
<DevelopmentServerPort>2311</DevelopmentServerPort>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
</Project>

View File

@@ -52,7 +52,7 @@ namespace ReactExample
// send the request to the following path or controller action.
app.UseExceptionHandler("/Home/Error");
}
// In dev mode, the JS/TS/etc is compiled and served dynamically and supports hot replacement.
// In production, we assume you've used webpack to emit the prebuilt content to disk.
if (env.IsDevelopment()) {

View File

@@ -1,6 +1,6 @@
<div id="react-app" asp-prerender-module="ReactApp/boot-server.jsx"
asp-prerender-webpack-config="webpack.config.js"></div>
@section scripts {
<script src="/dist/main.js"></script>
}
<div id="react-app" asp-prerender-module="ReactApp/boot-server.jsx"
asp-prerender-webpack-config="webpack.config.js"></div>
@section scripts {
<script src="/dist/main.js"></script>
}

View File

@@ -1,6 +1,6 @@
@{
ViewData["Title"] = "Error";
}
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@{
ViewData["Title"] = "Error";
}
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>

View File

@@ -1,14 +1,14 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>ReactExample</title>
<link rel="stylesheet" href="/dist/main.css" />
</head>
<body>
<div class="container">
@RenderBody()
</div>
@RenderSection("scripts", required: false)
</body>
</html>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>ReactExample</title>
<link rel="stylesheet" href="/dist/main.css" />
</head>
<body>
<div class="container">
@RenderBody()
</div>
@RenderSection("scripts", required: false)
</body>
</html>

View File

@@ -1,3 +1,3 @@
@using ReactExample
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"
@addTagHelper "*, Microsoft.AspNet.SpaServices"
@using ReactExample
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"
@addTagHelper "*, Microsoft.AspNet.SpaServices"

View File

@@ -1,3 +1,3 @@
@{
Layout = "_Layout";
}
@{
Layout = "_Layout";
}

View File

@@ -40,4 +40,4 @@
"npm install"
]
}
}
}

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
</handlers>
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false"/>
</system.webServer>
</configuration>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
</handlers>
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false"/>
</system.webServer>
</configuration>