This repository has been archived by the owner on Nov 22, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from mdrillin/DataServiceWizard
Addition of Dataservice Wizard
- Loading branch information
Showing
38 changed files
with
1,887 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
ngapp/src/app/connections/add-connection/add-connection.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
ngapp/src/app/dataservices/add-dataservice-wizard/add-dataservice-wizard.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.wizard-pf-failed-icon { | ||
color: #9c3535; | ||
font-size: 67px; | ||
line-height: 67px; | ||
} |
78 changes: 78 additions & 0 deletions
78
ngapp/src/app/dataservices/add-dataservice-wizard/add-dataservice-wizard.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<pfng-wizard #wizard | ||
[config]="wizardConfig" | ||
(onCancel)="cancelClicked($event)" | ||
(onNext)="nextClicked($event)" | ||
(onStepChange)="stepChanged($event)"> | ||
<!-- ------------------------- --> | ||
<!-- Step 1 : Basic Properties --> | ||
<!-- ------------------------- --> | ||
<pfng-wizard-step [config]="step1Config"> | ||
<h3><i>{{ step1InstructionMessage }}</i></h3> | ||
<div *ngIf="!connectionsLoaded"> | ||
<div class="spinner spinner-lg blank-slate-pf-icon"></div> | ||
</div> | ||
<form [formGroup]=basicPropertyForm class="form-horizontal" *ngIf="connectionsLoaded"> | ||
<div [ngClass]="nameValid ? 'form-group' : 'form-group has-error'"> | ||
<label class="col-sm-2 control-label">Name</label> | ||
<div class="col-sm-5"> | ||
<input class="form-control" formControlName="name" title=""> | ||
<div class="help-block" *ngIf="!nameValid">{{ getBasicPropertyErrorMessage("name") }}</div> | ||
</div> | ||
</div> | ||
<div [ngClass]="connectionValid ? 'form-group' : 'form-group has-error'"> | ||
<label class="col-sm-2 control-label">Connection</label> | ||
<div class="col-sm-5"> | ||
<select class="form-control" formControlName="connection" title=""> | ||
<option value="" selected hidden>-- Select a Connection ---</option> | ||
<option *ngFor="let connection of connectionNames" [value]="connection">{{ connection }}</option> | ||
</select> | ||
<div class="help-block" *ngIf="!connectionValid">{{ getBasicPropertyErrorMessage("connection") }}</div> | ||
</div> | ||
</div> | ||
</form> | ||
</pfng-wizard-step> | ||
<!-- -------------------------- --> | ||
<!-- Step 2 : Review and Create --> | ||
<!-- -------------------------- --> | ||
<pfng-wizard-step [config]="step2Config"> | ||
<!-- Step 2A: Review --> | ||
<pfng-wizard-substep [config]="step2aConfig"> | ||
<h3><i>{{ step2InstructionMessage }}</i></h3> | ||
<h4>Dataservice Properties:</h4> | ||
<form class="form-horizontal"> | ||
<div class="form-group"> | ||
<label class="col-sm-2 control-label">Name:</label> | ||
<label class="col-sm-10">{{ dataserviceName }}</label> | ||
</div> | ||
<div class="form-group"> | ||
<label class="col-sm-2 control-label">Connection:</label> | ||
<label class="col-sm-5">{{ connectionName }}</label> | ||
</div> | ||
</form> | ||
</pfng-wizard-substep> | ||
<!-- Step 2B: Create --> | ||
<pfng-wizard-substep [config]="step2bConfig" (onShow)="createDataservice()"> | ||
<div class="wizard-pf-contents"> | ||
<!-- In progress --> | ||
<div class="wizard-pf-process blank-slate-pf" *ngIf="!createComplete"> | ||
<div class="spinner spinner-lg blank-slate-pf-icon"></div> | ||
<h3 class="blank-slate-pf-main-action">Creation in progress</h3> | ||
<p class="blank-slate-pf-secondary-action">The dataservice is being created. </p> | ||
</div> | ||
<!-- Create Successful --> | ||
<div class="wizard-pf-complete blank-slate-pf" *ngIf="createComplete && createSuccessful"> | ||
<div class="wizard-pf-success-icon"><span class="glyphicon glyphicon-ok-circle"></span></div> | ||
<h3 class="blank-slate-pf-main-action">Creation was successful</h3> | ||
<p class="blank-slate-pf-secondary-action">The dataservice was created successfully. Click on the button to see all dataservices.</p> | ||
<a class="btn btn-lg btn-primary" [routerLink]="[dataserviceSummaryLink]">View All Dataservices</a> | ||
</div> | ||
<!-- Create Failed --> | ||
<div class="wizard-pf-complete blank-slate-pf" *ngIf="createComplete && !createSuccessful"> | ||
<div class="wizard-pf-failed-icon"><span class="glyphicon glyphicon-remove-circle"></span></div> | ||
<h3 class="blank-slate-pf-main-action">Creation failed</h3> | ||
<p class="blank-slate-pf-secondary-action">The dataservice creation failed. Correct any properties and retry.</p> | ||
</div> | ||
</div> | ||
</pfng-wizard-substep> | ||
</pfng-wizard-step> | ||
</pfng-wizard> |
42 changes: 42 additions & 0 deletions
42
ngapp/src/app/dataservices/add-dataservice-wizard/add-dataservice-wizard.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { async, ComponentFixture, TestBed } from "@angular/core/testing"; | ||
|
||
import { FormsModule, ReactiveFormsModule } from "@angular/forms"; | ||
import { RouterTestingModule } from "@angular/router/testing"; | ||
import { DataserviceService } from "@dataservices/shared/dataservice.service"; | ||
import { MockDataserviceService } from "@dataservices/shared/mock-dataservice.service"; | ||
import { CoreModule } from "@core/core.module"; | ||
import { PropertyFormPropertyComponent } from "@shared/property-form/property-form-property/property-form-property.component"; | ||
import { PropertyFormComponent } from "@shared/property-form/property-form.component"; | ||
import { PatternFlyNgModule } from "patternfly-ng"; | ||
import { AddDataserviceWizardComponent } from "./add-dataservice-wizard.component"; | ||
import { ConnectionService } from "@connections/shared/connection.service"; | ||
import { MockConnectionService } from "@connections/shared/mock-connection.service"; | ||
|
||
describe("AddDataserviceWizardComponent", () => { | ||
let component: AddDataserviceWizardComponent; | ||
let fixture: ComponentFixture<AddDataserviceWizardComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [ CoreModule, FormsModule, PatternFlyNgModule, ReactiveFormsModule, RouterTestingModule ], | ||
declarations: [ AddDataserviceWizardComponent, PropertyFormComponent, PropertyFormPropertyComponent ], | ||
providers: [ | ||
{ provide: DataserviceService, useClass: MockDataserviceService }, | ||
{ provide: ConnectionService, useClass: MockConnectionService }, | ||
] | ||
}) | ||
.compileComponents().then(() => { | ||
// nothing to do | ||
}); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(AddDataserviceWizardComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it("should be created", () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.