Ticket.bjs
authorAlan Knowles <alan@roojs.com>
Mon, 17 Dec 2018 06:44:47 +0000 (14:44 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 17 Dec 2018 06:44:47 +0000 (14:44 +0800)
Ticket.vala

Ticket.bjs
Ticket.vala

index 2a41ff9..8ad1730 100644 (file)
         },
         {
          "listeners" : {
-          "clicked" : "() => {\n\tGLib.debug(\"fire response = 1\");\n\t\n\t\n\tvar invalid = false;\n\t\n\t// validate first...\n\t_this.project_id.el.get_style_context().remove_class(\"warning\");\t\n\tif (_this.project_id.selectedProjectId() == \"\") {\n\t\t_this.project_id.el.get_style_context().add_class(\"warning\");\n\t\tinvalid = true;\n\t}\n\t\n\t\n\t\n\tif (invalid) {\n\t\treturn;\n\t}\n\t\n\t_this.el.response(1);\n}"
+          "clicked" : "() => {\n\tGLib.debug(\"fire response = 1\");\n\t\n\t\n\tvar invalid = false;\n\t\n\t// validate first...\n\t_this.project_id.el.get_style_context().remove_class(\"warning\");\t\n\tif (_this.project_id.selectedProjectId() == \"\") {\n\t\t_this.project_id.el.get_style_context().add_class(\"warning\");\n\t\tinvalid = true;\n\t}\n\t\n\t_this.milestone_id.el.get_style_context().remove_class(\"warning\");\t\n\tif (_this.milestone_id.selectedMilestoneId() == \"\") {\n\t\t_this.milestone_id.el.get_style_context().add_class(\"warning\");\n\t\tinvalid = true;\n\t}\n\n\t_this.milestone_id.el.get_style_context().remove_class(\"warning\");\t\n\tif (_this.milestone_id.selectedProjectId() == \"\") {\n\t\t_this.milestone_id.el.get_style_context().add_class(\"warning\");\n\t\tinvalid = true;\n\t}\n\t\n\t\n\tif (invalid) {\n\t\treturn;\n\t}\n\t\n\t_this.el.response(1);\n}"
          },
          "label" : "Create Ticket",
          "* init" : "{\n   this.el.get_style_context().add_class(\"suggested-action\");\n}\n",
index 85624e2..5354ea2 100644 (file)
@@ -1172,6 +1172,17 @@ public class Ticket : Object
                        invalid = true;
                }
                
+               _this.milestone_id.el.get_style_context().remove_class("warning");      
+               if (_this.milestone_id.selectedMilestoneId() == "") {
+                       _this.milestone_id.el.get_style_context().add_class("warning");
+                       invalid = true;
+               }
+            
+               _this.milestone_id.el.get_style_context().remove_class("warning");      
+               if (_this.milestone_id.selectedProjectId() == "") {
+                       _this.milestone_id.el.get_style_context().add_class("warning");
+                       invalid = true;
+               }
                
                
                if (invalid) {