-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into SHIBUI-680
- Loading branch information
Showing
32 changed files
with
776 additions
and
57 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
ui/src/app/metadata/domain/component/preview-dialog.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,46 @@ | ||
import { TestBed, ComponentFixture } from '@angular/core/testing'; | ||
import { ReactiveFormsModule } from '@angular/forms'; | ||
import { NoopAnimationsModule } from '@angular/platform-browser/animations'; | ||
import { ViewChild, Component } from '@angular/core'; | ||
import { Observable, of } from 'rxjs'; | ||
import { PreviewDialogComponent } from './preview-dialog.component'; | ||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; | ||
import { NgbActiveModalStub } from '../../../../testing/modal.stub'; | ||
|
||
@Component({ | ||
template: `<preview-dialog></preview-dialog>` | ||
}) | ||
class TestHostComponent { | ||
@ViewChild(PreviewDialogComponent) | ||
public formUnderTest: PreviewDialogComponent; | ||
} | ||
|
||
|
||
describe('Advanced Info Form Component', () => { | ||
let fixture: ComponentFixture<TestHostComponent>; | ||
let instance: TestHostComponent; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
providers: [ | ||
{ provide: NgbActiveModal, useClass: NgbActiveModalStub } | ||
], | ||
imports: [ | ||
NoopAnimationsModule, | ||
ReactiveFormsModule | ||
], | ||
declarations: [ | ||
PreviewDialogComponent, | ||
TestHostComponent | ||
], | ||
}); | ||
|
||
fixture = TestBed.createComponent(TestHostComponent); | ||
instance = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should compile', () => { | ||
expect(fixture).toBeDefined(); | ||
}); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export interface ProviderOrder { | ||
resourceIds: string[]; | ||
} |
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
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
16 changes: 16 additions & 0 deletions
16
ui/src/app/metadata/provider/component/unsaved-provider.dialog.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,16 @@ | ||
<ng-container> | ||
<div aria-label="Save your information? modal" role="region" tabindex="0"> | ||
<div class="modal-header"> | ||
<h4 class="modal-title" i18n="@@message--unsaved-dialog-title">Save your information?</h4> | ||
</div> | ||
<div class="modal-body"> | ||
<p i18n="@@message--unsaved-editor">You have not saved your changes. If you exit this screen, your changes will be lost.</p> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-primary" (click)="this.close()"> | ||
<span i18n="@@action--discard-changes" aria-label="Discard changes, go back to dashboard">Discard Changes</span> | ||
</button> | ||
<button type="button" class="btn btn-secondary" (click)="this.dismiss()" i18n="@@action--cancel" aria-label="Close modal and go back to editing">Cancel</button> | ||
</div> | ||
</div> | ||
</ng-container> |
46 changes: 46 additions & 0 deletions
46
ui/src/app/metadata/provider/component/unsaved-provider.dialog.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,46 @@ | ||
import { Component, ViewChild } from '@angular/core'; | ||
import { TestBed, async, ComponentFixture} from '@angular/core/testing'; | ||
import { RouterTestingModule } from '@angular/router/testing'; | ||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; | ||
import { SharedModule } from '../../../shared/shared.module'; | ||
import { UnsavedProviderComponent } from './unsaved-provider.dialog'; | ||
import { NgbActiveModalStub } from '../../../../testing/modal.stub'; | ||
|
||
@Component({ | ||
template: ` | ||
<unsaved-provider></unsaved-provider> | ||
` | ||
}) | ||
class TestHostComponent { | ||
@ViewChild(UnsavedProviderComponent) | ||
public componentUnderTest: UnsavedProviderComponent; | ||
} | ||
|
||
describe('Unsaved Provider Dialog Component', () => { | ||
|
||
let fixture: ComponentFixture<TestHostComponent>; | ||
let instance: TestHostComponent; | ||
let cmp: UnsavedProviderComponent; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [], | ||
declarations: [ | ||
UnsavedProviderComponent, | ||
TestHostComponent | ||
], | ||
providers: [ | ||
{ provide: NgbActiveModal, useClass: NgbActiveModalStub } | ||
] | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(TestHostComponent); | ||
instance = fixture.componentInstance; | ||
cmp = instance.componentUnderTest; | ||
fixture.detectChanges(); | ||
})); | ||
|
||
it('should instantiate the component', async(() => { | ||
expect(cmp).toBeTruthy(); | ||
})); | ||
}); |
27 changes: 27 additions & 0 deletions
27
ui/src/app/metadata/provider/component/unsaved-provider.dialog.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,27 @@ | ||
import { Component, Input } from '@angular/core'; | ||
|
||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; | ||
import { Store, Action } from '@ngrx/store'; | ||
import { Subject } from 'rxjs/Subject'; | ||
|
||
import * as fromEditor from '../reducer'; | ||
|
||
@Component({ | ||
selector: 'unsaved-provider', | ||
templateUrl: './unsaved-provider.dialog.html' | ||
}) | ||
export class UnsavedProviderComponent { | ||
readonly subject: Subject<boolean> = new Subject<boolean>(); | ||
|
||
constructor( | ||
public activeModal: NgbActiveModal | ||
) { } | ||
|
||
close(): void { | ||
this.activeModal.close(); | ||
} | ||
|
||
dismiss(): void { | ||
this.activeModal.dismiss(); | ||
} | ||
} |
Oops, something went wrong.