{{ notification.text }}
+{{ notification.text }}
+ + +{{ notification.text }}
+ + +{{ notification.text }}
+ + +{{ notification.text }}
+ + +Show appreciation to a contact:
@@ -157,10 +245,17 @@ export default class HomeView extends Vue { this.feedLastViewedId = settings?.lastViewedClaimId; this.updateAllFeed(); } catch (err) { - this.alertTitle = "Error"; - this.alertMessage = - err.userMessage || - "There was an error retrieving the latest sweet, sweet action."; + this.$notify( + { + group: "alert", + type: "danger", + title: "Error", + text: + err.userMessage || + "There was an error retrieving the latest sweet, sweet action.", + }, + -1, + ); } } @@ -209,9 +304,15 @@ export default class HomeView extends Vue { }) .catch((e) => { console.log("Error with feed load:", e); - this.alertMessage = - e.userMessage || "There was an error retrieving feed data."; - this.alertTitle = "Error"; + this.$notify( + { + group: "alert", + type: "danger", + title: "Export Error", + text: e.userMessage || "There was an error retrieving feed data.", + }, + -1, + ); }); this.isHiddenSpinner = true; @@ -302,17 +403,27 @@ export default class HomeView extends Vue { */ public async recordGive(giverDid, description, hours) { if (!this.activeDid) { - this.setAlert( - "Error", - "You must select an identity before you can record a give.", + this.$notify( + { + group: "alert", + type: "danger", + title: "Error", + text: "You must select an identity before you can record a give.", + }, + -1, ); return; } if (!description && !hours) { - this.setAlert( - "Error", - "You must enter a description or some number of hours.", + this.$notify( + { + group: "alert", + type: "danger", + title: "Error", + text: "You must enter a description or some number of hours.", + }, + -1, ); return; } @@ -332,19 +443,38 @@ export default class HomeView extends Vue { if (this.isGiveCreationError(result)) { const errorMessage = this.getGiveCreationErrorMessage(result); console.log("Error with give result:", result); - this.setAlert( - "Error", - errorMessage || "There was an error recording the give.", + this.$notify( + { + group: "alert", + type: "danger", + title: "Error", + text: errorMessage || "There was an error recording the give.", + }, + -1, ); } else { - this.setAlert("Success", "That gift was recorded."); + this.$notify( + { + group: "alert", + type: "success", + title: "Success", + text: "That gift was recorded.", + }, + -1, + ); } } catch (error) { console.log("Error with give caught:", error); - this.setAlert( - "Error", - this.getGiveErrorMessage(error) || - "There was an error recording the give.", + this.$notify( + { + group: "alert", + type: "danger", + title: "Error", + text: + this.getGiveErrorMessage(error) || + "There was an error recording the give.", + }, + -1, ); } } diff --git a/src/views/IdentitySwitcherView.vue b/src/views/IdentitySwitcherView.vue index f378e511..41fdfef5 100644 --- a/src/views/IdentitySwitcherView.vue +++ b/src/views/IdentitySwitcherView.vue @@ -133,13 +133,19 @@ export default class IdentitySwitcherView extends Vue { this.limitsMessage = "No identity."; this.loadingLimits = false; } else { - this.alertMessage = - "Clear your cache and start over (after data backup)."; + this.$notify( + { + group: "alert", + type: "danger", + title: "Error Creating Account", + text: "Clear your cache and start over (after data backup).", + }, + -1, + ); console.error( "Telling user to clear cache at page create because:", err, ); - this.alertTitle = "Error Creating Account"; } } } diff --git a/src/views/NewEditProjectView.vue b/src/views/NewEditProjectView.vue index f50e129d..cf331231 100644 --- a/src/views/NewEditProjectView.vue +++ b/src/views/NewEditProjectView.vue @@ -245,20 +245,41 @@ export default class NewEditProjectView extends Vue { if (serverError) { if (Object.prototype.hasOwnProperty.call(serverError, "message")) { console.log(serverError); - this.alertTitle = "User Message"; userMessage = serverError.response.data.error.message; // This is info for the user. - this.alertMessage = userMessage; + this.$notify( + { + group: "alert", + type: "danger", + title: "User Message", + text: userMessage, + }, + -1, + ); } else { - this.alertTitle = "Server Message"; - this.alertMessage = JSON.stringify(serverError.toJSON()); + this.$notify( + { + group: "alert", + type: "danger", + title: "Server Message", + text: JSON.stringify(serverError.toJSON()), + }, + -1, + ); } } else { console.error( "Here's the full error trying to save the claim:", error, ); - this.alertTitle = "Claim Error"; - this.alertMessage = error as string; + this.$notify( + { + group: "alert", + type: "danger", + title: "Claim Error", + text: error as string, + }, + -1, + ); } // Now set that error for the user to see. this.errorMessage = userMessage; diff --git a/src/views/ProjectViewView.vue b/src/views/ProjectViewView.vue index 00f54d9d..5fa3dbc3 100644 --- a/src/views/ProjectViewView.vue +++ b/src/views/ProjectViewView.vue @@ -295,16 +295,38 @@ export default class ProjectViewView extends Vue { this.truncatedDesc = this.description.slice(0, this.truncateLength); } else if (resp.status === 404) { // actually, axios throws an error so we never get here - this.alertMessage = "That project does not exist."; + this.$notify( + { + group: "alert", + type: "danger", + title: "Error", + text: "That project does not exist.", + }, + -1, + ); } } catch (error: unknown) { const serverError = error as AxiosError; if (serverError.response?.status === 404) { - this.alertMessage = "That project does not exist."; + this.$notify( + { + group: "alert", + type: "danger", + title: "Error", + text: "That project does not exist.", + }, + -1, + ); } else { - this.alertMessage = - "Something went wrong retrieving that project." + - " See logs for more info."; + this.$notify( + { + group: "alert", + type: "danger", + title: "Error", + text: "Something went wrong retrieving that project. See logs for more info.", + }, + -1, + ); console.error("Error retrieving project:", serverError.message); } } @@ -318,12 +340,27 @@ export default class ProjectViewView extends Vue { if (resp.status === 200 && resp.data.data) { this.givesToThis = resp.data.data; } else { - this.alertMessage = "Failed to retrieve gives to this project."; + this.$notify( + { + group: "alert", + type: "danger", + title: "Error", + text: "Failed to retrieve gives to this project.", + }, + -1, + ); } } catch (error: unknown) { const serverError = error as AxiosError; - this.alertMessage = - "Something went wrong retrieving gives to this project."; + this.$notify( + { + group: "alert", + type: "danger", + title: "Error", + text: "Something went wrong retrieving gives to this project.", + }, + -1, + ); console.error( "Error retrieving gives to this project:", serverError.message, @@ -339,11 +376,27 @@ export default class ProjectViewView extends Vue { if (resp.status === 200 && resp.data.data) { this.givesByThis = resp.data.data; } else { - this.alertMessage = "Failed to retrieve gives by this project."; + this.$notify( + { + group: "alert", + type: "danger", + title: "Error", + text: "Failed to retrieve gives by this project.", + }, + -1, + ); } } catch (error: unknown) { const serverError = error as AxiosError; - this.alertMessage = "Something went wrong retrieving gives by project."; + this.$notify( + { + group: "alert", + type: "danger", + title: "Error", + text: "Something went wrong retrieving gives by project.", + }, + -1, + ); console.error( "Error retrieving gives by this project:", serverError.message, @@ -374,16 +427,28 @@ export default class ProjectViewView extends Vue { */ async recordGive(giverDid, description, hours) { if (!this.activeDid) { - this.alertTitle = "Error"; - this.alertMessage = - "You must select an identity before you can record a give."; + this.$notify( + { + group: "alert", + type: "danger", + title: "Error", + text: "You must select an identity before you can record a give.", + }, + -1, + ); return; } if (!description && !hours) { - this.alertTitle = "Error"; - this.alertMessage = - "You must enter a description or some number of hours."; + this.$notify( + { + group: "alert", + type: "danger", + title: "Error", + text: "You must enter a description or some number of hours.", + }, + -1, + ); return; } @@ -402,21 +467,42 @@ export default class ProjectViewView extends Vue { if (result.status !== 201 || result.data?.error) { console.log("Error with give result:", result); - this.alertTitle = "Error"; - this.alertMessage = - result.data?.error?.message || - "There was an error recording the give."; + this.$notify( + { + group: "alert", + type: "danger", + title: "Error", + text: + result.data?.error?.message || + "There was an error recording the give.", + }, + -1, + ); } else { - this.alertTitle = "Success"; - this.alertMessage = "That gift was recorded."; + this.$notify( + { + group: "alert", + type: "success", + title: "Success", + text: "That gift was recorded.", + }, + -1, + ); } } catch (e) { console.log("Error with give caught:", e); - this.alertTitle = "Error"; - this.alertMessage = - e.userMessage || - e.response?.data?.error?.message || - "There was an error recording the give."; + this.$notify( + { + group: "alert", + type: "danger", + title: "Error", + text: + e.userMessage || + e.response?.data?.error?.message || + "There was an error recording the give.", + }, + -1, + ); } } } diff --git a/src/views/ProjectsView.vue b/src/views/ProjectsView.vue index 0def1230..3605e072 100644 --- a/src/views/ProjectsView.vue +++ b/src/views/ProjectsView.vue @@ -126,8 +126,15 @@ export default class ProjectsView extends Vue { } } catch (error) { console.error("Got error loading projects:", error.message); - this.alertTitle = "Error"; - this.alertMessage = "Got an error loading projects:" + error.message; + this.$notify( + { + group: "alert", + type: "danger", + title: "Error", + text: "Got an error loading projects: " + error.message, + }, + -1, + ); } finally { this.isLoading = false; } @@ -196,8 +203,15 @@ export default class ProjectsView extends Vue { if (this.numAccounts === 0) { console.error("No accounts found."); - this.alertTitle = "Error"; - this.alertMessage = "You need an identity to load your projects."; + this.$notify( + { + group: "alert", + type: "danger", + title: "Error", + text: "You need an identity to load your projects.", + }, + -1, + ); } else { const identity = await this.getIdentity(activeDid); this.current = identity; @@ -205,8 +219,15 @@ export default class ProjectsView extends Vue { } } catch (err) { console.log("Error initializing:", err); - this.alertTitle = "Error"; - this.alertMessage = "Something went wrong loading your projects."; + this.$notify( + { + group: "alert", + type: "danger", + title: "Error", + text: "Something went wrong loading your projects.", + }, + -1, + ); } } diff --git a/src/views/SeedBackupView.vue b/src/views/SeedBackupView.vue index 08129049..05f3ea1f 100644 --- a/src/views/SeedBackupView.vue +++ b/src/views/SeedBackupView.vue @@ -72,8 +72,15 @@ export default class SeedBackupView extends Vue { this.activeAccount = R.find((acc) => acc.did === activeDid, accounts); } catch (err) { console.error("Got an error loading an identity:", err); - this.alertTitle = "Error Loading Account"; - this.alertMessage = "Got an error loading your seed data."; + this.$notify( + { + group: "alert", + type: "danger", + title: "Error Loading Account", + text: "Got an error loading your seed data.", + }, + -1, + ); } } diff --git a/src/views/StatisticsView.vue b/src/views/StatisticsView.vue index d9875533..0c2c7d62 100644 --- a/src/views/StatisticsView.vue +++ b/src/views/StatisticsView.vue @@ -62,8 +62,15 @@ export default class StatisticsView extends Vue { this.world = newWorld; } catch (err) { console.log(err); - this.alertTitle = "Mounting error"; - this.alertMessage = err.message; + this.$notify( + { + group: "alert", + type: "danger", + title: "Mounting Error", + text: err.message, + }, + -1, + ); } }