UI fixes for all the new trigger stuff
This commit is contained in:
parent
de29a441c8
commit
b7317f894b
25 changed files with 260 additions and 149 deletions
28
static/css/directives/ui/setup-trigger-dialog.css
Normal file
28
static/css/directives/ui/setup-trigger-dialog.css
Normal file
|
@ -0,0 +1,28 @@
|
|||
.setup-trigger-directive-element .dockerfile-found-content {
|
||||
margin-left: 32px;
|
||||
}
|
||||
|
||||
.setup-trigger-directive-element .dockerfile-found-content:before {
|
||||
content: "\f071";
|
||||
font-family: FontAwesome;
|
||||
color: rgb(255, 194, 0);
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.setup-trigger-directive-element .loading {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.setup-trigger-directive-element .loading .cor-loader-inline {
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.setup-trigger-directive-element .dockerfile-found {
|
||||
position: relative;
|
||||
margin-bottom: 16px;
|
||||
padding-bottom: 16px;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
|
@ -1,8 +1,42 @@
|
|||
.source-commit-link-element .fa {
|
||||
margin-right: 4px;
|
||||
.source-commit-link-element .commit-circle {
|
||||
margin-right: 6px;
|
||||
display: inline-block;
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
.source-commit-link-element .commit-circle {
|
||||
display: inline-block;
|
||||
border: 2px solid #999;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 50%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.source-commit-link-element .commit-circle:before,
|
||||
.source-commit-link-element .commit-circle:after {
|
||||
content: "";
|
||||
display: inline-block;
|
||||
border-top: 2px solid #999;
|
||||
height: 10px;
|
||||
width: 4px;
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
.source-commit-link-element .commit-circle:before {
|
||||
left: -5px;
|
||||
}
|
||||
|
||||
.source-commit-link-element .commit-circle:after {
|
||||
left: 7px;
|
||||
}
|
||||
|
||||
|
||||
.source-commit-link-element {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.source-commit-link-element .anchor {
|
||||
vertical-align: middle;
|
||||
}
|
9
static/css/directives/ui/step-view-step.css
Normal file
9
static/css/directives/ui/step-view-step.css
Normal file
|
@ -0,0 +1,9 @@
|
|||
.step-view-step-content .loading-message {
|
||||
position: relative;
|
||||
text-align: center;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.step-view-step-content .loading-message .cor-loader-inline {
|
||||
margin-right: 6px;
|
||||
}
|
|
@ -42,7 +42,7 @@
|
|||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.trigger-setup-githost-element li.repo-listing i {
|
||||
.trigger-setup-githost-element li.host-repo-listing i {
|
||||
margin-right: 10px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
|
|
|
@ -10,9 +10,8 @@
|
|||
.triggered-build-description-element .commit-who img {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-left: 2px;
|
||||
margin-left: 4px;
|
||||
margin-right: 2px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.triggered-build-description-element .fa-github {
|
||||
|
|
|
@ -3768,27 +3768,6 @@ pre.command:before {
|
|||
border-bottom-left-radius: 0px;
|
||||
}
|
||||
|
||||
.setup-trigger-directive-element .dockerfile-found-content {
|
||||
margin-left: 32px;
|
||||
}
|
||||
|
||||
.setup-trigger-directive-element .dockerfile-found-content:before {
|
||||
content: "\f071";
|
||||
font-family: FontAwesome;
|
||||
color: rgb(255, 194, 0);
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.setup-trigger-directive-element .dockerfile-found {
|
||||
position: relative;
|
||||
margin-bottom: 16px;
|
||||
padding-bottom: 16px;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
.slideinout {
|
||||
-webkit-transition:0.5s all;
|
||||
transition:0.5s linear all;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<span class="anchor-element">
|
||||
<a ng-href="{{ href }}" ng-show="href && !isOnlyText"><span ng-transclude></span></a>
|
||||
<a ng-href="{{ href }}" ng-show="href && !isOnlyText" target="{{ target }}"><span ng-transclude></span></a>
|
||||
<span ng-show="!href || isOnlyText"><span ng-transclude></span></span>
|
||||
</span>
|
||||
|
|
|
@ -54,7 +54,6 @@
|
|||
style="min-width: 66px;">
|
||||
<a href="javascript:void(0)" ng-click="orderBy('tags')">Tags</a>
|
||||
</td>
|
||||
<td class="options-col hidden-xs"></td>
|
||||
</thead>
|
||||
|
||||
<tr ng-repeat="build in fullBuilds">
|
||||
|
@ -139,6 +138,7 @@
|
|||
<td>{{ trigger.config.branchtag_regex || 'All' }}</td>
|
||||
<td>
|
||||
<span class="entity-reference" entity="trigger.pull_robot" ng-if="trigger.pull_robot"></span>
|
||||
<span class="empty" ng-if="!trigger.pull_robot">(None)</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="cor-options-menu">
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<div class="setup-trigger-directive-element">
|
||||
|
||||
<!-- Modal message dialog -->
|
||||
<div class="modal fade" id="setupTriggerModal">
|
||||
<div class="modal-dialog">
|
||||
|
@ -8,8 +7,8 @@
|
|||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">Setup new build trigger</h4>
|
||||
</div>
|
||||
<div class="modal-body" ng-show="currentView == 'activating'">
|
||||
<span class="quay-spinner"></span> Setting up trigger...
|
||||
<div class="modal-body loading" ng-show="currentView == 'activating'">
|
||||
<span class="cor-loader-inline"></span> Setting up trigger...
|
||||
</div>
|
||||
<div class="modal-body" ng-show="currentView != 'activating'">
|
||||
<!-- Trigger-specific setup -->
|
||||
|
@ -34,8 +33,8 @@
|
|||
</div>
|
||||
|
||||
<!-- Loading pull information -->
|
||||
<div ng-show="currentView == 'analyzing'">
|
||||
<span class="quay-spinner"></span> Checking pull credential requirements...
|
||||
<div ng-show="currentView == 'analyzing'" class="loading">
|
||||
<span class="cor-loader-inline"></span> Checking pull credential requirements...
|
||||
</div>
|
||||
|
||||
<!-- Pull information -->
|
||||
|
@ -125,7 +124,7 @@
|
|||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="modal-footer" ng-show="currentView != 'activating'">
|
||||
<button type="button" class="btn btn-primary" ng-disabled="!state.stepValid"
|
||||
ng-click="nextStepCounter = nextStepCounter + 1"
|
||||
ng-show="currentView == 'config'">Next</button>
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
<span class="source-commit-link-elememt">
|
||||
<i class="fa fa-dot-circle-o" data-title="Commit" data-container="body" bs-tooltip></i>
|
||||
<span class="anchor" href="getUrl(commitSha, urlTemplate)" target="_blank" is-only-text="!urlTemplate">
|
||||
{{ commitSha.substring(0, 8) }}
|
||||
<span class="source-commit-link-element">
|
||||
<soan class="commit-circle-container" data-title="Commit" data-container="body" bs-tooltip>
|
||||
<span class="commit-circle"></span>
|
||||
</span>
|
||||
<span class="anchor" href="{{ getUrl(commitSha, urlTemplate) }}" target="_blank"
|
||||
is-only-text="!urlTemplate">
|
||||
{{ commitSha.substring(0, 8) }}
|
||||
</span>
|
||||
</span>
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
<!-- Branch -->
|
||||
<span ng-switch-when="heads">
|
||||
<i class="fa fa-code-fork" data-container="body" data-title="Branch" bs-tooltip></i>
|
||||
<span href="getUrl(ref, branchTemplate, 'branch')" is-only-text="!branchTemplate" target="_blank">{{ getTitle(ref) }}</span>
|
||||
<span class="anchor" href="{{ getUrl(ref, branchTemplate, 'branch') }}" is-only-text="!branchTemplate" target="_blank">{{ getTitle(ref) }}</span>
|
||||
</span>
|
||||
|
||||
<!-- Tag -->
|
||||
<span ng-switch-when="tags">
|
||||
<i class="fa fa-tag" data-container="body" data-title="Tag" bs-tooltip></i>
|
||||
<span href="getUrl(ref, tagTemplate, 'tag')" is-only-text="!tagTemplate" target="_blank">{{ getTitle(ref) }}</span>
|
||||
<span class="anchor" href="{{ getUrl(ref, tagTemplate, 'tag') }}" is-only-text="!tagTemplate" target="_blank">{{ getTitle(ref) }}</span>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<span class="step-view-step-content">
|
||||
<span ng-show="!loading">
|
||||
<span ng-transclude></span>
|
||||
</span>
|
||||
<span ng-show="loading">
|
||||
<span class="quay-spinner"></span>
|
||||
<div class="step-view-step-content">
|
||||
<div ng-show="!loading">
|
||||
<div ng-transclude></div>
|
||||
</div>
|
||||
<div ng-show="loading" class="loading-message">
|
||||
<span class="cor-loader-inline"></span>
|
||||
{{ loadMessage }}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -8,17 +8,12 @@
|
|||
</td>
|
||||
<td>
|
||||
<div class="current-repo">
|
||||
<i class="dropdown-select-icon org-icon fa" ng-class="'fa-' + kind"
|
||||
ng-show="!state.currentRepo.avatar_url"></i>
|
||||
<img class="dropdown-select-icon org-icon"
|
||||
ng-src="{{ state.currentRepo.avatar_url ? state.currentRepo.avatar_url : '/static/img/empty.png' }}">
|
||||
|
||||
<!-- Kind Switch -->
|
||||
<a ng-href="https://github.com/{{ state.currentRepo.repo }}" target="_blank" ng-if="kind == 'github'">
|
||||
{{ state.currentRepo.repo }}
|
||||
</a>
|
||||
<a ng-href="https://bitbucket.org/{{ state.currentRepo.repo }}" target="_blank" ng-if="kind == 'bitbucket'">
|
||||
{{ state.currentRepo.repo }}
|
||||
</a>
|
||||
<!-- /Kind Switch -->
|
||||
ng-src="{{ state.currentRepo.avatar_url ? state.currentRepo.avatar_url : '/static/img/empty.png' }}"
|
||||
ng-show="state.currentRepo.avatar_url">
|
||||
{{ state.currentRepo.repo }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -61,14 +56,17 @@
|
|||
<!-- Icons -->
|
||||
<i class="dropdown-select-icon none-icon fa fa-lg" ng-class="'fa-' + kind"></i>
|
||||
<img class="dropdown-select-icon org-icon"
|
||||
ng-src="{{ state.currentRepo.avatar_url ? state.currentRepo.avatar_url : '/static/image/empty.png' }}">
|
||||
ng-show="state.currentRepo.avatar_url"
|
||||
ng-src="{{ state.currentRepo.avatar_url ? state.currentRepo.avatar_url : '/static/img/empty.png' }}">
|
||||
<i class="dropdown-select-icon org-icon fa fa-lg" ng-class="'fa-' + kind"
|
||||
ng-show="!state.currentRepo.avatar_url"></i>
|
||||
|
||||
<!-- Dropdown menu -->
|
||||
<ul class="dropdown-select-menu scrollable-menu" role="menu">
|
||||
<li ng-repeat-start="org in orgs" role="presentation" class="dropdown-header org-header">
|
||||
<img ng-src="{{ org.info.avatar_url }}" class="org-icon">{{ org.info.name }}
|
||||
</li>
|
||||
<li ng-repeat="repo in org.repos" class="repo-listing">
|
||||
<li ng-repeat="repo in org.repos" class="trigger-repo-listing">
|
||||
<a href="javascript:void(0)" ng-click="selectRepo(repo, org)">
|
||||
<i class="fa fa-lg" ng-class="'fa-' + kind"></i> {{ repo }}
|
||||
</a>
|
||||
|
@ -187,7 +185,7 @@
|
|||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="quay-spinner" ng-show="!locations && !locationError"></div>
|
||||
<div class="cor-loader" ng-show="!locations && !locationError"></div>
|
||||
<div class="alert alert-warning" ng-show="locationError">
|
||||
{{ locationError }}
|
||||
</div>
|
||||
|
|
|
@ -7,39 +7,51 @@
|
|||
|
||||
<!-- Manually built with a user -->
|
||||
<div class="tbd-content" ng-switch-when="manual+user">
|
||||
<i class="fa fa-user"></i> {{ build.job_config.manual_user }}
|
||||
<i class="fa fa-user"></i> {{ build.manual_user }}
|
||||
</div>
|
||||
|
||||
<!-- Source information only (i.e. no info) -->
|
||||
<div class="tbd-content" ng-switch-when="source">
|
||||
Triggered by commit to
|
||||
<div class="trigger-description" short="true" trigger="build.trigger"></div>
|
||||
Triggered by
|
||||
<div class="trigger-description" short="true" trigger="build.trigger"
|
||||
style="display: inline-block; margin-left: 4px;"></div>
|
||||
</div>
|
||||
|
||||
<!-- Just commit SHA -->
|
||||
<div class="tbd-content" ng-switch-when="commitsha">
|
||||
Triggered by commit
|
||||
<span class="source-commit-link"
|
||||
commit-sha="build.job_config.trigger_metadata.commit_sha"></span>
|
||||
commit-sha="build.trigger_metadata.commit_sha"></span>
|
||||
</div>
|
||||
|
||||
<!-- Full Commit Information -->
|
||||
<div class="tbd-content" ng-switch-when="fullcommit">
|
||||
<div class="commit-message">
|
||||
{{ build.job_config.trigger_metadata.commit_info.message }}
|
||||
<span class="anchor" is-only-text="!TriggerService.getFullLinkTemplate(build, 'commit')"
|
||||
target="_blank" href="{{ TriggerService.getFullLinkTemplate(build, 'commit').replace('{sha}', build.trigger_metadata.commit_sha) }}">
|
||||
{{ build.trigger_metadata.commit_info.message }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="commit-information">
|
||||
<span class="commit-who-when">
|
||||
Authored
|
||||
<span am-time-ago="build.job_config.trigger_metadata.commit_info.date"></span>
|
||||
<span class="commit-who">
|
||||
{{ build.job_config.trigger_metadata.commit_info.author.username }}
|
||||
<span am-time-ago="build.trigger_metadata.commit_info.date"></span>
|
||||
<span class="anchor commit-who"
|
||||
href="{{ build.trigger_metadata.commit_info.author.url }}"
|
||||
is-only-text="!build.trigger_metadata.commit_info.author.url"
|
||||
target="_blank">
|
||||
<img ng-src="{{ build.trigger_metadata.commit_info.author.avatar_url }}"
|
||||
ng-if="build.trigger_metadata.commit_info.author.avatar_url">
|
||||
{{ build.trigger_metadata.commit_info.author.username }}
|
||||
</span>
|
||||
</span>
|
||||
<span class="source-commit-link"
|
||||
commit-sha="build.job_config.trigger_metadata.commit_sha"></span>
|
||||
commit-sha="build.trigger_metadata.commit_sha"
|
||||
url-template="TriggerService.getFullLinkTemplate(build, 'commit')"></span>
|
||||
<span class="source-ref-link"
|
||||
ref="build.job_config.trigger_metadata.ref"></span>
|
||||
ref="build.trigger_metadata.ref"
|
||||
branch-template="TriggerService.getFullLinkTemplate(build, 'branch')"
|
||||
tag-template="TriggerService.getFullLinkTemplate(build, 'tag')"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -42,15 +42,14 @@ angular.module('quay').directive('repoPanelBuilds', function () {
|
|||
|
||||
var unordered = $scope.allBuilds.map(function(build_info) {
|
||||
var commit_sha = null;
|
||||
var job_config = build_info.job_config || {};
|
||||
|
||||
if (job_config.trigger_metadata) {
|
||||
commit_sha = job_config.trigger_metadata.commit_sha;
|
||||
if (build_info.trigger_metadata) {
|
||||
commit_sha = build_info.trigger_metadata.commit_sha;
|
||||
}
|
||||
|
||||
return $.extend(build_info, {
|
||||
'started_datetime': (new Date(build_info.started)).valueOf() * (-1),
|
||||
'building_tags': job_config.docker_tags || [],
|
||||
'building_tags': build_info.tags || [],
|
||||
'commit_sha': commit_sha
|
||||
});
|
||||
});
|
||||
|
|
|
@ -10,6 +10,7 @@ angular.module('quay').directive('anchor', function () {
|
|||
restrict: 'C',
|
||||
scope: {
|
||||
'href': '@href',
|
||||
'target': '@target',
|
||||
'isOnlyText': '=isOnlyText'
|
||||
},
|
||||
controller: function($scope, $element) {
|
||||
|
|
|
@ -6,11 +6,12 @@ angular.module('quay').directive('sourceCommitLink', function () {
|
|||
priority: 0,
|
||||
templateUrl: '/static/directives/source-commit-link.html',
|
||||
replace: false,
|
||||
transclude: false,
|
||||
transclude: true,
|
||||
restrict: 'C',
|
||||
scope: {
|
||||
'commitSha': '=commitSha',
|
||||
'urlTemplate': '=urlTemplate'
|
||||
'urlTemplate': '=urlTemplate',
|
||||
'showTransclude': '=showTransclude'
|
||||
},
|
||||
controller: function($scope, $element) {
|
||||
$scope.getUrl = function(sha, template) {
|
||||
|
|
|
@ -16,26 +16,38 @@ angular.module('quay').directive('stepView', function ($compile) {
|
|||
'stepsCompleted': '&stepsCompleted'
|
||||
},
|
||||
controller: function($scope, $element, $rootScope) {
|
||||
this.currentStepIndex = -1;
|
||||
this.steps = [];
|
||||
this.watcher = null;
|
||||
var currentStepIndex = -1;
|
||||
var steps = [];
|
||||
var watcher = null;
|
||||
|
||||
this.getCurrentStep = function() {
|
||||
return this.steps[this.currentStepIndex];
|
||||
// Members on 'this' are accessed by the individual steps.
|
||||
this.register = function(scope, element) {
|
||||
element.hide();
|
||||
|
||||
steps.push({
|
||||
'scope': scope,
|
||||
'element': element
|
||||
});
|
||||
|
||||
nextStep();
|
||||
};
|
||||
|
||||
this.reset = function() {
|
||||
this.currentStepIndex = -1;
|
||||
for (var i = 0; i < this.steps.length; ++i) {
|
||||
this.steps[i].element.hide();
|
||||
var getCurrentStep = function() {
|
||||
return steps[currentStepIndex];
|
||||
};
|
||||
|
||||
var reset = function() {
|
||||
currentStepIndex = -1;
|
||||
for (var i = 0; i < steps.length; ++i) {
|
||||
steps[i].element.hide();
|
||||
}
|
||||
|
||||
$scope.currentStepValid = false;
|
||||
};
|
||||
|
||||
this.next = function() {
|
||||
if (this.currentStepIndex >= 0) {
|
||||
var currentStep = this.getCurrentStep();
|
||||
var next = function() {
|
||||
if (currentStepIndex >= 0) {
|
||||
var currentStep = getCurrentStep();
|
||||
if (!currentStep || !currentStep.scope) { return; }
|
||||
|
||||
if (!currentStep.scope.completeCondition) {
|
||||
|
@ -44,20 +56,20 @@ angular.module('quay').directive('stepView', function ($compile) {
|
|||
|
||||
currentStep.element.hide();
|
||||
|
||||
if (this.unwatch) {
|
||||
this.unwatch();
|
||||
this.unwatch = null;
|
||||
if (unwatch) {
|
||||
unwatch();
|
||||
unwatch = null;
|
||||
}
|
||||
}
|
||||
|
||||
this.currentStepIndex++;
|
||||
currentStepIndex++;
|
||||
|
||||
if (this.currentStepIndex < this.steps.length) {
|
||||
var currentStep = this.getCurrentStep();
|
||||
if (currentStepIndex < steps.length) {
|
||||
var currentStep = getCurrentStep();
|
||||
currentStep.element.show();
|
||||
currentStep.scope.load()
|
||||
|
||||
this.unwatch = currentStep.scope.$watch('completeCondition', function(cc) {
|
||||
unwatch = currentStep.scope.$watch('completeCondition', function(cc) {
|
||||
$scope.currentStepValid = !!cc;
|
||||
});
|
||||
} else {
|
||||
|
@ -65,23 +77,17 @@ angular.module('quay').directive('stepView', function ($compile) {
|
|||
}
|
||||
};
|
||||
|
||||
this.register = function(scope, element) {
|
||||
element.hide();
|
||||
var nextStep = function() {
|
||||
if (!steps || !steps.length) { return; }
|
||||
|
||||
this.steps.push({
|
||||
'scope': scope,
|
||||
'element': element
|
||||
});
|
||||
if ($scope.nextStepCounter >= 0) {
|
||||
next();
|
||||
} else {
|
||||
reset();
|
||||
}
|
||||
};
|
||||
|
||||
var that = this;
|
||||
$scope.$watch('nextStepCounter', function(nsc) {
|
||||
if (nsc >= 0) {
|
||||
that.next();
|
||||
} else {
|
||||
that.reset();
|
||||
}
|
||||
});
|
||||
$scope.$watch('nextStepCounter', nextStep);
|
||||
}
|
||||
};
|
||||
return directiveDefinitionObject;
|
||||
|
|
|
@ -12,29 +12,30 @@ angular.module('quay').directive('triggeredBuildDescription', function () {
|
|||
'build': '=build'
|
||||
},
|
||||
controller: function($scope, $element, KeyService, TriggerService) {
|
||||
$scope.TriggerService = TriggerService;
|
||||
$scope.$watch('build', function(build) {
|
||||
if (!build) { return; }
|
||||
|
||||
var jobConfig = build.job_config || {};
|
||||
var triggerMetadata = jobConfig.trigger_metadata || {};
|
||||
var triggerMetadata = build.trigger_metadata || {};
|
||||
|
||||
if (!build.trigger && !jobConfig.manual_user) {
|
||||
if (!build.trigger && !build.manual_user) {
|
||||
$scope.infoDisplay = 'manual';
|
||||
return;
|
||||
}
|
||||
|
||||
if (!build.trigger && jobConfig.manual_user) {
|
||||
if (!build.trigger && build.manual_user) {
|
||||
$scope.infoDisplay = 'manual+user';
|
||||
return;
|
||||
}
|
||||
|
||||
if (triggerMetadata.commit_info) {
|
||||
if (build.trigger && triggerMetadata.commit_info) {
|
||||
$scope.infoDisplay = 'fullcommit';
|
||||
return;
|
||||
}
|
||||
|
||||
if (triggerMetadata.commit_sha) {
|
||||
if (build.trigger && build.trigger.build_source && triggerMetadata.commit_sha) {
|
||||
$scope.infoDisplay = 'commitsha';
|
||||
return;
|
||||
}
|
||||
|
||||
$scope.infoDisplay = 'source';
|
||||
|
|
|
@ -30,16 +30,14 @@
|
|||
|
||||
var determineDockerfilePath = function() {
|
||||
var dockerfilePath = 'Dockerfile';
|
||||
if ($scope.repobuild['job_config']) {
|
||||
var dockerfileFolder = ($scope.repobuild['job_config']['build_subdir'] || '');
|
||||
if (dockerfileFolder[0] == '/') {
|
||||
dockerfileFolder = dockerfileFolder.substr(1);
|
||||
}
|
||||
if (dockerfileFolder && dockerfileFolder[dockerfileFolder.length - 1] != '/') {
|
||||
dockerfileFolder += '/';
|
||||
}
|
||||
dockerfilePath = dockerfileFolder + 'Dockerfile';
|
||||
var dockerfileFolder = ($scope.repobuild['subdirectory'] || '');
|
||||
if (dockerfileFolder[0] == '/') {
|
||||
dockerfileFolder = dockerfileFolder.substr(1);
|
||||
}
|
||||
if (dockerfileFolder && dockerfileFolder[dockerfileFolder.length - 1] != '/') {
|
||||
dockerfileFolder += '/';
|
||||
}
|
||||
dockerfilePath = dockerfileFolder + 'Dockerfile';
|
||||
return dockerfilePath;
|
||||
};
|
||||
|
||||
|
|
|
@ -70,15 +70,12 @@
|
|||
$scope.restartBuild = function(build) {
|
||||
$('#confirmRestartBuildModal').modal('hide');
|
||||
|
||||
var subdirectory = '';
|
||||
if (build['job_config']) {
|
||||
subdirectory = build['job_config']['build_subdir'] || '';
|
||||
}
|
||||
var subdirectory = build['subdirectory'] || '';
|
||||
|
||||
var data = {
|
||||
'file_id': build['resource_key'],
|
||||
'subdirectory': subdirectory,
|
||||
'docker_tags': build['job_config']['docker_tags']
|
||||
'docker_tags': build['tags']
|
||||
};
|
||||
|
||||
if (build['pull_robot']) {
|
||||
|
|
|
@ -54,6 +54,14 @@ angular.module('quay').factory('TriggerService', ['UtilService', '$sanitize', 'K
|
|||
'templates': {
|
||||
'credentials': '/static/directives/trigger/githost/credentials.html',
|
||||
'trigger-description': '/static/directives/trigger/github/trigger-description.html'
|
||||
},
|
||||
'repository_url': function(build) {
|
||||
return KeyService['githubTriggerEndpoint'] + build.trigger.build_source;
|
||||
},
|
||||
'link_templates': {
|
||||
'commit': '/commit/{sha}',
|
||||
'branch': '/tree/{branch}',
|
||||
'tag': '/releases/tag/{tag}',
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -85,6 +93,14 @@ angular.module('quay').factory('TriggerService', ['UtilService', '$sanitize', 'K
|
|||
'templates': {
|
||||
'credentials': '/static/directives/trigger/githost/credentials.html',
|
||||
'trigger-description': '/static/directives/trigger/bitbucket/trigger-description.html'
|
||||
},
|
||||
'repository_url': function(build) {
|
||||
return 'https://bitbucket.org/' + build.trigger.build_source;
|
||||
},
|
||||
'link_templates': {
|
||||
'commit': '/commits/{sha}',
|
||||
'branch': '/branch/{branch}',
|
||||
'tag': '/commits/tag/{tag}',
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -125,6 +141,26 @@ angular.module('quay').factory('TriggerService', ['UtilService', '$sanitize', 'K
|
|||
});
|
||||
};
|
||||
|
||||
triggerService.getFullLinkTemplate = function(build, templateName) {
|
||||
var name = build.trigger.service;
|
||||
var type = triggerTypes[name];
|
||||
if (!type) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var repositoryUrl = type.repository_url;
|
||||
if (!repositoryUrl) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var linkTemplate = type.link_templates;
|
||||
if (!linkTemplate || !linkTemplate[templateName]) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return repositoryUrl(build) + linkTemplate[templateName];
|
||||
};
|
||||
|
||||
triggerService.supportsFullListing = function(name) {
|
||||
var type = triggerTypes[name];
|
||||
if (!type) {
|
||||
|
|
Reference in a new issue