You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2016/10/03 10:51:16 UTC
[1/2] syncope git commit: [SYNCOPE-946] i18n handling of confirmation
message
Repository: syncope
Updated Branches:
refs/heads/2_0_X 77407a43a -> 720794a6c
[SYNCOPE-946] i18n handling of confirmation message
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/57faf70b
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/57faf70b
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/57faf70b
Branch: refs/heads/2_0_X
Commit: 57faf70bc8f2763ab1803e488c4029baae8f671e
Parents: 77407a4
Author: Francesco Chicchiricc� <il...@apache.org>
Authored: Mon Oct 3 11:11:59 2016 +0200
Committer: Francesco Chicchiricc� <il...@apache.org>
Committed: Mon Oct 3 12:50:58 2016 +0200
----------------------------------------------------------------------
.../markup/html/form/BinaryFieldPanel.html | 57 ++++++++++----------
.../markup/html/form/EncryptedFieldPanel.html | 4 +-
.../html/form/EncryptedFieldPanel.properties | 17 ++++++
.../html/form/EncryptedFieldPanel_it.properties | 17 ++++++
.../form/EncryptedFieldPanel_pt_BR.properties | 17 ++++++
.../html/form/EncryptedFieldPanel_ru.properties | 19 +++++++
6 files changed, 100 insertions(+), 31 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/57faf70b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/BinaryFieldPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/BinaryFieldPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/BinaryFieldPanel.html
index 19dd850..0a913b6 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/BinaryFieldPanel.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/BinaryFieldPanel.html
@@ -17,34 +17,31 @@ specific language governing permissions and limitations
under the License.
-->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <head><title></title></head>
- <body>
- <wicket:extend>
- <wicket:enclosure child="field-label">
- <label wicket:id="field-label">[LABEL]</label><span wicket:id="required"/>
- <span wicket:id="externalAction"/>
- </wicket:enclosure>
- <fieldset class="input-group">
- <input style="display: none;" wicket:id="textField"/>
- <div>
- <form wicket:id="uploadForm" encType="multipart/form-data" method="post" accept-charset="UTF-8">
- <span wicket:id="previewContainer">
- <span wicket:id="panelPreview">[panelPreview]</span>
- <wicket:fragment wicket:id="previewFragment">
- <div wicket:id = "previewer" class="ui-widget-content ui-corner-all form-group"></div>
- </wicket:fragment>
- <wicket:fragment wicket:id="emptyFragment">
- </wicket:fragment>
- </span>
- <input wicket:id="fileUpload" type="file"/>
- <div>
- <a href="#" wicket:id="downloadLink"><i title="download" alt="file download icon" class="glyphicon glyphicon-download"></i></a>
- <a href="#" wicket:id="resetLink"><i title="remove value" alt="remove value icon" class="glyphicon glyphicon-remove"></i></a>
- <span wicket:id="preview"/>
- </div>
- </form>
- </div>
- </fieldset>
- </wicket:extend>
- </body>
+ <wicket:extend>
+ <wicket:enclosure child="field-label">
+ <label wicket:id="field-label">[LABEL]</label><span wicket:id="required"/>
+ <span wicket:id="externalAction"/>
+ </wicket:enclosure>
+ <fieldset class="input-group">
+ <input style="display: none;" wicket:id="textField"/>
+ <div>
+ <form wicket:id="uploadForm" encType="multipart/form-data" method="post" accept-charset="UTF-8">
+ <span wicket:id="previewContainer">
+ <span wicket:id="panelPreview">[panelPreview]</span>
+ <wicket:fragment wicket:id="previewFragment">
+ <div wicket:id = "previewer" class="ui-widget-content ui-corner-all form-group"></div>
+ </wicket:fragment>
+ <wicket:fragment wicket:id="emptyFragment">
+ </wicket:fragment>
+ </span>
+ <input wicket:id="fileUpload" type="file"/>
+ <div>
+ <a href="#" wicket:id="downloadLink"><i title="download" alt="file download icon" class="glyphicon glyphicon-download"></i></a>
+ <a href="#" wicket:id="resetLink"><i title="remove value" alt="remove value icon" class="glyphicon glyphicon-remove"></i></a>
+ <span wicket:id="preview"/>
+ </div>
+ </form>
+ </div>
+ </fieldset>
+ </wicket:extend>
</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/57faf70b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/EncryptedFieldPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/EncryptedFieldPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/EncryptedFieldPanel.html
index 6a6117f..632307d 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/EncryptedFieldPanel.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/EncryptedFieldPanel.html
@@ -25,14 +25,16 @@ under the License.
<div class="input-group input-group-sm">
<span class="input-group-btn">
<button type="button" class="btn btn-warning btn-flat"
+ wicket:message="confirm:confirmMessage"
onclick="var pwd = $(this).parent().next('input');
var children = $(this).children();
+ var confirmMessage = $(this).attr('confirm');
if (pwd.is('[readonly]')) {
if (pwd.val() === '') {
pwd.removeAttr('readonly');
children.attr('class', 'fa fa-unlock');
} else {
- bootbox.confirm('This will remove the current value. Continue?', function (result) {
+ bootbox.confirm(confirmMessage, function (result) {
if (result === true) {
pwd.removeAttr('readonly');
pwd.val('');
http://git-wip-us.apache.org/repos/asf/syncope/blob/57faf70b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/EncryptedFieldPanel.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/EncryptedFieldPanel.properties b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/EncryptedFieldPanel.properties
new file mode 100644
index 0000000..193287d
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/EncryptedFieldPanel.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+confirmMessage=This will remove the current value. Continue?
http://git-wip-us.apache.org/repos/asf/syncope/blob/57faf70b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/EncryptedFieldPanel_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/EncryptedFieldPanel_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/EncryptedFieldPanel_it.properties
new file mode 100644
index 0000000..13be74d
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/EncryptedFieldPanel_it.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+confirmMessage=Questa azione rimuover\u00e0 il valore corrente. Continuare?
http://git-wip-us.apache.org/repos/asf/syncope/blob/57faf70b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/EncryptedFieldPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/EncryptedFieldPanel_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/EncryptedFieldPanel_pt_BR.properties
new file mode 100644
index 0000000..193287d
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/EncryptedFieldPanel_pt_BR.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+confirmMessage=This will remove the current value. Continue?
http://git-wip-us.apache.org/repos/asf/syncope/blob/57faf70b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/EncryptedFieldPanel_ru.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/EncryptedFieldPanel_ru.properties b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/EncryptedFieldPanel_ru.properties
new file mode 100644
index 0000000..1c45ef7
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/EncryptedFieldPanel_ru.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+# field.DateTimeFieldPanel$DateTimeFormValidator=\u00d0\u009f\u00d0\u00be\u00d0\u00bb\u00d0\u00b5 '${label0}' \u00d0\u00b4\u00d0\u00be\u00d0\u00bb\u00d0\u00b6\u00d0\u00bd\u00d0\u00be \u00d0\u00b1\u00d1\u008b\u00d1\u0082\u00d1\u008c \u00d0\u00b7\u00d0\u00b0\u00d0\u00bf\u00d0\u00be\u00d0\u00bb\u00d0\u00bd\u00d0\u00b5\u00d0\u00bd\u00d0\u00be \u00d0\u00bf\u00d0\u00be\u00d0\u00bb\u00d0\u00bd\u00d0\u00be\u00d1\u0081\u00d1\u0082\u00d1\u008c\u00d1\u008e
+confirmMessage=This will remove the current value. Continue?
[2/2] syncope git commit: [SYNCOPE-946] Same fix for enduser
Posted by il...@apache.org.
[SYNCOPE-946] Same fix for enduser
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/720794a6
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/720794a6
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/720794a6
Branch: refs/heads/2_0_X
Commit: 720794a6cea78fadb384db079239036c5e8a9422
Parents: 57faf70
Author: Francesco Chicchiricc� <il...@apache.org>
Authored: Mon Oct 3 12:49:55 2016 +0200
Committer: Francesco Chicchiricc� <il...@apache.org>
Committed: Mon Oct 3 12:51:02 2016 +0200
----------------------------------------------------------------------
.../enduser/resources/SchemaResource.java | 12 +++++
.../app/js/controllers/UserController.js | 1 -
.../app/views/dynamicPlainAttribute.html | 53 +++++++++++++++++---
3 files changed, 59 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/720794a6/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SchemaResource.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SchemaResource.java b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SchemaResource.java
index 605426a..e60a0a7 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SchemaResource.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SchemaResource.java
@@ -23,10 +23,12 @@ import java.util.Collections;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.core.Response;
+import org.apache.commons.collections4.ComparatorUtils;
import org.apache.commons.collections4.IterableUtils;
import org.apache.commons.collections4.Predicate;
import org.apache.syncope.client.enduser.SyncopeEnduserSession;
import org.apache.syncope.client.enduser.model.SchemaResponse;
+import org.apache.syncope.common.lib.EntityTOUtils;
import org.apache.syncope.common.lib.to.AbstractSchemaTO;
import org.apache.syncope.common.lib.to.AnyTypeTO;
import org.apache.syncope.common.lib.to.GroupTO;
@@ -125,6 +127,16 @@ public class SchemaResource extends AbstractBaseResource {
}
}
+ Collections.sort(plainSchemas, ComparatorUtils.transformedComparator(
+ ComparatorUtils.<String>naturalComparator(),
+ EntityTOUtils.keyTransformer()));
+ Collections.sort(derSchemas, ComparatorUtils.transformedComparator(
+ ComparatorUtils.<String>naturalComparator(),
+ EntityTOUtils.keyTransformer()));
+ Collections.sort(virSchemas, ComparatorUtils.transformedComparator(
+ ComparatorUtils.<String>naturalComparator(),
+ EntityTOUtils.keyTransformer()));
+
response.setWriteCallback(new AbstractResource.WriteCallback() {
@Override
http://git-wip-us.apache.org/repos/asf/syncope/blob/720794a6/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js b/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js
index 5e38b82..ebf5c81 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js
+++ b/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js
@@ -276,7 +276,6 @@ angular.module("self").controller("UserController", ['$scope', '$rootScope', '$l
};
var removeUserSchemas = function (anyTypeClass, group) {
-
//removing plain groupSchemas
for (var i = 0; i < $scope.dynamicForm.groupSchemas.length; i++) {
if ($scope.dynamicForm.groupSchemas[i] === group) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/720794a6/client/enduser/src/main/resources/META-INF/resources/app/views/dynamicPlainAttribute.html
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/views/dynamicPlainAttribute.html b/client/enduser/src/main/resources/META-INF/resources/app/views/dynamicPlainAttribute.html
index 654c0de..fbdf0a2 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/views/dynamicPlainAttribute.html
+++ b/client/enduser/src/main/resources/META-INF/resources/app/views/dynamicPlainAttribute.html
@@ -22,18 +22,59 @@ under the License.
ng-model="user.plainAttrs[schema.key].values[index]"
ng-required="{{schema.mandatoryCondition}}" validate="true"
ng-disabled="schema.readonly" ng-init="initAttribute(schema, index)" name="{{schema.key}}"/>
- <input ng-switch-when="Encrypted" class="form-control" type="text"
- ng-model="user.plainAttrs[schema.key].values[index]"
- ng-required="{{schema.mandatoryCondition}}" validate="true"
- ng-disabled="schema.readonly" ng-init="initAttribute(schema, index)"
- ame="{{schema.key}}"/>
+
+ <div ng-switch-when="Encrypted" class="input-group input-group-sm">
+ <span class="input-group-btn">
+ <button type="button" class="btn btn-default btn-flat"
+ onclick="var pwd = $(this).parent().next('input');
+ if (pwd.is('[readonly]')) {
+ if (pwd.val() === '') {
+ pwd.removeAttr('readonly');
+ $(this).children().attr('class', 'fa fa-unlock');
+ } else {
+ var response = confirm('This will remove the current value. Continue?');
+ if (response == true) {
+ pwd.removeAttr('readonly');
+ pwd.val('');
+ $(this).children().attr('class', 'fa fa-unlock');
+ }
+ }
+ }
+ ">
+ <i class="fa fa-lock"></i>
+ </button>
+ </span>
+ <input class="form-control" type="password" readonly="true"
+ ng-model="user.plainAttrs[schema.key].values[index]"
+ ng-required="{{schema.mandatoryCondition}}" validate="true"
+ ng-disabled="schema.readonly" ng-init="initAttribute(schema, index)" name="{{schema.key}}"/>
+ <span class="input-group-btn">
+ <button type="button" class="btn btn-default btn-flat"
+ onmousedown="var pwd = $(this).parent().prev('input');
+ if (!pwd.is('[readonly]')) {
+ pwd.attr('type', 'text');
+ $(this).children().attr('class', 'fa fa-eye-slash');
+ }"
+ onmouseup="var pwd = $(this).parent().prev('input');
+ if (!pwd.is('[readonly]')) {
+ pwd.attr('type', 'password');
+ $(this).children().attr('class', 'fa fa-eye');
+ }"
+ >
+ <i class="fa fa-eye"></i>
+ </button>
+ </span>
+ </div>
+
<div ng-switch-when="Boolean">
<input type="checkbox" ng-model="user.plainAttrs[schema.key].values[index]" ng-required="{{schema.mandatoryCondition}}"
ng-init="initAttribute(schema, index)" />
</div>
+
<input ng-switch-when="Long" class="form-control" type="number" ng-model="user.plainAttrs[schema.key].values[index]"
ng-required="{{schema.mandatoryCondition}}" validate="true"
ng-init="initAttribute(schema, index)" name="{{schema.key}}"/>
+
<input ng-switch-when="Double" class="form-control" type="number" ng-model="user.plainAttrs[schema.key].values[index]"
ng-required="{{schema.mandatoryCondition}}" validate="true"
ng-init="initAttribute(schema, index)" name="{{schema.key}}"/>
@@ -72,7 +113,7 @@ under the License.
</div>
<div ng-switch-when="Binary" ng-init="initAttribute(schema, index)">
- <input file-input type="file" id="fileInput" name="fileInput">
+ <input file-input type="file" id="fileInput" name="fileInput"/>
<button type="button" title="Download file" class="fileButton btn btn-default btn-sm" ng-click="download()">
<i class="glyphicon glyphicon-download" ></i>
</button>