diff --git a/static/directives/linear-workflow-section.html b/static/directives/linear-workflow-section.html deleted file mode 100644 index 7eeafcf63..000000000 --- a/static/directives/linear-workflow-section.html +++ /dev/null @@ -1,6 +0,0 @@ -
-
-
- -
\ No newline at end of file diff --git a/static/directives/linear-workflow.html b/static/directives/linear-workflow.html deleted file mode 100644 index b1f366f93..000000000 --- a/static/directives/linear-workflow.html +++ /dev/null @@ -1,31 +0,0 @@ -
- -
- -
- - - - - -
- - - - -
- Next: -
    -
  • - {{ section.title }} -
  • -
-
-
-
-
\ No newline at end of file diff --git a/static/js/directives/ui/linear-workflow.js b/static/js/directives/ui/linear-workflow.js deleted file mode 100644 index 1f24adeb5..000000000 --- a/static/js/directives/ui/linear-workflow.js +++ /dev/null @@ -1,141 +0,0 @@ -/** - * An element which displays a linear workflow of sections, each completed in order before the next - * step is made visible. - */ -angular.module('quay').directive('linearWorkflow', function () { - var directiveDefinitionObject = { - priority: 0, - templateUrl: '/static/directives/linear-workflow.html', - replace: false, - transclude: true, - restrict: 'C', - scope: { - 'workflowState': '=?workflowState', - 'workflowComplete': '&workflowComplete', - 'doneTitle': '@doneTitle' - }, - controller: function($scope, $element, $timeout) { - $scope.sections = []; - - $scope.nextSection = function() { - if (!$scope.currentSection.valid) { return; } - - var currentIndex = $scope.currentSection.index; - if (currentIndex + 1 >= $scope.sections.length) { - $scope.workflowComplete(); - return; - } - - $scope.workflowState = $scope.sections[currentIndex + 1].id; - }; - - this.registerSection = function(sectionScope, sectionElement) { - // Add the section to the list. - var sectionInfo = { - 'index': $scope.sections.length, - 'id': sectionScope.sectionId, - 'title': sectionScope.sectionTitle, - 'scope': sectionScope, - 'element': sectionElement - }; - - $scope.sections.push(sectionInfo); - - // Add a watch on the `sectionValid` value on the section itself. If/when this value - // changes, we copy it over to the sectionInfo, so that the overall workflow can watch - // the change. - sectionScope.$watch('sectionValid', function(isValid) { - sectionInfo['valid'] = isValid; - if (!isValid) { - // Reset the sections back to this section. - updateState(); - } - }); - - // Bind the `submitSection` callback to move to the next section when the user hits - // enter (which calls this method on the scope via an ng-submit set on a wrapping - //
tag). - sectionScope.submitSection = function() { - $scope.nextSection(); - }; - - // Update the state of the workflow to account for the new section. - updateState(); - }; - - var updateState = function() { - // Find the furthest state we can show. - var foundIndex = 0; - var maxValidIndex = -1; - - $scope.sections.forEach(function(section, index) { - if (section.id == $scope.workflowState) { - foundIndex = index; - } - - if (maxValidIndex == index - 1 && section.valid) { - maxValidIndex = index; - } - }); - - var minSectionIndex = Math.min(maxValidIndex + 1, foundIndex); - $scope.sections.forEach(function(section, index) { - section.scope.sectionVisible = index <= minSectionIndex; - section.scope.isCurrentSection = false; - }); - - $scope.workflowState = null; - if (minSectionIndex >= 0 && minSectionIndex < $scope.sections.length) { - $scope.currentSection = $scope.sections[minSectionIndex]; - $scope.workflowState = $scope.currentSection.id; - $scope.currentSection.scope.isCurrentSection = true; - - // Focus to the first input (if any) in the section. - $timeout(function() { - var inputs = $scope.currentSection.element.find('input'); - if (inputs.length == 1) { - inputs.focus(); - } - }, 10); - } - }; - - $scope.$watch('workflowState', updateState); - } - }; - return directiveDefinitionObject; -}); - -/** - * An element which displays a single section in a linear workflow. - */ -angular.module('quay').directive('linearWorkflowSection', function () { - var directiveDefinitionObject = { - priority: 0, - templateUrl: '/static/directives/linear-workflow-section.html', - replace: false, - transclude: true, - restrict: 'C', - require: '^linearWorkflow', - scope: { - 'sectionId': '@sectionId', - 'sectionTitle': '@sectionTitle', - 'sectionValid': '=?sectionValid', - }, - - link: function($scope, $element, $attrs, $ctrl) { - $ctrl.registerSection($scope, $element); - }, - - controller: function($scope, $element) { - $scope.$watch('sectionVisible', function(visible) { - if (visible) { - $element.show(); - } else { - $element.hide(); - } - }); - } - }; - return directiveDefinitionObject; -}); \ No newline at end of file diff --git a/static/js/directives/ui/manage-trigger-custom-git/manage-trigger-custom-git.component.html b/static/js/directives/ui/manage-trigger-custom-git/manage-trigger-custom-git.component.html index 43cb23b97..a4bf31b72 100644 --- a/static/js/directives/ui/manage-trigger-custom-git/manage-trigger-custom-git.component.html +++ b/static/js/directives/ui/manage-trigger-custom-git/manage-trigger-custom-git.component.html @@ -1,6 +1,5 @@
diff --git a/static/js/directives/ui/manage-trigger-githost/manage-trigger-githost.component.html b/static/js/directives/ui/manage-trigger-githost/manage-trigger-githost.component.html index 6c2f2837d..b3fd10bd7 100644 --- a/static/js/directives/ui/manage-trigger-githost/manage-trigger-githost.component.html +++ b/static/js/directives/ui/manage-trigger-githost/manage-trigger-githost.component.html @@ -1,15 +1,15 @@
-
+ -
-
+ +

Select {{ $ctrl.namespaceTitle }}

Please select the {{ $ctrl.namespaceTitle }} under which the repository lives @@ -48,7 +48,9 @@ - {{ namespace.id }} + {{ namespace.id }} -
No matching {{ $ctrl.namespaceTitle }} found.
Try expanding your filtering terms.
-
+
Retrieving {{ $ctrl.namespaceTitle }}s
- + -
+ -
+

Select Repository

Select a repository in @@ -131,12 +134,16 @@ - - {{ repository.name }} + {{ repository.name }} @@ -147,17 +154,20 @@ -
No matching repositories found.
Try expanding your filtering terms.
-
+
Retrieving repositories
- + -
-
+ +

Configure Trigger

Configure trigger options for @@ -183,7 +193,9 @@
@@ -198,7 +210,9 @@ Regular Expression: - +
Examples: heads/master, tags/tagname, heads/.+
-
+
Retrieving repository refs
-
+ -
-
+ +
{{ $ctrl.local.dockerfileLocations.message }}
-
+

Select Dockerfile

Please select the location of the Dockerfile to build when this trigger is invoked @@ -246,22 +262,24 @@ is-valid-path="$ctrl.local.hasValidDockerfilePath">
-
+
Retrieving Dockerfile locations
-
+ -
+ -
+

Verification Error

There was an error when verifying the state of @@ -272,19 +290,19 @@
-
+

Verification Warning

{{ $ctrl.local.triggerAnalysis.message }}
-
+

Ready to go!

Click "Create Trigger" to complete setup of this build trigger
-
+

Robot Account Required

The selected Dockerfile in the selected repository depends upon a private base image

A robot account with access to the base image is required to setup this trigger, but you are not the administrator of this namespace.

@@ -292,7 +310,7 @@
-
+

Select Robot Account

The selected Dockerfile in the selected repository depends upon a private base image. Select a robot account with access: @@ -324,7 +342,9 @@ ng-class="$ctrl.local.robotAccount == robot ? 'checked' : ''" bindonce> - + @@ -348,6 +368,7 @@

In order for the to pull the base image during the build process, a robot account with access must be selected.

Robot accounts that already have access to this base image are listed first. If you select a robot account that does not currently have access, read permission will be granted to that robot account on trigger creation.

-
+ -
\ No newline at end of file + +
\ No newline at end of file diff --git a/static/js/directives/ui/manage-trigger-githost/manage-trigger-githost.component.spec.ts b/static/js/directives/ui/manage-trigger-githost/manage-trigger-githost.component.spec.ts index d00a3f020..547781352 100644 --- a/static/js/directives/ui/manage-trigger-githost/manage-trigger-githost.component.spec.ts +++ b/static/js/directives/ui/manage-trigger-githost/manage-trigger-githost.component.spec.ts @@ -27,15 +27,11 @@ describe("ManageTriggerGithostComponent", () => { })); describe("constructor", () => { - + // TODO }); describe("$onInit", () => { - - }); - - describe("$onChanges", () => { - + // TODO }); describe("getTriggerIcon", () => { @@ -48,6 +44,6 @@ describe("ManageTriggerGithostComponent", () => { }); describe("createTrigger", () => { - + // TODO }); }); \ No newline at end of file diff --git a/static/js/directives/ui/manage-trigger-githost/manage-trigger-githost.component.ts b/static/js/directives/ui/manage-trigger-githost/manage-trigger-githost.component.ts index a6815d8ad..a28f1e2f4 100644 --- a/static/js/directives/ui/manage-trigger-githost/manage-trigger-githost.component.ts +++ b/static/js/directives/ui/manage-trigger-githost/manage-trigger-githost.component.ts @@ -11,6 +11,7 @@ import * as moment from 'moment'; }) export class ManageTriggerGithostComponent implements ng.IComponentController { + // FIXME: Use one-way data binding @Input('=') public repository: any; @Input('=') public trigger: Trigger; @Output() public activateTrigger: (trigger: {config: any, pull_robot: any}) => void; @@ -101,10 +102,6 @@ export class ManageTriggerGithostComponent implements ng.IComponentController { this.$scope.$watch(() => this.local.robotOptions.filter, this.buildOrderedRobotAccounts); } - public $onChanges(changes: ng.IOnChangesObject): void { - - } - public getTriggerIcon(): any { return this.TriggerService.getIcon(this.trigger.service); } @@ -323,6 +320,9 @@ export class ManageTriggerGithostComponent implements ng.IComponentController { } +/** + * A type representing local application data. + */ export type Local = { namespaceOptions: { filter: string; @@ -343,10 +343,13 @@ export type Local = { reverse: boolean; page: number; }; -} +}; +/** + * A type representing a trigger. + */ export type Trigger = { id: number; service: any; -} \ No newline at end of file +}; \ No newline at end of file diff --git a/test/data/test.db b/test/data/test.db index c70eb4c9c..dc4f5960a 100644 Binary files a/test/data/test.db and b/test/data/test.db differ