Prevent user from trying to delete archived project they don't own

This change disables the select-project checkbox if the user
is on the 'archived' project pane and they don't own the project.
The request to delete would fail anyway, but this prevents UI confusion
This commit is contained in:
Shane Kilkelly 2017-12-12 16:23:24 +00:00
parent edfc259c53
commit 603252f3b4
2 changed files with 4 additions and 0 deletions

View file

@ -2,6 +2,7 @@
input.select-item( input.select-item(
select-individual, select-individual,
type="checkbox", type="checkbox",
ng-disabled="shouldDisableCheckbox(project)",
ng-model="project.selected" ng-model="project.selected"
stop-propagation="click" stop-propagation="click"
aria-label=translate('select_project') + " '{{ project.name }}'" aria-label=translate('select_project') + " '{{ project.name }}'"

View file

@ -462,6 +462,9 @@ define [
App.controller "ProjectListItemController", ($scope) -> App.controller "ProjectListItemController", ($scope) ->
$scope.shouldDisableCheckbox = (project) ->
$scope.filter == 'archived' && project.accessLevel != 'owner'
$scope.projectLink = (project) -> $scope.projectLink = (project) ->
if project.accessLevel == 'readAndWrite' and project.source == 'token' if project.accessLevel == 'readAndWrite' and project.source == 'token'
"/#{project.tokens.readAndWrite}" "/#{project.tokens.readAndWrite}"