From 690bd7de5ceddc62dcb5fa002a7f588880b48f63 Mon Sep 17 00:00:00 2001 From: Imesh Chandrasiri Date: Fri, 9 Sep 2016 14:58:31 +0530 Subject: [PATCH 1/4] modal popup changes --- .../cdmf.page.certificates/certificates.hbs | 55 ++++++++++--------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificates/certificates.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificates/certificates.hbs index 86f161ae35..6bb4257acc 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificates/certificates.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificates/certificates.hbs @@ -121,48 +121,49 @@
-
-
-
-

Done. Certificate was successfully removed.

- -
+ + +
-
-
-
-

An unexpected error occurred. Please try again later.

+ + +
+
-
-
-
-

+ + Unauthorized action! +

+ +
+ +
From 7dc93ff01060efc94c012809993e08a180fd0696 Mon Sep 17 00:00:00 2001 From: harshanl Date: Fri, 9 Sep 2016 15:06:30 +0530 Subject: [PATCH 2/4] MSSQL script fixes and added the /users/count REST API --- .../service/api/UserManagementService.java | 34 +++++++++++++++++-- .../impl/UserManagementServiceImpl.java | 20 +++++++++++ .../main/resources/dbscripts/cdm/mssql.sql | 9 ++--- 3 files changed, 57 insertions(+), 6 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java index 6097b4e43a..ce403fa281 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java @@ -288,12 +288,12 @@ public interface UserManagementService { httpMethod = "GET", value = "Get user list", notes = "If you wish to get the details of all the users registered with EMM, you can do so " - + "using the REST API", + + "using this REST API", tags = "User Management") @ApiResponses(value = { @ApiResponse( code = 200, - message = "OK. \n Successfully fetched the requested role.", + message = "OK. \n Successfully fetched the requested users.", response = BasicUserInfoList.class, responseHeaders = { @ResponseHeader( @@ -343,6 +343,36 @@ public interface UserManagementService { required = false) @QueryParam("limit") int limit); + @GET + @Path("/count") + @ApiOperation( + produces = MediaType.APPLICATION_JSON, + httpMethod = "GET", + value = "Get user count", + notes = "If you wish to get the user count registered with EMM, you can do so using this REST API", + tags = "User Management") + @ApiResponses(value = { + @ApiResponse( + code = 200, + message = "OK. \n Successfully fetched the user count.", + response = BasicUserInfoList.class, + responseHeaders = { + @ResponseHeader( + name = "Content-Type", + description = "The content type of the body") + }), + @ApiResponse( + code = 406, + message = "Not Acceptable.\n The requested media type is not supported", + response = ErrorResponse.class), + @ApiResponse( + code = 500, + message = "Internal Server Error. \n Server error occurred while fetching the user list.", + response = ErrorResponse.class) + }) + @Permission(name = "View Users", permission = "/device-mgt/users/view") + Response getUserCount(); + @GET @Path("/search/usernames") @ApiOperation( diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java index 6df497f8c1..df34771125 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java @@ -316,6 +316,26 @@ public class UserManagementServiceImpl implements UserManagementService { } } + @GET + @Path("/count") + @Override + public Response getUserCount() { + if (log.isDebugEnabled()) { + log.debug("Getting the user count"); + } + + try { + UserStoreManager userStoreManager = DeviceMgtAPIUtils.getUserStoreManager(); + int userCount = userStoreManager.listUsers("*", -1).length; + return Response.status(Response.Status.OK).entity(userCount).build(); + } catch (UserStoreException e) { + String msg = "Error occurred while retrieving the user count."; + log.error(msg, e); + return Response.serverError().entity( + new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); + } + } + @GET @Path("/search/usernames") @Override diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mssql.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mssql.sql index a3f9976fef..1f62c3fccf 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mssql.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mssql.sql @@ -3,7 +3,8 @@ CREATE TABLE DM_DEVICE_TYPE ( NAME VARCHAR(300) DEFAULT NULL, PROVIDER_TENANT_ID INTEGER NULL, SHARED_WITH_ALL_TENANTS BIT NOT NULL DEFAULT 0, - PRIMARY KEY (ID) + PRIMARY KEY (ID), + CONSTRAINT DEVICE_TYPE_NAME UNIQUE(NAME) ); CREATE INDEX IDX_DEVICE_TYPE ON DM_DEVICE_TYPE (NAME); @@ -122,12 +123,12 @@ CREATE TABLE DM_PROFILE ( ID INTEGER IDENTITY(1,1) NOT NULL, PROFILE_NAME VARCHAR(45) NOT NULL , TENANT_ID INTEGER NOT NULL , - DEVICE_TYPE_ID INTEGER NOT NULL , + DEVICE_TYPE VARCHAR(300) NOT NULL , CREATED_TIME DATETIME NOT NULL , UPDATED_TIME DATETIME NOT NULL , PRIMARY KEY (ID) , - CONSTRAINT DM_PROFILE_DEVICE_TYPE FOREIGN KEY (DEVICE_TYPE_ID) REFERENCES - DM_DEVICE_TYPE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION + CONSTRAINT DM_PROFILE_DEVICE_TYPE FOREIGN KEY (DEVICE_TYPE) REFERENCES + DM_DEVICE_TYPE (NAME) ON DELETE NO ACTION ON UPDATE NO ACTION ); CREATE TABLE DM_POLICY ( From 6a9225d2490be54b887ab08fbd0ca067e0784a6b Mon Sep 17 00:00:00 2001 From: dilanua Date: Fri, 9 Sep 2016 15:30:23 +0530 Subject: [PATCH 3/4] Updating device module for permissions - Ui --- .../devicemgt/app/modules/business-controllers/device.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js index 4b205346d9..b970b04cf9 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js @@ -40,7 +40,7 @@ deviceModule = function () { // var deviceCloudService = devicemgtProps["httpsURL"] + "/common/device_manager"; -/** + /** * Only GET method is implemented for now since there are no other type of methods used this method. * @param url - URL to call the backend without the host * @param method - HTTP Method (GET, POST) @@ -273,6 +273,9 @@ deviceModule = function () { deviceObject[constants["DEVICE_PROPERTIES"]] = properties; response["content"] = deviceObject; return response; + } else if (backendResponse.status == 401) { + response["status"] = "unauthorized"; + return response; } else { response["status"] = "error"; return response; From dc23e55444273e724cd154944357ddced0dfa661 Mon Sep 17 00:00:00 2001 From: thusithakalugamage Date: Fri, 9 Sep 2016 16:02:09 +0530 Subject: [PATCH 4/4] responsive tab panel component - style changes --- .../public/css/custom-desktop.css | 36 +++++++++++-------- .../uuf.unit.theme/public/css/theme-wso2.css | 15 -------- 2 files changed, 21 insertions(+), 30 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/public/css/custom-desktop.css b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/public/css/custom-desktop.css index 49ada6fc1e..6f89f73627 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/public/css/custom-desktop.css +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/public/css/custom-desktop.css @@ -3042,14 +3042,7 @@ a.list-group-item:hover { left: 0; } -@media (min-width: 768px) { - .tab-content > .tab-pane { - display: none !important; - } - .tab-content > .active { - display: block !important; - } -} + .wr-content { padding-top: 10px; } @@ -4313,6 +4306,13 @@ a.wr-side-panel-toggle-btn.selected { height: 110px; margin-bottom: 10px; } +.device-detail-body .wr-stats-board-tile { + background: #e2e2e2; + color: #333; + padding: 15px; + height: 110px; + margin-bottom: 10px; +} .wr-stats-board .tiles .row { margin: 0 -5px; @@ -6905,15 +6905,19 @@ ul.tiles .icon { .media .panel-group.tab-content{ position: relative; - background: #f4f4f4; - border: 1px solid #ddd; + border: none; + margin-bottom:0px; } .media .panel-group .panel-heading{ - padding:10px; + padding:0px; margin-bottom:0px; } + .media .panel-group .panel-heading.display-none-xs{ + padding:10px; + margin-bottom:0px; + } .media .panel.active .panel-heading.visible-xs{ - background:#2c313b; + background:#11375b; color:#fff; } .media .panel-heading{ @@ -6930,11 +6934,13 @@ ul.tiles .icon { height: 0px; border-top: 10px solid transparent; border-bottom: 10px solid transparent; - border-right: 10px solid #f4f4f4; + border-right: 10px solid #ddd; } .media .panel-group.tab-content .panel{ - background:none; + background: #f4f4f4; + border:1px solid #ddd; + margin-bottom:10px; } .media .list-group-item a, .media .list-group-item a{ background:#f4f4f4; @@ -6947,7 +6953,7 @@ ul.tiles .icon { margin-top:0px; } .media .panel-group .panel-body{ - margin-bottom:40px; + /*margin-bottom:40px;*/ } .media .panel-group .panel-body .thumbnail.icon{ margin-bottom:10px; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/css/theme-wso2.css b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/css/theme-wso2.css index 39d6f1b6ca..a126a734fd 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/css/theme-wso2.css +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/css/theme-wso2.css @@ -3525,13 +3525,6 @@ tbody.collapse.in { } } -.tab-content > .tab-pane { - display: none; -} -.tab-content > .active { - display: block; -} - .nav-tabs .dropdown-menu { margin-top: -1px; border-top-right-radius: 0; @@ -8295,15 +8288,7 @@ a.list-group-item:hover { left: 0; } -@media (min-width: 768px) { - .tab-content > .tab-pane { - display: none !important; - } - .tab-content > .active { - display: block !important; - } -} /* ======================================================================== * Misc customizations * ======================================================================== */