Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions website/static/js/accessRequestManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ var AccessRequestModel = function(accessRequest, pageOwner, isRegistration, isPa
self.respondToAccessRequest = function(trigger, data, event) {
$osf.trackClick('button', 'click', trigger + '-project-access');
$osf.block();
data = data || {};

var requestUrl = $osf.apiV2Url('actions/requests/nodes/');
var payload = self.requestAccessPayload(trigger, data.permissions, data.visible);
var request = $osf.ajaxJSON(
Expand Down
5 changes: 4 additions & 1 deletion website/templates/project/contributors.mako
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,10 @@
visible: visible()
})}"
><i class="fa fa-plus"></i> Add</button>
<span data-bind="click: function() {respondToAccessRequest('reject')}, visible: !$root.collapsed()"><i class="fa fa-times fa-2x remove-or-reject"></i></span>
<span data-bind="click: function() {respondToAccessRequest('reject', {
visible: !$root.collapsed()
})}"
><i class="fa fa-times fa-2x remove-or-reject"></i></span>
<button class="btn btn-default btn-sm m-l-md" data-bind="click: function() {respondToAccessRequest('reject')}, visible: $root.collapsed()"><i class="fa fa-times"></i> Remove</button>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this also need something similar?

Copy link
Contributor Author

@antkryt antkryt Jun 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current issue is that when we create requestAccessPayload, we try to access data (that we don't pass) and if it's null it throws an error on the JS side. I'll update code as you suggested, permission will be passed in any case (by default it's "read"):
self.permission = ko.observable(accessRequest.requested_permissions || 'read');

Regarding the button, it's currently disabled and not visible on the Contributors page (visible: $root.collapsed()). I'd like to remove it but I'm not sure if it's used somewhere else.

</div>
</td>
Expand Down
Loading