-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: replace mat-menu with dialog
- Loading branch information
Showing
34 changed files
with
326 additions
and
373 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<h3 mat-dialog-title>Citation Link</h3> | ||
<mat-dialog-content> | ||
<mat-form-field> | ||
<mat-label>ARK URL</mat-label> | ||
<input matInput [(ngModel)]="arkURL"/> | ||
</mat-form-field> | ||
</mat-dialog-content> | ||
<mat-dialog-actions> | ||
<button mat-button mat-dialog-close>Cancel</button> | ||
<button mat-button class="btn-copy-arkurl" (click)="copyToClipBoard()">Copy To Clipboard</button> | ||
</mat-dialog-actions> |
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,7 @@ | ||
mat-form-field { | ||
width: 100%; | ||
} | ||
|
||
mat-dialog-actions { | ||
justify-content: space-between; | ||
} |
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,44 @@ | ||
import { Component, Inject, OnInit } from '@angular/core'; | ||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; | ||
import { MatSnackBar } from '@angular/material/snack-bar'; | ||
import { Clipboard } from '@angular/cdk/clipboard'; | ||
|
||
@Component({ | ||
selector: 'ark-url-dialog', | ||
templateUrl: 'ark-url-dialog.component.html', | ||
styleUrls: ['ark-url-dialog.component.scss'] | ||
}) | ||
export class ArkUrlDialogComponent implements OnInit { | ||
arkURL: string; | ||
constructor( | ||
@Inject(MAT_DIALOG_DATA) public data, | ||
private _snackBar: MatSnackBar, | ||
private _clipboard: Clipboard, | ||
private _dialogRef: MatDialogRef<ArkUrlDialogComponent> | ||
) { | ||
} | ||
|
||
ngOnInit() { | ||
this.arkURL = this.data.arkURL; | ||
} | ||
|
||
copyToClipBoard() { | ||
this._clipboard.copy(this.arkURL); | ||
this.openSnackBar(); | ||
this._dialogRef.close(); | ||
} | ||
|
||
/** | ||
* Display message to confirm the copy of the citation link (ARK URL) | ||
*/ | ||
openSnackBar() { | ||
this._snackBar.open( | ||
'Copied to clipboard!', | ||
'Citation Link', | ||
{ | ||
duration: 3000, | ||
horizontalPosition: 'center', | ||
verticalPosition: 'top' | ||
}); | ||
} | ||
} |
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
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
Oops, something went wrong.