This is an automated email from the ASF dual-hosted git repository.
dklco pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git
The following commit(s) were added to refs/heads/master by this push:
new cc18612 Updating to not display parent values when creating a new item
cc18612 is described below
commit cc1861226a22fdd52a088d5f78be3d47cd1b5c47
Author: Dan Klco <[email protected]>
AuthorDate: Sun Feb 3 22:35:41 2019 -0500
Updating to not display parent values when creating a new item
---
.../components/editor/fields/base/base.jsp | 53 +++++++++++++---------
.../components/editor/fields/path/path.jsp | 15 +++++-
.../components/editor/fields/repeating/field.jsp | 2 +-
.../components/editor/fields/richtext/field.jsp | 2 +-
.../components/editor/fields/select/field.jsp | 4 +-
.../components/editor/fields/taxonomy/field.jsp | 2 +-
.../components/editor/fields/text/field.jsp | 2 +-
.../components/editor/fields/textarea/field.jsp | 2 +-
.../libs/sling-cms/content/config/create.json | 4 +-
.../libs/sling-cms/content/folder/create.json | 1 +
.../libs/sling-cms/content/i18n/entry/create.json | 3 +-
.../sling-cms/content/i18n/language/create.json | 3 +-
.../libs/sling-cms/content/mappings/create.json | 14 ++++--
.../libs/sling-cms/content/site/create.json | 12 +++--
.../libs/sling-cms/content/site/creategroup.json | 4 +-
.../libs/sling-cms/content/taxonomy/create.json | 3 +-
.../libs/sling-cms/content/template/create.json | 3 +-
17 files changed, 84 insertions(+), 45 deletions(-)
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/base/base.jsp
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/base/base.jsp
index 7965f0f..0983057 100644
---
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/base/base.jsp
+++
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/base/base.jsp
@@ -18,33 +18,44 @@
*/ --%>
<%@include file="/libs/sling-cms/global.jsp"%>
<c:if test="${slingRequest.requestPathInfo.suffix != null}">
- <sling:getResource path="${slingRequest.requestPathInfo.suffix}"
var="editedResource" />
- <c:set var="editProperties"
value="${sling:adaptTo(editedResource,'org.apache.sling.api.resource.ValueMap')}"
scope="request"/>
+ <sling:getResource path="${slingRequest.requestPathInfo.suffix}"
var="editedResource" />
+ <c:set var="editProperties"
value="${sling:adaptTo(editedResource,'org.apache.sling.api.resource.ValueMap')}"
scope="request"/>
</c:if>
<c:choose>
- <c:when test="${properties.required}">
- <c:set var="required" value="required='required'"
scope="request" />
- </c:when>
- <c:otherwise>
- <c:set var="required" value="" scope="request" />
- </c:otherwise>
+ <c:when test="${properties.required}">
+ <c:set var="required" value="required='required'" scope="request" />
+ </c:when>
+ <c:otherwise>
+ <c:set var="required" value="" scope="request" />
+ </c:otherwise>
</c:choose>
<c:choose>
- <c:when test="${properties.disabled}">
- <c:set var="disabled" value="disabled='disabled'"
scope="request" />
- </c:when>
- <c:otherwise>
- <c:set var="disabled" value="" scope="request" />
- </c:otherwise>
+ <c:when test="${properties.disabled}">
+ <c:set var="disabled" value="disabled='disabled'" scope="request" />
+ </c:when>
+ <c:otherwise>
+ <c:set var="disabled" value="" scope="request" />
+ </c:otherwise>
+</c:choose>
+<c:choose>
+ <c:when test="${properties.skipload}">
+ <c:set var="value" value="" scope="request" />
+ </c:when>
+ <c:when test="${empty editProperties[properties.name] &&
properties.defaultValue}">
+ <c:set var="value" value="${properties.defaultValue}" scope="request"
/>
+ </c:when>
+ <c:otherwise>
+ <c:set var="value" value="${editProperties[properties.name]}"
scope="request" />
+ </c:otherwise>
</c:choose>
<div class="field">
- <c:if test="${not empty properties.label}">
- <label class="label" for="${properties.name}">
- <sling:encode value="${properties.label}" mode="HTML" />
- <c:if test="${properties.required}"><span
class="has-text-danger">*</span></c:if>
- </label>
- </c:if>
- <div class="control">
+ <c:if test="${not empty properties.label}">
+ <label class="label" for="${properties.name}">
+ <sling:encode value="${properties.label}" mode="HTML" />
+ <c:if test="${properties.required}"><span
class="has-text-danger">*</span></c:if>
+ </label>
+ </c:if>
+ <div class="control">
<sling:call script="field.jsp" />
</div>
</div>
\ No newline at end of file
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/path/path.jsp
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/path/path.jsp
index 15ab141..87a82c3 100644
---
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/path/path.jsp
+++
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/path/path.jsp
@@ -37,6 +37,17 @@
<c:set var="disabled" value="" scope="request" />
</c:otherwise>
</c:choose>
+<c:choose>
+ <c:when test="${properties.skipload}">
+ <c:set var="value" value="" scope="request" />
+ </c:when>
+ <c:when test="${empty editProperties[properties.name] &&
properties.defaultValue}">
+ <c:set var="value" value="${properties.defaultValue}" scope="request"
/>
+ </c:when>
+ <c:otherwise>
+ <c:set var="value" value="${editProperties[properties.name]}"
scope="request" />
+ </c:otherwise>
+</c:choose>
<c:if test="${not empty properties.label}">
<label class="label" for="${properties.name}">
<sling:encode value="${properties.label}" mode="HTML" />
@@ -47,7 +58,7 @@
<c:when test="${properties.hidesearch != true}">
<div class="field has-addons">
<div class="control is-expanded">
- <input class="input pathfield" type="text"
name="${properties.name}" value="${editProperties[properties.name]}"
${required} ${disabled} data-type="${properties.type}"
data-base="${properties.basePath}" autocomplete="off" />
+ <input class="input pathfield" type="text"
name="${properties.name}" value="${value}" ${required} ${disabled}
data-type="${properties.type}" data-base="${properties.basePath}"
autocomplete="off" />
</div>
<div class="control">
<a href="/cms/shared/search.html" class="button Fetch-Modal
search-button" data-title="Search" data-path=".Main-Content > *">
@@ -59,7 +70,7 @@
<c:otherwise>
<div class="field">
<div class="control">
- <input class="input pathfield" type="text"
name="${properties.name}" value="${editProperties[properties.name]}"
${required} ${disabled} data-type="${properties.type}"
data-base="${properties.basePath}" autocomplete="off" />
+ <input class="input pathfield" type="text"
name="${properties.name}" value="${value}" ${required} ${disabled}
data-type="${properties.type}" data-base="${properties.basePath}"
autocomplete="off" />
</div>
</div>
</c:otherwise>
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/repeating/field.jsp
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/repeating/field.jsp
index 05352a1..57338a7 100644
---
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/repeating/field.jsp
+++
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/repeating/field.jsp
@@ -31,7 +31,7 @@
</div>
</fieldset>
<div class="repeating__container">
- <c:forEach var="value" items="${editProperties[properties.name]}">
+ <c:forEach var="value" items="${value}">
<div class="repeating__item field has-addons">
<div class="control is-expanded">
<input type="${properties.type}" value="${value}"
class="input" name="${properties.name}" ${required} ${disabled} />
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/richtext/field.jsp
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/richtext/field.jsp
index 184deed..ff77598 100644
---
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/richtext/field.jsp
+++
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/richtext/field.jsp
@@ -27,5 +27,5 @@
</c:otherwise>
</c:choose>
<sling:include resource="${toolbar}" />
- <textarea class="rte-editor textarea" name="${properties.name}"
${required} ${disabled}>${editProperties[properties.name]}</textarea>
+ <textarea class="rte-editor textarea" name="${properties.name}"
${required} ${disabled}>${value}</textarea>
</div>
\ No newline at end of file
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/select/field.jsp
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/select/field.jsp
index 20f5822..b51aad8 100644
---
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/select/field.jsp
+++
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/select/field.jsp
@@ -26,9 +26,9 @@
<c:when test="${not empty properties.options}">
<c:forEach var="option" items="${properties.options}">
<c:set var="label" value="${fn:split(option,'=')[0]}" />
- <c:set var="value" value="${fn:split(option,'=')[1]}" />
+ <c:set var="val" value="${fn:split(option,'=')[1]}" />
<c:choose>
- <c:when test="${value eq
editProperties[properties.name]}">
+ <c:when test="${val eq value}">
<c:set var="selected"
value="selected=\"selected\"" />
</c:when>
<c:otherwise>
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/taxonomy/field.jsp
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/taxonomy/field.jsp
index 0c4d7c3..9fc984c 100644
---
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/taxonomy/field.jsp
+++
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/taxonomy/field.jsp
@@ -37,7 +37,7 @@
</div>
</div>
<div class="taxonomy__container">
- <c:forEach var="item" items="${editProperties[properties.name]}">
+ <c:forEach var="item" items="${value}">
<a class="button taxonomy__item">
<input type="hidden" name="${properties.name}"
value="${item}" />
<span class="taxonomy__title">
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/text/field.jsp
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/text/field.jsp
index ce757de..aee546f 100644
---
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/text/field.jsp
+++
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/text/field.jsp
@@ -17,4 +17,4 @@
* under the License.
*/ --%>
<%@include file="/libs/sling-cms/global.jsp"%>
-<input type="${not empty properties.type ? properties.type : 'text'}"
class="input" name="${properties.name}" value="${not empty
editProperties[properties.name] ? editProperties[properties.name] :
properties.defaultValue}" ${required} ${disabled} />
\ No newline at end of file
+<input type="${not empty properties.type ? properties.type : 'text'}"
class="input" name="${properties.name}" value="${value}" ${required}
${disabled} />
\ No newline at end of file
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/textarea/field.jsp
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/textarea/field.jsp
index 94a2db0..b20012e 100644
---
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/textarea/field.jsp
+++
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/textarea/field.jsp
@@ -17,4 +17,4 @@
* under the License.
*/ --%>
<%@include file="/libs/sling-cms/global.jsp"%>
-<textarea class="textarea" name="${properties.name}" ${required}
${disabled}>${not empty editProperties[properties.name] ?
editProperties[properties.name] : properties.defaultValue}</textarea>
\ No newline at end of file
+<textarea class="textarea" name="${properties.name}" ${required}
${disabled}>${value}</textarea>
\ No newline at end of file
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/content/config/create.json
b/ui/src/main/resources/jcr_root/libs/sling-cms/content/config/create.json
index 5ba58af..3d91f00 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/content/config/create.json
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/content/config/create.json
@@ -21,6 +21,7 @@
"sling:resourceType":
"sling-cms/components/editor/fields/text",
"label": "Title",
"name": "jcr:title",
+ "skipload":true,
"required": true
},
"name": {
@@ -53,7 +54,8 @@
"label": "Configuration Type",
"name": "sling:resourceType",
"optionsScript":
"/libs/sling-cms/components/editor/scripts/configResourceTypeOptions.jsp",
- "required": true
+ "required": true,
+ "skipload":true
}
}
}
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/content/folder/create.json
b/ui/src/main/resources/jcr_root/libs/sling-cms/content/folder/create.json
index d69d7bc..ad7bbf9 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/content/folder/create.json
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/content/folder/create.json
@@ -21,6 +21,7 @@
"sling:resourceType":
"sling-cms/components/editor/fields/text",
"label": "Title",
"name": "jcr:content/jcr:title",
+ "skipload":true,
"required": true
},
"name": {
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/content/i18n/entry/create.json
b/ui/src/main/resources/jcr_root/libs/sling-cms/content/i18n/entry/create.json
index 32e6f6e..895641f 100644
---
a/ui/src/main/resources/jcr_root/libs/sling-cms/content/i18n/entry/create.json
+++
b/ui/src/main/resources/jcr_root/libs/sling-cms/content/i18n/entry/create.json
@@ -22,7 +22,8 @@
"sling:resourceType":
"sling-cms/components/editor/fields/text",
"label": "Key",
"name": "sling:key",
- "required": true
+ "required": true,
+ "skipload":true
},
"value": {
"jcr:primaryType": "nt:unstructured",
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/content/i18n/language/create.json
b/ui/src/main/resources/jcr_root/libs/sling-cms/content/i18n/language/create.json
index c5d56d7..3621a7f 100644
---
a/ui/src/main/resources/jcr_root/libs/sling-cms/content/i18n/language/create.json
+++
b/ui/src/main/resources/jcr_root/libs/sling-cms/content/i18n/language/create.json
@@ -22,7 +22,8 @@
"label": "Language",
"name": "jcr:language",
"optionsScript":
"/libs/sling-cms/components/editor/scripts/localeOptions.jsp",
- "required": true
+ "required": true,
+ "skipload":true
},
"name": {
"jcr:primaryType": "nt:unstructured",
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/content/mappings/create.json
b/ui/src/main/resources/jcr_root/libs/sling-cms/content/mappings/create.json
index b300caf..98ea760 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/content/mappings/create.json
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/content/mappings/create.json
@@ -29,21 +29,24 @@
"sling:resourceType":
"sling-cms/components/editor/fields/text",
"label": "Match",
"name": "sling:Match",
- "required": false
+ "required": false,
+ "skipload":true
},
"redirect": {
"jcr:primaryType": "nt:unstructured",
"sling:resourceType":
"sling-cms/components/editor/fields/text",
"label": "Redirect",
"name": "sling:redirect",
- "required": false
+ "required": false,
+ "skipload":true
},
- "status": {
+ "alias": {
"jcr:primaryType": "nt:unstructured",
"sling:resourceType":
"sling-cms/components/editor/fields/number",
"label": "Alias",
"name": "sling:alias",
- "required": false
+ "required": false,
+ "skipload":true
},
"statusTypeHint": {
"jcr:primaryType": "nt:unstructured",
@@ -56,7 +59,8 @@
"sling:resourceType":
"sling-cms/components/editor/fields/repeating",
"label": "Internal Redirect",
"name": "sling:internalRedirect",
- "required": false
+ "required": false,
+ "skipload":true
},
"internalRedirectTypeHint": {
"jcr:primaryType": "nt:unstructured",
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/create.json
b/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/create.json
index 830e49a..327084e 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/create.json
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/create.json
@@ -21,7 +21,8 @@
"sling:resourceType":
"sling-cms/components/editor/fields/text",
"label": "Title",
"name": "jcr:title",
- "required": true
+ "required": true,
+ "skipload":true
},
"name": {
"jcr:primaryType": "nt:unstructured",
@@ -40,7 +41,8 @@
"sling:resourceType":
"sling-cms/components/editor/fields/text",
"label": "Primary URL",
"name": "sling:url",
- "required": true
+ "required": true,
+ "skipload":true
},
"locale": {
"jcr:primaryType": "nt:unstructured",
@@ -48,7 +50,8 @@
"label": "Language",
"name": "jcr:language",
"optionsScript":
"/libs/sling-cms/components/editor/scripts/localeOptions.jsp",
- "required": true
+ "required": true,
+ "skipload":true
},
"config": {
"jcr:primaryType": "nt:unstructured",
@@ -57,7 +60,8 @@
"label": "Config",
"name": "sling:configRef",
"required": false,
- "type": "config"
+ "type": "config",
+ "skipload":true
},
"primaryType": {
"jcr:primaryType": "nt:unstructured",
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/creategroup.json
b/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/creategroup.json
index 939d47b..e730b51 100644
---
a/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/creategroup.json
+++
b/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/creategroup.json
@@ -21,7 +21,8 @@
"sling:resourceType":
"sling-cms/components/editor/fields/text",
"label": "Title",
"name": "jcr:content/jcr:title",
- "required": true
+ "required": true,
+ "skipload":true
},
"name": {
"jcr:primaryType": "nt:unstructured",
@@ -42,6 +43,7 @@
"label": "Config",
"name": "sling:configRef",
"required": false,
+ "skipload":true,
"type": "config"
},
"primaryType": {
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/content/taxonomy/create.json
b/ui/src/main/resources/jcr_root/libs/sling-cms/content/taxonomy/create.json
index 336b1a7..703f24f 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/content/taxonomy/create.json
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/content/taxonomy/create.json
@@ -20,7 +20,8 @@
"sling:resourceType":
"sling-cms/components/editor/fields/text",
"label": "Title",
"name": "jcr:title",
- "required": true
+ "required": true,
+ "skipload":true
},
"name": {
"jcr:primaryType": "nt:unstructured",
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/content/template/create.json
b/ui/src/main/resources/jcr_root/libs/sling-cms/content/template/create.json
index 97e8902..376ddfb 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/content/template/create.json
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/content/template/create.json
@@ -22,7 +22,8 @@
"sling:resourceType":
"sling-cms/components/editor/fields/text",
"label": "Title",
"name": "jcr:title",
- "required": true
+ "required": true,
+ "skipload":true
},
"name": {
"jcr:primaryType": "nt:unstructured",