Commits

Robert Massaioli [Atlassian] committed 8125040

Still cleaning up the success page.

The error messages on the list page are also better now too.

Comments (0)

Files changed (2)

src/main/resources/js/list-user-pings.js

             dataType:"json"
         }).done(function (json) {
             displayData(json);
-            console.log("TODO: give the user feedback that the ping was placed!");
         }).fail(function (jqXHR, textStatus) {
-            console.log("TODO: let the user know that we failed to create the ping.");
+            var error = JSON.parse(jqXHR.responseText);
             AJS.messages.error("#status-messages", {
                 title: "We have failed to load your Pings.",
-                body: "This is caused by...",
+                body: error.message,
                 closeable: true
             });
         });
             dataType:"json"
            // TODO return all of the pings that were destroyed
         }).done(function (json) {
-            console.log("TODO: give the user feedback that the ping was placed!");
             // TODO the user should be able to undo this operation. It would be pretty nasty to not be able to undo this...
             AJS.messages.success("#status-messages", {
                 title: "All of your Pings Have been cleared.",
-                body: "This is caused by...",
+                body: "You will not get any more notifications unless you create more pings.",
                 closeable: true
             });
             tableBody.empty();
-        }).fail(function (jqXHR, textStatus) {
-            console.log("TODO: let the user know that we failed to create the ping.");
+        }).fail(function (jqXHR) {
+            var error = JSON.parse(jqXHR.responseText);
             AJS.messages.error("#status-messages", {
-                title: "We weree not able to successfully destroy all of your pings.",
-                body: "This is caused by...TODO",
+                title: "We were not able to successfully destroy all of your pings.",
+                body: error.message,
                 closeable: true
             });
         });
 
     // Given a big list of search results this can display the data.
     var displayData = function(json) {
+        console.log("We got a new batch of data. Displaying it on the page now.");
         tableBody.empty();
         for(var i = 0; i < json.length; ++i) {
             var ping = json[i];
                callbackFunction(pingId);
             }
         }).fail(function (jqXHR, textStatus) {
+            var error = JSON.parse(jqXHR.responseText);
             AJS.messages.error("#status-messages", {
                 title: "Could not delete the following ping: " + issueId,
-                body: "TODO: put in the error reasons here.",
+                body: error.message,
                 closeable: true
             });
         });

src/main/resources/templates/success.vm

     <body>
     	<form class="aui-panel">
 	        <h1>Ping Me Plugin for JIRA</h1>
-            <p>Create one or more pings for this issue.</p>
-	        <label for="date-input">When:</label>
-	        <input id="date-input" type="text" value="tomorrow" />
-	        <p id="date-preview-container" class="hidden">
-	        	<strong>Preview:</strong> <span id="date-preview"></span>
-	        </p>
-	        <div id="status-messages"></div>
+            <div class="aui-panel" style="display: inline-block; vertical-align: top;">
+                <label for="date-input">When:</label>
+                <input id="date-input" type="text" value="tomorrow" />
+                <p id="date-preview-container" class="hidden">
+                    <strong>Preview:</strong> <span id="date-preview"></span>
+                </p>
+                <div id="status-messages"></div>
+            </div>
+            <div id="javascript-instructions" class="aui-panel" style="display: inline-block;">
+                <p>Type in a date. It could be:</p>
+                <ul>
+                    <li>next week</li>
+                    <li>next month</li>
+                    <li>+6 months</li>
+                    <li>or even a plain date "2033-12-11"</li>
+                </ul>
+                <p>All this and more, it just works! Try it out, the text will be green if it is okay. Hit Enter to create the ping.</p>
+            </div>
 	    </form>
     </body>
 </html>