Skip to content

Commit

Permalink
Merge 10b2efa into f1cb5fd
Browse files Browse the repository at this point in the history
  • Loading branch information
darmiel committed Oct 16, 2023
2 parents f1cb5fd + 10b2efa commit 2243898
Show file tree
Hide file tree
Showing 39 changed files with 1,244 additions and 179 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@

node_modules/
Dockerfile
.env
9 changes: 8 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@ export PORT=5000
export PROTOCOL=http
export HOST=localhost
export MONGODB=mongodb://cla_assistant:cla_assistant@localhost:27017/cla_assistant

export GITHUB_APP_NAME=
export GITHUB_APP_PRIVATE_KEY=
export GITHUB_APP_ID=
export GITHUB_APP_CLIENT=
export GITHUB_APP_SECRET=
export GITHUB_APP_WEBHOOK_SECRET=

export GITHUB_CLIENT=
export GITHUB_SECRET=

export GITHUB_TOKEN=
4 changes: 2 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ module.exports = function (grunt) {
grunt.registerTask('build', ['uglify', 'sass']);
grunt.registerTask('lint', ['eslint', 'scsslint']);
grunt.registerTask('coverage', ['mocha_istanbul']);
grunt.registerTask('default', ['uglify', 'eslint', 'mochaTest:server', 'karma', 'watch']);
grunt.registerTask('test', ['eslint', 'mochaTest:server', 'karma']);
grunt.registerTask('default', ['uglify', 'eslint', 'mochaTest:server', 'watch']);
grunt.registerTask('test', ['eslint', 'mochaTest:server']);
grunt.registerTask('debug_test', ['mochaTest:debugServer']);
};
124 changes: 87 additions & 37 deletions README.md

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@octokit/plugin-retry": "^3.0.9",
"@octokit/plugin-throttling": "^3.5.2",
"@octokit/rest": "^18.10.0",
"@octokit/webhooks-methods": "^4.0.0",
"async": "^3.2.1",
"body-parser": "^1.19.0",
"bunyan": "^1.8.15",
Expand Down Expand Up @@ -90,7 +91,7 @@
"scripts": {
"build": "node_modules/grunt/bin/grunt build",
"start": "node src/server/src/app.js",
"start:dev": "source .env && node src/server/src/app.js",
"start:dev": "npx grunt build && source .env && node src/server/src/app.js",
"test": "node_modules/grunt/bin/grunt test",
"acceptance_test": "source .env && npx codeceptjs run"
}
Expand Down
41 changes: 38 additions & 3 deletions src/client/assets/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ <h5 ng-if="user.value.org_admin" class="col-xs-12 link-topic-2">
<ui-select-match placeholder="select">
<button class="fa fa-times clear-button" ng-click="clear($event, 'repo')"
ng-show="$select.selected.name"></button>
{{$select.selected.full_name || $select.selected.login}}</ui-select-match>
{{$select.selected.full_name || $select.selected.login}}
</ui-select-match>
<ui-select-choices group-by="groupOrgs"
repeat="item in reposAndOrgs | filter: $select.search | notIn:claRepos | notIn:claOrgs">
<span ng-if="item.full_name" class="octicon"
Expand All @@ -48,6 +49,9 @@ <h5 ng-if="user.value.org_admin" class="col-xs-12 link-topic-2">
<img src="{{item.avatarUrl}}" alt="" style="width:20px">
</span>
<span ng-if="!item.full_name" ng-bind-html="item.login | highlight: $select.search"></span>
<span ng-if="item.repository_selection">
| ({{item.repository_selection}} repos)
</span>
</ui-select-choices>
</ui-select>
<span ng-if="selected.item && !isRepo(selected.item)">
Expand All @@ -56,6 +60,14 @@ <h5 ng-if="user.value.org_admin" class="col-xs-12 link-topic-2">
<input class="form-control" ng-model="selected.item.excludePattern"
placeholder="repo1,repo2,substring1"></input>
</span>
<span ng-id="!selected.item">
<div style="margin-bottom: 5px; margin-top: 5px;">
<i>Can't find your repository?</i>
<a href="https://github.com/apps/{{appName}}/installations/new">
Add the CLA-Assistant app to your repository
</a>
</div>
</span>
</div>
</div>
<h5 class="link-topic-1">
Expand Down Expand Up @@ -121,9 +133,26 @@ <h5 class="link-topic-1">

</div>

<div class="well row" style="padding: 2rem; background-color: #0794C6;">
<h3 style="color: white; font-weight: bold;">Missing anything?</h3>
<p style="color: #d2d2d2">
If you can't find your linked repository or organization,
you'll need to add the new CLA-Assistant app to your repository or organization.
</p>
<a class="btn btn-success" href="https://github.com/apps/{{appName}}/installations/new">
Add GitHub App
</a>
</div>

<!-- ----------ACTIVATED ORGS---------- -->
<div ng-if="claOrgs.length > 0" class="row">
<h4 class="col-xs-12" style="margin: 25px 0; padding-left: 0;">Linked Organisations</h4>
<h4 class="col-xs-12" style="margin: 25px 0; padding-left: 0;">
Linked Organisations
<span ng-if="numMigrateOrgs" style="color: red;">
<i class="octicon octicon-alert"></i>
<strong>{{numMigrateOrgs}}</strong> organizations need to be migrated.
</span>
</h4>
</div>
<div ng-if="claOrgs.length > 0" class="well row" style="padding-top:25px;">
<table class="table">
Expand Down Expand Up @@ -163,7 +192,13 @@ <h4 class="col-xs-12" style="margin: 25px 0; padding-left: 0;">Linked Organisati

<!-- ----------ACTIVATED REPOS---------- -->
<div class="row">
<h4 class="col-xs-12" style="margin: 25px 0; padding-left: 0;">Linked Repositories</h4>
<h4 class="col-xs-12" style="margin: 25px 0; padding-left: 0;">
Linked Repositories
<span ng-if="numMigrateRepos" style="color: red;">
<i class="octicon octicon-alert"></i>
<strong>{{numMigrateRepos}}</strong> repositories need to be migrated.
</span>
</h4>
</div>
<div class="well row" style="padding-top:25px;">
<table class=" table">
Expand Down
69 changes: 69 additions & 0 deletions src/client/assets/templates/modals/migrateOrganization.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<!--
SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and CLA-assistant contributors
SPDX-License-Identifier: Apache-2.0
-->

<div class="modal-body modal-primary container" style="text-align: center;">
<div ng-click="cancel()" class="fa fa-times close-button"></div>

<div class="modal-header">
<span class="small-light-text">MIGRATION</span><br>
<span class="big-bold-text">{{item.org}}</span>
<div ng-show="success">
<span class="small-green-text">Migration Successful</span>
</div>
</div>

<div class="row">
<img src="/assets/images/howto4.svg" class="icon-img icon" ng-show="success">
<img src="/assets/images/feature3.svg" class="icon-img icon" ng-show="!success">
</div>

<!-- Default Migrating Notice -->
<div ng-if="checking" class="row">
<h2>Migrating...</h2>
<p>
This process can take a while.
</p>
</div>

<!-- Actual Left Content -->
<div ng-if="!checking" class="row">
<div ng-show="needGitHubApp">
<h2>Install the GitHub App</h2>
<p>
Install the GitHub App to every repository in your organization you plan to use CLA-Assistant on.
The GitHub App will act on your behalf with more restricted permissions.
</p>
<a ng-show="inviteOrganizationID" class="btn btn-success"
href="https://github.com/apps/{{inviteAppName}}/installations/new/permissions?suggested_target_id={{inviteOrganizationID}}">
Install GitHub App
</a>
<br><br>
</div>
<div ng-show="needGitHubAppPrivileges">
<h2>Extend Privileges</h2>
<p>
The GitHub App requires extended permissions.
</p>
<a class="btn btn-info" href="https://github.com/settings/installations/40445958">Update Permissions</a>
<br><br>
</div>
<div ng-show="needCheckMigration">
<h2>Start Migration</h2>
<p>
Click on the button to check if CLA-Assistant can access your repository and start the migration.
</p>
<button class="btn btn-info" ng-show="!checking" ng-click="migrate()">Start Migration</button>
</div>
<div ng-show="errorMsg">
<h2>Error</h2>
<span style="color: red">{{errorMsg}}</span>
</div>
<div ng-show="success">
<h2>Migration Complete!</h2>
<button class="btn btn-info" ng-click="done()">Close Window</button>
</div>
</div>
</div>
69 changes: 69 additions & 0 deletions src/client/assets/templates/modals/migrateRepository.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<!--
SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and CLA-assistant contributors
SPDX-License-Identifier: Apache-2.0
-->

<div class="modal-body modal-primary container" style="text-align: center;">
<div ng-click="cancel()" class="fa fa-times close-button"></div>

<div class="modal-header">
<span class="small-light-text">MIGRATION</span><br>
<span class="big-bold-text">{{item.owner}}/{{item.repo}}</span>
<div ng-show="success">
<span class="small-green-text">Migration Successful</span>
</div>
</div>

<div class="row">
<img src="/assets/images/howto4.svg" class="icon-img icon" ng-show="success">
<img src="/assets/images/feature3.svg" class="icon-img icon" ng-show="!success">
</div>

<!-- Default Migrating Notice -->
<div ng-if="checking" class="row">
<h2>Migrating...</h2>
<p>
This process can take a while.
</p>
</div>

<!-- Actual Left Content -->
<div ng-if="!checking" class="row">
<div ng-show="needGitHubApp">
<h2>Install the GitHub App</h2>
<p>
Install the GitHub App on each repository where you want to use CLA-Assistant.
The GitHub app will act on your behalf with more restricted permissions.
</p>
<a ng-show="inviteUserID" class="btn btn-success"
href="https://github.com/apps/{{inviteAppName}}/installations/new/permissions?suggested_target_id={{inviteUserID}}&repository_ids[]={{item.repoId}}">
Install GitHub App
</a>
<br><br>
</div>
<div ng-show="needGitHubAppPrivileges">
<h2>Extend Privileges</h2>
<p>
The GitHub App requires extended permissions.
</p>
<a class="btn btn-info" href="https://github.com/settings/installations/40445958">Update Permissions</a>
<br><br>
</div>
<div ng-show="needCheckMigration">
<h2>Start Migration</h2>
<p>
Click on the button to check if CLA-Assistant can access your repository and start the migration.
</p>
<button class="btn btn-info" ng-show="!checking" ng-click="migrate()">Start Migration</button>
</div>
<div ng-show="errorMsg">
<h2>Error</h2>
<span style="color: red">{{errorMsg}}</span>
</div>
<div ng-show="success">
<h2>Migration Complete!</h2>
<button class="btn btn-info" ng-click="done()">Close Window</button>
</div>
</div>
</div>
17 changes: 16 additions & 1 deletion src/client/assets/templates/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,23 @@
<td>
<div class="col-xs-12 col-sm-3 col-lg-5" style="padding-left:0">
<div class="text clickable">
<i
ng-if="item.migrate && item.repo"
ng-click="showMigration(item)"
tooltip-placement="bottom"
tooltip="Migrate Repository"
class="octicon octicon-alert"
></i>
<i
ng-if="item.migrate && item.org"
ng-click="showOrganizationMigration(item)"
tooltip-placement="bottom"
tooltip="Migrate Organization"
class="octicon octicon-alert"
></i>
<a ng-if="item.repo" ng-href="https://github.com/{{ item.owner }}/{{ item.repo }}" target="space">
<i class="octicon" ng-class="{false:'octicon-repo', true:'octicon-repo-forked'}[item.fork]"></i> &nbsp;
<i ng-if="!item.migrate" class="octicon" ng-class="{false:'octicon-repo', true:'octicon-repo-forked'}[item.fork]"></i>
&nbsp;
{{ item.owner }} / {{ item.repo }}
</a>
<a ng-if="item.org" ng-href="https://github.com/{{ item.org }}" target="space" tooltip-placement="bottom"
Expand Down

0 comments on commit 2243898

Please sign in to comment.