Browse Source

In checks list, the pause button asks for confirmation. Fixes #356

pull/366/head
Pēteris Caune 5 years ago
parent
commit
00ea45655d
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
4 changed files with 31 additions and 3 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +5
    -0
      static/css/my_checks_desktop.css
  3. +24
    -2
      static/js/checks.js
  4. +1
    -1
      templates/front/my_checks_desktop.html

+ 1
- 0
CHANGELOG.md View File

@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
- Use Slack V2 OAuth flow
- Users can edit their existing webhook integrations (#176)
- Add a "Transfer Ownership" feature in Project Settings
- In checks list, the pause button asks for confirmation (#356)
### Bug Fixes
- "Get a single check" API call now supports read-only API keys (#346)


+ 5
- 0
static/css/my_checks_desktop.css View File

@ -154,3 +154,8 @@ tr:hover .copy-link {
opacity: 0;
}
#checks-table tr:hover .pause.confirm:hover {
background: #0091ea;
color: #FFF;
outline: none;
}

+ 24
- 2
static/js/checks.js View File

@ -141,8 +141,25 @@ $(function () {
return false;
});
$(".pause").click(function(e) {
var code = $(this).closest("tr.checks-row").attr("id");
$(".pause").tooltip({
title: "Pause this check?<br />Click again to confirm.",
trigger: "manual",
html: true
});
$(".pause").click(function() {
var btn = $(this);
// First click: show a confirmation tooltip
if (!btn.hasClass("confirm")) {
btn.addClass("confirm").tooltip("show");
return false;
}
// Second click: update UI and pause the check
btn.removeClass("confirm").tooltip("hide");
var code = btn.closest("tr.checks-row").attr("id");
$("#" + code + " span.status").attr("class", "status icon-paused");
var url = base + "/checks/" + code + "/pause/";
@ -156,6 +173,11 @@ $(function () {
return false;
});
$(".pause").mouseleave(function() {
$(this).removeClass("confirm").tooltip("hide");
});
$('[data-toggle="tooltip"]').tooltip({
html: true,
container: "body",


+ 1
- 1
templates/front/my_checks_desktop.html View File

@ -121,7 +121,7 @@
</div>
</td>
<td class="actions">
<button title="Pause" class="btn btn-default pause" type="button">
<button class="btn btn-default pause" type="button">
<span class="icon-paused" />
</button>


Loading…
Cancel
Save