-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Outreachy Task Submission] - Added confirmation messages and a complete button when posts are added to collections #888
Changes from 4 commits
30b9599
9abb295
762bd17
dd2cb07
18e18c9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the changes in this file part of this PR? If not, remove the commits to only include changes for the specific issue you are solving :) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,25 +113,69 @@ export class GeneralComponent implements OnInit { | |
.pipe( | ||
mergeMap((newImage: any) => { | ||
this.siteConfig.image_header = newImage.result.original_file_url; | ||
console.log(newImage.result.original_file_url); | ||
console.log(this.updateSettings()); | ||
return this.updateSettings(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the console.logs here |
||
}), | ||
) | ||
.subscribe({ | ||
complete: () => { | ||
this.loader.hide(); | ||
this.submitted = false; | ||
this.notificationService.showError('save successful'); | ||
|
||
this.notificationService.showSnackbar( | ||
{ | ||
// icon: { | ||
// color: 'success', | ||
// name: 'thumb-up', | ||
// }, | ||
title: 'notify.export.upload_complete', | ||
buttons: [ | ||
{ | ||
color: 'primary', | ||
text: 'notify.export.confirmation', | ||
}, | ||
], | ||
}, | ||
{ | ||
duration: 0, | ||
wide: true, | ||
}, | ||
); | ||
// alert('uploaded'); | ||
}, | ||
error: (error) => { | ||
this.loader.hide(); | ||
this.submitted = false; | ||
this.notificationService.showError(error.message); | ||
alert('error'); | ||
}, | ||
}); | ||
} else { | ||
this.updateSettings().subscribe({ | ||
complete: () => { | ||
this.submitted = false; | ||
this.loader.hide(); | ||
this.notificationService.showSnackbar( | ||
{ | ||
icon: { | ||
color: 'success', | ||
name: 'thumb-up', | ||
}, | ||
title: 'Deployment settings updated successfully', | ||
buttons: [ | ||
{ | ||
color: 'primary', | ||
text: 'notify.export.confirmation', | ||
}, | ||
], | ||
}, | ||
{ | ||
duration: 3000, | ||
wide: false, | ||
}, | ||
); | ||
}, | ||
error: (error) => { | ||
this.submitted = false; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; | ||
// import { SnackbarComponent, SnackbarData } from '../../shared/components'; | ||
|
||
export interface SnackbarOptions extends MatSnackBarConfig { | ||
wide?: boolean; | ||
} | ||
|
||
@Injectable({ | ||
providedIn: 'root', | ||
}) | ||
export class AlertService { | ||
constructor(public snackBar: MatSnackBar) {} | ||
|
||
showError(message: string) { | ||
this.snackBar.open(message, 'Close', { panelClass: ['error'], duration: 3000 }); | ||
} | ||
|
||
showMessage(message: string) { | ||
this.snackBar.open(message, 'Close', { | ||
panelClass: ['success'], | ||
duration: 2000, | ||
verticalPosition: 'top', | ||
horizontalPosition: 'right', | ||
}); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the changes in this file part of this PR? If not, remove the commits to only include changes for the specific issue you are solving :)