Skip to content
This repository has been archived by the owner on Jun 9, 2021. It is now read-only.

Commit

Permalink
Only projects objects on project level #202
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasbjerre committed Mar 1, 2017
1 parent ce0079e commit 58f4f91
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
Changelog of Pull Request Notifier for Bitbucket.

## Unreleased
### GitHub [#202](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/issues/202) Pull Request Notifier for Bitbucket: project-level admin page displays objects from more than one project.
Only projects objects on project level

[120aa353cb3fc2c](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/120aa353cb3fc2c) Tomas Bjerre *2017-03-01 18:53:50*

### GitHub [#204](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/issues/204) Allow only specific users or group triggering a custom button?
PULL_REQUEST_USER_GRUPS variable
PULL_REQUEST_USER_GROUPS variable

[c0441391bfb1b35](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/c0441391bfb1b35) Tomas Bjerre *2017-03-01 18:47:23*
[ce0079ebc0e3ef3](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/ce0079ebc0e3ef3) Tomas Bjerre *2017-03-01 18:51:17*

### No issue
Git Changelog Maven plugin 1.39 and using HTTP
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/se/bjurr/prnfb/service/PrnfbVariable.java
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ public String resolve(
ClientKeyStore clientKeyStore,
boolean shouldAcceptAnyCertificate,
SecurityService securityService) {
return variables.get(PULL_REQUEST_USER_GROUPS).get();
return getOrEmpty(variables,PULL_REQUEST_USER_GROUPS);
}
}),
PULL_REQUEST_USER_DISPLAY_NAME(
Expand Down
8 changes: 7 additions & 1 deletion src/main/resources/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ define('plugin/prnfb/admin', [
var buttonsAdminUrlPostUrl = AJS.contextPath() + "/rest/prnfb-admin/1.0/settings/buttons";
var buttonsAdminUrl = buttonsAdminUrlPostUrl;

var projectKey;
if ($('#prnfbRepositorySlug').length !== 0) {
var projectKey = $('#prnfbProjectKey').val();
projectKey = $('#prnfbProjectKey').val();
var repositorySlug = $('#prnfbRepositorySlug').val();

notificationsAdminUrl = notificationsAdminUrlPostUrl + '/projectKey/' + projectKey + '/repositorySlug/' + repositorySlug;
buttonsAdminUrl = buttonsAdminUrlPostUrl + '/projectKey/' + projectKey + '/repositorySlug/' + repositorySlug;
} else if ($('#prnfbProjectKey').length !== 0) {
projectKey = $('#prnfbProjectKey').val();

notificationsAdminUrl = notificationsAdminUrlPostUrl + '/projectKey/' + projectKey;
buttonsAdminUrl = buttonsAdminUrlPostUrl + '/projectKey/' + projectKey;
}

$(document)
Expand Down
9 changes: 9 additions & 0 deletions src/main/resources/admin.vm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@
#end
<!-- //-->

<!-- //-->
#if($project)
<!-- //-->
<input type="hidden" id="prnfbProjectKey" name="projectKey" value="$project.key" />
<!-- //-->
#end
<!-- //-->

<div class="statusresponse"></div>


Expand Down Expand Up @@ -66,6 +74,7 @@
<li><b>${PULL_REQUEST_USER_ID}</b> Example: 1</li>
<li><b>${PULL_REQUEST_USER_NAME}</b> Example: some.user</li>
<li><b>${PULL_REQUEST_USER_SLUG}</b> Example: some.user</li>
<li><b>${PULL_REQUEST_USER_GROUPS}</b> Example: ADMIN,DEV</li>
<li><b>${PULL_REQUEST_AUTHOR_DISPLAY_NAME}</b> Example: Administrator</li>
<li><b>${PULL_REQUEST_AUTHOR_EMAIL}</b> Example: [email protected]</li>
<li><b>${PULL_REQUEST_AUTHOR_ID}</b> Example: 1</li>
Expand Down

0 comments on commit 58f4f91

Please sign in to comment.