From d0d161e8ab7fee52c5de31ac26b68210dd3f2361 Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Wed, 9 Apr 2014 00:13:38 -0300 Subject: [PATCH 01/18] fix padding and label in two lines --- wise-webapp/src/main/webapp/css/mindmapList.less | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wise-webapp/src/main/webapp/css/mindmapList.less b/wise-webapp/src/main/webapp/css/mindmapList.less index 51678c8b..be5b8118 100644 --- a/wise-webapp/src/main/webapp/css/mindmapList.less +++ b/wise-webapp/src/main/webapp/css/mindmapList.less @@ -352,8 +352,13 @@ abbr[title] { padding:0px; margin:0px; } + #footerContainer > li.active { padding:0px; margin:0px; } +#foldersContainer > ul > li > a { + padding: 8px 15px; + white-space: nowrap; +} From bddf867b63f168e81a1ec49bbfde14b0d78c689d Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Sat, 12 Apr 2014 19:03:31 -0300 Subject: [PATCH 02/18] icon message --- wise-webapp/src/main/resources/messages_en.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/wise-webapp/src/main/resources/messages_en.properties b/wise-webapp/src/main/resources/messages_en.properties index 91d96563..5f667902 100644 --- a/wise-webapp/src/main/resources/messages_en.properties +++ b/wise-webapp/src/main/resources/messages_en.properties @@ -145,6 +145,7 @@ NEW=New MIND_FILE=File PARENT_LABEL=Nest label under COLOR=Color +ICON=Icon CHOOSE_LABEL=Choose a label SELECT_LABEL=Please select a label NO_SEARCH_RESULT=No mindmap available for the selected filter criteria From d66666010da39f30cc67ce1dc58071d7ec776964 Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Sat, 12 Apr 2014 19:04:19 -0300 Subject: [PATCH 03/18] icon dropdown creation dialog --- .../src/main/webapp/css/mindmapList.less | 26 +++ .../src/main/webapp/jsp/mindmapList.jsp | 173 ++++++++++++++++++ 2 files changed, 199 insertions(+) diff --git a/wise-webapp/src/main/webapp/css/mindmapList.less b/wise-webapp/src/main/webapp/css/mindmapList.less index be5b8118..6199b5ca 100644 --- a/wise-webapp/src/main/webapp/css/mindmapList.less +++ b/wise-webapp/src/main/webapp/css/mindmapList.less @@ -362,3 +362,29 @@ abbr[title] { padding: 8px 15px; white-space: nowrap; } + +#iconGroup > div > button { + background: #eee; + border: 1px solid #ccc !important; +} + +.bs-glyphicons { + width: 800%; +} + +.bs-glyphicons > ul { + padding-left: 10px; + overflow-x: hidden; +} + +.bs-glyphicons > ul > li { + float: left; + width: 12%; + height: 25%; + padding: 10px; + font-size: 10px; + line-height: 1.4; + text-align: center; + border: 1px solid #fff; + background-color: #f9f9f9; +} diff --git a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp index 2f5566cb..dd556d75 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp @@ -346,6 +346,179 @@ +
+ +
+ + + +
+
From 5d182832856498776246b0f669d3a0362f8484fe Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Sat, 12 Apr 2014 19:04:28 -0300 Subject: [PATCH 04/18] icon ui selection --- wise-webapp/src/main/webapp/js/mindmapList.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wise-webapp/src/main/webapp/js/mindmapList.js b/wise-webapp/src/main/webapp/js/mindmapList.js index 4404e1d7..2147a0f0 100644 --- a/wise-webapp/src/main/webapp/js/mindmapList.js +++ b/wise-webapp/src/main/webapp/js/mindmapList.js @@ -531,7 +531,15 @@ $(function () { $("#foldersContainer ul").css('overflow-x', 'hidden'); $("#foldersContainer ul").height(maxHeight); - }) + }); + + $(".bs-glyphicons-list li").on("click", function(){ + var defaultIcon = $("#defaultIcon"); + //remove current icon + defaultIcon.find("i").remove(); + var myClass = $(this).attr("class"); + defaultIcon.prepend(""); + }); }); /*--------------------------------------------- Label actions --------------------------------------------------**/ From 9e992a8f611358c55809738d94b31c38e2d91a7a Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Mon, 14 Apr 2014 18:09:34 -0300 Subject: [PATCH 05/18] add label icons back-end (model and database) --- config/database/hsql/apopulate-schemas.sql | 6 +++--- config/database/hsql/create-schemas.sql | 3 ++- config/database/mysql/apopulate-schemas.sql | 6 +++--- config/database/mysql/create-schemas.sql | 1 + .../src/main/java/com/wisemapping/model/Label.java | 11 +++++++++++ .../java/com/wisemapping/rest/model/RestLabel.java | 8 ++++++++ .../resources/com/wisemapping/model/Label.hbm.xml | 1 + 7 files changed, 29 insertions(+), 7 deletions(-) diff --git a/config/database/hsql/apopulate-schemas.sql b/config/database/hsql/apopulate-schemas.sql index d1cd5912..092acc82 100644 --- a/config/database/hsql/apopulate-schemas.sql +++ b/config/database/hsql/apopulate-schemas.sql @@ -30,7 +30,7 @@ INSERT INTO COLLABORATION (id, colaborator_id, properties_id, mindmap_id, role_i INSERT INTO COLLABORATION_PROPERTIES (id, starred, mindmap_properties) VALUES (2, 1, '{zoom:0.8}'); INSERT INTO COLLABORATION (id, colaborator_id, properties_id, mindmap_id, role_id) VALUES (2, 2, 2, 1, 1); -INSERT INTO LABEL (id, title, creator_id, parent_label_id, color) VALUES (1, 'test label', 1, NULL, '#ff0000'); +INSERT INTO LABEL (id, title, creator_id, parent_label_id, color, icon) VALUES (1, 'test label', 1, NULL, '#ff0000', 'glyphicon glyphicon-tag'); INSERT INTO R_LABEL_MINDMAP (label_id, mindmap_id) VALUES (1,1); INSERT INTO MINDMAP (id, title, xml, description, public, creation_date, edition_date, creator_id, tags, last_editor_id) @@ -38,9 +38,9 @@ INSERT INTO MINDMAP (id, title, xml, description, public, creation_date, edition INSERT INTO COLLABORATION_PROPERTIES (id, starred, mindmap_properties) VALUES (3, 1, '{zoom:0.8}'); INSERT INTO COLLABORATION (id, colaborator_id, properties_id, mindmap_id, role_id) VALUES (3, 2, 3, 2, 0); -INSERT INTO LABEL (id, title, creator_id, parent_label_id, color) VALUES (2, 'admin label', 2, NULL, '#0000ff'); +INSERT INTO LABEL (id, title, creator_id, parent_label_id, color, icon) VALUES (2, 'admin label', 2, NULL, '#0000ff', 'glyphicon glyphicon-star'); INSERT INTO R_LABEL_MINDMAP (label_id, mindmap_id) VALUES (2,2); -INSERT INTO LABEL (id, title, creator_id, parent_label_id, color) VALUES (3, 'mindmap shared', 2, NULL, '#00ff00'); +INSERT INTO LABEL (id, title, creator_id, parent_label_id, color, icon) VALUES (3, 'mindmap shared', 2, NULL, '#00ff00', 'glyphicon glyphicon-share'); INSERT INTO R_LABEL_MINDMAP (label_id, mindmap_id) VALUES (3,1); COMMIT; diff --git a/config/database/hsql/create-schemas.sql b/config/database/hsql/create-schemas.sql index ca5ec213..92322877 100644 --- a/config/database/hsql/create-schemas.sql +++ b/config/database/hsql/create-schemas.sql @@ -37,7 +37,8 @@ CREATE TABLE LABEL ( title VARCHAR(30), creator_id INTEGER NOT NULL, parent_label_id INTEGER, - color VARCHAR(7) NOT NULL + color VARCHAR(7) NOT NULL, + icon VARCHAR(255) NOT NULL --FOREIGN KEY (creator_id) REFERENCES USER (colaborator_id) ); diff --git a/config/database/mysql/apopulate-schemas.sql b/config/database/mysql/apopulate-schemas.sql index aee90b96..076cf61d 100644 --- a/config/database/mysql/apopulate-schemas.sql +++ b/config/database/mysql/apopulate-schemas.sql @@ -34,7 +34,7 @@ INSERT INTO COLLABORATION (id, colaborator_id, properties_id, mindmap_id, role_i INSERT INTO COLLABORATION_PROPERTIES (id, starred, mindmap_properties) VALUES (2, 1, '{zoom:0.8}'); INSERT INTO COLLABORATION (id, colaborator_id, properties_id, mindmap_id, role_id) VALUES (2, 2, 2, 1, 1); -INSERT INTO LABEL (id, title, creator_id, parent_label_id, color) VALUES (1, 'test label', 1, NULL, '#ff0000'); +INSERT INTO LABEL (id, title, creator_id, parent_label_id, color, icon) VALUES (1, 'test label', 1, NULL, '#ff0000', 'glyphicon glyphicon-tag'); INSERT INTO R_LABEL_MINDMAP (label_id, mindmap_id) VALUES (1,1); INSERT INTO MINDMAP (id, title, xml, description, public, creation_date, edition_date, creator_id, tags, last_editor_id) @@ -42,9 +42,9 @@ INSERT INTO MINDMAP (id, title, xml, description, public, creation_date, edition INSERT INTO COLLABORATION_PROPERTIES (id, starred, mindmap_properties) VALUES (3, 1, '{zoom:0.8}'); INSERT INTO COLLABORATION (id, colaborator_id, properties_id, mindmap_id, role_id) VALUES (3, 2, 3, 2, 0); -INSERT INTO LABEL (id, title, creator_id, parent_label_id, color) VALUES (2, 'admin label', 2, NULL, '#0000ff'); +INSERT INTO LABEL (id, title, creator_id, parent_label_id, color, icon) VALUES (2, 'admin label', 2, NULL, '#0000ff', 'glyphicon glyphicon-star'); INSERT INTO R_LABEL_MINDMAP (label_id, mindmap_id) VALUES (2,2); -INSERT INTO LABEL (id, title, creator_id, parent_label_id, color) VALUES (3, 'mindmap shared', 2, NULL, '#00ff00'); +INSERT INTO LABEL (id, title, creator_id, parent_label_id, color, icon) VALUES (3, 'mindmap shared', 2, NULL, '#00ff00', 'glyphicon glyphicon-share'); INSERT INTO R_LABEL_MINDMAP (label_id, mindmap_id) VALUES (3,1); COMMIT; diff --git a/config/database/mysql/create-schemas.sql b/config/database/mysql/create-schemas.sql index bf12dbf1..8aaaf0db 100644 --- a/config/database/mysql/create-schemas.sql +++ b/config/database/mysql/create-schemas.sql @@ -58,6 +58,7 @@ CREATE TABLE LABEL ( creator_id INTEGER NOT NULL, parent_label_id INTEGER, color VARCHAR(7) NOT NULL, + icon VARCHAR(255) NOT NULL, FOREIGN KEY (creator_id) REFERENCES USER (colaborator_id), FOREIGN KEY (parent_label_id) REFERENCES LABEL (id) ON DELETE CASCADE diff --git a/wise-webapp/src/main/java/com/wisemapping/model/Label.java b/wise-webapp/src/main/java/com/wisemapping/model/Label.java index ca8dad6b..654bbaf9 100644 --- a/wise-webapp/src/main/java/com/wisemapping/model/Label.java +++ b/wise-webapp/src/main/java/com/wisemapping/model/Label.java @@ -12,6 +12,7 @@ public class Label { @NotNull private User creator; @Nullable private Label parent; @NotNull private String color; + @NotNull private String icon; public void setParent(@Nullable Label parent) { this.parent = parent; @@ -57,6 +58,15 @@ public class Label { this.color = color; } + @NotNull + public String getIcon() { + return icon; + } + + public void setIcon(@NotNull String icon) { + this.icon = icon; + } + @Override public boolean equals(Object o) { if (this == o) return true; @@ -76,4 +86,5 @@ public class Label { result = 31 * result + (parent != null ? parent.hashCode() : 0); return result; } + } diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLabel.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLabel.java index 65bc29bb..14ad2abc 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLabel.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLabel.java @@ -65,10 +65,18 @@ public class RestLabel { label.setColor(color); } + public void setIcon(@NotNull final String icon) { + label.setIcon(icon); + } + @Nullable public String getColor() { return label.getColor(); } + @Nullable public String getIcon() { + return label.getIcon(); + } + @JsonIgnore public Label getDelegated() { return label; diff --git a/wise-webapp/src/main/resources/com/wisemapping/model/Label.hbm.xml b/wise-webapp/src/main/resources/com/wisemapping/model/Label.hbm.xml index 11602ec6..b0589623 100644 --- a/wise-webapp/src/main/resources/com/wisemapping/model/Label.hbm.xml +++ b/wise-webapp/src/main/resources/com/wisemapping/model/Label.hbm.xml @@ -11,6 +11,7 @@ + From 183ab33729464f7561408cd8cf91ca777bf35816 Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Mon, 14 Apr 2014 18:10:16 -0300 Subject: [PATCH 06/18] add styles --- wise-webapp/src/main/webapp/css/mindmapList.less | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/wise-webapp/src/main/webapp/css/mindmapList.less b/wise-webapp/src/main/webapp/css/mindmapList.less index 6199b5ca..ff737479 100644 --- a/wise-webapp/src/main/webapp/css/mindmapList.less +++ b/wise-webapp/src/main/webapp/css/mindmapList.less @@ -363,11 +363,15 @@ abbr[title] { white-space: nowrap; } -#iconGroup > div > button { +#defaultIcon { background: #eee; border: 1px solid #ccc !important; } +#defaultIcon:hover { + background-color: #C8C8C8; +} + .bs-glyphicons { width: 800%; } @@ -387,4 +391,9 @@ abbr[title] { text-align: center; border: 1px solid #fff; background-color: #f9f9f9; + cursor: pointer; } + +.bs-glyphicons > ul > li:hover { + background-color: #C8C8C8; +} \ No newline at end of file From 86ba19c120efdd4712eefe4140543e786d409b65 Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Mon, 14 Apr 2014 18:14:32 -0300 Subject: [PATCH 07/18] sending icon data to api rest --- wise-webapp/src/main/webapp/js/mindmapList.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/wise-webapp/src/main/webapp/js/mindmapList.js b/wise-webapp/src/main/webapp/js/mindmapList.js index 2147a0f0..8cb84100 100644 --- a/wise-webapp/src/main/webapp/js/mindmapList.js +++ b/wise-webapp/src/main/webapp/js/mindmapList.js @@ -91,6 +91,12 @@ jQuery.fn.dialogForm = function (options) { formData[elem.name] = elem.value; }); + // FIX: How should I do this? + var icon = $("#defaultIcon"); + if (icon) { + formData["icon"] = icon.find('i').attr('class'); + } + // Success actions ... var onSuccess = function (jqXHR, textStatus, data) { var resourceId = jqXHR ? jqXHR.getResponseHeader("ResourceId") : undefined; @@ -301,7 +307,7 @@ $(function () { postUpdate: function(data, id) { createLabelItem(data, id); if (mapIds.length > 0) { - linkLabelToMindmap(mapIds, {id: id, title: data.title, color: data.color}); + linkLabelToMindmap(mapIds, {id: id, title: data.title, color: data.color, icon: data.icon}); } } }); @@ -548,7 +554,7 @@ function createLabelItem(data, id) { var labelItem = $("
  • "); labelItem.append( " " + - "" + + "" + "
    " + "
    " + data.title + "
    " + "" + From c6ae7be2558cb9f9b6f2466b27e95bf4bdb7c13d Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Mon, 14 Apr 2014 18:14:56 -0300 Subject: [PATCH 08/18] import label list from another jsp prototype --- .../src/main/webapp/jsp/labelIconList.jsp | 163 +++++++++ .../src/main/webapp/jsp/mindmapList.jsp | 334 +++++++++--------- 2 files changed, 333 insertions(+), 164 deletions(-) create mode 100644 wise-webapp/src/main/webapp/jsp/labelIconList.jsp diff --git a/wise-webapp/src/main/webapp/jsp/labelIconList.jsp b/wise-webapp/src/main/webapp/jsp/labelIconList.jsp new file mode 100644 index 00000000..f909a0fe --- /dev/null +++ b/wise-webapp/src/main/webapp/jsp/labelIconList.jsp @@ -0,0 +1,163 @@ +<%@page pageEncoding="UTF-8" %> +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • + +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • + +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • + +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • + +
    • +
    • +
    • +
    • +
    • +
    \ No newline at end of file diff --git a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp index dd556d75..e8c848f1 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp @@ -122,6 +122,12 @@ }); }); + + @@ -342,179 +348,179 @@
    - +
    - - +
    +
    From edb91b92bdfaaa6f23c820fdd912ab9fb7caa75f Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Wed, 16 Apr 2014 00:25:32 -0300 Subject: [PATCH 09/18] fix tests --- .../wisemapping/validator/LabelValidator.java | 1 + .../test/rest/RestLabelITCase.java | 25 ++++++++++++++----- .../test/rest/RestMindmapITCase.java | 3 ++- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/validator/LabelValidator.java b/wise-webapp/src/main/java/com/wisemapping/validator/LabelValidator.java index f7f0083f..2dbc2f9a 100644 --- a/wise-webapp/src/main/java/com/wisemapping/validator/LabelValidator.java +++ b/wise-webapp/src/main/java/com/wisemapping/validator/LabelValidator.java @@ -37,6 +37,7 @@ public class LabelValidator implements Validator { private void validateLabel(@NotNull final Label label, @NotNull final Errors errors) { ValidationUtils.rejectIfEmptyOrWhitespace(errors, "title", Messages.FIELD_REQUIRED); ValidationUtils.rejectIfEmptyOrWhitespace(errors, "color", Messages.FIELD_REQUIRED); + ValidationUtils.rejectIfEmptyOrWhitespace(errors, "icon", Messages.FIELD_REQUIRED); final String title = label.getTitle(); ValidatorUtils.rejectIfExceeded( errors, diff --git a/wise-webapp/src/test/java/com/wisemapping/test/rest/RestLabelITCase.java b/wise-webapp/src/test/java/com/wisemapping/test/rest/RestLabelITCase.java index 00d7ffcc..0a35304f 100644 --- a/wise-webapp/src/test/java/com/wisemapping/test/rest/RestLabelITCase.java +++ b/wise-webapp/src/test/java/com/wisemapping/test/rest/RestLabelITCase.java @@ -30,6 +30,7 @@ public class RestLabelITCase { private String userEmail; private static final String COLOR = "#000000"; + private static final String ICON = "glyphicon glyphicon-tag"; @BeforeClass void createUser() { @@ -45,11 +46,11 @@ public class RestLabelITCase { // Create a new label final String title1 = "Label 1 - " + mediaType.toString(); - addNewLabel(requestHeaders, template, title1, COLOR); + addNewLabel(requestHeaders, template, title1, COLOR, ICON); // Create a new label final String title2 = "Label 2 - " + mediaType.toString(); - addNewLabel(requestHeaders, template, title2, COLOR); + addNewLabel(requestHeaders, template, title2, COLOR, ICON); // Check that the label has been created ... final RestLabelList restLabelList = getLabels(requestHeaders, template); @@ -83,7 +84,7 @@ public class RestLabelITCase { final RestTemplate template = RestHelper.createTemplate( userEmail + ":" + "admin"); try { - addNewLabel(requestHeaders, template, null, COLOR); + addNewLabel(requestHeaders, template, null, COLOR, ICON); fail("Wrong response"); } catch (HttpClientErrorException e) { final String responseBodyAsString = e.getResponseBodyAsString(); @@ -91,12 +92,21 @@ public class RestLabelITCase { } try { - addNewLabel(requestHeaders, template, "title12345", null); + addNewLabel(requestHeaders, template, "title12345", null, ICON); fail("Wrong response"); } catch (HttpClientErrorException e) { final String responseBodyAsString = e.getResponseBodyAsString(); assert (responseBodyAsString.contains("Required field cannot be left blank")); } + + try { + addNewLabel(requestHeaders, template, "title12345", COLOR, null); + fail("Wrong response"); + } catch (HttpClientErrorException e) { + final String responseBodyAsString = e.getResponseBodyAsString(); + assert (responseBodyAsString.contains("Required field cannot be left blank")); + } + } @Test(dataProviderClass = RestHelper.class, dataProvider="ContentType-Provider-Function") @@ -105,7 +115,7 @@ public class RestLabelITCase { final RestTemplate template = RestHelper.createTemplate( userEmail + ":" + "admin"); final String title = "title to delete"; - final URI resourceUri = addNewLabel(requestHeaders, template, title, COLOR); + final URI resourceUri = addNewLabel(requestHeaders, template, title, COLOR, ICON); // Now remove it ... template.delete(RestHelper.HOST_PORT + resourceUri.toString()); @@ -119,7 +129,7 @@ public class RestLabelITCase { } - static URI addNewLabel(@NotNull HttpHeaders requestHeaders, @NotNull RestTemplate template, @Nullable String title, @Nullable String color ) throws IOException, WiseMappingException { + static URI addNewLabel(@NotNull HttpHeaders requestHeaders, @NotNull RestTemplate template, @Nullable String title, @Nullable String color, @Nullable String icon) throws IOException, WiseMappingException { final RestLabel restLabel = new RestLabel(); if (title != null) { restLabel.setTitle(title); @@ -127,6 +137,9 @@ public class RestLabelITCase { if (color != null) { restLabel.setColor(color); } + if (icon != null) { + restLabel.setIcon(icon); + } // Create a new label ... HttpEntity createUserEntity = new HttpEntity(restLabel, requestHeaders); diff --git a/wise-webapp/src/test/java/com/wisemapping/test/rest/RestMindmapITCase.java b/wise-webapp/src/test/java/com/wisemapping/test/rest/RestMindmapITCase.java index b083feb2..7316dfff 100644 --- a/wise-webapp/src/test/java/com/wisemapping/test/rest/RestMindmapITCase.java +++ b/wise-webapp/src/test/java/com/wisemapping/test/rest/RestMindmapITCase.java @@ -40,6 +40,7 @@ import static org.testng.Assert.fail; public class RestMindmapITCase { private String userEmail = "admin@wisemapping.com"; + private static final String ICON = "glyphicon glyphicon-tag"; @BeforeClass void createUser() { @@ -251,7 +252,7 @@ public class RestMindmapITCase { // Create a new label final String titleLabel = "Label 1 - " + mediaType.toString(); - final URI labelUri = RestLabelITCase.addNewLabel(requestHeaders, template, titleLabel, COLOR); + final URI labelUri = RestLabelITCase.addNewLabel(requestHeaders, template, titleLabel, COLOR, ICON); // Create a sample map ... final String mapTitle = "Maps 1 - " + mediaType.toString(); From 4b01f7c8ee1662e2dfdaa2ad9360b7530cf39788 Mon Sep 17 00:00:00 2001 From: Ezequiel Bergamaschi Date: Wed, 16 Apr 2014 01:47:40 -0300 Subject: [PATCH 10/18] removing fixme from dialogForm function --- wise-webapp/src/main/webapp/js/mindmapList.js | 10 +++------- wise-webapp/src/main/webapp/jsp/mindmapList.jsp | 3 ++- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/wise-webapp/src/main/webapp/js/mindmapList.js b/wise-webapp/src/main/webapp/js/mindmapList.js index 8cb84100..70867cb9 100644 --- a/wise-webapp/src/main/webapp/js/mindmapList.js +++ b/wise-webapp/src/main/webapp/js/mindmapList.js @@ -78,7 +78,8 @@ jQuery.fn.dialogForm = function (options) { // Clear form values ... if (options.clearForm == undefined || options.clearForm) { - $("#" + containerId).find('input[name!="color"]').val(''); + //FIXME: icon and color should be handled as exceptions.. + $("#" + containerId).find('input[name!="color"]input[name!="icon"]').val(''); } // Clear button "Saving..." state ... @@ -91,12 +92,6 @@ jQuery.fn.dialogForm = function (options) { formData[elem.name] = elem.value; }); - // FIX: How should I do this? - var icon = $("#defaultIcon"); - if (icon) { - formData["icon"] = icon.find('i').attr('class'); - } - // Success actions ... var onSuccess = function (jqXHR, textStatus, data) { var resourceId = jqXHR ? jqXHR.getResponseHeader("ResourceId") : undefined; @@ -545,6 +540,7 @@ $(function () { defaultIcon.find("i").remove(); var myClass = $(this).attr("class"); defaultIcon.prepend(""); + defaultIcon.closest("#iconGroup").find('input').val(myClass); }); }); diff --git a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp index e8c848f1..39df6061 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp @@ -353,7 +353,8 @@
    - + +
  • ').attr('value', value.id).attr('color', value.color) + $('
  • ').attr('value', value.id).attr('color', value.color).attr('icon', value.icon) .append( '
    ' + + "
    " + "
    " + "
    " + value.title + "
    " + '
    ') diff --git a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp index 39df6061..ca4b429a 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp @@ -360,7 +360,7 @@ - From 27304ea3853dd2cde2ea8322c976f26be511152f Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Wed, 16 Apr 2014 03:00:00 -0300 Subject: [PATCH 15/18] label icon list reduced --- .../src/main/webapp/jsp/labelIconList.jsp | 33 +------------------ 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/wise-webapp/src/main/webapp/jsp/labelIconList.jsp b/wise-webapp/src/main/webapp/jsp/labelIconList.jsp index f909a0fe..83a3f789 100644 --- a/wise-webapp/src/main/webapp/jsp/labelIconList.jsp +++ b/wise-webapp/src/main/webapp/jsp/labelIconList.jsp @@ -1,4 +1,5 @@ <%@page pageEncoding="UTF-8" %> +
    • @@ -17,30 +18,22 @@
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • @@ -49,14 +42,7 @@
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • @@ -65,7 +51,6 @@
    • -
    • @@ -83,8 +68,6 @@
    • -
    • -
    • @@ -99,12 +82,9 @@
    • -
    • -
    • -
    • @@ -124,8 +104,6 @@
    • -
    • -
    • @@ -133,15 +111,8 @@
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • @@ -158,6 +129,4 @@
    • -
    • -
    \ No newline at end of file From 85c7e3ce5c95177c13ff6d58f52c6489d8fca6af Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Wed, 16 Apr 2014 10:29:36 -0300 Subject: [PATCH 16/18] fixing tests broken because refactor of label attribute icon --- .../src/main/java/com/wisemapping/validator/LabelValidator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/validator/LabelValidator.java b/wise-webapp/src/main/java/com/wisemapping/validator/LabelValidator.java index 2dbc2f9a..bd5e2035 100644 --- a/wise-webapp/src/main/java/com/wisemapping/validator/LabelValidator.java +++ b/wise-webapp/src/main/java/com/wisemapping/validator/LabelValidator.java @@ -37,7 +37,7 @@ public class LabelValidator implements Validator { private void validateLabel(@NotNull final Label label, @NotNull final Errors errors) { ValidationUtils.rejectIfEmptyOrWhitespace(errors, "title", Messages.FIELD_REQUIRED); ValidationUtils.rejectIfEmptyOrWhitespace(errors, "color", Messages.FIELD_REQUIRED); - ValidationUtils.rejectIfEmptyOrWhitespace(errors, "icon", Messages.FIELD_REQUIRED); + ValidationUtils.rejectIfEmptyOrWhitespace(errors, "iconName", Messages.FIELD_REQUIRED); final String title = label.getTitle(); ValidatorUtils.rejectIfExceeded( errors, From bfe24b7dfb955d582e551b2ef3635bc5c1c676ad Mon Sep 17 00:00:00 2001 From: Ezequiel Bergamaschi Date: Thu, 17 Apr 2014 01:29:44 -0300 Subject: [PATCH 17/18] popovers for icons in label icon chooser --- .../src/main/resources/messages_en.properties | 126 ++++++++++++++++++ wise-webapp/src/main/webapp/js/mindmapList.js | 14 +- 2 files changed, 139 insertions(+), 1 deletion(-) diff --git a/wise-webapp/src/main/resources/messages_en.properties b/wise-webapp/src/main/resources/messages_en.properties index 5f667902..0ce64939 100644 --- a/wise-webapp/src/main/resources/messages_en.properties +++ b/wise-webapp/src/main/resources/messages_en.properties @@ -282,6 +282,132 @@ OPEN_OFFICE_EXPORT_FORMAT_DETAILS=Get your map as OpenOffice Write Document MINDJET_EXPORT_FORMAT=(BETA) MindJet 8.x MINDJET_EXPORT_FORMAT_DETAILS=Export your maps in MindJet 8.x format MINDMAP_IS_LOCKED=Mindmap is locked for edition. +# icons.. +ASTERISK=Asterisk +PLUS=Plus +EURO=Euro +MINUS=Minus +CLOUD=Cloud +ENVELOPE=Envelope +PENCIL=Pencil +CLASS=Glass +MUSIC=Music +HEART=Heart +STAR=Star +STAR-EMPTY=Empty Star +USER=User +FILM=Film +OK=Ok +REMOVE=Remove +SIGNAL=Signal +COG=Cog +TRASH=Trash +FILE=File +TIME=Time +DOWNLOAD-ALT=Download +DOWNLOAD=Download +UPLOAD=Upload +INBOX=Inbox +REPEAT=Repeat +REFRESH=Refresh +LIST-ALT=List +LOCK=Lock +FLAG=Flag +HEADPHONES=Headphones +GRCODE=GR Code +BARCODE=Barcode +TAG=Tag +TAGS=Tags +BOOK=Book +BOOKMARK=Bookmark +PRING=Print +CAMERA=Camera +LIST=List +FACETIME-VIDEO=Facetime Video +PICTURE=Picture +MAP-MARKER=Map Maker +ADJUST=Adjust +TINT=Tint +EDIT=Edit +CHECK=Check +CHEVRON-LEFT=Chevron Left +CHEVRON-RIGHT=Chevron Right +PLUS-SIGN=Plus Sign +MINUS-SIGN=Minus Sign +REMOVE-SIGN=Remove Sign +OK-SIGN=Ok Sign +QUESTION-SIGN=Question Sign +INFO-SIGN=Info Sign +SCREENSHOT=Screenshot +REMOVE-CIRCLE=Remove Circle +OK-CIRCLE=Ok Circle +BAN-CIRCLE=Ban Circle +ARROW-LEFT=Arrow Left +ARROW-RIGHT=Arrow Right +ARROW-UP=Arrow Up +ARROW-DOWN=Arrow Down +SHARE-ALT=Share +EXCLAMATION-SIGN=Exclamation +GIFT=Gift +LEAF=Leaf +FIRE=Fire +EYE-OPEN=Open eye +EYE-CLOSE=Closed eye +WARNING-SIGN=Warning +PLANE=Plane +CALENDAR=Calendar +RANDOM=Random +COMMENT=Comment +MAGNET=Magnet +CHEVRON-UP=Chevrop Up +CHEVRON-DOWN=Chevron Down +SHOPPING-CART=Shopping +FOLDER-CLOSE=Closed Folder +FOLDER-OPEN=Open Folder +HDD=HDD +BULLHORN=Bullhorn +BELL=Bell +CERTIFICATE=Certificate +THUMBS-UP=Thumbs up +THUMBS-DOWN=Thumbs down +HAND-RIGHT=Hand right +HAND-LEFT=Hand left +HAND-UP=Hang up +HAND-DOWN=Hang down +CIRCLE-ARROW-RIGHT=Circle right +CIRCLE-ARROW-LEFT=Circle left +CIRCLE-ARROW-UP=Circle up +CIRCLE-ARROW-DOWN=Circle down +GLOBE=Globe +WRENCH=Wrench +TASKS=Tasks +FILTER=Filter +BRIEFCASE=Briefcase +PAPERCLIP=Paperclip +HEART-EMPTY=Empty Heart +LINK=Link +PHONE=Phone +PUSHPIN=Pushpin +USD=USD +GBP=GBP +UNCHECKED=Unchecked +FLASH=Flash +RECORD=Record +SAVED=Saved +SEND=Send +FLOPPY-DISK=Floppy Disk +TRANSFER +CUTLERY=Cutlery +HEADER=Header +COMPRESSED=Compressed +EARPHONE=Earphone +PHONE-ALT=Phone +TOWER=Tower +STATS=Stats +COPYRIGTH-MARK=Copyright +REGISTRATION-MARK=Registration Mark +CLOUD-DOWNLOAD=Cloud Download +CLOUD-UPLOAD=Cloud Updload diff --git a/wise-webapp/src/main/webapp/js/mindmapList.js b/wise-webapp/src/main/webapp/js/mindmapList.js index 5f4dd119..67addd10 100644 --- a/wise-webapp/src/main/webapp/js/mindmapList.js +++ b/wise-webapp/src/main/webapp/js/mindmapList.js @@ -539,7 +539,19 @@ $(function () { }); - $(".bs-glyphicons-list li").on("click", function(){ + //init popovers... + var icons = $(".bs-glyphicons-list li"); + icons.each(function() { + $(this).popover({ + animation: true, + placement: "auto", + trigger: 'hover', + //FIXME: Which is the best way to use messages.properties here? + content: ($(this).attr('class').replace('glyphicon glyphicon-','')) + }) + }); + + icons.on("click", function(){ var defaultIcon = $("#defaultIcon"); //remove current icon defaultIcon.find("i").remove(); From 754d4b3dcf7ffb6ef2b5a70465786c49d911d96b Mon Sep 17 00:00:00 2001 From: Ezequiel Bergamaschi Date: Sat, 19 Apr 2014 14:18:35 -0300 Subject: [PATCH 18/18] fixing wrong reference variable --- wise-webapp/src/main/webapp/js/mindmapList.js | 8 +++----- wise-webapp/src/main/webapp/jsp/mindmapList.jsp | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/wise-webapp/src/main/webapp/js/mindmapList.js b/wise-webapp/src/main/webapp/js/mindmapList.js index 67addd10..fc2fa0f3 100644 --- a/wise-webapp/src/main/webapp/js/mindmapList.js +++ b/wise-webapp/src/main/webapp/js/mindmapList.js @@ -66,7 +66,6 @@ jQuery.fn.dataTableExt.removeSelectedRows = function () { updateStatusToolbar(); }; - jQuery.fn.dialogForm = function (options) { var containerId = this[0].id; @@ -79,7 +78,7 @@ jQuery.fn.dialogForm = function (options) { // Clear form values ... if (options.clearForm == undefined || options.clearForm) { //FIXME: icon and color should be handled as exceptions.. - $("#" + containerId).find('input[name!="color"]input[name!="icon"]').val(''); + $("#" + containerId).find('input[name!="color"]input[name!="iconName"]').val(''); } // Clear button "Saving..." state ... @@ -178,7 +177,6 @@ jQuery.fn.dialogForm = function (options) { }; - // Update toolbar events ... function updateStatusToolbar() { @@ -567,7 +565,7 @@ function createLabelItem(data, id) { var labelItem = $("
  • "); labelItem.append( " " + - "" + + "" + "
    " + "
    " + data.title + "
    " + "" + @@ -641,7 +639,7 @@ function prepareLabelList(labels) { $('
  • ').attr('value', value.id).attr('color', value.color).attr('icon', value.icon) .append( '' + - "
    " + + "
    " + "
    " + "
    " + value.title + "
    " + '
    ') diff --git a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp index adc2e25f..6ae0df9d 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp @@ -354,7 +354,7 @@
    - +