From c49aac65fc5b95a30e4162a6f784c00f06f3d84b Mon Sep 17 00:00:00 2001 From: Shaun Ford Date: Wed, 30 May 2018 13:28:33 -0700 Subject: [PATCH] Fix dashboard width and file list (#162) * Fix total count of paginated files in list call * Fix secure data browser off screen in dashboard * Update gradle version to 3.15.7 * Add max width to secure data browser in dashboard --- .../app/components/SecureDataForm/SecureDataForm.scss | 3 ++- gradle.properties | 2 +- .../java/com/nike/cerberus/dao/SecureDataDao.java | 4 ++++ .../com/nike/cerberus/mapper/SecureDataMapper.java | 2 ++ .../com/nike/cerberus/service/SecureDataService.java | 2 +- .../com/nike/cerberus/mapper/SecureDataMapper.xml | 11 +++++++++++ 6 files changed, 21 insertions(+), 3 deletions(-) diff --git a/dashboard/app/components/SecureDataForm/SecureDataForm.scss b/dashboard/app/components/SecureDataForm/SecureDataForm.scss index 6e396c363..d739f1699 100644 --- a/dashboard/app/components/SecureDataForm/SecureDataForm.scss +++ b/dashboard/app/components/SecureDataForm/SecureDataForm.scss @@ -1,7 +1,8 @@ @import '../../assets/styles/common.scss'; #add-new-secure-data-form { - width: 1150px; + width: 100%; + max-width: 1150px; #new-secure-data-path { display: flex; font-size: 16px; diff --git a/gradle.properties b/gradle.properties index b28738bfd..edbb18858 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,6 +14,6 @@ # limitations under the License. # -version=3.15.6 +version=3.15.7 groupId=com.nike.cerberus artifactId=cms diff --git a/src/main/java/com/nike/cerberus/dao/SecureDataDao.java b/src/main/java/com/nike/cerberus/dao/SecureDataDao.java index 4d08d5598..b00d8b837 100644 --- a/src/main/java/com/nike/cerberus/dao/SecureDataDao.java +++ b/src/main/java/com/nike/cerberus/dao/SecureDataDao.java @@ -112,6 +112,10 @@ public List listSecureDataByPartialPathAndType(String partialP return secureDataMapper.listSecureDataByPartialPathAndType(partialPath, type, limit, offset); } + public int countByPartialPathAndType(String partialPath, SecureDataType type) { + return secureDataMapper.countByPartialPathAndType(partialPath, type); + } + public int countByType(SecureDataType type) { return secureDataMapper.countByType(type); } diff --git a/src/main/java/com/nike/cerberus/mapper/SecureDataMapper.java b/src/main/java/com/nike/cerberus/mapper/SecureDataMapper.java index 0a8b89a2d..0e5de1ac3 100644 --- a/src/main/java/com/nike/cerberus/mapper/SecureDataMapper.java +++ b/src/main/java/com/nike/cerberus/mapper/SecureDataMapper.java @@ -45,6 +45,8 @@ List listSecureDataByPartialPathAndType( @Param("limit") int limit, @Param("offset") int offset); + int countByPartialPathAndType(@Param("partialPath") String partialPath, @Param("type") SecureDataType type); + int countByType(@Param("type") SecureDataType type); Set getPathsBySdbId(@Param("sdbId") String sdbId); diff --git a/src/main/java/com/nike/cerberus/service/SecureDataService.java b/src/main/java/com/nike/cerberus/service/SecureDataService.java index 5f81d3bce..86d63b1b8 100644 --- a/src/main/java/com/nike/cerberus/service/SecureDataService.java +++ b/src/main/java/com/nike/cerberus/service/SecureDataService.java @@ -326,7 +326,7 @@ public SecureFileSummaryResult listSecureFilesSummaries(String partialPath, int partialPath = partialPath + "/"; } - int totalNumFiles = secureDataDao.countByType(SecureDataType.FILE); + int totalNumFiles = secureDataDao.countByPartialPathAndType(partialPath, SecureDataType.FILE); List fileSummaries = Lists.newArrayList(); List secureDataRecords = secureDataDao.listSecureDataByPartialPathAndType(partialPath, SecureDataType.FILE, limit, offset); secureDataRecords.forEach(secureDataRecord -> { diff --git a/src/main/resources/com/nike/cerberus/mapper/SecureDataMapper.xml b/src/main/resources/com/nike/cerberus/mapper/SecureDataMapper.xml index 63c5bf152..2ad26c15b 100644 --- a/src/main/resources/com/nike/cerberus/mapper/SecureDataMapper.xml +++ b/src/main/resources/com/nike/cerberus/mapper/SecureDataMapper.xml @@ -157,6 +157,17 @@ OFFSET #{offset} + +