diff --git a/all/pom.xml b/all/pom.xml index d915b992cf..2eb0a36586 100644 --- a/all/pom.xml +++ b/all/pom.xml @@ -22,7 +22,7 @@ com.adobe.aem.guides aem-guides-wknd - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT ../pom.xml @@ -123,7 +123,7 @@ analyse-project verify - project-analyse + project-analyse @@ -200,7 +200,7 @@ org.apache.jackrabbit - filevault-package-maven-plugin + filevault-package-maven-plugin true aem-guides-wknd.all-${version}-classic @@ -257,20 +257,20 @@ aem-guides-wknd-shared.ui.content zip /apps/wknd-vendor-packages/content/install - + - + com.adobe.aem.guides aem-guides-wknd-shared.ui.content ${wknd-shared.version} zip - + @@ -316,13 +316,13 @@ com.adobe.cq - core.wcm.components.core + core.wcm.components.core com.adobe.aem.guides aem-guides-wknd-shared.ui.content zip - + diff --git a/core/pom.xml b/core/pom.xml index 8e80fe2319..381739042b 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -19,7 +19,7 @@ com.adobe.aem.guides aem-guides-wknd - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT ../pom.xml aem-guides-wknd.core @@ -83,7 +83,7 @@ Import-Package: javax.annotation;version=0.0.0,* com.adobe.cq core.wcm.components.core - + uk.org.lidalia slf4j-test @@ -188,7 +188,7 @@ Import-Package: javax.annotation;version=0.0.0,* @@ -326,5 +326,5 @@ Import-Package: javax.annotation;version=0.0.0,* - + diff --git a/core/src/main/java/com/adobe/aem/guides/wknd/core/models/ContactUsModel.java b/core/src/main/java/com/adobe/aem/guides/wknd/core/models/ContactUsModel.java new file mode 100644 index 0000000000..19c080d893 --- /dev/null +++ b/core/src/main/java/com/adobe/aem/guides/wknd/core/models/ContactUsModel.java @@ -0,0 +1,60 @@ +/* + * Copyright 2015 Adobe Systems Incorporated + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.adobe.aem.guides.wknd.core.models; + +import javax.annotation.PostConstruct; + +import org.apache.sling.api.SlingHttpServletRequest; +import org.apache.sling.api.resource.Resource; +import org.apache.sling.api.resource.ResourceResolver; +import org.apache.sling.models.annotations.DefaultInjectionStrategy; +import org.apache.sling.models.annotations.Model; +import org.apache.sling.models.annotations.injectorspecific.Self; +import org.apache.sling.models.annotations.injectorspecific.SlingObject; + +@Model( + adaptables = {SlingHttpServletRequest.class}, + adapters = {ContactUsModel.class}, + resourceType = {ContactUsModel.RESOURCE_TYPE}, + defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL +) +public class ContactUsModel { + protected static final String RESOURCE_TYPE = "wknd/components/contactus"; + + @Self + private SlingHttpServletRequest request; + + @SlingObject + private Resource currentResource; + @SlingObject + private ResourceResolver resourceResolver; + + private String message; + + @PostConstruct + protected void init() { + message = ""; + + String formUsername = request.getParameter("username"); + if(formUsername != null) { + message = "Thank you " + formUsername + " for contacting us."; + } + } + + public String getMessage() { + return message; + } +} diff --git a/core/src/main/java/com/adobe/aem/guides/wknd/core/models/package-info.java b/core/src/main/java/com/adobe/aem/guides/wknd/core/models/package-info.java index 631e3daf07..09f3518f89 100644 --- a/core/src/main/java/com/adobe/aem/guides/wknd/core/models/package-info.java +++ b/core/src/main/java/com/adobe/aem/guides/wknd/core/models/package-info.java @@ -13,5 +13,5 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@org.osgi.annotation.versioning.Version("2.1.0") +@org.osgi.annotation.versioning.Version("2.2.0") package com.adobe.aem.guides.wknd.core.models; diff --git a/dispatcher/pom.xml b/dispatcher/pom.xml index c03a00bbbf..949746e25c 100644 --- a/dispatcher/pom.xml +++ b/dispatcher/pom.xml @@ -7,7 +7,7 @@ com.adobe.aem.guides aem-guides-wknd - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT ../pom.xml @@ -15,7 +15,7 @@ pom WKND Sites Project - Dispatcher HTTP & Dispatcher configurations for WKND Sites Project - + diff --git a/dispatcher/src/conf.d/available_vhosts/wknd.vhost b/dispatcher/src/conf.d/available_vhosts/wknd.vhost index cb73f222bf..918b529b76 100644 --- a/dispatcher/src/conf.d/available_vhosts/wknd.vhost +++ b/dispatcher/src/conf.d/available_vhosts/wknd.vhost @@ -3,7 +3,7 @@ # # It has been modified to let Apache handle errors 400, 500 # It uses error pages created in AEM as the 404 and 500x pages defined by variables in custom.vars -# +# # Include customer defined variables Include conf.d/variables/custom.vars @@ -49,7 +49,7 @@ Include conf.d/variables/custom.vars # Developer Localhost SetEnvIfExpr "env('CORSProcessing') == 'true' && req_novary('Origin') =~ m#(http://localhost(:\d+)?$)#" CORSTrusted=true # Adobe AppBuilder - SetEnvIfExpr "env('CORSProcessing') == 'true' && req_novary('Origin') =~ m#(https://experience\.adobe\.com$)#" CORSTrusted=true + SetEnvIfExpr "env('CORSProcessing') == 'true' && req_novary('Origin') =~ m#(https://experience\.adobe\.com$)#" CORSTrusted=true # Developer Vercel app SetEnvIfExpr "env('CORSProcessing') == 'true' && req_novary('Origin') =~ m#(https://.*\.vercel\.app$)#" CORSTrusted=true # Developer Github.io app @@ -133,7 +133,7 @@ Include conf.d/variables/custom.vars ErrorDocument 502 ${500_PAGE} ErrorDocument 503 ${500_PAGE} ErrorDocument 504 ${500_PAGE} - + ## Default Fastly Cache Settings for AEM - V20220414 # Theme Sources via Clientlib: cache mutable resources for max 24h on CDN and background refresh after 12h to avoid MISS @@ -188,4 +188,14 @@ Include conf.d/variables/custom.vars Header set Cache-Control "max-age=300,stale-while-revalidate=43200,stale-if-error=43200" "expr=%{REQUEST_STATUS} < 400" Header set Age 0 + + Header unset Cache-Control + Header always set Cache-Control "private" + Header set Age 0 + + + Header unset Cache-Control + Header always set Cache-Control "private" + Header set Age 0 + diff --git a/it.tests/pom.xml b/it.tests/pom.xml index 30e90fe7ab..de1a8ef4ed 100644 --- a/it.tests/pom.xml +++ b/it.tests/pom.xml @@ -19,7 +19,7 @@ com.adobe.aem.guides aem-guides-wknd - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT ../pom.xml aem-guides-wknd.it.tests @@ -52,7 +52,7 @@ org.slf4j slf4j-simple 1.7.25 - + com.adobe.aem.headless aem-headless-client-java diff --git a/pom.xml b/pom.xml index 0e08dba9bc..a3ddc81882 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ com.adobe.aem.guides aem-guides-wknd pom - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT WKND Sites Project - Reactor Project WKND Sites Project https://github.com/adobe/aem-guides-wknd diff --git a/ui.apps.structure/pom.xml b/ui.apps.structure/pom.xml index 976d20bfb2..384d124fb9 100644 --- a/ui.apps.structure/pom.xml +++ b/ui.apps.structure/pom.xml @@ -8,7 +8,7 @@ com.adobe.aem.guides aem-guides-wknd - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT ../pom.xml diff --git a/ui.apps/pom.xml b/ui.apps/pom.xml index e95a3fd27b..11afc21b76 100644 --- a/ui.apps/pom.xml +++ b/ui.apps/pom.xml @@ -23,7 +23,7 @@ com.adobe.aem.guides aem-guides-wknd - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT ../pom.xml diff --git a/ui.apps/src/main/content/jcr_root/apps/wknd/components/contactus/.content.xml b/ui.apps/src/main/content/jcr_root/apps/wknd/components/contactus/.content.xml new file mode 100644 index 0000000000..d110974e87 --- /dev/null +++ b/ui.apps/src/main/content/jcr_root/apps/wknd/components/contactus/.content.xml @@ -0,0 +1,5 @@ + + diff --git a/ui.apps/src/main/content/jcr_root/apps/wknd/components/contactus/_cq_dialog/.content.xml b/ui.apps/src/main/content/jcr_root/apps/wknd/components/contactus/_cq_dialog/.content.xml new file mode 100644 index 0000000000..886122d457 --- /dev/null +++ b/ui.apps/src/main/content/jcr_root/apps/wknd/components/contactus/_cq_dialog/.content.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + diff --git a/ui.apps/src/main/content/jcr_root/apps/wknd/components/contactus/contactus.html b/ui.apps/src/main/content/jcr_root/apps/wknd/components/contactus/contactus.html new file mode 100644 index 0000000000..dd0e891679 --- /dev/null +++ b/ui.apps/src/main/content/jcr_root/apps/wknd/components/contactus/contactus.html @@ -0,0 +1,38 @@ + + + + ${model.message @context="unsafe"} + + + + + + + + + + + + + + + + + + + + diff --git a/ui.config/pom.xml b/ui.config/pom.xml index 0d03b384bb..2646b99322 100644 --- a/ui.config/pom.xml +++ b/ui.config/pom.xml @@ -23,7 +23,7 @@ com.adobe.aem.guides aem-guides-wknd - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT ../pom.xml diff --git a/ui.content.sample/pom.xml b/ui.content.sample/pom.xml index 5863070216..dacd663ec2 100644 --- a/ui.content.sample/pom.xml +++ b/ui.content.sample/pom.xml @@ -23,7 +23,7 @@ com.adobe.aem.guides aem-guides-wknd - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT ../pom.xml diff --git a/ui.content.sample/src/main/content/jcr_root/content/wknd/us/en/about-us/.content.xml b/ui.content.sample/src/main/content/jcr_root/content/wknd/us/en/about-us/.content.xml index 4476fd8caf..f62445d5c2 100644 --- a/ui.content.sample/src/main/content/jcr_root/content/wknd/us/en/about-us/.content.xml +++ b/ui.content.sample/src/main/content/jcr_root/content/wknd/us/en/about-us/.content.xml @@ -39,6 +39,23 @@ jcr:mixinTypes="[cq:LiveRelationship]" jcr:primaryType="nt:unstructured" sling:resourceType="wknd/components/title"/> + + com.adobe.aem.guides aem-guides-wknd - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT ../pom.xml @@ -125,5 +125,5 @@ - + diff --git a/ui.frontend/pom.xml b/ui.frontend/pom.xml index 1d18d0cc47..36c762a6e7 100644 --- a/ui.frontend/pom.xml +++ b/ui.frontend/pom.xml @@ -23,7 +23,7 @@ com.adobe.aem.guides aem-guides-wknd - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT ../pom.xml diff --git a/ui.frontend/src/main/webpack/components/contactus/js/contactus.js b/ui.frontend/src/main/webpack/components/contactus/js/contactus.js new file mode 100644 index 0000000000..a488fd4fc3 --- /dev/null +++ b/ui.frontend/src/main/webpack/components/contactus/js/contactus.js @@ -0,0 +1,19 @@ +import jQuery from "jquery"; + +jQuery(function($) { + "use strict"; + + $( "#wknd-contact-us-form-submit" ).on( "click", function( event ) { + event.preventDefault(); + const username = $( "#wknd-contact-us-form-username" ).val(); + const time = Date.now(); + $.get( `/us/en/about-us.html?username=${username}&time=${time}`, function(data) { + console.log(data); + window.location.href = `/us/en/about-us.html?username=${username}&time=${time}`; + }) + .fail(function(err) { + console.log(err); + $( "#cmp-contactus-error" ).html(`Error: ${err.status}`); + }); + }); +}); diff --git a/ui.frontend/src/main/webpack/components/contactus/scss/contactus.scss b/ui.frontend/src/main/webpack/components/contactus/scss/contactus.scss new file mode 100644 index 0000000000..a7756e3abb --- /dev/null +++ b/ui.frontend/src/main/webpack/components/contactus/scss/contactus.scss @@ -0,0 +1,51 @@ +.cmp-contactus { +} + +.cmp-contactus-error { + +} + +.wknd-contact-us-form { + +} + +#wknd-contact-us-form-username, #wknd-contact-us-form-message { + border: 1px solid black; + border-radius: 4px; + box-sizing: border-box; + font-size: var(--fontSizeSmall, 15px); + font-weight: var(--fontWeightSemiBold, 400); + height: 3pc; + padding: 20px; + width: 100%; + margin-top: 20px; + resize: none; + font-family: var(--fontFamilySansSerif, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif); +} + +#wknd-contact-us-form-username { + +} + +#wknd-contact-us-form-message { + height: 100px; +} + +#wknd-contact-us-form-submit { + background: #ffea00 0 0 no-repeat padding-box; + border: 0; + box-sizing: border-box; + color: #202020; + font-family: var(--fontFamilySansSerif, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif); + font-size: 18px; + font-weight: var(--fontWeightBold, 600); + min-width: 180px; + padding: 0.75rem 1rem; + text-align: center; + text-transform: uppercase; + float: right; +} + +#wknd-contact-us-form-submit:hover { + cursor: pointer; +} diff --git a/ui.frontend/src/main/webpack/site/main.js b/ui.frontend/src/main/webpack/site/main.js index e6559b2b2e..0799b09b6b 100644 --- a/ui.frontend/src/main/webpack/site/main.js +++ b/ui.frontend/src/main/webpack/site/main.js @@ -10,3 +10,4 @@ import '../components/navigation/navigation.js'; import '../components/form/sign-in-buttons/sign-in-buttons.js'; import '../components/form/sign-in-form/sign-in-form.js'; import '../components/contentfragment/js/contributor.js'; +import '../components/contactus/js/contactus.js'; diff --git a/ui.frontend/src/main/webpack/site/main.scss b/ui.frontend/src/main/webpack/site/main.scss index cce7877a5c..17a13f55fe 100644 --- a/ui.frontend/src/main/webpack/site/main.scss +++ b/ui.frontend/src/main/webpack/site/main.scss @@ -27,6 +27,7 @@ @import '../components/teaser/scss/teaser.scss'; @import '../components/text/scss/text.scss'; @import '../components/title/scss/title.scss'; +@import '../components/contactus/scss/contactus.scss'; /* Form */ @import '../components/form/sign-in-form/scss/sign-in-form.scss'; diff --git a/ui.tests/pom.xml b/ui.tests/pom.xml index d7bf70ce91..31c17934dd 100644 --- a/ui.tests/pom.xml +++ b/ui.tests/pom.xml @@ -18,14 +18,14 @@ - 4.0.0 com.adobe.aem.guides aem-guides-wknd - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT ../pom.xml @@ -117,7 +117,7 @@ exec - + docker . @@ -134,7 +134,7 @@ exec - + docker .
${model.message @context="unsafe"}