diff --git a/.gitignore b/.gitignore index 80ec64d..891a46c 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ target *.settings *.classpath .DS_Store +**/node_modules +**package-lock.json diff --git a/src/main/java/knox/spring/data/neo4j/domain/Branch.java b/src/main/java/knox/spring/data/neo4j/domain/Branch.java index a650dec..244cdb9 100644 --- a/src/main/java/knox/spring/data/neo4j/domain/Branch.java +++ b/src/main/java/knox/spring/data/neo4j/domain/Branch.java @@ -84,6 +84,11 @@ public Commit getLatestCommit() { public String getBranchID() { return branchID; } + + public void setBranchID(String branchID) { + + this.branchID = branchID; + } public boolean hasLatestCommit() { return latestCommit != null; diff --git a/src/main/java/knox/spring/data/neo4j/services/DesignSpaceService.java b/src/main/java/knox/spring/data/neo4j/services/DesignSpaceService.java index e32fb1e..a106b58 100644 --- a/src/main/java/knox/spring/data/neo4j/services/DesignSpaceService.java +++ b/src/main/java/knox/spring/data/neo4j/services/DesignSpaceService.java @@ -616,8 +616,11 @@ public void deleteBranch(String targetSpaceID, String targetBranchID) { public void copyHeadBranch(String targetSpaceID, String outputBranchID) { DesignSpace targetSpace = loadDesignSpace(targetSpaceID); - - targetSpace.addBranch(targetSpace.getHeadBranch().copy()); + + Branch outputBranch = targetSpace.getHeadBranch().copy(); + outputBranch.setBranchID(outputBranchID); + + targetSpace.addBranch(outputBranch); saveDesignSpace(targetSpace); } @@ -626,7 +629,9 @@ public void checkoutBranch(String targetSpaceID, String targetBranchID) { DesignSpace targetSpace = loadDesignSpace(targetSpaceID); targetSpace.clearNodes(); - + + targetSpace.setHeadBranch(targetSpace.getBranch(targetBranchID)); + targetSpace.copyNodeSpace(targetSpace.getHeadSnapshot()); saveDesignSpace(targetSpace); @@ -646,12 +651,12 @@ public void commitToHeadBranch(String targetSpaceID) { commitToBranch(targetSpace, targetSpace.getHeadBranch()); } - public void commitToBranch(DesignSpace targetSpace, Branch targetBranch) { + private void commitToBranch(DesignSpace targetSpace, Branch targetBranch) { Commit commit = targetSpace.createCommit(targetBranch); - - targetBranch.setLatestCommit(commit); - - commit.getSnapshot().copyNodeSpace(targetSpace); + + commit.createSnapshot().copyNodeSpace(targetSpace); + + targetBranch.setLatestCommit(commit); saveDesignSpace(targetSpace); } diff --git a/src/main/resources/static/css/knox.css b/src/main/resources/static/css/knox.css index 642f1ce..e24e4d2 100644 --- a/src/main/resources/static/css/knox.css +++ b/src/main/resources/static/css/knox.css @@ -37,6 +37,7 @@ a { a:hover, a:focus { color: #eb3812; + cursor: pointer } h1, @@ -547,7 +548,7 @@ section { } #search-tb { - background-image: url("http://i47.tinypic.com/r02vbq.png"); + background-image: url('../img/search.jpg'); background-repeat: no-repeat; background-position: left center; display: inline-block; @@ -599,70 +600,6 @@ textarea:focus, input:focus{ background: #EEEEEE; } -.btn-holder { - text-align: center; - position: absolute; - width: 100%; - bottom: 0; - padding-bottom: 40px; -} - -.circle-float-btn { - background-color: white; - width: 70px; - height: 70px; - padding: 10px 16px; - font-size: 18px; - line-height: 1.33; - border-radius: 35px; - display: inline-block; - border: 1px solid #EEEEEE; - box-shadow: 0px 2px 5px #EEEEEE; - -webkit-transition: box-shadow ease-in-out .35s; - -moz-transition: box-shadow ease-in-out .35s; - transition: box-shadow ease-in-out .35s; - margin: 10px; - overflow: hidden; -} - -.btn-img { - margin-left: -5px; - margin-top: -1px; -} - -#combine-btn img { - opacity: 0.5; - -webkit-transition: box-shadow .35s, opacity ease-in-out .35s; - -moz-transition: box-shadow .35s, opacity ease-in-out .35s; - transition: box-shadow .35s, opacity ease-in-out .35s; -} - -#combine-btn:hover img.btn-img { - opacity: 1; -} - -#delete-btn img { - opacity: 0.5; - -webkit-transition: box-shadow .35s, opacity ease-in-out .35s; - -moz-transition: box-shadow .35s, opacity ease-in-out .35s; - transition: box-shadow .35s, opacity ease-in-out .35s; -} - -#delete-btn:hover img.btn-img { - opacity: 1; -} - -#list-btn img { - opacity: 0.5; - -webkit-transition: box-shadow .35s, opacity ease-in-out .35s; - -moz-transition: box-shadow .35s, opacity ease-in-out .35s; - transition: box-shadow .35s, opacity ease-in-out .35s; -} - -#list-btn:hover img.btn-img { - opacity: 1; -} - .circle-float-btn:hover { box-shadow: 0px 4px 5px #CCCCCC; } @@ -702,6 +639,126 @@ textarea:focus, input:focus{ padding: 10px; } -#swal-svg-box { - overflow: scroll; +/********************** +VERSION HISTORY SIDEBAR +***********************/ +#branch-selector{ + display: block; + position: absolute; + top: 95px; + left: 120px; + text-align:center; + z-index: 2; + height: 40px; + background-color: white; + border: 1px solid #ccc +} + +#vh-sidebar { + display:none; + background: #e5e5e5; + position: absolute; + height: 100%; + + /*the left value is what hides the width */ + /*if these are changed, must change in knox.js as well*/ + left: -380px; + width: 400px; +} + +#vh-toggle-button { + position: absolute; + left: 20px; /*this is the offset of the vh-sidebar*/ + top: 95px; + display: none; /*hide the button until a design is selected*/ + width: 30px; + height: 40px; + background-color: transparent; + outline:none; + border: 2px solid #e5e5e5; + cursor:pointer; + z-index: 2; +} + +/********* + TOOLTIP +**********/ +.tooltip-templates { + display: none; +} + +/************ + SWEET ALERT +*************/ +.swal-button--confirm { + background-color: #F05F40; +} + +.swal-button--confirm:not([disabled]):hover{ + background-color: #d35234 +} + +.swal-button--confirm:active { + background-color: #b85435; +} + +.swal-content__input { + border-color: #bbbbbb; +} + +.swal-content__input:focus,.swal-content__textarea:focus{ + border-color:#999 +} + +.enumeration-swal .swal-content{ + height: 400px +} + +/************* + DESIGN SPACE +**************/ +#design-space { + height: 100%; +} + +#btn-holder { + text-align: center; + position: absolute; + width: 100%; + bottom: 0; + padding-bottom: 40px; } + +.circle-float-btn { + background-color: white; + width: 70px; + height: 70px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.33; + border-radius: 35px; + display: inline-block; + border: 1px solid #EEEEEE; + box-shadow: 0px 2px 5px #EEEEEE; + -webkit-transition: box-shadow ease-in-out .35s; + -moz-transition: box-shadow ease-in-out .35s; + transition: box-shadow ease-in-out .35s; + margin: 10px; + overflow: hidden; +} + +.btn-img { + margin-left: -5px; + margin-top: -1px; +} + +.circle-float-btn img { + opacity: 0.5; + -webkit-transition: box-shadow .35s, opacity ease-in-out .35s; + -moz-transition: box-shadow .35s, opacity ease-in-out .35s; + transition: box-shadow .35s, opacity ease-in-out .35s; +} + +.circle-float-btn:hover img.btn-img { + opacity: 1; +} \ No newline at end of file diff --git a/src/main/resources/static/gulpfile.js b/src/main/resources/static/gulpfile.js index ecd77f0..3c80de9 100755 --- a/src/main/resources/static/gulpfile.js +++ b/src/main/resources/static/gulpfile.js @@ -64,6 +64,14 @@ gulp.task('copy', function() { gulp.src(['node_modules/scrollreveal/dist/*.js']) .pipe(gulp.dest('vendor/scrollreveal')) + gulp.src(['node_modules/tooltipster/dist/css/plugins/tooltipster/sideTip/themes/*.css', + 'node_modules/tooltipster/dist/css/*.css', + 'node_modules/tooltipster/dist/js/*.js']) + .pipe(gulp.dest('vendor/tooltipster')) + + gulp.src(['node_modules/sweetalert/dist/*']) + .pipe(gulp.dest('vendor/sweet')) + gulp.src([ 'node_modules/font-awesome/**', '!node_modules/font-awesome/**/*.map', diff --git a/src/main/resources/static/img/save.png b/src/main/resources/static/img/save.png new file mode 100644 index 0000000..954310a Binary files /dev/null and b/src/main/resources/static/img/save.png differ diff --git a/src/main/resources/static/img/search.jpg b/src/main/resources/static/img/search.jpg new file mode 100644 index 0000000..e390ec6 Binary files /dev/null and b/src/main/resources/static/img/search.jpg differ diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html index af72851..3d778ab 100755 --- a/src/main/resources/static/index.html +++ b/src/main/resources/static/index.html @@ -1,123 +1,147 @@ -
- - - - - -Knox is a platform for storing, tracking, and synthesizing - combinatorial genetic designs. -
- Explore -