Skip to content

Commit

Permalink
EVG-6425 hide reconfigure for commit queue patches (#2996)
Browse files Browse the repository at this point in the history
  • Loading branch information
ablack12 committed Jan 2, 2020
1 parent 7329e4c commit 5fda235
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion public/static/js/patches.js
Expand Up @@ -35,7 +35,7 @@ mciModule.controller('PatchesController', function($scope, $filter, $http, $wind
$scope.patches = data['UIPatches'];

_.each($scope.patches, function(patch) {
patch.canEdit = ($window.user.Id === patch.Author ) || $window.isSuperUser
patch.canEdit = (($window.user.Id === patch.Author ) || $window.isSuperUser) && patch.alias !== "__commit_queue"
});

_.each($scope.buildsMap, function(buildArray) {
Expand Down
2 changes: 1 addition & 1 deletion service/templates/patches.html
Expand Up @@ -58,7 +58,7 @@ <h1>
&nbsp;]
</span>
</span>
<span ng-if="!patch.version">
<span ng-if="!patch.version && patch.canEdit">
<a ng-href="/patch/[[patch.id]]" class="btn btn-info btn-sm">
Configure
</a>
Expand Down
3 changes: 2 additions & 1 deletion service/version.go
Expand Up @@ -197,6 +197,7 @@ func (uis *UIServer) versionPage(w http.ResponseWriter, r *http.Request) {
return
}

canEdit := (currentUser != nil) && (projCtx.Version.Requester != evergreen.MergeTestRequester)
pluginContext := projCtx.ToPluginContext(uis.Settings, currentUser)
pluginContent := getPluginDataAndHTML(uis, plugin.VersionPage, pluginContext)

Expand All @@ -209,7 +210,7 @@ func (uis *UIServer) versionPage(w http.ResponseWriter, r *http.Request) {
}{
Version: &versionAsUI,
PluginContent: pluginContent,
CanEdit: currentUser != nil,
CanEdit: canEdit,
JiraHost: uis.Settings.Jira.Host,
ViewData: uis.GetCommonViewData(w, r, false, true)}, "base", "version.html", "base_angular.html", "menu.html")
}
Expand Down

0 comments on commit 5fda235

Please sign in to comment.