Skip to content
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

USH 1204 - Errors in console after CSV Import #924

Merged
merged 2 commits into from
Mar 28, 2024
Merged

Conversation

ushahidlee
Copy link
Contributor

This PR fixes some issues following a CSV import, specifically allowing the user to be notified that the job was successful or not. Previously this functionality was incomplete, meaning the status page would endlessly loop, the user would never be notified of the job's success or failure and the console would fill up with errors.

https://linear.app/ushahidi/issue/USH-1204/messy-console-with-error-code-500-when-attempting-import

@ushahidlee ushahidlee requested a review from Angamanga March 20, 2024 04:32
Copy link

linear bot commented Mar 20, 2024

Copy link
Contributor

@Angamanga Angamanga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works but a change is needed in the showNotification-function in order to show the correct string in the notification-bar.

@@ -25,6 +25,7 @@ export class ImportResultsComponent implements OnInit {

ngOnInit(): void {
const jobId = this.route.snapshot.queryParamMap.get('job')?.split(',');
console.log(jobId);
if (jobId) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the console.log 🙃

result.forEach((job: any) => {
if (job.result.status === 'SUCCESS') {
this.showNotification('success');
this.importFinished.next(job.result);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works, but the text in the notification says "Upload complete. You should now see your tagged data in your HDX account.", I think it is the title that is hardcoded on row 95. Maybe we need to send that from the start instead in order to be able to reuse the function?

@ushahidlee ushahidlee merged commit 44b6af3 into development Mar 28, 2024
10 of 12 checks passed
tuxpiper pushed a commit that referenced this pull request May 10, 2024
* First cut, basic functionality fixed. Probably should clean it up though

* Removed the snackbar stuff and added an error result page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants