diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml index 1bf917de68..19590e84a1 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml @@ -22,13 +22,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.annotations - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT bundle WSO2 Carbon - API Management Annotations WSO2 Carbon - API Management Custom Annotation Module diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml index ee4e158727..3270853c90 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml @@ -21,12 +21,12 @@ apimgt-extensions org.wso2.carbon.devicemgt - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT ../pom.xml 4.0.0 - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT org.wso2.carbon.apimgt.application.extension.api war WSO2 Carbon - API Application Management API diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml index b68df772b3..d6bee7e1b2 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml @@ -22,12 +22,12 @@ apimgt-extensions org.wso2.carbon.devicemgt - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT ../pom.xml 4.0.0 - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT org.wso2.carbon.apimgt.application.extension bundle WSO2 Carbon - API Application Management diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml index c5c272cfad..a3f22c0eec 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml @@ -21,13 +21,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.handlers - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT bundle WSO2 Carbon - API Security Handler Component WSO2 Carbon - API Management Security Handler Module diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/resources/iot-api-config.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/resources/iot-api-config.xml index fc65693d28..ed61a4a115 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/resources/iot-api-config.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/resources/iot-api-config.xml @@ -19,22 +19,22 @@ - https://localhost:9443/ + https://${iot.core.host}:${iot.core.https.port}/ - https://localhost:9443/api/certificate-mgt/v1.0/admin/certificates/verify/ + https://${iot.core.host}:${iot.core.https.port}/api/certificate-mgt/v1.0/admin/certificates/verify/ admin admin - https://localhost:9443/dynamic-client-web/register + https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.11/register - https://localhost:9443/oauth2/token + https://${iot.keymanager.host}:${iot.keymanager.https.port}/oauth2/token - /services/echo + /services \ No newline at end of file diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml index b22946aa8d..91fa6da450 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml @@ -13,13 +13,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.integration.client - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT bundle WSO2 Carbon - API Management Integration Client WSO2 Carbon - API Management Integration Client diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml index 6ca40596f9..f30727e42e 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml @@ -13,13 +13,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.integration.generated.client - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT bundle WSO2 Carbon - API Management Integration Generated Client WSO2 Carbon - API Management Integration Client diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml index e7ee4fbf12..f4a292724c 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml @@ -22,13 +22,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.webapp.publisher - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT bundle WSO2 Carbon - API Management Webapp Publisher WSO2 Carbon - API Management Webapp Publisher diff --git a/components/apimgt-extensions/pom.xml b/components/apimgt-extensions/pom.xml index 745926115b..2fa724040a 100644 --- a/components/apimgt-extensions/pom.xml +++ b/components/apimgt-extensions/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT ../../pom.xml 4.0.0 apimgt-extensions - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT pom WSO2 Carbon - API Management Extensions Component http://wso2.org diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml index 0b546ac473..c85c1c5e4b 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml @@ -22,7 +22,7 @@ certificate-mgt org.wso2.carbon.devicemgt - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT ../pom.xml diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml index 0e429ff5d4..8205ac67e0 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml @@ -22,7 +22,7 @@ certificate-mgt org.wso2.carbon.devicemgt - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT ../pom.xml diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml index 1abc607ad1..3f4e05bedc 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml @@ -21,13 +21,13 @@ org.wso2.carbon.devicemgt certificate-mgt - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.certificate.mgt.core - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT bundle WSO2 Carbon - Certificate Management Core WSO2 Carbon - Certificate Management Core diff --git a/components/certificate-mgt/pom.xml b/components/certificate-mgt/pom.xml index 98a05901e4..1294fee302 100644 --- a/components/certificate-mgt/pom.xml +++ b/components/certificate-mgt/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt certificate-mgt - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT pom WSO2 Carbon - Certificate Management Component http://wso2.org diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml index eedaa95417..b7e7b30fcd 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml index 3a3f0b5c3e..34c7b6dee4 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml index f2db26c166..62a1b30d4d 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml index ffa9b0e9e3..c344336342 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/pom.xml b/components/device-mgt-extensions/pom.xml index 046d66c705..2122a3712f 100644 --- a/components/device-mgt-extensions/pom.xml +++ b/components/device-mgt-extensions/pom.xml @@ -22,7 +22,7 @@ carbon-devicemgt org.wso2.carbon.devicemgt - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT ../../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml index 582da4d506..018c8b81b0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml @@ -3,7 +3,7 @@ org.wso2.carbon.devicemgt device-mgt - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml index cd7b19e7b4..c1129bc6f4 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml index ec7025d04f..b52d94a8d0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml @@ -22,7 +22,7 @@ device-mgt org.wso2.carbon.devicemgt - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GroupManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GroupManagementServiceImpl.java index cc5fa3ddac..8bab08463b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GroupManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GroupManagementServiceImpl.java @@ -173,7 +173,10 @@ public class GroupManagementServiceImpl implements GroupManagementService { .manageGroupSharing(groupId, userRoles); return Response.status(Response.Status.OK).build(); } catch (GroupManagementException e) { - String msg = "Error occurred while managing group share."; + String msg = "Error occurred while managing group share. "; + if (e.getErrorMessage() != null){ + msg += e.getErrorMessage(); + } log.error(msg, e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); } catch (RoleDoesNotExistException e) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml index fe45823629..c1afd8d489 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml @@ -21,7 +21,7 @@ device-mgt org.wso2.carbon.devicemgt - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml index b0b30b119d..69f9f9027b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/GroupManagementProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/GroupManagementProviderServiceImpl.java index 94b480978e..44a5995b55 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/GroupManagementProviderServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/GroupManagementProviderServiceImpl.java @@ -367,39 +367,41 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid @Override public void manageGroupSharing(int groupId, List newRoles) throws GroupManagementException, RoleDoesNotExistException { - int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId(); - UserStoreManager userStoreManager; - try { - userStoreManager = - DeviceManagementDataHolder.getInstance().getRealmService().getTenantUserRealm( - tenantId).getUserStoreManager(); - List currentUserRoles = getRoles(groupId); - GroupManagementDAOFactory.beginTransaction(); - for (String role : newRoles) { - if (!userStoreManager.isExistingRole(role)) { - throw new RoleDoesNotExistException("Role '" + role + "' does not exists in the user store."); + int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId(); + UserStoreManager userStoreManager; + try { + userStoreManager = + DeviceManagementDataHolder.getInstance().getRealmService().getTenantUserRealm( + tenantId).getUserStoreManager(); + List currentUserRoles = getRoles(groupId); + GroupManagementDAOFactory.beginTransaction(); + if (newRoles != null) { + for (String role : newRoles) { + if (!userStoreManager.isExistingRole(role)) { + throw new RoleDoesNotExistException("Role '" + role + "' does not exists in the user store."); + } + // Removing role from current user roles of the group will return true if role exist. + // So we don't need to add it to the db again. + if (!currentUserRoles.remove(role)) { + // If group doesn't have the role, it is adding to the db. + groupDAO.addRole(groupId, role, tenantId); + } + } } - // Removing role from current user roles of the group will return true if role exist. - // So we don't need to add it to the db again. - if (!currentUserRoles.remove(role)) { - // If group doesn't have the role, it is adding to the db. - groupDAO.addRole(groupId, role, tenantId); + for (String role : currentUserRoles) { + // Removing old roles from db which are not available in the new roles list. + groupDAO.removeRole(groupId, role, tenantId); } - } - for (String role : currentUserRoles) { - // Removing old roles from db which are not available in the new roles list. - groupDAO.removeRole(groupId, role, tenantId); - } - GroupManagementDAOFactory.commitTransaction(); - } catch (GroupManagementDAOException e) { - GroupManagementDAOFactory.rollbackTransaction(); - throw new GroupManagementException(e); - } catch (UserStoreException e) { - throw new GroupManagementException("User store error in updating sharing roles.", e); - } catch (TransactionManagementException e) { - throw new GroupManagementException(e); - } finally { - GroupManagementDAOFactory.closeConnection(); + GroupManagementDAOFactory.commitTransaction(); + } catch (GroupManagementDAOException e) { + GroupManagementDAOFactory.rollbackTransaction(); + throw new GroupManagementException(e); + } catch (UserStoreException e) { + throw new GroupManagementException("User store error in updating sharing roles.", e); + } catch (TransactionManagementException e) { + throw new GroupManagementException(e); + } finally { + GroupManagementDAOFactory.closeConnection(); } } @@ -469,12 +471,12 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid try { int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId(); GroupManagementDAOFactory.beginTransaction(); - for (DeviceIdentifier deviceIdentifier : deviceIdentifiers){ + for (DeviceIdentifier deviceIdentifier : deviceIdentifiers) { device = DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().getDevice(deviceIdentifier); if (device == null) { throw new DeviceNotFoundException("Device not found for id '" + deviceIdentifier.getId() + "'"); } - if (!this.groupDAO.isDeviceMappedToGroup(groupId, device.getId(), tenantId)){ + if (!this.groupDAO.isDeviceMappedToGroup(groupId, device.getId(), tenantId)) { this.groupDAO.addDevice(groupId, device.getId(), tenantId); } } @@ -501,7 +503,7 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid try { int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId(); GroupManagementDAOFactory.beginTransaction(); - for (DeviceIdentifier deviceIdentifier : deviceIdentifiers){ + for (DeviceIdentifier deviceIdentifier : deviceIdentifiers) { device = DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().getDevice(deviceIdentifier); if (device == null) { throw new DeviceNotFoundException("Device not found for id '" + deviceIdentifier.getId() + "'"); @@ -554,7 +556,7 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid Device device = managementProviderService.getDevice(deviceIdentifier); GroupManagementDAOFactory.openConnection(); return groupDAO.getGroups(device.getId(), - PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId()); + PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId()); } catch (DeviceManagementException e) { throw new GroupManagementException("Error occurred while retrieving the device details.", e); } catch (GroupManagementDAOException e) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml index 4fc6554209..e25649eb5c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml @@ -22,7 +22,7 @@ device-mgt org.wso2.carbon.devicemgt - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml index 5f72aa84b3..10e5c8ac63 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml @@ -22,7 +22,7 @@ device-mgt org.wso2.carbon.devicemgt - 2.0.65-SNAPSHOT + 2.0.68-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs index 74d866758b..645d05b0ed 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs @@ -381,7 +381,7 @@
-

Unexpected error occurred!

+

Unexpected error occurred!

diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js index 7dfacfb41f..716d6f6917 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js @@ -112,7 +112,7 @@ function toTitleCase(str) { }); } -function htmlspecialchars(text){ +function htmlspecialchars(text) { return jQuery('
').text(text).html(); } @@ -138,11 +138,11 @@ function loadGroups() { var objects = []; $(data.deviceGroups).each(function (index) { objects.push({ - groupId: htmlspecialchars(data.deviceGroups[index].id), - name: htmlspecialchars(data.deviceGroups[index].name), - description: htmlspecialchars(data.deviceGroups[index].description), - owner: htmlspecialchars(data.deviceGroups[index].owner) - }) + groupId: htmlspecialchars(data.deviceGroups[index].id), + name: htmlspecialchars(data.deviceGroups[index].name), + description: htmlspecialchars(data.deviceGroups[index].description), + owner: htmlspecialchars(data.deviceGroups[index].owner) + }) }); var json = { "recordsTotal": data.count, @@ -159,7 +159,7 @@ function loadGroups() { class: 'remove-padding icon-only content-fill viewEnabledIcon', render: function (data, type, row, meta) { return '
'; + 'src="public/cdmf.page.groups/images/group-icon.png"/>
'; } }, { @@ -185,38 +185,38 @@ function loadGroups() { var html = ''; if ($.hasPermission("VIEW_GROUP_DEVICES")) { /*html += '
' + - '' - + - '';*/ + + '/analytics" data-click-event="remove-form" class="btn padding-reduce-on-grid-view">' + + '' + + + '';*/ } if (row.owner != "wso2.system.user") { if ($.hasPermission("SHARE_GROUP")) { html += - ''; + ''; } if ($.hasPermission("UPDATE_GROUP")) { html += - '' + - ''; + '' + + ''; } if ($.hasPermission("REMOVE_GROUP")) { html += - '' - + - ''; + '' + + + ''; } } return html; @@ -251,21 +251,21 @@ function loadGroups() { }; $('#group-grid').datatables_extended_serverside_paging( - null, - serviceURL, - dataFilter, - columns, - fnCreatedRow, - function (oSettings) { - $(".icon .text").res_text(0.2); - attachEvents(); - var thisTable = $(this).closest('.dataTables_wrapper').find('.dataTable').dataTable(); - thisTable.removeClass("table-selectable"); - }, - { - "placeholder": "Search By Group Name", - "searchKey": "name" - } + null, + serviceURL, + dataFilter, + columns, + fnCreatedRow, + function (oSettings) { + $(".icon .text").res_text(0.2); + attachEvents(); + var thisTable = $(this).closest('.dataTables_wrapper').find('.dataTable').dataTable(); + thisTable.removeClass("table-selectable"); + }, + { + "placeholder": "Search By Group Name", + "searchKey": "name" + } ); $(groupCheckbox).click(function () { addGroupSelectedClass(this); @@ -402,17 +402,16 @@ function attachEvents() { var shareGroupNewRoleFromSelectionLink = $("a#share-group-new-role-from-selection"); shareGroupNewRoleFromSelectionLink.click(function () { - var roles = []; - $('.modal .roleCheckBoxes').each( - function () { - if ($(this).is(':checked')) { - roles.push($(this).data('role-name')); - } - } - ); - addNewRole(roles); - // $(modalPopupContent).html($('#share-group-w3-modal-content').html()); - // createNewRole(roles); + var roles = $("#roles").val(); + if (roles && roles.length >= 2) { + addNewRole(roles); + } else { + var errorMsgWrapper = "#notification-error-msg"; + var errorMsg = "#notification-error-msg span"; + $(errorMsg).text("To create a new role with the combination of roles, at least two roles should be" + + " selected."); + $(errorMsgWrapper).removeClass("hidden"); + } }); }); @@ -442,7 +441,7 @@ function attachEvents() { }; invokerUtil.delete("/api/device-mgt/v1.0/groups/id/" + groupId, - successCallback, function (message) { + successCallback, function (message) { displayErrors(message); }); }); @@ -487,7 +486,7 @@ function attachEvents() { }; invokerUtil.put("/api/device-mgt/v1.0/groups/id/" + groupId, group, - successCallback, function (message) { + successCallback, function (message) { displayErrors(message); }); }); @@ -517,7 +516,7 @@ function markAlreadySavedUsersRoles(groupId) { }; invokerUtil.get("/api/device-mgt/v1.0/groups/id/" + groupId + "/roles", - successCallback, function (message) { + successCallback, function (message) { displayErrors(message); }); } @@ -534,9 +533,9 @@ function listAllRoles(groupId) { html += ''; $("#rolesListing").html(html); markAlreadySavedUsersRoles(groupId); - $("select.select2[multiple=multiple]").select2({ - tags: false - }); + $("select.select2[multiple=multiple]").select2({tags: false}).on("select2:select", function () { + $("#notification-error-msg").addClass("hidden"); + }); } else { $("#rolesListing").html("No roles available"); } @@ -546,7 +545,7 @@ function listAllRoles(groupId) { }; invokerUtil.get("/api/device-mgt/v1.0/roles?offset=0&limit=100&user-store=all", - successCallback, function (message) { + successCallback, function (message) { displayErrors(message); }); } @@ -589,7 +588,7 @@ function updateGroupShare(groupId, roles) { }; invokerUtil.post("/api/device-mgt/v1.0/groups/id/" + groupId + "/share", - roles, successCallback, function (message) { + roles, successCallback, function (message) { displayErrors(message); }); } @@ -600,7 +599,7 @@ function createNewCombinedRole(roleName, roleList) { showPopup(); }; invokerUtil.post("/api/device-mgt/v1.0/roles/create-combined-role/" + roleName, roleList, - successCallback, function (message) { + successCallback, function (message) { displayErrors(message); }); } @@ -633,6 +632,9 @@ function displayErrors(jqXHR) { }); } else { $(modalPopupContent).html($('#group-unexpected-error-content').html()); + if (jqXHR.responseText) { + $('#unexp-error-msg').html(jqXHR.responseText.replace(new RegExp("\"", 'g'), "")); + } $("a#group-unexpected-error-link").click(function () { hidePopup(); }); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/public/js/policy-edit.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/public/js/policy-edit.js index 7296b3ed89..e2a7182b6b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/public/js/policy-edit.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/public/js/policy-edit.js @@ -164,6 +164,12 @@ skipStep["policy-platform"] = function (policyPayloadObj) { $("#users-radio-btn").prop("checked", true); $("#users-select-field").show(); $("#user-roles-select-field").hide(); + $.each(currentlyEffected["users"], function (i, item) { + userInput.append($('