[Bps-public-commit] rt-extension-todolist branch, master, updated. 980d372ec17f930da5e1394f80ebb6cf57fea0c3

Craig Kaiser craig at bestpractical.com
Mon Apr 29 09:46:19 EDT 2019


The branch, master has been updated
       via  980d372ec17f930da5e1394f80ebb6cf57fea0c3 (commit)
       via  cf82fc495d603d05a1dbc2cf3abfd998c15d95c4 (commit)
      from  37b65e80e92648971e0ccd3430887cc6ee62b647 (commit)

Summary of changes:
 html/Helpers/TodoList              |  2 +-
 lib/RT/Extension/TodoList.pm       |  2 +-
 static/js/rt-extension-todolist.js | 20 ++++++++++----------
 3 files changed, 12 insertions(+), 12 deletions(-)

- Log -----------------------------------------------------------------
commit cf82fc495d603d05a1dbc2cf3abfd998c15d95c4
Author: Craig Kaiser <craig at bestpractical.com>
Date:   Wed Apr 24 12:01:01 2019 -0400

    Use ES5 JS syntax

diff --git a/static/js/rt-extension-todolist.js b/static/js/rt-extension-todolist.js
index b065e41..b2d2af5 100644
--- a/static/js/rt-extension-todolist.js
+++ b/static/js/rt-extension-todolist.js
@@ -1,5 +1,5 @@
-const UpdateTodoList = (Object) => {
-    const CustomField = jQuery('#RT-TodoList-Select').val()
+function UpdateTodoList (Object) {
+    const CustomField = jQuery('#RT-TodoList-Select').val();
     fetch(RT.Config.WebHomePath + "/Helpers/TodoList?UpdateTodoList=1&ObjectId="+Object+"&CustomField="+CustomField, {
     }).then(response => (response.json()))
     .then(json => {
@@ -7,19 +7,19 @@ const UpdateTodoList = (Object) => {
       })
       .catch(function (error) {
         console.log('Request failed', error)
-      })
-}
+      });
+};
 
-const UpdateTodos = () => {
-    let values = {}
+function UpdateTodos () {
+    let values = {};
     jQuery('#RT-TodoList :checkbox').each(function(){
         if ( jQuery(this).is(":checked") ) {
             values[this.id] = document.querySelectorAll("[for='"+this.id+"']")[0].innerHTML;
         } else {
             values[this.id] = 'RT-TodoList-Remove-'+document.querySelectorAll("[for='"+this.id+"']")[0].innerHTML;
         }
-    })
-    values['UpdateTodo'] = 1
+    });
+    values['UpdateTodo'] = 1;
     fetch(RT.Config.WebHomePath + "/Helpers/TodoList", {
         method: 'POST',
         headers: {
@@ -27,5 +27,5 @@ const UpdateTodos = () => {
         'Content-Type': 'application/json'
         },
         body: JSON.stringify(values)
-    })
-}
+    });
+};

commit 980d372ec17f930da5e1394f80ebb6cf57fea0c3
Author: Craig Kaiser <craig at bestpractical.com>
Date:   Mon Apr 29 09:45:43 2019 -0400

    Standardize the displayed HTML when no todo list is selected

diff --git a/html/Helpers/TodoList b/html/Helpers/TodoList
index bb148b9..462bc65 100644
--- a/html/Helpers/TodoList
+++ b/html/Helpers/TodoList
@@ -14,7 +14,7 @@ if ( $POSTDATA ) {
 }
 
 if ( $UpdateTodoList ) {
-    my $html = '<p>No Todo List</p>';
+    my $html = '';
     $html = RT::Extension::TodoList->UpdateTodoList(
         ObjectId => $ObjectId, CustomField => $CustomField,
         CurrentUser => $session{'CurrentUser'}
diff --git a/lib/RT/Extension/TodoList.pm b/lib/RT/Extension/TodoList.pm
index bd4ca06..ae0633c 100644
--- a/lib/RT/Extension/TodoList.pm
+++ b/lib/RT/Extension/TodoList.pm
@@ -21,7 +21,7 @@ sub UpdateTodoList {
         ObjectId => $ObjectId, CustomField => $CustomField, CurrentUser => $args{'CurrentUser'}
     );
     RT::Logger->error("Could not set TodoList ticket attribute: $msg") unless $ret;
-    return '<p>No Todo List</p>' unless $CustomField;
+    return '' unless $CustomField;
 
     my $Object = RT::Ticket->new($args{'CurrentUser'});
     ($ret, $msg) = $Object->Load($ObjectId);

-----------------------------------------------------------------------


More information about the Bps-public-commit mailing list