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

Updates/1.3.0 #12

Merged
merged 11 commits into from
Apr 8, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ GitHubGit
MVC/packages/*
MVC/MVC/bin/*
MVC/MVC/obj/*
MVC/MVC/node_modules/*
KenticoAdmin/packages/*
KenticoAdmin/CMS/bin/*
KenticoAdmin/CMS/obj/*
Expand All @@ -38,4 +39,14 @@ MVC/MVC.Models/bin
MVC/MVC.Models/obj
XperienceModels/bin
XperienceModels/obj
!README.md
!README.md

# Ignore files that automatically build from source using npm gulp
MVC/MVC/wwwroot/css/bundles/**/*
MVC/MVC/wwwroot/js/bundles/**/*
MVC/MVC/wwwroot/css/Custom.css
MVC/MVC/wwwroot/css/EditMode.css
MVC/MVC/wwwroot/js/scripts/Custom.js*
MVC/MVC/wwwroot/js/scripts/HeaderCustom.js*
MVC/MVC/wwwroot/js/scripts/helpers.js*
MVC/MVC/wwwroot/js/scripts/samplereact.js*
2 changes: 1 addition & 1 deletion KenticoAdmin/CMS/App_Data/Install/Hotfix.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
57
64
Binary file modified KenticoAdmin/CMS/App_Data/Install/SQL.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion MVC/MVC.Libraries/MVC.Libraries.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<ItemGroup>
<PackageReference Include="AutoMapper" Version="10.1.1" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.1.1" />
<PackageReference Include="Kentico.Xperience.AspNetCore.WebApp" Version="13.0.62" />
<PackageReference Include="Kentico.Xperience.AspNetCore.WebApp" Version="13.0.64" />
<PackageReference Include="MVCCaching.Base.Core" Version="2.1.1" />
<PackageReference Include="MVCCaching.Kentico.Core" Version="13.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
Expand Down
1 change: 1 addition & 0 deletions MVC/MVC/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scripts-prepend-node-path=true
23 changes: 23 additions & 0 deletions MVC/MVC/App_Start/StartupConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
using Generic.Repositories.Implementation;
using System.Collections.Generic;
using XperienceCommunity.WidgetFilter;
using Microsoft.Extensions.FileProviders;
using System.IO;

namespace Generic.App_Start
{
Expand Down Expand Up @@ -296,6 +298,27 @@ public static void RegisterDotNetCoreConfigurationsAndKentico(IApplicationBuilde

app.UseStaticFiles();

// While IIS and IIS Express automatically handle StaticFiles from the root, default Kestrel doesn't, so safer to
// add this for any Site Media Libraries if you ever plan on linking directly to the file. /getmedia linkes are not
// impacted.
//
// Also, if you ever need to bypass the IIS/IIS Express default StaticFile handling, you can add a web.config in the media folder
// with the below:
// <?xml version="1.0"?>
// <configuration>
// <system.webServer>
// <handlers>
// <add name="ForceStaticFileHandlingToNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Either" requireAccess="Read" />
// </handlers>
// </system.webServer>
// </configuration>
app.UseStaticFiles(new StaticFileOptions()
{
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "Baseline")),
RequestPath = "/Baseline"
});


app.UseKentico();

app.UseCookiePolicy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
}
}


.active > a {
font-weight: bold;
}
Expand All @@ -22,4 +21,4 @@ img.Logo {

.validation-summary-valid {
display: none;
}
}
18 changes: 18 additions & 0 deletions MVC/MVC/FrontEndDev/react/sampleapp/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions MVC/MVC/FrontEndDev/react/sampleapp/app.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions MVC/MVC/FrontEndDev/react/sampleapp/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import * as ReactDOM from 'react-dom';
import * as React from 'react';
import {HelloWorld} from './components/HelloWorld'


// declare my helper in the window interface
declare global {
interface Window {
ReactMethods: ReactMethods
}
}
export class ReactMethods {
static SampleApp(containerID : string): void {
ReactDOM.render(
<HelloWorld CustomMessage="Testing etc" />
, document.getElementById(containerID));
}
}

// Can access your methods with window.ReactMethods.SampleApp("MyContainer")
window.ReactMethods = ReactMethods;
49 changes: 49 additions & 0 deletions MVC/MVC/FrontEndDev/react/sampleapp/components/HelloWorld.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions MVC/MVC/FrontEndDev/react/sampleapp/components/HelloWorld.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import * as React from "react";
import ReactDOM = require("react-dom");

export class HelloWorld extends React.Component<IHelloWorldProps, IHelloWorldState> {
constructor(props) {
super(props);

this.state = {
DisplayedMessage: false
}
}
componentDidMount() {
}
componentDidUpdate() {
}
render() {
return <div>
Hello world!
{this.state.DisplayedMessage &&
<p>{this.props.CustomMessage}</p>
}
{!this.state.DisplayedMessage &&
<button type="button" onClick={this.DisplayMessageClick}>Show Message</button>
}
</div>
}

DisplayMessageClick = () => {
this.setState({
DisplayedMessage: true
});
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
interface IHelloWorldProps {
CustomMessage? : string;
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
interface IHelloWorldState {
DisplayedMessage : boolean;
}
40 changes: 40 additions & 0 deletions MVC/MVC/FrontEndDev/react/sampleapp/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const path = require('path');
const isDevelopment = (process.env.NODE_ENV !== undefined && process.env.NODE_ENV.toLowerCase() === "development" ? true : false);

module.exports = {
entry: "/FrontEndDev/react/sampleapp/app.tsx",
mode: isDevelopment ? "development" : "production",
output: {
filename: "samplereact.js",
path: path.resolve(__dirname, "../../../wwwroot/js/scripts")
},
// Enable sourcemaps for debugging webpack's output.
devtool: "source-map",
resolve: {
// Add '.ts' and '.tsx' as resolvable extensions.
extensions: [".ts", ".tsx", ".js"]
},
module: {
rules: [
{
test: /\.ts(x?)$/,
exclude: /node_modules/,
use: [
{
loader: "ts-loader"
}
]
},

// All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'.
{
enforce: "pre",
test: /\.js$/,
loader: "source-map-loader"
}
]
},
optimization: {
minimize: false
}
}
13 changes: 13 additions & 0 deletions MVC/MVC/FrontEndDev/typescript/Custom/custom.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions MVC/MVC/FrontEndDev/typescript/Custom/custom.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions MVC/MVC/FrontEndDev/typescript/Custom/custom.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* Content here */
export function testCustom(): Test {
var testing: Test = { message: "Hello World" };
return testing;
}

interface Test {
message: string;
}

document.addEventListener("ready", function () {
var test = testCustom();
});
40 changes: 40 additions & 0 deletions MVC/MVC/FrontEndDev/typescript/Custom/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const path = require('path');
const isDevelopment = (process.env.NODE_ENV !== undefined && process.env.NODE_ENV.toLowerCase() === "development" ? true : false);

module.exports = {
entry: "/FrontEndDev/typescript/Custom/custom.ts",
mode: isDevelopment ? "development" : "production",
output: {
filename: "Custom.js",
path: path.resolve(__dirname, "../../../wwwroot/js/scripts")
},
// Enable sourcemaps for debugging webpack's output.
devtool: "source-map",
resolve: {
// Add '.ts' and '.tsx' as resolvable extensions.
extensions: [".ts", ".tsx", ".js"]
},
module: {
rules: [
{
test: /\.ts(x?)$/,
exclude: /node_modules/,
use: [
{
loader: "ts-loader"
}
]
},

// All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'.
{
enforce: "pre",
test: /\.js$/,
loader: "source-map-loader"
}
]
},
optimization: {
minimize: false
}
}
Loading