From 8fcd76c0bebf6903756fbbc043cff748edddba55 Mon Sep 17 00:00:00 2001 From: alecmerdler Date: Wed, 22 Feb 2017 17:22:34 -0800 Subject: [PATCH] removed old templates --- .../directives/linear-workflow-section.html | 6 - static/directives/linear-workflow.html | 31 ---- static/js/directives/ui/linear-workflow.js | 141 ------------------ .../manage-trigger-custom-git.component.html | 1 - .../manage-trigger-githost.component.html | 129 +++++++++------- .../manage-trigger-githost.component.spec.ts | 10 +- .../manage-trigger-githost.component.ts | 15 +- test/data/test.db | Bin 1314816 -> 1323008 bytes 8 files changed, 87 insertions(+), 246 deletions(-) delete mode 100644 static/directives/linear-workflow-section.html delete mode 100644 static/directives/linear-workflow.html delete mode 100644 static/js/directives/ui/linear-workflow.js 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 c70eb4c9ceae00ef2f559ac05c0e392abc9673fe..dc4f5960a4ca8e6d01970518b5266faa231d986f 100644 GIT binary patch delta 3617 zcmeHJOROa4Rqn37kGXa4ow}1;Vj;(I#~zGPGgI%Eg=|+>S9MiCs;eLMOomK%*Q2Ye zs~^?XuM5_lNPrc|Q5-gfY=k1jV;Q7~X(=|=2^2v-)Q7$TX;5pA zyngUIL`wxIe?Q%{fNvIx7cZx$D)1U`@$&cXz5c`VwE9)x>K^?H!oGr|4@rtb2&DL> zLi+p!cy8}~75JS(p?LmjdiogndEorh{lmw=U!JF5oB;QrpWy5><3DE37f0#o9H4=V zqy4LM;LrbO=YzuU?*HOffmaXmAEl>HfL{R4KiVTt4vc5s0zP;B6Y|BQJeN<=f(GIq0{bXYTG7^Lv;1?-gHva(VkJ1u#c{{W8Ce7*{v)se!8zzppcMpX<@+*} z{?U_r$KwAsa6vfA&X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