This repository has been archived by the owner on Feb 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove "symbol_dollar" and "symbol_hash" archetype variables (#105)
- Loading branch information
1 parent
df45547
commit 2a068a5
Showing
14 changed files
with
124 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 10 additions & 10 deletions
20
src/main/resources/archetype-resources/react-app/DEVELOPMENT.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
|
||
${symbol_hash}${symbol_hash} Running the development server | ||
#set($hash = '#') | ||
${hash}${hash} Running the development server | ||
``` | ||
npm run start | ||
``` | ||
This will open the local dev server on port 3000. You can navigate then to `http://localhost:3000/content/${projectName}/en/home.html` | ||
where `REACT_APP_API_HOST` points to your AEM instance. | ||
|
||
${symbol_hash}${symbol_hash}${symbol_hash}${symbol_hash} Your requests to AEM are failing | ||
Most probably this is due to CORS rejection, so you might want to either configure AEM to accept CORS or bypass it from the browser if you are doing local development. | ||
${hash}${hash}${hash}${hash} Your requests to AEM are failing | ||
Most probably this is due to CORS rejection, so you might want to either configure AEM to accept CORS or bypass it from the browser if you are doing local development. | ||
Also assure that your request to the AEM instance is authorized. | ||
|
||
${symbol_hash}${symbol_hash}${symbol_hash}${symbol_hash} Authorize your requests | ||
* Instantiate a CustomModelClient such as [src/server/CustomModelClient.js](https://github.com/adobe/aem-spa-project-archetype/blob/master/src/main/resources/archetype-resources/react-app/src/server/CustomModelClient.js) | ||
when initializing the [ModelManager in src/index.js](https://github.com/adobe/aem-spa-project-archetype/blob/master/src/main/resources/archetype-resources//react-app/src/index.js${symbol_hash}L42) | ||
* If necessary adapt the Authorization header in [src/server/CustomModelClient.js](https://github.com/adobe/aem-spa-project-archetype/blob/master/src/main/resources/archetype-resources//react-app/src/server/CustomModelClient.js${symbol_hash}L21) | ||
${hash}${hash}${hash}${hash} Authorize your requests | ||
* Instantiate a CustomModelClient such as [src/server/CustomModelClient.js](https://github.com/adobe/aem-spa-project-archetype/blob/master/src/main/resources/archetype-resources/react-app/src/server/CustomModelClient.js) | ||
when initializing the [ModelManager in src/index.js](https://github.com/adobe/aem-spa-project-archetype/blob/master/src/main/resources/archetype-resources//react-app/src/index.js${hash}L42) | ||
* If necessary adapt the Authorization header in [src/server/CustomModelClient.js](https://github.com/adobe/aem-spa-project-archetype/blob/master/src/main/resources/archetype-resources//react-app/src/server/CustomModelClient.js${hash}L21) | ||
|
||
${symbol_hash}${symbol_hash}${symbol_hash}${symbol_hash} Update the CORS configuration of the AEM instance | ||
${hash}${hash}${hash}${hash} Update the CORS configuration of the AEM instance | ||
1. Navigate to the Configuration Manager on the AEM instance at http://localhost:4502/system/console/configMgr | ||
2. Look for the configuration: Adobe Granite Cross-Origin Resource Sharing Policy | ||
3. Create a new configuration with the following additional values: | ||
* Allowed Origins: http://localhost:3000 | ||
* Supported Headers: Authorization | ||
* Allowed Methods: OPTIONS | ||
|
||
${symbol_hash}${symbol_hash}${symbol_hash}${symbol_hash} Your images don't show up | ||
${hash}${hash}${hash}${hash} Your images don't show up | ||
Most probably the images are having relative paths, and because we are not on AEM they won't exist on this server. | ||
Quick fix would be to force the AEM absolute path on the images from the image component |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 11 additions & 7 deletions
18
...apps/src/main/content/jcr_root/apps/__projectName__/components/page/customfooterlibs.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
<!--/* | ||
Custom footer | ||
*/--> | ||
<sly data-sly-use.clientLib="${symbol_dollar}{'/libs/granite/sightly/templates/clientlib.html'}"></sly> | ||
<sly data-sly-test="${symbol_dollar}{wcmmode.edit || wcmmode.preview}" | ||
data-sly-call="${symbol_dollar}{clientLib.js @ categories='cq.authoring.pagemodel.messaging'}"></sly> | ||
<sly data-sly-call="${symbol_dollar}{clientLib.js @ categories='${projectName}-${optionFrontend}'}"></sly> | ||
#set($dollar = '$') | ||
<sly | ||
data-sly-use.clientLib="${dollar}{'/libs/granite/sightly/templates/clientlib.html'}" | ||
></sly> | ||
<sly | ||
data-sly-test="${dollar}{wcmmode.edit || wcmmode.preview}" | ||
data-sly-call="${dollar}{clientLib.js @ categories='cq.authoring.pagemodel.messaging'}" | ||
></sly> | ||
<sly | ||
data-sly-call="${dollar}{clientLib.js @ categories='${projectName}-${optionFrontend}'}" | ||
></sly> |
30 changes: 21 additions & 9 deletions
30
...apps/src/main/content/jcr_root/apps/__projectName__/components/page/customheaderlibs.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,22 @@ | ||
<!--/* | ||
Custom Headerlibs | ||
*/--> | ||
<meta property="cq:datatype" data-sly-test="${symbol_dollar}{wcmmode.edit || wcmmode.preview}" content="JSON"/> | ||
<meta property="cq:wcmmode" data-sly-test="${wcmmode.edit}" content="edit"/> | ||
<meta property="cq:wcmmode" data-sly-test="${wcmmode.preview}" content="preview"/> | ||
<meta property="cq:pagemodel_root_url" data-sly-use.page="${package}.models.HierarchyPage" content="${page.rootUrl}"/> | ||
#set($dollar = '$') | ||
<meta | ||
property="cq:datatype" | ||
data-sly-test="${dollar}{wcmmode.edit || wcmmode.preview}" | ||
content="JSON" | ||
/> | ||
<meta property="cq:wcmmode" data-sly-test="${wcmmode.edit}" content="edit" /> | ||
<meta | ||
property="cq:wcmmode" | ||
data-sly-test="${wcmmode.preview}" | ||
content="preview" | ||
/> | ||
<meta | ||
property="cq:pagemodel_root_url" | ||
data-sly-use.page="${package}.models.HierarchyPage" | ||
content="${page.rootUrl}" | ||
/> | ||
<sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html"> | ||
<sly data-sly-call="${symbol_dollar}{clientlib.css @ categories='${projectName}-${optionFrontend}'}"/> | ||
</sly> | ||
<sly | ||
data-sly-call="${dollar}{clientlib.css @ categories='${projectName}-${optionFrontend}'}" | ||
></sly> | ||
</sly> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 10 additions & 7 deletions
17
...main/content/jcr_root/apps/test-spa-angular-project/components/page/customfooterlibs.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
<!--/* | ||
Custom footer | ||
*/--> | ||
<sly data-sly-use.clientLib="${'/libs/granite/sightly/templates/clientlib.html'}"></sly> | ||
<sly data-sly-test="${wcmmode.edit || wcmmode.preview}" | ||
data-sly-call="${clientLib.js @ categories='cq.authoring.pagemodel.messaging'}"></sly> | ||
<sly data-sly-call="${clientLib.js @ categories='test-spa-angular-project-angular'}"></sly> | ||
<sly | ||
data-sly-use.clientLib="${'/libs/granite/sightly/templates/clientlib.html'}" | ||
></sly> | ||
<sly | ||
data-sly-test="${wcmmode.edit || wcmmode.preview}" | ||
data-sly-call="${clientLib.js @ categories='cq.authoring.pagemodel.messaging'}" | ||
></sly> | ||
<sly | ||
data-sly-call="${clientLib.js @ categories='test-spa-angular-project-angular'}" | ||
></sly> |
29 changes: 20 additions & 9 deletions
29
...main/content/jcr_root/apps/test-spa-angular-project/components/page/customheaderlibs.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,21 @@ | ||
<!--/* | ||
Custom Headerlibs | ||
*/--> | ||
<meta property="cq:datatype" data-sly-test="${wcmmode.edit || wcmmode.preview}" content="JSON"/> | ||
<meta property="cq:wcmmode" data-sly-test="${wcmmode.edit}" content="edit"/> | ||
<meta property="cq:wcmmode" data-sly-test="${wcmmode.preview}" content="preview"/> | ||
<meta property="cq:pagemodel_root_url" data-sly-use.page="com.adobe.spa.test.projects.models.HierarchyPage" content="${page.rootUrl}"/> | ||
<meta | ||
property="cq:datatype" | ||
data-sly-test="${wcmmode.edit || wcmmode.preview}" | ||
content="JSON" | ||
/> | ||
<meta property="cq:wcmmode" data-sly-test="${wcmmode.edit}" content="edit" /> | ||
<meta | ||
property="cq:wcmmode" | ||
data-sly-test="${wcmmode.preview}" | ||
content="preview" | ||
/> | ||
<meta | ||
property="cq:pagemodel_root_url" | ||
data-sly-use.page="com.adobe.spa.test.projects.models.HierarchyPage" | ||
content="${page.rootUrl}" | ||
/> | ||
<sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html"> | ||
<sly data-sly-call="${clientlib.css @ categories='test-spa-angular-project-angular'}"/> | ||
</sly> | ||
<sly | ||
data-sly-call="${clientlib.css @ categories='test-spa-angular-project-angular'}" | ||
></sly> | ||
</sly> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 10 additions & 7 deletions
17
...c/main/content/jcr_root/apps/test-spa-react-project/components/page/customfooterlibs.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
<!--/* | ||
Custom footer | ||
*/--> | ||
<sly data-sly-use.clientLib="${'/libs/granite/sightly/templates/clientlib.html'}"></sly> | ||
<sly data-sly-test="${wcmmode.edit || wcmmode.preview}" | ||
data-sly-call="${clientLib.js @ categories='cq.authoring.pagemodel.messaging'}"></sly> | ||
<sly data-sly-call="${clientLib.js @ categories='test-spa-react-project-react'}"></sly> | ||
<sly | ||
data-sly-use.clientLib="${'/libs/granite/sightly/templates/clientlib.html'}" | ||
></sly> | ||
<sly | ||
data-sly-test="${wcmmode.edit || wcmmode.preview}" | ||
data-sly-call="${clientLib.js @ categories='cq.authoring.pagemodel.messaging'}" | ||
></sly> | ||
<sly | ||
data-sly-call="${clientLib.js @ categories='test-spa-react-project-react'}" | ||
></sly> |
29 changes: 20 additions & 9 deletions
29
...c/main/content/jcr_root/apps/test-spa-react-project/components/page/customheaderlibs.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,21 @@ | ||
<!--/* | ||
Custom Headerlibs | ||
*/--> | ||
<meta property="cq:datatype" data-sly-test="${wcmmode.edit || wcmmode.preview}" content="JSON"/> | ||
<meta property="cq:wcmmode" data-sly-test="${wcmmode.edit}" content="edit"/> | ||
<meta property="cq:wcmmode" data-sly-test="${wcmmode.preview}" content="preview"/> | ||
<meta property="cq:pagemodel_root_url" data-sly-use.page="com.adobe.spa.test.projects.models.HierarchyPage" content="${page.rootUrl}"/> | ||
<meta | ||
property="cq:datatype" | ||
data-sly-test="${wcmmode.edit || wcmmode.preview}" | ||
content="JSON" | ||
/> | ||
<meta property="cq:wcmmode" data-sly-test="${wcmmode.edit}" content="edit" /> | ||
<meta | ||
property="cq:wcmmode" | ||
data-sly-test="${wcmmode.preview}" | ||
content="preview" | ||
/> | ||
<meta | ||
property="cq:pagemodel_root_url" | ||
data-sly-use.page="com.adobe.spa.test.projects.models.HierarchyPage" | ||
content="${page.rootUrl}" | ||
/> | ||
<sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html"> | ||
<sly data-sly-call="${clientlib.css @ categories='test-spa-react-project-react'}"/> | ||
</sly> | ||
<sly | ||
data-sly-call="${clientlib.css @ categories='test-spa-react-project-react'}" | ||
></sly> | ||
</sly> |