From ab64e4e97044feca3bb6e04298a4271fd0799e6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carles=20Barrob=C3=A9s?= Date: Fri, 24 May 2013 23:55:26 +0100 Subject: [PATCH 01/13] Add rudimentary story detail view --- deploystream/static/js/app.js | 6 ++++- deploystream/static/js/controllers.js | 30 +++++++++++++++++++++++ deploystream/static/partials/feature.html | 26 ++++++++++++++++++++ 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 deploystream/static/partials/feature.html diff --git a/deploystream/static/js/app.js b/deploystream/static/js/app.js index 2f80d5a..b8c9e11 100644 --- a/deploystream/static/js/app.js +++ b/deploystream/static/js/app.js @@ -1,4 +1,4 @@ -// global angular, FeatureListCtrl +// global angular, FeatureListCtrl, FeatureDetailCtrl 'use strict'; @@ -16,5 +16,9 @@ angular.module('deploystream', [ templateUrl: '/static/partials/features.html', controller: FeatureListCtrl }); + $routeProvider.when('/features/:featureId', { + templateUrl: '/static/partials/feature.html', + controller: FeatureDetailCtrl + }); }] ); diff --git a/deploystream/static/js/controllers.js b/deploystream/static/js/controllers.js index 0a0ec52..c78741e 100644 --- a/deploystream/static/js/controllers.js +++ b/deploystream/static/js/controllers.js @@ -11,4 +11,34 @@ function FeatureListCtrl($scope, Feature) { $scope.features = features; }); } + + +function FeatureDetailCtrl($scope, $routeParams, Feature) { + + var featureId = $routeParams.featureId; + var get_branch_data = function (repoBranches, repo) { + var branches = []; + var branchData = repoBranches[repo]; + for (var branch in branchData) { + branches.push({name: branch, data: branchData[branch]}); + } + return branches; + }; + + Feature.query('', function (features) { + $scope.features = features; + }); + + Feature.get({featureId: featureId}, function (feature) { + var repos = []; + var repoBranches = feature.branches; + for (var repo in repoBranches) { + repos.push({name: repo, branches: get_branch_data(repoBranches, repo)}); + } + $scope.feature = feature; + $scope.repos = repos; + }); +} + + //FeatureListCtrl.$inject = []; diff --git a/deploystream/static/partials/feature.html b/deploystream/static/partials/feature.html new file mode 100644 index 0000000..11276eb --- /dev/null +++ b/deploystream/static/partials/feature.html @@ -0,0 +1,26 @@ +

#{{feature.id}} {{feature.title}}

+ +

+ {{feature.project}} + {{feature.type}} +

+

+ Owner: {{feature.owner}} +

+ + + + + From 5d8bc98e464e6d4fbc80b9469a0c6aedcbf5b6e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carles=20Barrob=C3=A9s?= Date: Sat, 25 May 2013 21:43:14 +0100 Subject: [PATCH 02/13] Adjustments to properly display branch hierarchy --- deploystream/apps/feature/lib.py | 6 +-- deploystream/apps/feature/models.py | 2 + deploystream/apps/feature/views.py | 2 +- deploystream/static/js/controllers.js | 16 ++----- deploystream/static/js/services.js | 1 + deploystream/static/partials/feature.html | 55 ++++++++++++++-------- deploystream/static/partials/features.html | 2 +- 7 files changed, 46 insertions(+), 38 deletions(-) diff --git a/deploystream/apps/feature/lib.py b/deploystream/apps/feature/lib.py index 125e846..7fe7334 100644 --- a/deploystream/apps/feature/lib.py +++ b/deploystream/apps/feature/lib.py @@ -45,13 +45,13 @@ def get_feature_info(feature_provider, feature_id, providers): # First get feature info from the management provider planning_provider = providers[feature_provider] + feature_info = planning_provider.get_feature_info(feature_id) + feature = Feature(planning_provider, **feature_info) - feature = Feature(planning_provider, - **planning_provider.get_feature_info(feature_id)) # Then get any branch info from any source control providers for provider in providers[ISourceCodeControlProvider]: for branch_data in provider.get_repo_branches_involved( - feature_id, app.config['HIERARCHY_REGEXES']): + feature_id, app.config['HIERARCHY_REGEXES']): feature.add_branch(Branch(provider=provider, **branch_data)) # Use that branch info, along with configuration regexes to create a diff --git a/deploystream/apps/feature/models.py b/deploystream/apps/feature/models.py index 6cbf05d..19ce314 100644 --- a/deploystream/apps/feature/models.py +++ b/deploystream/apps/feature/models.py @@ -42,11 +42,13 @@ def __init__(self, provider, project, id, title, self._extras = kwargs self.branches = defaultdict(dict) + self.branch_list = [] self.trees = [] def add_branch(self, branch): assert isinstance(branch, Branch) self.branches[branch.repo_name][branch.branch_name] = branch + self.branch_list.append(branch) def create_hierarchy_trees(self): "Create hierarchy trees - one for each repo." diff --git a/deploystream/apps/feature/views.py b/deploystream/apps/feature/views.py index 28c7bd0..65f0d3e 100644 --- a/deploystream/apps/feature/views.py +++ b/deploystream/apps/feature/views.py @@ -30,7 +30,7 @@ def list_features(providers): return features -@app.route('/features//', methods=['GET']) +@app.route('/features/-', methods=['GET']) @needs_providers @as_json def view_feature(source_id, feature_id, providers): diff --git a/deploystream/static/js/controllers.js b/deploystream/static/js/controllers.js index c78741e..6c657b4 100644 --- a/deploystream/static/js/controllers.js +++ b/deploystream/static/js/controllers.js @@ -16,14 +16,6 @@ function FeatureListCtrl($scope, Feature) { function FeatureDetailCtrl($scope, $routeParams, Feature) { var featureId = $routeParams.featureId; - var get_branch_data = function (repoBranches, repo) { - var branches = []; - var branchData = repoBranches[repo]; - for (var branch in branchData) { - branches.push({name: branch, data: branchData[branch]}); - } - return branches; - }; Feature.query('', function (features) { $scope.features = features; @@ -31,12 +23,10 @@ function FeatureDetailCtrl($scope, $routeParams, Feature) { Feature.get({featureId: featureId}, function (feature) { var repos = []; - var repoBranches = feature.branches; - for (var repo in repoBranches) { - repos.push({name: repo, branches: get_branch_data(repoBranches, repo)}); - } + var branches = feature.branch_list; $scope.feature = feature; - $scope.repos = repos; + $scope.branches = branches; + $scope.root = 'develop'; }); } diff --git a/deploystream/static/js/services.js b/deploystream/static/js/services.js index f5d1635..1857586 100644 --- a/deploystream/static/js/services.js +++ b/deploystream/static/js/services.js @@ -11,6 +11,7 @@ angular.module('deploystream.services', ['ngResource']) .factory('Feature', function ($resource) { return $resource( '/features/:featureId', + //'/static/:featureId.json', {}, { query: { diff --git a/deploystream/static/partials/feature.html b/deploystream/static/partials/feature.html index 11276eb..2bbe9cf 100644 --- a/deploystream/static/partials/feature.html +++ b/deploystream/static/partials/feature.html @@ -1,26 +1,41 @@ -

#{{feature.id}} {{feature.title}}

+
-

- {{feature.project}} - {{feature.type}} -

-

- Owner: {{feature.owner}} -

+

+ + #{{feature.id}} + + {{feature.title}} +

+

+ {{feature.project}} + {{feature.type}} +

+

+ Owner: {{feature.owner}} +

+ +

Branches

+ - -
    -
  • - {{repo.name}} -
      -
    • -
    -
  • -
+
+

+ Loading... +

diff --git a/deploystream/static/partials/features.html b/deploystream/static/partials/features.html index 9fe8b8b..2b6b386 100644 --- a/deploystream/static/partials/features.html +++ b/deploystream/static/partials/features.html @@ -15,7 +15,7 @@

Features

#{{feature.id}} {{feature.type}} {{feature.owner}} - {{feature.title}} + {{feature.title}} (+) From 73eb225cd79a3ae68d7a0d278d37574b2c402499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carles=20Barrob=C3=A9s?= Date: Sat, 25 May 2013 21:46:12 +0100 Subject: [PATCH 03/13] Add a 'pretenders' local settings file --- config/local_settings_pretenders.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 config/local_settings_pretenders.py diff --git a/config/local_settings_pretenders.py b/config/local_settings_pretenders.py new file mode 100644 index 0000000..559ecd6 --- /dev/null +++ b/config/local_settings_pretenders.py @@ -0,0 +1,20 @@ +# Settings for pretenders projects + +GITHUB_CONFIG = { + 'organization': 'pretenders', +} + +# GIT_CONFIG = { +# 'feature_breakup_regex': "(?P[a-zA-Z]+)-?(?P[0-9]+)", +# 'branch_finder_template': ".*(?i){project}.*" +# } + +HIERARCHY_REGEXES = [ + 'master', + 'develop', + 'story/{FEATURE_ID}', + 'story/{FEATURE_ID}/[a-z_]*', + '{PARENT}[/_][a-z]*', + 'dev/{FEATURE_ID}/[a-z]*', + '{PARENT}[/_][a-z]*', +] From b4442037a40561c93bfcd313e216ab11cf756aef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carles=20Barrob=C3=A9s?= Date: Sat, 25 May 2013 22:04:07 +0100 Subject: [PATCH 04/13] Use master as root --- deploystream/static/js/controllers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploystream/static/js/controllers.js b/deploystream/static/js/controllers.js index 6c657b4..0d9759f 100644 --- a/deploystream/static/js/controllers.js +++ b/deploystream/static/js/controllers.js @@ -26,7 +26,7 @@ function FeatureDetailCtrl($scope, $routeParams, Feature) { var branches = feature.branch_list; $scope.feature = feature; $scope.branches = branches; - $scope.root = 'develop'; + $scope.root = 'master'; }); } From 53d9f79f8672c844f79183d84c6632d3839c35b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carles=20Barrob=C3=A9s?= Date: Tue, 23 Jul 2013 00:18:02 +0100 Subject: [PATCH 05/13] Playing with the front-end and JSON structure --- deploystream/static/font-awesome | 1 + deploystream/static/github-70.json | 101 ++++++++++++++++++++++ deploystream/static/js/controllers.js | 2 - deploystream/static/js/services.js | 5 +- deploystream/static/less/colours.less | 6 ++ deploystream/static/less/features.less | 26 ++++++ deploystream/static/less/font-awesome | 1 - deploystream/static/less/site.less | 8 +- deploystream/static/partials/feature.html | 20 ++--- deploystream/templates/base.html | 1 + 10 files changed, 152 insertions(+), 19 deletions(-) create mode 120000 deploystream/static/font-awesome create mode 100644 deploystream/static/github-70.json create mode 100644 deploystream/static/less/features.less delete mode 120000 deploystream/static/less/font-awesome diff --git a/deploystream/static/font-awesome b/deploystream/static/font-awesome new file mode 120000 index 0000000..8a3fd51 --- /dev/null +++ b/deploystream/static/font-awesome @@ -0,0 +1 @@ +../../components/font-awesome/ \ No newline at end of file diff --git a/deploystream/static/github-70.json b/deploystream/static/github-70.json new file mode 100644 index 0000000..5257ed8 --- /dev/null +++ b/deploystream/static/github-70.json @@ -0,0 +1,101 @@ +{ + "description": "", + "title": "Ability to view the branch hierarchy for a feature, and what is merged into what.", + "url": "https://github.com/pretenders/deploystream/issues/70", + "project": "pretenders/deploystream", + "owner": "", + "provider": "github", + "type": "story", + "id": 70, + "repositories": [ + { + "name": "deploystream", + "branches": [ + { + "latest_commit": "9770a5e", + "branch_name": "master", + "health": { + "status": "green", + "details": [ + { + "type": "build", + "provider": "travis-ci", + "status": "green", + "url": "https://travis-ci.org/pretenders/deploystream/builds/8604410" + } + ] + }, + "children": [ + { + "latest_commit": "dfa9217", + "branch_name": "develop", + "health": { + "status": "green", + "details": [ + { + "type": "build", + "provider": "travis-ci", + "status": "green", + "url": "https://travis-ci.org/pretenders/deploystream/builds/8604410" + } + ] + }, + "children": [ + { + "latest_commit": "98457ab", + "branch_name": "story/70/alex", + "health": { + "status": "red", + "details": [ + { + "type": "build", + "provider": "travis-ci", + "status": "red", + "url": "https://travis-ci.org/pretenders/deploystream/builds/8604410" + } + ] + }, + "children": [ + { + "latest_commit": "5719681", + "branch_name": "dev/70/alex", + "repo_name": "deploystream", + "health": { + "status": "unknown", + "details": [ + { + "type": "build", + "provider": "travis-ci", + "status": "unknown", + "url": "https://travis-ci.org/pretenders/deploystream/builds/8604410" + } + ] + }, + "children": [] + }, + { + "latest_commit": "aace02c", + "branch_name": "dev/70/carles", + "health": { + "status": "yellow", + "details": [ + { + "type": "build", + "provider": "travis-ci", + "status": "yellow", + "url": "https://travis-ci.org/pretenders/deploystream/builds/8604410" + } + ] + }, + "children": [] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/deploystream/static/js/controllers.js b/deploystream/static/js/controllers.js index 0d9759f..4e44921 100644 --- a/deploystream/static/js/controllers.js +++ b/deploystream/static/js/controllers.js @@ -23,9 +23,7 @@ function FeatureDetailCtrl($scope, $routeParams, Feature) { Feature.get({featureId: featureId}, function (feature) { var repos = []; - var branches = feature.branch_list; $scope.feature = feature; - $scope.branches = branches; $scope.root = 'master'; }); } diff --git a/deploystream/static/js/services.js b/deploystream/static/js/services.js index 1857586..b2c4ede 100644 --- a/deploystream/static/js/services.js +++ b/deploystream/static/js/services.js @@ -10,13 +10,12 @@ angular.module('deploystream.services', ['ngResource']) .value('version', '0.1') .factory('Feature', function ($resource) { return $resource( - '/features/:featureId', - //'/static/:featureId.json', + //'/features/:featureId', + '/static/:featureId.json', {}, { query: { method: 'GET', - params: {featureId: ''}, isArray: true } }); diff --git a/deploystream/static/less/colours.less b/deploystream/static/less/colours.less index b023896..ab0ede5 100644 --- a/deploystream/static/less/colours.less +++ b/deploystream/static/less/colours.less @@ -35,3 +35,9 @@ @altDarkBackground: darken(@color5, 30%); @btnPrimaryColor: @color5; +@secondaryTitle: @color5; + +@statusGreen: @color1; +@statusRed: @color4; +@statusYellow: @yellow; +@statusUnknown: #888; diff --git a/deploystream/static/less/features.less b/deploystream/static/less/features.less new file mode 100644 index 0000000..774bf45 --- /dev/null +++ b/deploystream/static/less/features.less @@ -0,0 +1,26 @@ +.repo { + h4 { + font-size: 140%; + color: @secondaryTitle; + } + ul { + margin-top: 10px; + list-style: none; + } +} + +.health-green { + color: @statusGreen; +} + +.health-yellow { + color: @statusYellow; +} + +.health-red { + color: @statusRed; +} + +.health-unknown { + color: @statusUnknown; +} diff --git a/deploystream/static/less/font-awesome b/deploystream/static/less/font-awesome deleted file mode 120000 index a45a4c5..0000000 --- a/deploystream/static/less/font-awesome +++ /dev/null @@ -1 +0,0 @@ -../../../components/font-awesome/less/ \ No newline at end of file diff --git a/deploystream/static/less/site.less b/deploystream/static/less/site.less index 70c429c..a0a4034 100644 --- a/deploystream/static/less/site.less +++ b/deploystream/static/less/site.less @@ -12,9 +12,6 @@ @import "variables.less"; @import "bootstrap-modules.less"; -// Iconic font-awesome -@import "font-awesome/font-awesome.less"; - // Custom Site-wide styles @@ -140,3 +137,8 @@ body { height: 16px; background-image: url("../img/loading.gif"); } + + +// TODO: structure properly... + +@import "features.less"; diff --git a/deploystream/static/partials/feature.html b/deploystream/static/partials/feature.html index 2bbe9cf..fc1e433 100644 --- a/deploystream/static/partials/feature.html +++ b/deploystream/static/partials/feature.html @@ -1,4 +1,4 @@ -
+

diff --git a/deploystream/templates/base.html b/deploystream/templates/base.html index e36bb90..6805a53 100644 --- a/deploystream/templates/base.html +++ b/deploystream/templates/base.html @@ -16,6 +16,7 @@ + {% block extrahead %} From 8f90e16644ff01825d86d5b54198a80c09d238c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carles=20Barrob=C3=A9s?= Date: Tue, 23 Jul 2013 00:21:27 +0100 Subject: [PATCH 06/13] Add 'tool' icon --- deploystream/static/partials/feature.html | 1 + 1 file changed, 1 insertion(+) diff --git a/deploystream/static/partials/feature.html b/deploystream/static/partials/feature.html index fc1e433..0f00ab4 100644 --- a/deploystream/static/partials/feature.html +++ b/deploystream/static/partials/feature.html @@ -20,6 +20,7 @@

Branches

+ {{branch.branch_name}} {{branch.latest_commit}}

From 9405ff3d9546ec9804f4519b503109e0b2ab41cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carles=20Barrob=C3=A9s?= Date: Tue, 23 Jul 2013 21:23:27 +0100 Subject: [PATCH 07/13] Add an additional component/repo to the example --- deploystream/static/github-70.json | 39 +++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/deploystream/static/github-70.json b/deploystream/static/github-70.json index 5257ed8..5934d07 100644 --- a/deploystream/static/github-70.json +++ b/deploystream/static/github-70.json @@ -43,7 +43,7 @@ "children": [ { "latest_commit": "98457ab", - "branch_name": "story/70/alex", + "branch_name": "story/70/view-hierarchy", "health": { "status": "red", "details": [ @@ -96,6 +96,43 @@ ] } ] + }, + { + "name": "somecomponent", + "branches": [ + { + "latest_commit": "7923a5e", + "branch_name": "develop", + "health": { + "status": "green", + "details": [ + { + "type": "build", + "provider": "travis-ci", + "status": "green", + "url": "https://travis-ci.org/pretenders/deploystream/builds/8604410" + } + ] + }, + "children": [ + { + "latest_commit": "e3457ab", + "branch_name": "story/70/view-hierarchy", + "health": { + "status": "green", + "details": [ + { + "type": "build", + "provider": "travis-ci", + "status": "red", + "url": "https://travis-ci.org/pretenders/deploystream/builds/8604410" + } + ] + } + } + ] + } + ] } ] } From e62effc1af6ac699531b46ccc7dd36e6ad9a9bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carles=20Barrob=C3=A9s?= Date: Sun, 28 Jul 2013 23:40:56 +0100 Subject: [PATCH 08/13] Additional styling for feature detail page --- deploystream/static/github-70.json | 2 +- deploystream/static/less/features.less | 27 ++++++++++++++++++ deploystream/static/less/site.less | 2 +- deploystream/static/partials/feature.html | 34 +++++++++++------------ scripts/watch-less.sh | 4 --- 5 files changed, 46 insertions(+), 23 deletions(-) delete mode 100755 scripts/watch-less.sh diff --git a/deploystream/static/github-70.json b/deploystream/static/github-70.json index 5934d07..a96579d 100644 --- a/deploystream/static/github-70.json +++ b/deploystream/static/github-70.json @@ -3,7 +3,7 @@ "title": "Ability to view the branch hierarchy for a feature, and what is merged into what.", "url": "https://github.com/pretenders/deploystream/issues/70", "project": "pretenders/deploystream", - "owner": "", + "owner": "alexcouper", "provider": "github", "type": "story", "id": 70, diff --git a/deploystream/static/less/features.less b/deploystream/static/less/features.less index 774bf45..a8c0ebd 100644 --- a/deploystream/static/less/features.less +++ b/deploystream/static/less/features.less @@ -1,7 +1,34 @@ +.feature { + header { + border-bottom: 1px solid @grayLight; + margin-bottom: 20px; + .box-shadow(0 10px 8px -8px @grayLight); + p { + float: right; + font-size: 80%; + font-weight: normal; + font-style: italic; + font-family: @baseFontFamily; + margin-top: 8px; + .opacity(70); + } + } +} .repo { + margin-top: 8px; h4 { + min-width: 150px; + float: left; font-size: 140%; color: @secondaryTitle; + text-align: right; + clear: left; + } + .branches { + float: left; + border-left: 6px solid @secondaryTitle; + padding-left: 8px; + margin-left: 8px; } ul { margin-top: 10px; diff --git a/deploystream/static/less/site.less b/deploystream/static/less/site.less index a0a4034..4bd7c7b 100644 --- a/deploystream/static/less/site.less +++ b/deploystream/static/less/site.less @@ -49,7 +49,7 @@ body { height: auto !important; height: 100%; /* Negative indent footer by it's height */ - margin: 0 auto -120px; + margin: 0 auto -154px; } /* Set the fixed height of the footer here */ diff --git a/deploystream/static/partials/feature.html b/deploystream/static/partials/feature.html index 0f00ab4..1198975 100644 --- a/deploystream/static/partials/feature.html +++ b/deploystream/static/partials/feature.html @@ -1,22 +1,22 @@
-

- - #{{feature.id}} - - {{feature.title}} -

+
+

+ + #{{feature.id}} + + {{feature.title}} +

-

- {{feature.project}} - {{feature.type}} -

-

- Owner: {{feature.owner}} -

+

+ {{feature.project}} + {{feature.type}} + {{feature.owner}} +

+
-

Branches

-
-

{{repo.name}}

-
    +
    +

    {{repo.name}}

    +
    diff --git a/scripts/watch-less.sh b/scripts/watch-less.sh deleted file mode 100755 index dc0d8e7..0000000 --- a/scripts/watch-less.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -# Dynamically compile site.less when LESS files in 'less' folder change - -recess less/site.less:css/site.css --watch less/ From d72b156b7ea65cfcce0bf06481ce7c8d6587aa10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carles=20Barrob=C3=A9s?= Date: Mon, 29 Jul 2013 23:24:12 +0100 Subject: [PATCH 09/13] Add example of branch tools and health indicators dropdowns --- deploystream/static/github-70.json | 20 ++++++++++++++++++-- deploystream/static/js/controllers.js | 1 - deploystream/static/js/directives.js | 22 ++++++++++++++++++---- deploystream/static/less/features.less | 23 +++++++++++++++++++++++ deploystream/static/partials/feature.html | 19 +++++++++++++++---- 5 files changed, 74 insertions(+), 11 deletions(-) diff --git a/deploystream/static/github-70.json b/deploystream/static/github-70.json index a96579d..729a04f 100644 --- a/deploystream/static/github-70.json +++ b/deploystream/static/github-70.json @@ -32,12 +32,17 @@ "health": { "status": "green", "details": [ - { + { "type": "build", "provider": "travis-ci", "status": "green", "url": "https://travis-ci.org/pretenders/deploystream/builds/8604410" - } + }, + { + "type": "relevant", + "provider": "git", + "status": "green" + } ] }, "children": [ @@ -52,6 +57,17 @@ "provider": "travis-ci", "status": "red", "url": "https://travis-ci.org/pretenders/deploystream/builds/8604410" + }, + { + "type": "relevant", + "provider": "git", + "status": "green" + }, + { + "type": "updated", + "provider": "git", + "status": "yellow", + "message": "this branch is not up to date with develop" } ] }, diff --git a/deploystream/static/js/controllers.js b/deploystream/static/js/controllers.js index 4e44921..a6a08dc 100644 --- a/deploystream/static/js/controllers.js +++ b/deploystream/static/js/controllers.js @@ -22,7 +22,6 @@ function FeatureDetailCtrl($scope, $routeParams, Feature) { }); Feature.get({featureId: featureId}, function (feature) { - var repos = []; $scope.feature = feature; $scope.root = 'master'; }); diff --git a/deploystream/static/js/directives.js b/deploystream/static/js/directives.js index 6424c97..f8000b5 100644 --- a/deploystream/static/js/directives.js +++ b/deploystream/static/js/directives.js @@ -1,4 +1,4 @@ -// global angular +/* global angular */ 'use strict'; /* Directives */ @@ -6,7 +6,21 @@ angular.module('deploystream.directives', []) .directive('appVersion', ['version', function (version) { - return function (scope, elm, attrs) { - elm.text(version); + return function ($scope, $element) { + $element.text(version); }; -}]); +}]) +.directive('featureHealth', function() { + return function($scope, $element) { + $scope.$watch('branch', function(branch) { + var health = branch.health.details; + console.log($element); + $($element).popover({ + placement: 'bottom', + trigger: 'hover', + html: false, + content: JSON.stringify(health) + }); + }); + }; +}); diff --git a/deploystream/static/less/features.less b/deploystream/static/less/features.less index a8c0ebd..839b215 100644 --- a/deploystream/static/less/features.less +++ b/deploystream/static/less/features.less @@ -29,11 +29,33 @@ border-left: 6px solid @secondaryTitle; padding-left: 8px; margin-left: 8px; + .popover-content { + padding: 0; + } + .dropdown { + display: inline; + } + .dropdown-menu { + left: -18px; + width: 220px; + font-size: 90%; + padding: 8px 0; + li { + padding: 0 16px; + &:hover { + background-color: @linkColor; + color: @white; + } + } + } } ul { margin-top: 10px; list-style: none; } + .tool:hover { + color: @linkColor; + } } .health-green { @@ -51,3 +73,4 @@ .health-unknown { color: @statusUnknown; } + diff --git a/deploystream/static/partials/feature.html b/deploystream/static/partials/feature.html index 1198975..acdb038 100644 --- a/deploystream/static/partials/feature.html +++ b/deploystream/static/partials/feature.html @@ -17,18 +17,29 @@

    + +

    {{repo.name}}

      From 869d8c6e9a76f62ce44688ba40c054e37c1637d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carles=20Barrob=C3=A9s?= Date: Tue, 30 Jul 2013 22:44:33 +0100 Subject: [PATCH 10/13] Health indicator details as dropdown, in HTML instead of JS --- deploystream/static/js/directives.js | 18 +++-------------- deploystream/static/less/features.less | 24 +++++++++++++++++++++-- deploystream/static/partials/feature.html | 10 +++++++++- 3 files changed, 34 insertions(+), 18 deletions(-) diff --git a/deploystream/static/js/directives.js b/deploystream/static/js/directives.js index f8000b5..eb4c097 100644 --- a/deploystream/static/js/directives.js +++ b/deploystream/static/js/directives.js @@ -9,18 +9,6 @@ angular.module('deploystream.directives', []) return function ($scope, $element) { $element.text(version); }; -}]) -.directive('featureHealth', function() { - return function($scope, $element) { - $scope.$watch('branch', function(branch) { - var health = branch.health.details; - console.log($element); - $($element).popover({ - placement: 'bottom', - trigger: 'hover', - html: false, - content: JSON.stringify(health) - }); - }); - }; -}); +}]); +// .directive('featureHealth', function() { +// }); diff --git a/deploystream/static/less/features.less b/deploystream/static/less/features.less index 839b215..fcd96e4 100644 --- a/deploystream/static/less/features.less +++ b/deploystream/static/less/features.less @@ -43,10 +43,30 @@ li { padding: 0 16px; &:hover { - background-color: @linkColor; - color: @white; + background-color: @grayLighter; } } + &:before { + content: ''; + position: absolute; + top: -7px; + left: 15px; + display: inline-block; + border-left: 7px solid transparent; + border-right: 7px solid transparent; + border-bottom: 7px solid #ccc; + border-bottom-color: rgba(0, 0, 0, 0.2); + } + &:after { + content: ''; + position: absolute; + top: -6px; + left: 16px; + display: inline-block; + border-right: 6px solid transparent; + border-bottom: 6px solid white; + border-left: 6px solid transparent; + } } } ul { diff --git a/deploystream/static/partials/feature.html b/deploystream/static/partials/feature.html index acdb038..a561a61 100644 --- a/deploystream/static/partials/feature.html +++ b/deploystream/static/partials/feature.html @@ -19,7 +19,15 @@

      - +