-
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.
SHIBUI-331 Implemented unsaved changes modal in provider editor
- Loading branch information
Showing
9 changed files
with
92 additions
and
11 deletions.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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> |
28 changes: 28 additions & 0 deletions
28
ui/src/app/metadata/provider/component/unsaved-provider.dialog.ts
This file contains hidden or 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,28 @@ | ||
| 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, | ||
| private store: Store<fromEditor.State> | ||
| ) { } | ||
|
|
||
| close(): void { | ||
| this.activeModal.close(); | ||
| } | ||
|
|
||
| dismiss(): void { | ||
| this.activeModal.dismiss(); | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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