Merge pull request #2781 from alecmerdler/QUAY-734
Manual Build Trigger UI Fix
This commit is contained in:
commit
6f1e8ae9b2
10 changed files with 70 additions and 37 deletions
|
@ -1,21 +0,0 @@
|
|||
/**
|
||||
* DEPRECATED: An element which displays information about a build trigger.
|
||||
*/
|
||||
angular.module('quay').directive('triggerDescription', function () {
|
||||
var directiveDefinitionObject = {
|
||||
priority: 0,
|
||||
templateUrl: '/static/directives/trigger-description.html',
|
||||
replace: false,
|
||||
transclude: false,
|
||||
restrict: 'C',
|
||||
scope: {
|
||||
'trigger': '=trigger',
|
||||
},
|
||||
controller: function($scope, $element, KeyService, TriggerService) {
|
||||
$scope.KeyService = KeyService;
|
||||
$scope.TriggerService = TriggerService;
|
||||
TriggerService.populateTemplate($scope, 'trigger-description');
|
||||
}
|
||||
};
|
||||
return directiveDefinitionObject;
|
||||
});
|
|
@ -0,0 +1,39 @@
|
|||
<span class="trigger-description-element"
|
||||
ng-switch on="::$ctrl.trigger.service">
|
||||
<!-- GitHub -->
|
||||
<span ng-switch-when="github">
|
||||
<i class="fa fa-github fa-lg" style="margin-right: 6px"
|
||||
data-title="GitHub" bs-tooltip></i>
|
||||
Push to GitHub <span ng-if="::$ctrl.keyService.isEnterprise('github-trigger')">Enterprise</span> repository
|
||||
<a href="{{ ::$ctrl.trigger.repository_url }}" target="_new">
|
||||
{{ ::$ctrl.trigger.config.build_source }}
|
||||
</a>
|
||||
</span>
|
||||
|
||||
<!-- BitBucket -->
|
||||
<span ng-switch-when="bitbucket">
|
||||
<i class="fa fa-bitbucket fa-lg" style="margin-right: 6px"
|
||||
data-title="BitBucket" bs-tooltip></i>
|
||||
Push to BitBucket repository
|
||||
<a href="{{ ::$ctrl.trigger.repository_url }}" target="_new">
|
||||
{{ ::$ctrl.trigger.config.build_source }}
|
||||
</a>
|
||||
</span>
|
||||
|
||||
<!-- GitLab -->
|
||||
<span ng-switch-when="gitlab">
|
||||
<i class="fa fa-gitlab fa-lg" style="margin-right: 6px"
|
||||
data-title="GitLab" bs-tooltip></i>
|
||||
Push to GitLab repository
|
||||
<a ng-href="{{ ::$ctrl.trigger.repository_url }}" target="_new">
|
||||
{{ ::$ctrl.trigger.config.build_source }}
|
||||
</a>
|
||||
</span>
|
||||
|
||||
<!-- Custom Git -->
|
||||
<span ng-switch-when="custom-git">
|
||||
<i class="fa fa-git-square fa-lg" style="margin-right: 6px;"
|
||||
data-title="git" bs-tooltip></i>
|
||||
Push to repository {{ ::$ctrl.trigger.config.build_source }}
|
||||
</span>
|
||||
</span>
|
|
@ -0,0 +1,20 @@
|
|||
import { Component, Input, Inject } from 'ng-metadata/core';
|
||||
import { Trigger } from '../../../types/common.types';
|
||||
|
||||
|
||||
/**
|
||||
* A component which displays information about a build trigger.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'trigger-description',
|
||||
templateUrl: '/static/js/directives/ui/trigger-description/trigger-description.component.html'
|
||||
})
|
||||
export class TriggerDescriptionComponent {
|
||||
|
||||
@Input('<') public trigger: Trigger;
|
||||
|
||||
constructor(@Inject('TriggerService') private triggerService: any,
|
||||
@Inject('KeyService') private keyService: any) {
|
||||
|
||||
}
|
||||
}
|
|
@ -33,6 +33,7 @@ import { BrowserPlatform, browserPlatform } from './constants/platform.constant'
|
|||
import { ManageTriggerComponent } from './directives/ui/manage-trigger/manage-trigger.component';
|
||||
import { ClipboardCopyDirective } from './directives/ui/clipboard-copy/clipboard-copy.directive';
|
||||
import { CorTabsModule } from './directives/ui/cor-tabs/cor-tabs.module';
|
||||
import { TriggerDescriptionComponent } from './directives/ui/trigger-description/trigger-description.component';
|
||||
import { Converter, ConverterOptions } from 'showdown';
|
||||
import * as Clipboard from 'clipboard';
|
||||
|
||||
|
@ -70,6 +71,7 @@ import * as Clipboard from 'clipboard';
|
|||
TypeaheadDirective,
|
||||
ManageTriggerComponent,
|
||||
ClipboardCopyDirective,
|
||||
TriggerDescriptionComponent,
|
||||
],
|
||||
providers: [
|
||||
ViewArrayImpl,
|
||||
|
|
Reference in a new issue