Skip to content
This repository has been archived by the owner on Dec 15, 2018. It is now read-only.

Commit

Permalink
Remove mark unsafe button
Browse files Browse the repository at this point in the history
Summary:
The button is broken now because it's sending the build tags in the wrong place.
Since nothing makes use of the unsafe tag, remove the button.

Test Plan: To be tested locally by verifying button doesn't show up anymore.

Reviewers: kylec

Reviewed By: kylec

Subscribers: changesbot, dgoldstein

Tags: #changes_ui

Differential Revision: https://tails.corp.dropbox.com/D223984
  • Loading branch information
paulruan committed Aug 29, 2016
1 parent de061bf commit 6bd51d8
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions webapp/pages/builds_pages/build_info.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,50 +200,6 @@ export var SingleBuild = React.createClass({
</div> :
null;

var unsafe_to_push = null;

// only admins can mark a build as unsafe to push
if (window.changesAuthData && window.changesAuthData.user && window.changesAuthData.user.isAdmin === true){
// if already marked unsafe, allow it to be marked as safe again
var build_tags = "";

var build_tags = build.tags.filter(x => x !== "unsafe_to_push").map(x => "tags="+x).join("&")

if (!("unsafe_to_push" in build.tags)){
build_tags += "&tags=unsafe_to_push";
}

if ("unsafe_to_push" in build.tags){
var unsafeName = "markBuildSafe";
var buttonText = "Mark Safe";
var buttonColor = "";
var buttonClass = "fa fa-check marginRightM";
// otherwise, allow user to mark as unsafe
} else {
var unsafeName = "markBuildUnsafe";
var buttonText = "Mark Unsafe";
var buttonColor = "red";
var buttonClass = "fa fa-minus-circle marginRightM";
}

var unsafe_to_push =
<div className="marginTopM">
<Request
parentElem={this}
name={unsafeName}
method="post"
endpoint={`/api/0/builds/${build.id}/tags?${build_tags}`}>
<Button type="white" className="sizedButton">
<span className={buttonColor}>
<i className={buttonClass} />
{buttonText}
</span>
</Button>
</Request>
</div>
}


// show a button for the tests for build page, since its important and we
// want a prominent link
var buildTestsHref = ChangesLinks.testsForBuildHref(build.id, build.testFailures.total);
Expand Down Expand Up @@ -280,7 +236,6 @@ export var SingleBuild = React.createClass({
Test Details
</Button>
</div>
{unsafe_to_push}
</div>;
},

Expand Down

0 comments on commit 6bd51d8

Please sign in to comment.