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

Tech Preview Update 1 #13

Merged
merged 2 commits into from
Jan 16, 2018
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
24 changes: 24 additions & 0 deletions samples/advanced-sample-react/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Advanced Application Demo

Demonstrates an opinionated real-life demonstration of what can be done in a React JSS application.

Consult the primary JSS documentation at https://jss.sitecore.net for the latest documentation on JSS.

# Setup

**First** run `npm i` to install dependencies. Then choose how to run the application:

## Disconnected Sitecore-less Development

Use `npm run start` to run a local development server. Sitecore is not required to be installed, and content data is pulled from static local sources.

Disconnected development is appropriate when no Sitecore instance is available, or when frontend developers do not wish to run a local copy of Sitecore.

## Deploying to Sitecore

* Install the JSS server components on your local Sitecore installation according to the JSS documentation
* `npm run setup` to configure the connection to a local Sitecore installation
* Review the application config patch file in `sitecore/config` to ensure that it is configured appropriately for your Sitecore installation.
* `npm run deploy-config` to deploy the Sitecore config patch file to the Sitecore instance (you may need to add the `hostName` to your `hosts` file)
* Use `npm run deploy-codefirst` to deploy the sample to Sitecore
* Visit `http://jssadvancedapp` to see the demonstration running in Sitecore
41 changes: 38 additions & 3 deletions samples/advanced-sample-react/assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,23 @@ body {
webkit-tap-highlight-color: #222222;
}

.carousel {
margin: 0 auto;
width: 100%;
}

@media (min-width: 600px) {
.carousel {
width: 500px;
}
}

@media (min-width: 750px) {
.carousel {
width: 650px;
}
}

.carousel-inner > .item > .sc-image-wrapper {
display: block;
max-width: 100%;
Expand All @@ -421,7 +438,7 @@ body {
display: block;
max-width: 100%;
width: 100%;
height: 100%;
height: auto;
}

.dynamic-content p {
Expand All @@ -447,15 +464,33 @@ body {
display: block;
}

.nav-language {
background-color: #DDDDDD;
.nav-btn a {
-webkit-border-radius: 28;
-moz-border-radius: 28;
border-radius: 100px;
color: #ffffff !important;
background: #F05F40;
text-decoration: none;
margin-top: 10px;
padding-top: 5px !important;
margin-bottom: 10px;
padding-bottom: 5px !important;
}

.nav-btn a:hover {
text-decoration: underline !important;
background-color: #F05F40 !important;
}

.copyright {
clear: both;
width: 100%;
}

label, .alert {
font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
}

/*
Experience Editor fixes from
http://www.sagepath.com/blogs/development/articles/add-here-bug-bootstrap
Expand Down
13 changes: 10 additions & 3 deletions samples/advanced-sample-react/data/dictionary/en.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{
"Copyright": "{{year}} Sitecore Corporation A/S",
"Home": "Home",
"Copyright": "{{year}} Start Bootstrap",
"Start Bootstrap": "Start Bootstrap",
"Language": "Language",
"Home": "Home",
"Download Form": "Download Form",
"Close": "Close"
"Close": "Close",
"Login": "Login",
"Logout": "Logout",
"Cancel": "Cancel",
"Username": "Username",
"Password": "Password",
"LoginFailed": "Invalid username and/or password. Try b?"
}
11 changes: 9 additions & 2 deletions samples/advanced-sample-react/data/dictionary/es-mx.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{
"Copyright": "{{year}} Sitecore Corporation A/S",
"Copyright": "{{year}} Inicio Bootstrap",
"Start Bootstrap": "Inicio Bootstrap",
"Language": "Idioma",
"Home": "Inicio",
"Download Form": "Descargar Formulario",
"Close": "Cerca"
"Close": "Cerca",
"Login": "Iniciar sesión",
"Logout": "Cerrar sesión",
"Cancel": "Cancelar",
"Username": "Nombre de usuario",
"Password": "Contraseña",
"LoginFailed": "Nombre de usuario y / o contraseña inválido."
}
3 changes: 2 additions & 1 deletion samples/advanced-sample-react/data/routes/about/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"placeholders": {
"page-header": [
{
"name": "About Welcome",
"componentName": "Jumbotron",
"fields": {
"titleText": {
Expand All @@ -25,7 +26,7 @@
},
"params": {
"shade": "light",
"titleSize": 2
"titleSize": "2"
}
}
],
Expand Down
3 changes: 2 additions & 1 deletion samples/advanced-sample-react/data/routes/about/es-MX.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"placeholders": {
"page-header": [
{
"name": "About Welcome",
"componentName": "Jumbotron",
"fields": {
"titleText": {
Expand All @@ -25,7 +26,7 @@
},
"params": {
"shade": "light",
"titleSize": 2
"titleSize": "2"
}
}
],
Expand Down
14 changes: 13 additions & 1 deletion samples/advanced-sample-react/data/routes/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"placeholders": {
"page-header": [
{
"name": "welcome-message",
"displayName": "Welcome Message",
"componentName": "Jumbotron",
"fields": {
"titleText": {
Expand All @@ -24,12 +26,22 @@
}
},
"params": {
"titleSize": 1,
"titleSize": "1",
"shade": "dark"
}
}
],
"page-content": [
{
"name": "download-button",
"displayName": "Download Button",
"componentName": "DownloadCallout",
"fields": {
"linkText": {
"value": "Download"
}
}
}
]
}
}
Expand Down
9 changes: 5 additions & 4 deletions samples/advanced-sample-react/data/routes/es-MX.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"placeholders": {
"page-header": [
{
"name": "welcome-message",
"displayName": "Mensaje de bienvenida",
"componentName": "Jumbotron",
"fields": {
"titleText": {
Expand All @@ -24,23 +26,22 @@
}
},
"params": {
"titleSize": 1,
"titleSize": "1",
"shade": "dark"
}
}
],
"page-content": [
/* disabling until issue with react-modal and react 16 is fixed
https://github.com/react-bootstrap/react-bootstrap/issues/2812
{
"name": "download-button",
"displayName": "Botón de descarga",
"componentName": "DownloadCallout",
"fields": {
"linkText": {
"value": "Descargar"
}
}
}
*/
]
}
}
Expand Down
4 changes: 3 additions & 1 deletion samples/advanced-sample-react/data/routes/portfolio/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"placeholders": {
"page-header": [
{
"name": "Portfolio Welcome",
"componentName": "Jumbotron",
"fields": {
"titleText": {
Expand All @@ -29,12 +30,13 @@
},
"params": {
"shade": "light",
"titleSize": 2
"titleSize": "2"
}
}
],
"page-content": [
{
"name": "Main Carousel",
"componentName": "Carousel",
"fields": {
"items": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"placeholders": {
"page-header": [
{
"name": "Portfolio Welcome",
"componentName": "Jumbotron",
"fields": {
"titleText": {
Expand All @@ -28,12 +29,13 @@
},
"params": {
"shade": "light",
"titleSize": 2
"titleSize": "2"
}
}
],
"page-content": [
{
"name": "Main Carousel",
"componentName": "Carousel",
"fields": {
"items": [
Expand Down
16 changes: 14 additions & 2 deletions samples/advanced-sample-react/data/routes/services/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"placeholders": {
"page-header": [
{
"name": "Services Welcome",
"componentName": "Jumbotron",
"fields": {
"titleText": {
Expand All @@ -25,12 +26,13 @@
},
"params": {
"shade": "dark",
"titleSize": 2
"titleSize": "2"
}
}
],
"page-content": [
{
"name": "List of Services",
"componentName": "ServiceList",
"fields": {
"items": [
Expand Down Expand Up @@ -82,6 +84,7 @@
"placeholders": {
"tabs": [
{
"name": "Professional Services Tab",
"componentName": "Tab",
"fields": {
"title": {
Expand All @@ -91,17 +94,19 @@
"placeholders": {
"tab": [
{
"name": "Professional Services Header",
"componentName": "Heading",
"fields": {
"text": {
"value": "Professional Services"
}
},
"params": {
"size": 3
"size": "3"
}
},
{
"name": "Professional Services Text",
"componentName": "RichText",
"fields": {
"text": {
Expand All @@ -113,6 +118,7 @@
}
},
{
"name": "Support Tab",
"componentName": "Tab",
"fields": {
"title": {
Expand All @@ -122,6 +128,7 @@
"placeholders": {
"tab": [
{
"name": "Support Header",
"componentName": "Heading",
"fields": {
"text": {
Expand All @@ -130,6 +137,7 @@
}
},
{
"name": "Support Text",
"componentName": "RichText",
"fields": {
"text": {
Expand All @@ -138,6 +146,7 @@
}
},
{
"name": "Support Link",
"componentName": "LinkButton",
"fields": {
"link": {
Expand All @@ -154,6 +163,7 @@
}
},
{
"name": "Consulting Tab",
"componentName": "Tab",
"fields": {
"title": {
Expand All @@ -163,6 +173,7 @@
"placeholders": {
"tab": [
{
"name": "Consulting Text",
"componentName": "RichText",
"fields": {
"text": {
Expand All @@ -171,6 +182,7 @@
}
},
{
"name": "Consulting File",
"componentName": "FileLink",
"fields": {
"file": {
Expand Down
Loading