diff --git a/static/js/directives/ui/linear-workflow/linear-workflow.component.html b/static/js/directives/ui/linear-workflow/linear-workflow.component.html
index bbb0d3868..899dc4c2d 100644
--- a/static/js/directives/ui/linear-workflow/linear-workflow.component.html
+++ b/static/js/directives/ui/linear-workflow/linear-workflow.component.html
@@ -23,7 +23,7 @@
+ ng-if="$ctrl.currentSection.index < $ctrl.sections.length - 1">
Next:
- {
new LinearWorkflowSectionComponent(),
];
sections.forEach((section) => {
- section.sectionVisible = true;
- section.isCurrentSection = true;
+ section.sectionVisible = false;
+ section.isCurrentSection = false;
component.addSection(section);
});
});
+ it("does nothing if invalid section is after the current section", () => {
+ sections[sections.length - 1].sectionValid = false;
+ sections[sections.length - 1].sectionId = "Some Section";
+ component.onSectionInvalid(sections[sections.length - 1].sectionId);
+
+ expect(sections[sections.length - 1].isCurrentSection).toBe(false);
+ expect(sections[sections.length - 1].sectionVisible).toBe(false);
+ });
+
it("sets the section with the given id to be the current section", () => {
component.onSectionInvalid(invalidSection.sectionId);
@@ -102,6 +111,11 @@ describe("LinearWorkflowComponent", () => {
});
it("hides all sections after the section with the given id", () => {
+ sections.forEach((section) => {
+ section.sectionVisible = true;
+ section.isCurrentSection = true;
+ component.addSection(section);
+ });
component.onSectionInvalid(invalidSection.sectionId);
sections.forEach((section) => {
diff --git a/static/js/directives/ui/linear-workflow/linear-workflow.component.ts b/static/js/directives/ui/linear-workflow/linear-workflow.component.ts
index 69e43dc20..960289c15 100644
--- a/static/js/directives/ui/linear-workflow/linear-workflow.component.ts
+++ b/static/js/directives/ui/linear-workflow/linear-workflow.component.ts
@@ -45,14 +45,16 @@ export class LinearWorkflowComponent implements ng.IComponentController {
public onSectionInvalid(sectionId: string): void {
var invalidSection = this.sections.filter(section => section.component.sectionId == sectionId)[0];
- invalidSection.component.isCurrentSection = true;
- this.currentSection = invalidSection;
- this.sections.forEach((section) => {
- if (section.index > invalidSection.index) {
- section.component.sectionVisible = false;
- section.component.isCurrentSection = false;
- }
- });
+ if (invalidSection.index <= this.currentSection.index) {
+ invalidSection.component.isCurrentSection = true;
+ this.currentSection = invalidSection;
+ this.sections.forEach((section) => {
+ if (section.index > invalidSection.index) {
+ section.component.sectionVisible = false;
+ section.component.isCurrentSection = false;
+ }
+ });
+ }
}
}
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 d75adcb07..43cb23b97 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
@@ -2,7 +2,7 @@
+ on-workflow-complete="$ctrl.activateTrigger({'config': $ctrl.config})">
{
+ var component: ManageTriggerCustomGitComponent;
+
+ beforeEach(() => {
+ component = new ManageTriggerCustomGitComponent();
+ });
+
+ describe("$onChanges", () => {
+
+ });
+});
diff --git a/test/data/test.db b/test/data/test.db
index cfce4f869..c70eb4c9c 100644
Binary files a/test/data/test.db and b/test/data/test.db differ
|