From 29267b125264d7cb3ac6944ae75574c13bd462c9 Mon Sep 17 00:00:00 2001 From: Anthony Truskinger Date: Fri, 10 Feb 2017 18:39:48 +1000 Subject: [PATCH 01/10] feat(navigation): Added custom icon for annotations To match up with style guide: https://github.com/QutBioacoustics/baw-server/wiki/Design-guidelines --- src/sass/_font_awesome_customization.scss | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/sass/_font_awesome_customization.scss diff --git a/src/sass/_font_awesome_customization.scss b/src/sass/_font_awesome_customization.scss new file mode 100644 index 00000000..c66c6d8e --- /dev/null +++ b/src/sass/_font_awesome_customization.scss @@ -0,0 +1,15 @@ +.fa-baw-annotation { + &:before { + content: $fa-var-square-o; + position: relative; + margin-left: 0.1em; + } + + &:after { + content: $fa-var-th-large + "\00a0" !important; + font-size: (2/3) * 100%; + position: relative; + top: -2px; + left: calc(-1em - (1/3 * 1px)); + } +} \ No newline at end of file From 7a678bf2b3802e73d4af52353b931c53bb5064c3 Mon Sep 17 00:00:00 2001 From: Anthony Truskinger Date: Fri, 10 Feb 2017 18:44:57 +1000 Subject: [PATCH 02/10] fix(API): Fix various premature string conversions API data objects were being prematurely converted to a string and were bypassing the casing renamer http transformer. Fixes #280 Original bug introduced in https://github.com/QutBioacoustics/baw-client/commit/cd00962515ba14ca3cd4b47a1696de15186f858f --- src/app/listen/listen.js | 2 +- src/components/services/audioEvent.js | 6 +++--- src/components/services/queryBuilder.js | 12 ++++++------ src/components/services/tag.js | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/app/listen/listen.js b/src/app/listen/listen.js index 3ea9a872..68b264d5 100644 --- a/src/app/listen/listen.js +++ b/src/app/listen/listen.js @@ -614,7 +614,7 @@ angular function success(value, headers) { // possible race condition: may no longer may be selected after async - $scope.model.selectedAudioEvent.taggings[index] = new baw.Tagging(value); + $scope.model.selectedAudioEvent.taggings[index] = new baw.Tagging(value.data); $scope.model.selectedAudioEvent.tags[index] = addedTag.tag; console.assert( diff --git a/src/components/services/audioEvent.js b/src/components/services/audioEvent.js index af2e2098..eac8dc8d 100644 --- a/src/components/services/audioEvent.js +++ b/src/components/services/audioEvent.js @@ -77,7 +77,7 @@ angular return q; }); - return $http.post(url, qb.toJSONString()); + return $http.post(url, qb.toJSON()); }; const filterUrl = paths.api.routes.audioEvent.filterAbsolute; @@ -87,7 +87,7 @@ angular }); return $http - .post(filterUrl, query.toJSONString()) + .post(filterUrl, query.toJSON()) .then(x => AudioEventModel.makeFromApi(x)); }; @@ -100,7 +100,7 @@ angular ); }); - return $http.post(filterUrl, query.toJSONString()) + return $http.post(filterUrl, query.toJSON()) .then(resultPager.loadAll) .then(x => AudioEventModel.makeFromApi(x)); }; diff --git a/src/components/services/queryBuilder.js b/src/components/services/queryBuilder.js index 1dfb6583..6526d443 100644 --- a/src/components/services/queryBuilder.js +++ b/src/components/services/queryBuilder.js @@ -381,7 +381,7 @@ angular function filterToQueryString(filterObject) { var results = []; - for(let [key, value] of Object.entries(filterObject)) { + for (let [key, value] of Object.entries(filterObject)) { if (!validCombinators.hasOwnProperty(key)) { if (value.hasOwnProperty("eq")) { results.push(["filter_" + key, value.eq]); @@ -417,7 +417,7 @@ angular return this.end.call(query); }; - this.toJSON = function() { + this.toJSON = function () { var compiledQuery = {}, that = this; @@ -427,11 +427,11 @@ angular } }); - return compiledQuery; - }; + return compiledQuery; + }; - this.toJSONString = function toJSON(spaces) { - return JSON.stringify(this.toJSON(), null, spaces); + this.toJSONString = function toJSON(spaces) { + return JSON.stringify(this.toJSON(), null, spaces); }; this.toQueryString = function toQueryString() { diff --git a/src/components/services/tag.js b/src/components/services/tag.js index 92602ce8..640421e9 100644 --- a/src/components/services/tag.js +++ b/src/components/services/tag.js @@ -130,7 +130,7 @@ angular return q.in("audioEvents.id", audioEventIds); }); - return $http.post(url, query.toJSONString()).then(x => TagModel.makeFromApi(x)); + return $http.post(url, query.toJSON()).then(x => TagModel.makeFromApi(x)); }; return resource; From bed39f24f9851852b561824d695db9bd4cee7193 Mon Sep 17 00:00:00 2001 From: Anthony Truskinger Date: Fri, 10 Feb 2017 18:47:06 +1000 Subject: [PATCH 03/10] fix(library): Single annotation view now shows its tags again It appears a refector in https://github.com/QutBioacoustics/baw-client/commit/48caa9d8974ce423fe439e12ee987d9f5b0c163f#diff-9ea4b22c959cae1e6c3986866011f033 changed the type of data recieved by these objects and this was the result. Fixes #291 --- .../annotationLibrary/libraryItem.tpl.html | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/app/annotationLibrary/libraryItem.tpl.html b/src/app/annotationLibrary/libraryItem.tpl.html index 8d61b942..ccf4b58f 100644 --- a/src/app/annotationLibrary/libraryItem.tpl.html +++ b/src/app/annotationLibrary/libraryItem.tpl.html @@ -14,27 +14,28 @@

Details

-   - {{tag.typeOfTag.replace('_',' ')}} - retired - taxonomic - {{tag.text}} (ID {{tag.id}}) + {{tagging.tag.typeOfTag.replace('_',' ')}} + retired + taxonomic + {{tagging.tag.text}} (ID {{tagging.tag.id}}) - -   - no tags - +   + no tags + + class="list-group-item" + title="This is reference annotation - one that was nominated as an example of exceptional quality.">   Reference Annotation From dd87e645b4230410b0e5db8f47382d3bfd6c3b2d Mon Sep 17 00:00:00 2001 From: Anthony Truskinger Date: Fri, 10 Feb 2017 18:51:38 +1000 Subject: [PATCH 04/10] fix(layout): Incorrect default width for main content When using a collapsed layout it seems col-sm-8 was being used instead of col-sm12. This does not matter for standard width pages but has an effect on full-width pages in narrow layout scenarios - the page does not become full width. This happens because col-sm-* are defined after the col-md-* classes and they override. Bug introduced in 2cadd173e231a8870607339c2751e3fdf8fdfbbe --- src/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.html b/src/index.html index 857c3d0b..441648a5 100644 --- a/src/index.html +++ b/src/index.html @@ -93,7 +93,7 @@
From 6b4d6167ea4dd3593d7cba0e6e26429dfe713fc9 Mon Sep 17 00:00:00 2001 From: Anthony Truskinger Date: Fri, 10 Feb 2017 18:55:47 +1000 Subject: [PATCH 05/10] fix(listen): Event tagger was broken by transient library upgrade Fixes #292 It appears when we updated the angular-bootstrap library in https://github.com/QutBioacoustics/baw-client/commit/864c2a7e6e9f7845b87d33e2b9d84a681f7b37fb#diff-0a08a7565aba4405282251491979bb6bR6 we also broke the angular-tags package because it had a dependency on v0.6 of angular-bootstrap. These problems happen because we don't use a real package manager and because the angular tags library is out of date - see #293 This patch applies a monkey patch to the broken part of the template in the defunct library. --- .../directives/angular-tags/README.md | 5 +++ .../angular-tags/angular-tags-0.3.1-tpls.js | 40 +++++++++++++++++++ src/components/directives/directives.js | 1 + 3 files changed, 46 insertions(+) create mode 100644 src/components/directives/angular-tags/README.md create mode 100644 src/components/directives/angular-tags/angular-tags-0.3.1-tpls.js diff --git a/src/components/directives/angular-tags/README.md b/src/components/directives/angular-tags/README.md new file mode 100644 index 00000000..fcbf8686 --- /dev/null +++ b/src/components/directives/angular-tags/README.md @@ -0,0 +1,5 @@ +# WARNING: MONKEYPATCH FROM HELL + +*ULTRA DODGY* + +See https://github.com/QutBioacoustics/baw-client/issues/292 \ No newline at end of file diff --git a/src/components/directives/angular-tags/angular-tags-0.3.1-tpls.js b/src/components/directives/angular-tags/angular-tags-0.3.1-tpls.js new file mode 100644 index 00000000..07e2fb82 --- /dev/null +++ b/src/components/directives/angular-tags/angular-tags-0.3.1-tpls.js @@ -0,0 +1,40 @@ +/** + * Overriding the standard template because of this bug: + * https://github.com/QutBioacoustics/baw-client/issues/292 + */ +angular + .module("angular-tags.templates.monkeypatch", []) + .run(["$templateCache", function ($templateCache) { + $templateCache.put("templates/tags.html", ` +
+ +
+ + {{tag.name}} + + + +
+ + + + + + + + +
+ `); + }]); diff --git a/src/components/directives/directives.js b/src/components/directives/directives.js index cecf3533..1d25276a 100644 --- a/src/components/directives/directives.js +++ b/src/components/directives/directives.js @@ -1,6 +1,7 @@ angular.module("bawApp.directives", [ "bawApp.configuration", + "angular-tags.templates.monkeypatch", "bawApp.directives.ui.bootstrap", "bawApp.directives.formChildrenHack", "bawApp.directives.notInListValidator", From 247c2ae46c86ac795706084ed99332b9b23483f8 Mon Sep 17 00:00:00 2001 From: Anthony Truskinger Date: Fri, 10 Feb 2017 18:57:24 +1000 Subject: [PATCH 06/10] fix(users): User tile hide condition correction User tiles were not showing when they were meant to. --- src/app/users/userTile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/users/userTile.js b/src/app/users/userTile.js index b6822cb2..735ff6e0 100644 --- a/src/app/users/userTile.js +++ b/src/app/users/userTile.js @@ -19,7 +19,7 @@ angular return; } - if(!$ctrl.resource[userKey] || $ctrl.resource[dateKey]) { + if(!$ctrl.resource[userKey] || !$ctrl.resource[dateKey]) { $ctrl.show = false; return; } From a9fa742c9588e20662c1ee6ce9a125cd995a7791 Mon Sep 17 00:00:00 2001 From: Anthony Truskinger Date: Fri, 10 Feb 2017 18:57:45 +1000 Subject: [PATCH 07/10] chore(build): Brnading compliance --- buildConfig/environmentSettings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildConfig/environmentSettings.json b/buildConfig/environmentSettings.json index 7848ddb2..432642d9 100644 --- a/buildConfig/environmentSettings.json +++ b/buildConfig/environmentSettings.json @@ -31,7 +31,7 @@ }, "brand": { "name": "<>", - "title": "<> | Bioacoustic Workbench" + "title": "<> | Acoustic Workbench" }, "content": { "research": { From e25f96eeff0a7065372aa676a8740730f76a6e95 Mon Sep 17 00:00:00 2001 From: Anthony Truskinger Date: Fri, 10 Feb 2017 19:00:37 +1000 Subject: [PATCH 08/10] fix(users): Default user image was causing browser errors Even though thoroughly warned by angular docs, it seems we put an angular expression inside the img[src] attribute. In scenarios where angular loading is slow the browser tries to load an image at the URL "{{::defaultUserImage}}" which obviously does not exist and causes an error. --- src/app/login/widget/loginWidget.tpl.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app/login/widget/loginWidget.tpl.html b/src/app/login/widget/loginWidget.tpl.html index 07275bd1..82589158 100644 --- a/src/app/login/widget/loginWidget.tpl.html +++ b/src/app/login/widget/loginWidget.tpl.html @@ -14,8 +14,7 @@ class="loginWidgetLink" target="_self"> {{profile.userName}} - Date: Fri, 10 Feb 2017 19:04:38 +1000 Subject: [PATCH 09/10] fix(navigation): Synchronize changes from server views baw-server updated it's navigation to the new design style but also overtook where we left the client. These changes bring both designs to parity. See https://github.com/QutBioacoustics/baw-server/pull/313 Addresses #260 --- src/app/navigation/_navigation.scss | 17 +++++++++-------- src/app/navigation/leftNavBar.tpl.html | 11 ++++++----- src/app/navigation/menuDefinition.js | 22 +++++++++++++++++----- src/app/navigation/rightNavBar.tpl.html | 3 ++- src/app/navigation/secondaryNavigation.js | 2 +- 5 files changed, 35 insertions(+), 20 deletions(-) diff --git a/src/app/navigation/_navigation.scss b/src/app/navigation/_navigation.scss index 171f052a..278c0f78 100644 --- a/src/app/navigation/_navigation.scss +++ b/src/app/navigation/_navigation.scss @@ -1,25 +1,26 @@ left-nav-bar, right-nav-bar { ul.nav-pills > li { & > a, & > button { - padding: 5px 10px; + padding: 5px (1em/4); // approximately 1 standard space's width text-align: left; } } -} -right-nav-bar { - a>.fa, a>.glyphicon { + a .fa, a>.glyphicon { color: $text-color; } } left-nav-bar { + .tooltip-wide { + width: 200px; + } + @for $i from 0 through 4 { .indentation-#{$i} { - $step: ($i * 10%); - width: 100% - $step; - margin-left: $step !important; - font-size: 100% - ($step / 2); + width: calc(100% - #{1em * $i}); + margin-left: (1em * $i) !important; + font-size: 100% - ($i * 3%); } } } \ No newline at end of file diff --git a/src/app/navigation/leftNavBar.tpl.html b/src/app/navigation/leftNavBar.tpl.html index f70d6621..eae57b61 100644 --- a/src/app/navigation/leftNavBar.tpl.html +++ b/src/app/navigation/leftNavBar.tpl.html @@ -6,14 +6,15 @@