diff options
author | Angelo Gallarello <angelo.gallarell@gmail.com> | 2019-01-02 22:51:00 +0100 |
---|---|---|
committer | Angelo Gallarello <angelo.gallarell@gmail.com> | 2019-01-02 22:51:00 +0100 |
commit | 4d8b2029d266843dc0eb376a0bf752c46e440a13 (patch) | |
tree | eb7d5a6fdeb2e61c8c77863334816ac15fa2203c /client | |
parent | 8ad0da210940c514fc173564955568f023bde3d6 (diff) | |
download | wekan-4d8b2029d266843dc0eb376a0bf752c46e440a13.tar.gz wekan-4d8b2029d266843dc0eb376a0bf752c46e440a13.tar.bz2 wekan-4d8b2029d266843dc0eb376a0bf752c46e440a13.zip |
Fixed errors
Diffstat (limited to 'client')
-rw-r--r-- | client/components/rules/actions/boardActions.js | 4 | ||||
-rw-r--r-- | client/components/rules/actions/checklistActions.js | 2 | ||||
-rw-r--r-- | client/components/rules/rulesMain.js | 21 | ||||
-rw-r--r-- | client/components/rules/triggers/boardTriggers.js | 29 | ||||
-rw-r--r-- | client/lib/utils.js | 12 |
5 files changed, 32 insertions, 36 deletions
diff --git a/client/components/rules/actions/boardActions.js b/client/components/rules/actions/boardActions.js index c2ac156c..e0b8edc9 100644 --- a/client/components/rules/actions/boardActions.js +++ b/client/components/rules/actions/boardActions.js @@ -28,7 +28,7 @@ BlazeComponent.extendComponent({ actionId, boardId, }); - + }, 'click .js-add-swimlane-action' (event) { const ruleName = this.data().ruleName.get(); @@ -49,7 +49,7 @@ BlazeComponent.extendComponent({ actionId, boardId, }); - + }, 'click .js-add-spec-move-action' (event) { const ruleName = this.data().ruleName.get(); diff --git a/client/components/rules/actions/checklistActions.js b/client/components/rules/actions/checklistActions.js index 59141c39..3e79b075 100644 --- a/client/components/rules/actions/checklistActions.js +++ b/client/components/rules/actions/checklistActions.js @@ -25,7 +25,7 @@ BlazeComponent.extendComponent({ actionId, boardId, }); - + }, 'click .js-add-checklist-action' (event) { const ruleName = this.data().ruleName.get(); diff --git a/client/components/rules/rulesMain.js b/client/components/rules/rulesMain.js index 42116790..2e125960 100644 --- a/client/components/rules/rulesMain.js +++ b/client/components/rules/rulesMain.js @@ -1,4 +1,4 @@ -let rulesMainComponent = BlazeComponent.extendComponent({ +const rulesMainComponent = BlazeComponent.extendComponent({ onCreated() { this.rulesCurrentTab = new ReactiveVar('rulesList'); this.ruleName = new ReactiveVar(''); @@ -10,9 +10,9 @@ let rulesMainComponent = BlazeComponent.extendComponent({ this.rulesCurrentTab.set('trigger'); }, sanitizeObject(obj){ - Object.keys(obj).forEach(key =>{ - if(obj[key] == "" || obj[key] == undefined){ - obj[key] = "*"; + Object.keys(obj).forEach((key) => { + if(obj[key] == '' || obj[key] == undefined){ + obj[key] = '*'; }} ); }, @@ -49,25 +49,25 @@ let rulesMainComponent = BlazeComponent.extendComponent({ 'click .js-goto-action' (event) { event.preventDefault(); // Add user to the trigger - const username = $(event.currentTarget.offsetParent).find(".user-name").val(); + const username = $(event.currentTarget.offsetParent).find('.user-name').val(); let trigger = this.triggerVar.get(); - trigger["userId"] = "*"; + trigger.userId = '*'; if(username != undefined ){ - const userFound = Users.findOne({"username":username}); + const userFound = Users.findOne({username}); if(userFound != undefined){ - trigger["userId"] = userFound._id; + trigger.userId = userFound._id; this.triggerVar.set(trigger); } } // Sanitize trigger trigger = this.triggerVar.get(); - this.sanitizeObject(trigger) + this.sanitizeObject(trigger); this.triggerVar.set(trigger); this.setAction(); }, 'click .js-show-user-field' (event) { event.preventDefault(); - $(event.currentTarget.offsetParent).find(".user-details").removeClass("hide-element"); + $(event.currentTarget.offsetParent).find('.user-details').removeClass('hide-element'); }, 'click .js-goto-rules' (event) { event.preventDefault(); @@ -95,4 +95,3 @@ let rulesMainComponent = BlazeComponent.extendComponent({ }).register('rulesMain'); - diff --git a/client/components/rules/triggers/boardTriggers.js b/client/components/rules/triggers/boardTriggers.js index 1a7948de..f9aa57cb 100644 --- a/client/components/rules/triggers/boardTriggers.js +++ b/client/components/rules/triggers/boardTriggers.js @@ -1,7 +1,7 @@ BlazeComponent.extendComponent({ onCreated() { this.provaVar = new ReactiveVar(''); - this.currentPopupTriggerId = "def"; + this.currentPopupTriggerId = 'def'; this.cardTitleFilters = {}; }, setNameFilter(name){ @@ -11,12 +11,12 @@ BlazeComponent.extendComponent({ events() { return [{ 'click .js-open-card-title-popup'(event){ - var funct = Popup.open('boardCardTitle'); - let divId = $(event.currentTarget.parentNode.parentNode).attr("id"); - console.log("current popup"); + const funct = Popup.open('boardCardTitle'); + const divId = $(event.currentTarget.parentNode.parentNode).attr('id'); + console.log('current popup'); console.log(this.currentPopupTriggerId); this.currentPopupTriggerId = divId; - funct.call(this,event); + funct.call(this, event); }, 'click .js-add-create-trigger' (event) { const desc = Utils.getTriggerActionDesc(event, this); @@ -24,17 +24,17 @@ BlazeComponent.extendComponent({ const listName = this.find('#create-list-name').value; const swimlaneName = this.find('#create-swimlane-name').value; const boardId = Session.get('currentBoard'); - const divId = $(event.currentTarget.parentNode).attr("id"); + const divId = $(event.currentTarget.parentNode).attr('id'); const cardTitle = this.cardTitleFilters[divId]; // move to generic funciont datas.triggerVar.set({ - activityType: 'createCard', - boardId, - cardTitle, - swimlaneName, - listName, - desc, - }); + activityType: 'createCard', + boardId, + cardTitle, + swimlaneName, + listName, + desc, + }); }, 'click .js-add-moved-trigger' (event) { const datas = this.data(); @@ -105,9 +105,6 @@ BlazeComponent.extendComponent({ }).register('boardTriggers'); - - - Template.boardCardTitlePopup.events({ submit(evt, tpl) { const title = tpl.$('.js-card-filter-name').val().trim(); diff --git a/client/lib/utils.js b/client/lib/utils.js index f252a220..051ec952 100644 --- a/client/lib/utils.js +++ b/client/lib/utils.js @@ -220,19 +220,19 @@ Utils = { finalString += element.text().toLowerCase(); } else if (element.hasClass('user-details')) { let username = element.find('input').val(); - if(username == undefined || username == ""){ - username = "*"; + if(username == undefined || username == ''){ + username = '*'; } - finalString += element.find('.trigger-text').text().toLowerCase()+ " " + username ; + finalString += `${element.find('.trigger-text').text().toLowerCase() } ${ username}`; } else if (element.find('select').length > 0) { finalString += element.find('select option:selected').text().toLowerCase(); } else if (element.find('input').length > 0) { let inputvalue = element.find('input').val(); - if(inputvalue == undefined || inputvalue == ""){ - inputvalue = "*"; + if(inputvalue == undefined || inputvalue == ''){ + inputvalue = '*'; } finalString += inputvalue; - } + } // Add space if (i !== length - 1) { finalString += ' '; |