Skip to content

Commit

Permalink
Fix issues with tags with spaces not showing up in Edit Template. (#307)
Browse files Browse the repository at this point in the history
Use the tag specific methods in TemplateService to display tags in EditTemplate and TemplateList.
  • Loading branch information
ghinda authored May 9, 2019
1 parent 9cad425 commit 35805ef
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gorgias",
"version": "6.1.0",
"version": "6.1.1",
"description": "Gorgias grunt package",
"main": "index.js",
"scripts": {
Expand Down
5 changes: 4 additions & 1 deletion src/background/js/controllers/includes/template_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ gApp.controller('TemplateFormCtrl',
setTimeout(function(){ tinymce.activeEditor.setContent(self.selectedTemplate.body); }, 100);

}
$.each(self.selectedTemplate.tags.split(','), function (_, tag) {

// get tags from template service, to be cleaned-up.
var tags = TemplateService.tags(self.selectedTemplate);
$.each(tags, function (_, tag) {
$('#qt-tags')[0].selectize.addItem($.trim(tag));
});

Expand Down
4 changes: 4 additions & 0 deletions src/background/js/controllers/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,4 +486,8 @@ gApp.controller('ListCtrl',
});
exporter.downloadCsv(itemsFormatted);
};

$scope.getTags = function (template) {
return TemplateService.tags(template);
};
});
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "__MSG_extName__",
"version": "6.1.0",
"version": "6.1.1",
"description": "__MSG_extDesc__",
"short_name": "Gorgias",
"default_locale": "en",
Expand Down
2 changes: 1 addition & 1 deletion src/pages/views/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ <h4 class="list-group-item-heading">
ng-bind-html="template.body| stripHTML | truncate:100 | newlines | safe"></span>
</p>
<p class="list-group-item-text quicktext-tags" ng-if="template.tags">
<div class="label-wrapper" ng-repeat="tag in template.tags.split(', ')">
<div class="label-wrapper" ng-repeat="tag in getTags(template)">
<span class="tag" ng-if="tag">
<strong ng-if="filterTags.indexOf(tag) !== -1"><i class="fa fa-hashtag icon"></i>{{tag}} </strong>
<span ng-if="filterTags.indexOf(tag) === -1"><i class="fa fa-hashtag icon"></i>{{tag}} </span>
Expand Down

0 comments on commit 35805ef

Please sign in to comment.