@@ -205,9 +217,10 @@ import {
} from "@/libs/endorserServer";
import AlertMessage from "@/components/AlertMessage";
import QuickNav from "@/components/QuickNav";
+import EntityIcon from "@/components/EntityIcon";
@Component({
- components: { GiftedDialog, AlertMessage, QuickNav },
+ components: { GiftedDialog, AlertMessage, QuickNav, EntityIcon },
})
export default class ProjectViewView extends Vue {
activeDid = "";
@@ -317,16 +330,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);
}
}
@@ -340,12 +375,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,
@@ -361,11 +411,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,
@@ -396,16 +462,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;
}
@@ -424,21 +502,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 0def123..5abfc73 100644
--- a/src/views/ProjectsView.vue
+++ b/src/views/ProjectsView.vue
@@ -50,10 +50,11 @@
class="block py-4 flex gap-4"
>
-
+
@@ -82,9 +83,10 @@ import { IIdentifier } from "@veramo/core";
import InfiniteScroll from "@/components/InfiniteScroll";
import AlertMessage from "@/components/AlertMessage";
import QuickNav from "@/components/QuickNav";
+import EntityIcon from "@/components/EntityIcon";
@Component({
- components: { InfiniteScroll, AlertMessage, QuickNav },
+ components: { InfiniteScroll, AlertMessage, QuickNav, EntityIcon },
})
export default class ProjectsView extends Vue {
apiServer = "";
@@ -126,8 +128,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 +205,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 +221,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 0812904..05f3ea1 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 d987553..0c2c7d6 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,
+ );
}
}