Skip to content

Fix manual provider setup #763

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 5 additions & 1 deletion client/projects/controllers/manual.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ var $ = require('jquery');

module.exports = function ($scope, $attrs) {
var provider = $attrs.id.split('-')[1];
$scope.config = {};
$scope.config = {
auth: {
type: 'none'
}
};
$scope.projects = global.manualProjects[provider] || [];
$scope.remove = function (project) {
project.really_remove = 'removing';
Expand Down
90 changes: 90 additions & 0 deletions lib/views/partials/git-manual.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<div class="tab-pane" id="manual-setup">
{% for item in manual %}
<div id="manual-{{ loop.key }}" ng-controller="ManualController">
<form name="create{{ loop.key }}">
<h3>{{ item.provider.title }}</h3>
<div class="row-fluid">
<div class="general span6">
<p>
<label for="manual-display-url" class="bold-label">Link To Repository</label>
<input id="manual-display-url" type="text" ng-model="display_url" placeholder="Display Url"><br>
<small>Provides a link in the UI so you can easily jump to viewing the project's repository wherever it's hosted.</small>
</p>

<p>
<label for="manual-namespace" class="bold-label">Project Namespace (required)</label>
<input id="manual-namespace" type="text" required ng-pattern="/[\w-]\/[\w-]/" ng-model="display_name" placeholder="Name"><br>
<small>A Github-style namespace/name combination for the project. e.g. Strider-CD/strider</small>
</p>

<p>
<label class="checkbox">
<input id="manual-public" type="checkbox" ng-model="public">
Public project
</label>
<small>Public projects are visible to unauthenticated users.</small>
</p>
</div>

<div class="provider-specific span6">
{{ item.provider.html | raw }}
</div>
</div>
<button ng-disabled="!create{{ loop.key }}.$valid" class="btn btn-primary" ng-click="create()">Create New</button>
</form>
<ul class="unstyled repo-list">
<li class="repo" ng-repeat="project in projects">
<div>
<a ng-show="project.display_url" href="[[ project.display_url ]]" target="_blank" class="hosted-url">
<i class="fa fa-globe"></i>
</a>

<a class="view-jobs" href="/[[ project.name ]]/">[[ project.display_name ]]</a>

<div class="pull-right">
<button ng-show="project.really_remove" class="btn btn-danger" ng-click="remove(project)" ng-disabled="project.really_remove === 'removing'">
<i class="fa fa-refresh fa-spin" ng-show="project.really_remove === 'removing'"></i>
Really remove
</button>
<a href="/[[ project.name ]]/config" data-toggle="tooltip" title="Configure"><i class="fa fa-wrench"></i></a>
<button class="btn btn-danger" ng-click="project.really_remove = true" ng-disabled="project.really_remove">Remove</button>
<button ng-disabled="repo.adding" class="btn btn-primary" ng-click="repo.adding = 'pick-type'">Add</button>
</div>
<!--
<div class="adding-repo pull-right" ng-show="repo.adding" ng-switch="repo.adding">
<div class="pick-type" ng-switch-when="pick-type">
<span class="text">What type of project?</span>
{% for type in project_types %}
<div data-toggle="tooltip"
data-placement="bottom"
title="{{ type.description }}"
class="project-type btn"
ng-click="repo.adding = 'loading'; setupProject(account, repo, '{{ loop.key }}', group)">
{{ loop.key }}
</div>
{% endfor %}
</div>
<div ng-switch-when="loading" class="setting-up">
<span class="text">
Setting up
<i class="fa fa-refresh fa-spin"></i>
</span>
</div>
<div ng-switch-when="done">
<button type="button" class="close" ng-click="repo.adding=false">&times;</button>
<span class="text">Complete!</span>
<div class="btn btn-success" ng-click="startTest(repo)">
Start the first test
</div>
<a class="btn" href="/[[ repo.project.name ]]/config">
Configure
</a>
</div>
</div>
-->
</div>
</li>
</ul>
</div>
{% endfor %}
</div>
65 changes: 8 additions & 57 deletions lib/views/projects.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
</script>
{% endpluginblock %}


{% block bodyContent %}
<h3>Projects</h3>

Expand Down Expand Up @@ -48,12 +47,13 @@ <h3>Projects</h3>
{% endfor %}
</ul>
</div>
<div class="notify-wrapper pull-right">
<div id="notify" ng-class="{ visible: message.showing }" class="alert alert-[[ message.type ]]">
<a type="button" class="close" ng-click="clearMessage()">&times;</a>
<div class="message" ng-bind-html="message.text"></div>
</div>

<div class="notify-wrapper pull-right">
<div id="notify" ng-class="{ visible: message.showing }" class="alert alert-[[ message.type ]]">
<a type="button" class="close" ng-click="clearMessage()">&times;</a>
<div class="message" ng-bind-html="message.text"></div>
</div>
</div>

<div class="tab-content" ng-controller="ProjectsController">
<div ng-repeat="account in accounts" id="account-[[ account.provider ]]-[[ account.id ]]" class="tab-pane" ng-class="{ active: $first }">
Expand Down Expand Up @@ -151,57 +151,8 @@ <h3>Projects</h3>
</ul>
</div>
</div>
<div class="tab-pane" id="manual-setup">
{% for item in manual %}
<div id="manual-{{ loop.key }}" ng-controller="ManualController">
<form name="create{{ loop.key }}">
<h3>{{ item.provider.title }}</h3>
<div class="general">
<p>
<small>Public projects are visible to unauthenticated users.</small>
<div ng-model="public" class="btn public-btn" btn-checkbox>Public</div>
</p>

<p>
<small>Provides a link in the UI if you put a url there, so you can easily jump to viewing the repo on github or wherever</small>
<br/>
<input type="text" ng-model="display_url" placeholder="Display Url">
</p>

<p>
<small>A github-style namespace/name combination for the project. e.g. Strider-CD/strider</small>
<br/>
<input type="text" required ng-pattern="/[\w-]\/[\w-]/" ng-model="display_name" placeholder="Name">
</p>
</div>

<div class="provider-specific">
{{ item.provider.html | raw }}
</div>
<button ng-disabled="!create{{ loop.key }}.$valid" class="btn btn-primary" ng-click="create()">Create New</button>
</form>
<ul class="unstyled repo-list">
<li class="repo" ng-repeat="project in projects">
<div>
<a ng-show="project.display_url" href="[[ project.display_url ]]" target="_blank" class="hosted-url">
<i class="fa fa-globe"></i>
</a>
<a class="view-jobs" href="/[[ project.name ]]/">[[ project.display_name ]]</a>
<div class="pull-right">
<button ng-show="project.really_remove" class="btn btn-danger" ng-click="remove(project)" ng-disabled="project.really_remove === 'removing'">
<i class="fa fa-refresh fa-spin" ng-show="project.really_remove === 'removing'"></i>
Really remove
</button>
<a href="/[[ project.name ]]/config" data-toggle="tooltip" title="Configure"><i class="fa fa-wrench"></i></a>
<button class="btn btn-danger" ng-click="project.really_remove = true" ng-disabled="project.really_remove">Remove</button>
<button ng-disabled="repo.adding" class="btn btn-primary" ng-click="repo.adding = 'pick-type'">Add</button>
</div>
</div>
</li>
</ul>
</div>
{% endfor %}
</div>

{% include "partials/git-manual.html" %}
</div>
</div>
{% endblock %}
35 changes: 17 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@
},
"main": "main.js",
"description": "Brilliant continuous deployment platform",
"scripts": {
"test": "make test",
"start": "bin/strider",
"dev": "npm run build-debug && bin/strider",
"blanket": {
"pattern": "lib",
"data-cover-never": "node_modules"
},
"pre": "mkdirp dist/scripts dist/styles",
"styles": "lessc client/styles/strider.less > dist/styles/styles.css",
"styles-debug": "lessc --source-map client/styles/strider.less dist/styles/styles.css",
"watch": "npm run pre && watchify -e client/app.js -o dist/scripts/app.js",
"build": "npm run pre && npm run styles && browserify -e client/app.js -o dist/scripts/app.js",
"build-debug": "npm run pre && npm run styles-debug && browserify -d -e client/app.js -o dist/scripts/app.js",
"unitcov": "istanbul cover _mocha --recursive test/unit",
"unitdev": "mocha -w --recursive test/unit -R min"
},
"keywords": [
"strider",
"continuous integration",
Expand Down Expand Up @@ -38,24 +55,6 @@
"browserify-shim"
]
},
"scripts": {
"test": "make test",
"start": "bin/strider",
"dev": "npm run build-debug && bin/strider",
"blanket": {
"pattern": "lib",
"data-cover-never": "node_modules"
},
"pre": "mkdirp dist/scripts dist/styles",
"vendor": "bower-installer",
"styles": "lessc client/styles/strider.less > dist/styles/styles.css",
"styles-debug": "lessc --source-map client/styles/strider.less dist/styles/styles.css",
"watch": "npm run pre && watchify -e client/app.js -o dist/scripts/app.js",
"build": "npm run pre && npm run styles && browserify -e client/app.js -o dist/scripts/app.js",
"build-debug": "npm run pre && npm run styles-debug && browserify -d -e client/app.js -o dist/scripts/app.js",
"unitcov": "istanbul cover _mocha --recursive test/unit",
"unitdev": "mocha -w --recursive test/unit -R min"
},
"dependencies": {
"MD5": "^1.2.1",
"ansiparse": "0.0.5-1",
Expand Down