forked from trent_larson/crowd-funder-for-time-pwa
Compare commits
2 Commits
ui-fix
...
contact-am
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5addc3c206 | ||
|
|
69f2f3cfd2 |
17
package-lock.json
generated
17
package-lock.json
generated
@@ -38,7 +38,6 @@
|
|||||||
"luxon": "^3.3.0",
|
"luxon": "^3.3.0",
|
||||||
"merkletreejs": "^0.3.10",
|
"merkletreejs": "^0.3.10",
|
||||||
"moment": "^2.29.4",
|
"moment": "^2.29.4",
|
||||||
"notiwind": "^2.0.2",
|
|
||||||
"papaparse": "^5.4.1",
|
"papaparse": "^5.4.1",
|
||||||
"pina": "^0.20.2204228",
|
"pina": "^0.20.2204228",
|
||||||
"pinia-plugin-persistedstate": "^3.1.0",
|
"pinia-plugin-persistedstate": "^3.1.0",
|
||||||
@@ -20929,11 +20928,6 @@
|
|||||||
"node": ">= 8"
|
"node": ">= 8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mitt": {
|
|
||||||
"version": "3.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz",
|
|
||||||
"integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw=="
|
|
||||||
},
|
|
||||||
"node_modules/mkdirp": {
|
"node_modules/mkdirp": {
|
||||||
"version": "0.5.6",
|
"version": "0.5.6",
|
||||||
"resolved": "https://registry.npmmirror.com/mkdirp/-/mkdirp-0.5.6.tgz",
|
"resolved": "https://registry.npmmirror.com/mkdirp/-/mkdirp-0.5.6.tgz",
|
||||||
@@ -21281,17 +21275,6 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/notiwind": {
|
|
||||||
"version": "2.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/notiwind/-/notiwind-2.0.2.tgz",
|
|
||||||
"integrity": "sha512-wMCf+07E093d0Q78C5UHroT9GQHm4mIGerhg7dGLJ0GN6zONqKj8nTR3clkq/Y44On9k28/0DtDNwOX7FT5p/A==",
|
|
||||||
"dependencies": {
|
|
||||||
"mitt": "^3.0.1"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"vue": "^3.3.4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/npm-package-arg": {
|
"node_modules/npm-package-arg": {
|
||||||
"version": "7.0.0",
|
"version": "7.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-7.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-7.0.0.tgz",
|
||||||
|
|||||||
@@ -38,7 +38,6 @@
|
|||||||
"luxon": "^3.3.0",
|
"luxon": "^3.3.0",
|
||||||
"merkletreejs": "^0.3.10",
|
"merkletreejs": "^0.3.10",
|
||||||
"moment": "^2.29.4",
|
"moment": "^2.29.4",
|
||||||
"notiwind": "^2.0.2",
|
|
||||||
"papaparse": "^5.4.1",
|
"papaparse": "^5.4.1",
|
||||||
"pina": "^0.20.2204228",
|
"pina": "^0.20.2204228",
|
||||||
"pinia-plugin-persistedstate": "^3.1.0",
|
"pinia-plugin-persistedstate": "^3.1.0",
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ tasks:
|
|||||||
|
|
||||||
- 24 Move to Vite
|
- 24 Move to Vite
|
||||||
|
|
||||||
- .5 add link to further project / people when a project pays ahead
|
|
||||||
- .5 add project ID to the URL, to make a project publicly-accessible
|
- .5 add project ID to the URL, to make a project publicly-accessible
|
||||||
- .5 remove edit from project page for projects owned by others
|
- .5 remove edit from project page for projects owned by others
|
||||||
- .5 fix where user 0 sees no txns from user 1 on contacts page but sees them on list page
|
- .5 fix where user 0 sees no txns from user 1 on contacts page but sees them on list page
|
||||||
|
|||||||
127
src/App.vue
127
src/App.vue
@@ -1,132 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<router-view />
|
<router-view />
|
||||||
|
|
||||||
<NotificationGroup group="alert">
|
|
||||||
<div
|
|
||||||
class="fixed top-4 right-4 w-full max-w-sm flex flex-col items-start justify-end"
|
|
||||||
>
|
|
||||||
<Notification
|
|
||||||
v-slot="{ notifications, close }"
|
|
||||||
enter="transform ease-out duration-300 transition"
|
|
||||||
enter-from="translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-4"
|
|
||||||
enter-to="translate-y-0 opacity-100 sm:translate-x-0"
|
|
||||||
leave="transition ease-in duration-500"
|
|
||||||
leave-from="opacity-100"
|
|
||||||
leave-to="opacity-0"
|
|
||||||
move="transition duration-500"
|
|
||||||
move-delay="delay-300"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
v-for="notification in notifications"
|
|
||||||
:key="notification.id"
|
|
||||||
class="w-full"
|
|
||||||
role="alert"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
v-if="notification.type === 'toast'"
|
|
||||||
class="w-full max-w-sm mx-auto mb-3 overflow-hidden bg-slate-900/90 text-white rounded-lg shadow-md"
|
|
||||||
>
|
|
||||||
<div class="w-full px-4 py-3">
|
|
||||||
<span class="font-semibold">{{ notification.title }}</span>
|
|
||||||
<p class="text-sm">{{ notification.text }}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
|
||||||
v-if="notification.type === 'info'"
|
|
||||||
class="flex w-full max-w-sm mx-auto mb-3 overflow-hidden bg-slate-100 rounded-lg shadow-md"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="flex items-center justify-center w-12 bg-slate-600 text-slate-100"
|
|
||||||
>
|
|
||||||
<fa icon="circle-info" class="fa-fw fa-xl"></fa>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="relative w-full pl-4 pr-8 py-2 text-slate-900">
|
|
||||||
<span class="font-semibold">{{ notification.title }}</span>
|
|
||||||
<p class="text-sm">{{ notification.text }}</p>
|
|
||||||
|
|
||||||
<button
|
|
||||||
@click="close(notification.id)"
|
|
||||||
class="absolute top-2 right-2 px-0.5 py-0 rounded-full bg-slate-200 text-slate-600"
|
|
||||||
>
|
|
||||||
<fa icon="xmark" class="fa-fw"></fa>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
|
||||||
v-if="notification.type === 'success'"
|
|
||||||
class="flex w-full max-w-sm mx-auto mb-3 overflow-hidden bg-emerald-100 rounded-lg shadow-md"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="flex items-center justify-center w-12 bg-emerald-600 text-emerald-100"
|
|
||||||
>
|
|
||||||
<fa icon="circle-info" class="fa-fw fa-xl"></fa>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="relative w-full pl-4 pr-8 py-2 text-emerald-900">
|
|
||||||
<span class="font-semibold">{{ notification.title }}</span>
|
|
||||||
<p class="text-sm">{{ notification.text }}</p>
|
|
||||||
|
|
||||||
<button
|
|
||||||
@click="close(notification.id)"
|
|
||||||
class="absolute top-2 right-2 px-0.5 py-0 rounded-full bg-emerald-200 text-emerald-600"
|
|
||||||
>
|
|
||||||
<fa icon="xmark" class="fa-fw"></fa>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
|
||||||
v-if="notification.type === 'warning'"
|
|
||||||
class="flex w-full max-w-sm mx-auto mb-3 overflow-hidden bg-amber-100 rounded-lg shadow-md"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="flex items-center justify-center w-12 bg-amber-600 text-amber-100"
|
|
||||||
>
|
|
||||||
<fa icon="triangle-exclamation" class="fa-fw fa-xl"></fa>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="relative w-full pl-4 pr-8 py-2 text-amber-900">
|
|
||||||
<span class="font-semibold">{{ notification.title }}</span>
|
|
||||||
<p class="text-sm">{{ notification.text }}</p>
|
|
||||||
|
|
||||||
<button
|
|
||||||
@click="close(notification.id)"
|
|
||||||
class="absolute top-2 right-2 px-0.5 py-0 rounded-full bg-amber-200 text-amber-600"
|
|
||||||
>
|
|
||||||
<fa icon="xmark" class="fa-fw"></fa>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
|
||||||
v-if="notification.type === 'danger'"
|
|
||||||
class="flex w-full max-w-sm mx-auto mb-3 overflow-hidden bg-rose-100 rounded-lg shadow-md"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="flex items-center justify-center w-12 bg-rose-600 text-rose-100"
|
|
||||||
>
|
|
||||||
<fa icon="triangle-exclamation" class="fa-fw fa-xl"></fa>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="relative w-full pl-4 pr-8 py-2 text-rose-900">
|
|
||||||
<span class="font-semibold">{{ notification.title }}</span>
|
|
||||||
<p class="text-sm">{{ notification.text }}</p>
|
|
||||||
|
|
||||||
<button
|
|
||||||
@click="close(notification.id)"
|
|
||||||
class="absolute top-2 right-2 px-0.5 py-0 rounded-full bg-rose-200 text-rose-600"
|
|
||||||
>
|
|
||||||
<fa icon="xmark" class="fa-fw"></fa>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</Notification>
|
|
||||||
</div>
|
|
||||||
</NotificationGroup>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style></style>
|
<style></style>
|
||||||
|
|||||||
@@ -82,15 +82,10 @@ export function isHiddenDid(did) {
|
|||||||
/**
|
/**
|
||||||
always returns text, maybe UNNAMED_VISIBLE or UNKNOWN_ENTITY
|
always returns text, maybe UNNAMED_VISIBLE or UNKNOWN_ENTITY
|
||||||
**/
|
**/
|
||||||
export function didInfo(
|
export function didInfo(did, activeDid, allMyDids, contacts) {
|
||||||
did: string,
|
const myId: string | undefined = R.find(R.identity, allMyDids);
|
||||||
activeDid: string,
|
|
||||||
allMyDids: Array<string>,
|
|
||||||
contacts: Array<Contact>,
|
|
||||||
): string {
|
|
||||||
const myId: string | undefined = R.find(R.equals(did), allMyDids, did);
|
|
||||||
if (myId) {
|
if (myId) {
|
||||||
return "You" + (myId !== activeDid ? " (Alt ID)" : "");
|
return "You" + (myId.did !== activeDid ? " (Alt ID)" : "");
|
||||||
} else {
|
} else {
|
||||||
const contact: Contact | undefined = R.find((c) => c.did === did, contacts);
|
const contact: Contact | undefined = R.find((c) => c.did === did, contacts);
|
||||||
if (contact) {
|
if (contact) {
|
||||||
|
|||||||
10
src/main.ts
10
src/main.ts
@@ -5,19 +5,19 @@ import "./registerServiceWorker";
|
|||||||
import router from "./router";
|
import router from "./router";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import VueAxios from "vue-axios";
|
import VueAxios from "vue-axios";
|
||||||
import Notifications from "notiwind";
|
|
||||||
|
|
||||||
import "./assets/styles/tailwind.css";
|
import "./assets/styles/tailwind.css";
|
||||||
|
|
||||||
import { library } from "@fortawesome/fontawesome-svg-core";
|
import { library } from "@fortawesome/fontawesome-svg-core";
|
||||||
import {
|
import {
|
||||||
|
faArrowLeft,
|
||||||
|
faArrowRight,
|
||||||
faBurst,
|
faBurst,
|
||||||
faCalendar,
|
faCalendar,
|
||||||
faChevronLeft,
|
faChevronLeft,
|
||||||
faChevronRight,
|
faChevronRight,
|
||||||
faCircle,
|
faCircle,
|
||||||
faCircleCheck,
|
faCircleCheck,
|
||||||
faCircleInfo,
|
|
||||||
faCircleQuestion,
|
faCircleQuestion,
|
||||||
faCircleUser,
|
faCircleUser,
|
||||||
faClock,
|
faClock,
|
||||||
@@ -47,20 +47,20 @@ import {
|
|||||||
faSquareCaretDown,
|
faSquareCaretDown,
|
||||||
faSquareCaretUp,
|
faSquareCaretUp,
|
||||||
faTrashCan,
|
faTrashCan,
|
||||||
faTriangleExclamation,
|
|
||||||
faUser,
|
faUser,
|
||||||
faUsers,
|
faUsers,
|
||||||
faXmark,
|
faXmark,
|
||||||
} from "@fortawesome/free-solid-svg-icons";
|
} from "@fortawesome/free-solid-svg-icons";
|
||||||
|
|
||||||
library.add(
|
library.add(
|
||||||
|
faArrowLeft,
|
||||||
|
faArrowRight,
|
||||||
faBurst,
|
faBurst,
|
||||||
faCalendar,
|
faCalendar,
|
||||||
faChevronLeft,
|
faChevronLeft,
|
||||||
faChevronRight,
|
faChevronRight,
|
||||||
faCircle,
|
faCircle,
|
||||||
faCircleCheck,
|
faCircleCheck,
|
||||||
faCircleInfo,
|
|
||||||
faCircleQuestion,
|
faCircleQuestion,
|
||||||
faCircleUser,
|
faCircleUser,
|
||||||
faClock,
|
faClock,
|
||||||
@@ -90,7 +90,6 @@ library.add(
|
|||||||
faSquareCaretDown,
|
faSquareCaretDown,
|
||||||
faSquareCaretUp,
|
faSquareCaretUp,
|
||||||
faTrashCan,
|
faTrashCan,
|
||||||
faTriangleExclamation,
|
|
||||||
faUser,
|
faUser,
|
||||||
faUsers,
|
faUsers,
|
||||||
faXmark,
|
faXmark,
|
||||||
@@ -103,5 +102,4 @@ createApp(App)
|
|||||||
.use(createPinia())
|
.use(createPinia())
|
||||||
.use(VueAxios, axios)
|
.use(VueAxios, axios)
|
||||||
.use(router)
|
.use(router)
|
||||||
.use(Notifications)
|
|
||||||
.mount("#app");
|
.mount("#app");
|
||||||
|
|||||||
@@ -182,14 +182,4 @@ const router = createRouter({
|
|||||||
routes,
|
routes,
|
||||||
});
|
});
|
||||||
|
|
||||||
const errorHandler = (error, to, from) => {
|
|
||||||
// Handle the error here
|
|
||||||
console.error(error, to, from);
|
|
||||||
console.log("XXXXX");
|
|
||||||
|
|
||||||
// You can also perform additional actions, such as displaying an error message or redirecting the user to a specific page
|
|
||||||
};
|
|
||||||
|
|
||||||
router.onError(errorHandler); // Assign the error handler to the router instance
|
|
||||||
|
|
||||||
export default router;
|
export default router;
|
||||||
|
|||||||
@@ -400,19 +400,13 @@ export default class AccountViewView extends Vue {
|
|||||||
this.limitsMessage = "No identity.";
|
this.limitsMessage = "No identity.";
|
||||||
this.loadingLimits = false;
|
this.loadingLimits = false;
|
||||||
} else {
|
} else {
|
||||||
this.$notify(
|
this.alertMessage =
|
||||||
{
|
"Clear your cache and start over (after data backup).";
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Error Creating Account",
|
|
||||||
text: "Clear your cache and start over (after data backup).",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
console.error(
|
console.error(
|
||||||
"Telling user to clear cache at page create because:",
|
"Telling user to clear cache at page create because:",
|
||||||
err,
|
err,
|
||||||
);
|
);
|
||||||
|
this.alertTitle = "Error Creating Account";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -424,19 +418,13 @@ export default class AccountViewView extends Vue {
|
|||||||
showContactGivesInline: this.showContactGives,
|
showContactGivesInline: this.showContactGives,
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.$notify(
|
this.alertMessage =
|
||||||
{
|
"Clear your cache and start over (after data backup).";
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Error Updating Contact Setting",
|
|
||||||
text: "Clear your cache and start over (after data backup).",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
console.error(
|
console.error(
|
||||||
"Telling user to clear cache after contact setting update because:",
|
"Telling user to clear cache after contact setting update because:",
|
||||||
err,
|
err,
|
||||||
);
|
);
|
||||||
|
this.alertTitle = "Error Updating Contact Setting";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -452,25 +440,11 @@ export default class AccountViewView extends Vue {
|
|||||||
|
|
||||||
URL.revokeObjectURL(url);
|
URL.revokeObjectURL(url);
|
||||||
|
|
||||||
this.$notify(
|
this.alertTitle = "Download Started";
|
||||||
{
|
this.alertMessage = "See your downloads directory for the backup.";
|
||||||
group: "alert",
|
|
||||||
type: "toast",
|
|
||||||
title: "Download Started",
|
|
||||||
text: "See your downloads directory for the backup.",
|
|
||||||
},
|
|
||||||
5000,
|
|
||||||
);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.$notify(
|
this.alertTitle = "Export Error";
|
||||||
{
|
this.alertMessage = "See console logs for more info.";
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Export Error",
|
|
||||||
text: "See console logs for more info.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
console.error("Export Error:", error);
|
console.error("Export Error:", error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,66 +6,73 @@
|
|||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<!-- Results List -->
|
<!-- Results List -->
|
||||||
<div>
|
<table
|
||||||
<div class="border-b border-slate-300 flex">
|
class="table-auto w-full border-t border-slate-300 text-sm sm:text-base text-center"
|
||||||
<div class="w-1/4"></div>
|
>
|
||||||
<div class="w-1/4">from them</div>
|
<thead class="bg-slate-100">
|
||||||
<div class="w-1/4"></div>
|
<tr class="border-b border-slate-300">
|
||||||
<div class="w-1/4">to them</div>
|
<th></th>
|
||||||
</div>
|
<th class="px-1 py-2">From Them</th>
|
||||||
<div
|
<th></th>
|
||||||
class="border-b border-slate-300 flex"
|
<th class="px-1 py-2">To Them</th>
|
||||||
v-for="record in giveRecords"
|
</tr>
|
||||||
:key="record.id"
|
</thead>
|
||||||
>
|
<tbody>
|
||||||
<div class="w-1/4">
|
<tr
|
||||||
{{ new Date(record.issuedAt).toLocaleString() }}
|
v-for="record in giveRecords"
|
||||||
</div>
|
:key="record.id"
|
||||||
<div class="w-1/4">
|
class="border-b border-slate-300"
|
||||||
<span v-if="record.agentDid == contact.did">
|
>
|
||||||
<div class="font-bold">
|
<td class="p-1 text-xs sm:text-sm text-left text-slate-500">
|
||||||
{{ record.amount }} {{ record.unit }}
|
{{ new Date(record.issuedAt).toLocaleString() }}
|
||||||
<span v-if="record.amountConfirmed" class="tooltip">
|
</td>
|
||||||
<fa icon="circle-check" class="text-green-600 fa-fw ml-1" />
|
<td class="p-1">
|
||||||
<span class="tooltiptext">Confirmed</span>
|
<span v-if="record.agentDid == contact.did">
|
||||||
</span>
|
<div class="font-bold">
|
||||||
<button v-else class="tooltip" @click="confirm(record)">
|
{{ record.amount }} {{ record.unit }}
|
||||||
<fa icon="circle" class="text-blue-600 fa-fw ml-1" />
|
<span v-if="record.amountConfirmed" title="Confirmed">
|
||||||
<span class="tooltiptext">Unconfirmed</span>
|
<fa icon="circle-check" class="text-green-600 fa-fw" />
|
||||||
</button>
|
</span>
|
||||||
</div>
|
<button v-else @click="confirm(record)" title="Unconfirmed">
|
||||||
<br />
|
<fa icon="circle" class="text-blue-600 fa-fw" />
|
||||||
{{ record.description }}
|
</button>
|
||||||
</span>
|
</div>
|
||||||
</div>
|
<div class="italic text-xs sm:text-sm text-slate-500">
|
||||||
<div class="w-1/8">
|
{{ record.description }}
|
||||||
<span v-if="record.agentDid == contact.did">
|
</div>
|
||||||
<fa icon="long-arrow-alt-left" class="text-slate-900 fa-fw ml-1" />
|
</span>
|
||||||
</span>
|
</td>
|
||||||
<span v-else>
|
<td class="p-1">
|
||||||
|
<span v-if="record.agentDid == contact.did">
|
||||||
<fa icon="long-arrow-alt-right" class="text-slate-900 fa-fw ml-1" />
|
<fa icon="arrow-left" class="text-slate-400 fa-fw" />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
<span v-else>
|
||||||
<div class="w-1/4">
|
<fa icon="arrow-right" class="text-slate-400 fa-fw" />
|
||||||
<span v-if="record.agentDid != contact.did">
|
</span>
|
||||||
<div class="font-bold">
|
</td>
|
||||||
{{ record.amount }} {{ record.unit }}
|
<td class="p-1">
|
||||||
<span v-if="record.amountConfirmed" class="tooltip">
|
<span v-if="record.agentDid != contact.did">
|
||||||
<fa icon="circle-check" class="text-green-600 fa-fw ml-1" />
|
<div class="font-bold">
|
||||||
<span class="tooltiptext">Confirmed</span>
|
{{ record.amount }} {{ record.unit }}
|
||||||
</span>
|
<span v-if="record.amountConfirmed" title="Confirmed">
|
||||||
<button v-else class="tooltip" @click="cannotConfirmMessage()">
|
<fa icon="circle-check" class="text-green-600 fa-fw" />
|
||||||
<fa icon="circle" class="text-slate-600 fa-fw ml-1" />
|
</span>
|
||||||
<span class="tooltiptext">Unconfirmed</span>
|
<button
|
||||||
</button>
|
v-else
|
||||||
</div>
|
@click="cannotConfirmMessage()"
|
||||||
<br />
|
title="Unconfirmed"
|
||||||
{{ record.description }}
|
>
|
||||||
</span>
|
<fa icon="circle" class="text-slate-600 fa-fw" />
|
||||||
</div>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="italic text-xs sm:text-sm text-slate-500">
|
||||||
|
{{ record.description }}
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
<AlertMessage
|
<AlertMessage
|
||||||
:alertTitle="alertTitle"
|
:alertTitle="alertTitle"
|
||||||
:alertMessage="alertMessage"
|
:alertMessage="alertMessage"
|
||||||
@@ -146,17 +153,10 @@ export default class ContactsView extends Vue {
|
|||||||
this.loadGives(this.activeDid, this.contact);
|
this.loadGives(this.activeDid, this.contact);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.$notify(
|
this.alertTitle = "Error";
|
||||||
{
|
this.alertMessage =
|
||||||
group: "alert",
|
err.userMessage ||
|
||||||
type: "danger",
|
"There was an error retrieving the latest sweet, sweet action.";
|
||||||
title: "Error",
|
|
||||||
text:
|
|
||||||
err.userMessage ||
|
|
||||||
"There was an error retrieving the latest sweet, sweet action.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,15 +180,9 @@ export default class ContactsView extends Vue {
|
|||||||
resp.status,
|
resp.status,
|
||||||
resp.data,
|
resp.data,
|
||||||
);
|
);
|
||||||
this.$notify(
|
this.alertTitle = "Error With Server";
|
||||||
{
|
this.alertMessage =
|
||||||
group: "alert",
|
"Got an error retrieving your given time from the server.";
|
||||||
type: "danger",
|
|
||||||
title: "Error With Server",
|
|
||||||
text: "Got an error retrieving your given time from the server.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const url2 =
|
const url2 =
|
||||||
@@ -207,15 +201,9 @@ export default class ContactsView extends Vue {
|
|||||||
resp2.status,
|
resp2.status,
|
||||||
resp2.data,
|
resp2.data,
|
||||||
);
|
);
|
||||||
this.$notify(
|
this.alertTitle = "Error With Server";
|
||||||
{
|
this.alertMessage =
|
||||||
group: "alert",
|
"Got an error retrieving your given time from the server.";
|
||||||
type: "danger",
|
|
||||||
title: "Error With Server",
|
|
||||||
text: "Got an error retrieving your given time from the server.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const sortedResult: Array<GiveServerRecord> = R.sort(
|
const sortedResult: Array<GiveServerRecord> = R.sort(
|
||||||
@@ -225,15 +213,8 @@ export default class ContactsView extends Vue {
|
|||||||
);
|
);
|
||||||
this.giveRecords = sortedResult;
|
this.giveRecords = sortedResult;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.$notify(
|
this.alertTitle = "Error With Server";
|
||||||
{
|
this.alertMessage = error as string;
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Error With Server",
|
|
||||||
text: error as string,
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -302,29 +283,15 @@ export default class ContactsView extends Vue {
|
|||||||
userMessage = error as string;
|
userMessage = error as string;
|
||||||
}
|
}
|
||||||
// Now set that error for the user to see.
|
// Now set that error for the user to see.
|
||||||
this.$notify(
|
this.alertTitle = "Error With Server";
|
||||||
{
|
this.alertMessage = userMessage;
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Error With Server",
|
|
||||||
text: userMessage,
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cannotConfirmMessage() {
|
cannotConfirmMessage() {
|
||||||
this.$notify(
|
this.alertTitle = "Not Allowed";
|
||||||
{
|
this.alertMessage = "Only the recipient can confirm final receipt.";
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Not Allowed",
|
|
||||||
text: "Only the recipient can confirm final receipt.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -145,17 +145,10 @@ export default class HomeView extends Vue {
|
|||||||
this.feedLastViewedId = settings?.lastViewedClaimId;
|
this.feedLastViewedId = settings?.lastViewedClaimId;
|
||||||
this.updateAllFeed();
|
this.updateAllFeed();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.$notify(
|
this.alertTitle = "Error";
|
||||||
{
|
this.alertMessage =
|
||||||
group: "alert",
|
err.userMessage ||
|
||||||
type: "danger",
|
"There was an error retrieving the latest sweet, sweet action.";
|
||||||
title: "Error",
|
|
||||||
text:
|
|
||||||
err.userMessage ||
|
|
||||||
"There was an error retrieving the latest sweet, sweet action.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,27 +197,17 @@ export default class HomeView extends Vue {
|
|||||||
*/
|
*/
|
||||||
public async recordGive(giverDid, description, hours) {
|
public async recordGive(giverDid, description, hours) {
|
||||||
if (!this.activeDid) {
|
if (!this.activeDid) {
|
||||||
this.$notify(
|
this.setAlert(
|
||||||
{
|
"Error",
|
||||||
group: "alert",
|
"You must select an identity before you can record a give.",
|
||||||
type: "danger",
|
|
||||||
title: "Error",
|
|
||||||
text: "You must select an identity before you can record a give.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!description && !hours) {
|
if (!description && !hours) {
|
||||||
this.$notify(
|
this.setAlert(
|
||||||
{
|
"Error",
|
||||||
group: "alert",
|
"You must enter a description or some number of hours.",
|
||||||
type: "danger",
|
|
||||||
title: "Error",
|
|
||||||
text: "You must enter a description or some number of hours.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -244,38 +227,18 @@ export default class HomeView extends Vue {
|
|||||||
if (isGiveCreationError(result)) {
|
if (isGiveCreationError(result)) {
|
||||||
const errorMessage = getGiveCreationErrorMessage(result);
|
const errorMessage = getGiveCreationErrorMessage(result);
|
||||||
console.log("Error with give result:", result);
|
console.log("Error with give result:", result);
|
||||||
this.$notify(
|
this.setAlert(
|
||||||
{
|
"Error",
|
||||||
group: "alert",
|
errorMessage || "There was an error recording the give.",
|
||||||
type: "danger",
|
|
||||||
title: "Error",
|
|
||||||
text: errorMessage || "There was an error recording the give.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
this.$notify(
|
this.setAlert("Success", "That gift was recorded.");
|
||||||
{
|
|
||||||
group: "alert",
|
|
||||||
type: "success",
|
|
||||||
title: "Success",
|
|
||||||
text: "That gift was recorded.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Error with give caught:", error);
|
console.log("Error with give caught:", error);
|
||||||
this.$notify(
|
this.setAlert(
|
||||||
{
|
"Error",
|
||||||
group: "alert",
|
getGiveErrorMessage(error) || "There was an error recording the give.",
|
||||||
type: "danger",
|
|
||||||
title: "Error",
|
|
||||||
text:
|
|
||||||
getGiveErrorMessage(error) ||
|
|
||||||
"There was an error recording the give.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,15 +85,7 @@ export default class ContactQRScanShow extends Vue {
|
|||||||
const accounts = await accountsDB.accounts.toArray();
|
const accounts = await accountsDB.accounts.toArray();
|
||||||
const account = R.find((acc) => acc.did === this.activeDid, accounts);
|
const account = R.find((acc) => acc.did === this.activeDid, accounts);
|
||||||
if (!account) {
|
if (!account) {
|
||||||
this.$notify(
|
this.alertMessage = "You have no identity yet.";
|
||||||
{
|
|
||||||
group: "alert",
|
|
||||||
type: "warning",
|
|
||||||
title: "",
|
|
||||||
text: "You have no identity yet.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
const identity = await this.getIdentity(this.activeDid);
|
const identity = await this.getIdentity(this.activeDid);
|
||||||
const publicKeyHex = identity.keys[0].publicKeyHex;
|
const publicKeyHex = identity.keys[0].publicKeyHex;
|
||||||
|
|||||||
@@ -135,7 +135,7 @@
|
|||||||
<fa icon="trash-can" class="fa-fw" />
|
<fa icon="trash-can" class="fa-fw" />
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div v-if="showGiveNumbers" class="ml-auto flex gap-1.5">
|
<div v-if="!showGiveNumbers" class="ml-auto flex gap-1.5">
|
||||||
<button
|
<button
|
||||||
class="text-sm uppercase bg-blue-600 text-white px-2 py-1.5 rounded-md"
|
class="text-sm uppercase bg-blue-600 text-white px-2 py-1.5 rounded-md"
|
||||||
@click="onClickAddGive(activeDid, contact.did)"
|
@click="onClickAddGive(activeDid, contact.did)"
|
||||||
@@ -317,19 +317,12 @@ export default class ContactsView extends Vue {
|
|||||||
resp.status,
|
resp.status,
|
||||||
resp.data,
|
resp.data,
|
||||||
);
|
);
|
||||||
this.$notify(
|
this.alertTitle = "Error With Server";
|
||||||
{
|
this.alertMessage =
|
||||||
group: "alert",
|
"Got an error retrieving your " +
|
||||||
type: "danger",
|
resp.config.url.includes("recipientDid")
|
||||||
title: "Error With Server",
|
? "received"
|
||||||
text:
|
: "given" + " time from the server.";
|
||||||
"Got an error retrieving your " +
|
|
||||||
resp.config.url.includes("recipientDid")
|
|
||||||
? "received"
|
|
||||||
: "given" + " time from the server.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -377,15 +370,8 @@ export default class ContactsView extends Vue {
|
|||||||
this.givenToMeConfirmed = givenToMeConfirmed;
|
this.givenToMeConfirmed = givenToMeConfirmed;
|
||||||
this.givenToMeUnconfirmed = givenToMeUnconfirmed;
|
this.givenToMeUnconfirmed = givenToMeUnconfirmed;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.$notify(
|
this.alertTitle = "Error With Server";
|
||||||
{
|
this.alertMessage = error as string;
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Error With Server",
|
|
||||||
text: error as string,
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -478,32 +464,18 @@ export default class ContactsView extends Vue {
|
|||||||
try {
|
try {
|
||||||
const resp = await this.axios.post(url, payload, { headers });
|
const resp = await this.axios.post(url, payload, { headers });
|
||||||
if (resp.data?.success?.embeddedRecordError) {
|
if (resp.data?.success?.embeddedRecordError) {
|
||||||
|
this.alertTitle = "Registration Still Unknown";
|
||||||
let message = "There was some problem with the registration.";
|
let message = "There was some problem with the registration.";
|
||||||
if (typeof resp.data.success.embeddedRecordError == "string") {
|
if (typeof resp.data.success.embeddedRecordError == "string") {
|
||||||
message += " " + resp.data.success.embeddedRecordError;
|
message += " " + resp.data.success.embeddedRecordError;
|
||||||
}
|
}
|
||||||
this.$notify(
|
this.alertMessage = message;
|
||||||
{
|
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Registration Still Unknown",
|
|
||||||
text: message,
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
} else if (resp.data?.success?.handleId) {
|
} else if (resp.data?.success?.handleId) {
|
||||||
contact.registered = true;
|
contact.registered = true;
|
||||||
db.contacts.update(contact.did, { registered: true });
|
db.contacts.update(contact.did, { registered: true });
|
||||||
|
|
||||||
this.$notify(
|
this.alertTitle = "Registration Success";
|
||||||
{
|
this.alertMessage = contact.name + " has been registered.";
|
||||||
group: "alert",
|
|
||||||
type: "info",
|
|
||||||
title: "Registration Success",
|
|
||||||
text: contact.name + " has been registered.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
let userMessage = "There was an error. See logs for more info.";
|
let userMessage = "There was an error. See logs for more info.";
|
||||||
@@ -518,15 +490,8 @@ export default class ContactsView extends Vue {
|
|||||||
userMessage = error as string;
|
userMessage = error as string;
|
||||||
}
|
}
|
||||||
// Now set that error for the user to see.
|
// Now set that error for the user to see.
|
||||||
this.$notify(
|
this.alertTitle = "Error With Server";
|
||||||
{
|
this.alertMessage = userMessage;
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Error With Server",
|
|
||||||
text: userMessage,
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -547,39 +512,17 @@ export default class ContactsView extends Vue {
|
|||||||
contact.seesMe = visibility;
|
contact.seesMe = visibility;
|
||||||
db.contacts.update(contact.did, { seesMe: visibility });
|
db.contacts.update(contact.did, { seesMe: visibility });
|
||||||
} else {
|
} else {
|
||||||
|
this.alertTitle = "Error With Server";
|
||||||
console.error("Bad response setting visibility: ", resp.data);
|
console.error("Bad response setting visibility: ", resp.data);
|
||||||
if (resp.data.error?.message) {
|
if (resp.data.error?.message) {
|
||||||
this.$notify(
|
this.alertMessage = resp.data.error?.message;
|
||||||
{
|
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Error With Server",
|
|
||||||
text: resp.data.error?.message,
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
this.$notify(
|
this.alertMessage = "Bad server response of " + resp.status;
|
||||||
{
|
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Error With Server",
|
|
||||||
text: "Bad server response of " + resp.status,
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.$notify(
|
this.alertTitle = "Error With Server";
|
||||||
{
|
this.alertMessage = err as string;
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Error With Server",
|
|
||||||
text: err as string,
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -596,52 +539,23 @@ export default class ContactsView extends Vue {
|
|||||||
contact.seesMe = visibility;
|
contact.seesMe = visibility;
|
||||||
db.contacts.update(contact.did, { seesMe: visibility });
|
db.contacts.update(contact.did, { seesMe: visibility });
|
||||||
|
|
||||||
this.$notify(
|
this.alertTitle = "Refreshed";
|
||||||
{
|
this.alertMessage =
|
||||||
group: "alert",
|
this.nameForContact(contact, true) +
|
||||||
type: "toast",
|
" can " +
|
||||||
title: "Refreshed",
|
(visibility ? "" : "not ") +
|
||||||
text:
|
"see your activity.";
|
||||||
this.nameForContact(contact, true) +
|
|
||||||
" can " +
|
|
||||||
(visibility ? "" : "not ") +
|
|
||||||
"see your activity.",
|
|
||||||
},
|
|
||||||
5000,
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
|
this.alertTitle = "Error With Server";
|
||||||
if (resp.data.error?.message) {
|
if (resp.data.error?.message) {
|
||||||
this.$notify(
|
this.alertMessage = resp.data.error?.message;
|
||||||
{
|
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Error With Server",
|
|
||||||
text: resp.data.error?.message,
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
this.$notify(
|
this.alertMessage = "Bad server response of " + resp.status;
|
||||||
{
|
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Error With Server",
|
|
||||||
text: "Bad server response of " + resp.status,
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.$notify(
|
this.alertTitle = "Error With Server";
|
||||||
{
|
this.alertMessage = err as string;
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Error With Server",
|
|
||||||
text: err as string,
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -680,35 +594,15 @@ export default class ContactsView extends Vue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!this.isNumeric(this.hourInput)) {
|
if (!this.isNumeric(this.hourInput)) {
|
||||||
this.$notify(
|
this.alertTitle = "Input Error";
|
||||||
{
|
this.alertMessage =
|
||||||
group: "alert",
|
"This is not a valid number of hours: " + this.hourInput;
|
||||||
type: "danger",
|
|
||||||
title: "Input Error",
|
|
||||||
text: "This is not a valid number of hours: " + this.hourInput,
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
} else if (!parseFloat(this.hourInput)) {
|
} else if (!parseFloat(this.hourInput)) {
|
||||||
this.$notify(
|
this.alertTitle = "Input Error";
|
||||||
{
|
this.alertMessage = "Giving 0 hours does nothing.";
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Input Error",
|
|
||||||
text: "Giving 0 hours does nothing.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
} else if (!identity) {
|
} else if (!identity) {
|
||||||
this.$notify(
|
this.alertTitle = "Status Error";
|
||||||
{
|
this.alertMessage = "No identity is available.";
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Status Error",
|
|
||||||
text: "No identity is available.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
// ask to confirm amount
|
// ask to confirm amount
|
||||||
let toFrom;
|
let toFrom;
|
||||||
@@ -792,15 +686,8 @@ export default class ContactsView extends Vue {
|
|||||||
try {
|
try {
|
||||||
const resp = await this.axios.post(url, payload, { headers });
|
const resp = await this.axios.post(url, payload, { headers });
|
||||||
if (resp.data?.success?.handleId) {
|
if (resp.data?.success?.handleId) {
|
||||||
this.$notify(
|
this.alertTitle = "Done";
|
||||||
{
|
this.alertMessage = "Successfully logged time to the server.";
|
||||||
group: "alert",
|
|
||||||
type: "success",
|
|
||||||
title: "Done",
|
|
||||||
text: "Successfully logged time to the server.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (fromDid === identity.did) {
|
if (fromDid === identity.did) {
|
||||||
const newList = R.clone(this.givenByMeUnconfirmed);
|
const newList = R.clone(this.givenByMeUnconfirmed);
|
||||||
@@ -825,15 +712,8 @@ export default class ContactsView extends Vue {
|
|||||||
userMessage = error as string;
|
userMessage = error as string;
|
||||||
}
|
}
|
||||||
// Now set that error for the user to see.
|
// Now set that error for the user to see.
|
||||||
this.$notify(
|
this.alertTitle = "Error With Server";
|
||||||
{
|
this.alertMessage = userMessage;
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Error With Server",
|
|
||||||
text: userMessage,
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,12 +90,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="grow">
|
<div class="grow">
|
||||||
<h2 class="text-base font-semibold">{{ project.name }}</h2>
|
<h2 class="text-base font-semibold">Canyon cleanup</h2>
|
||||||
<div class="text-sm">
|
<div class="text-sm">
|
||||||
<fa icon="user" class="fa-fw text-slate-400"></fa>
|
<fa icon="user" class="fa-fw text-slate-400"></fa>
|
||||||
{{
|
{{ project.name }}
|
||||||
didInfo(project.issuerDid, activeDid, allMyDids, allContacts)
|
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
@@ -113,10 +111,8 @@
|
|||||||
import { Component, Vue } from "vue-facing-decorator";
|
import { Component, Vue } from "vue-facing-decorator";
|
||||||
|
|
||||||
import { accountsDB, db } from "@/db";
|
import { accountsDB, db } from "@/db";
|
||||||
import { Contact } from "@/db/tables/contacts";
|
|
||||||
import { MASTER_SETTINGS_KEY } from "@/db/tables/settings";
|
import { MASTER_SETTINGS_KEY } from "@/db/tables/settings";
|
||||||
import { accessToken } from "@/libs/crypto";
|
import { accessToken } from "@/libs/crypto";
|
||||||
import { didInfo } from "@/libs/endorserServer";
|
|
||||||
import AlertMessage from "@/components/AlertMessage";
|
import AlertMessage from "@/components/AlertMessage";
|
||||||
import QuickNav from "@/components/QuickNav";
|
import QuickNav from "@/components/QuickNav";
|
||||||
import InfiniteScroll from "@/components/InfiniteScroll";
|
import InfiniteScroll from "@/components/InfiniteScroll";
|
||||||
@@ -126,8 +122,6 @@ import InfiniteScroll from "@/components/InfiniteScroll";
|
|||||||
})
|
})
|
||||||
export default class DiscoverView extends Vue {
|
export default class DiscoverView extends Vue {
|
||||||
activeDid = "";
|
activeDid = "";
|
||||||
allContacts: Array<Contact> = [];
|
|
||||||
allMyDids: Array<string> = [];
|
|
||||||
apiServer = "";
|
apiServer = "";
|
||||||
searchTerms = "";
|
searchTerms = "";
|
||||||
alertMessage = "";
|
alertMessage = "";
|
||||||
@@ -139,20 +133,11 @@ export default class DiscoverView extends Vue {
|
|||||||
remoteCount = 0;
|
remoteCount = 0;
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
|
|
||||||
// make this function available to the Vue template
|
|
||||||
didInfo = didInfo;
|
|
||||||
|
|
||||||
async mounted() {
|
async mounted() {
|
||||||
await db.open();
|
await db.open();
|
||||||
const settings = await db.settings.get(MASTER_SETTINGS_KEY);
|
const settings = await db.settings.get(MASTER_SETTINGS_KEY);
|
||||||
this.activeDid = settings?.activeDid || "";
|
this.activeDid = settings?.activeDid || "";
|
||||||
this.apiServer = settings?.apiServer || "";
|
this.apiServer = settings?.apiServer || "";
|
||||||
this.allContacts = await db.contacts.toArray();
|
|
||||||
|
|
||||||
await accountsDB.open();
|
|
||||||
const allAccounts = await accountsDB.accounts.toArray();
|
|
||||||
this.allMyDids = allAccounts.map((acc) => acc.did);
|
|
||||||
|
|
||||||
this.searchLocal();
|
this.searchLocal();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,6 +166,7 @@ export default class DiscoverView extends Vue {
|
|||||||
public async search(beforeId?: string) {
|
public async search(beforeId?: string) {
|
||||||
let queryParams = "claimContents=" + encodeURIComponent(this.searchTerms);
|
let queryParams = "claimContents=" + encodeURIComponent(this.searchTerms);
|
||||||
|
|
||||||
|
console.log(beforeId);
|
||||||
if (beforeId) {
|
if (beforeId) {
|
||||||
queryParams = queryParams + `&beforeId=${beforeId}`;
|
queryParams = queryParams + `&beforeId=${beforeId}`;
|
||||||
}
|
}
|
||||||
@@ -200,16 +186,6 @@ export default class DiscoverView extends Vue {
|
|||||||
|
|
||||||
if (response.status !== 200) {
|
if (response.status !== 200) {
|
||||||
const details = await response.text();
|
const details = await response.text();
|
||||||
this.$notify(
|
|
||||||
{
|
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Error",
|
|
||||||
text: `There was a problem accessing the server. Please try again later. (${details})`,
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
|
|
||||||
throw details;
|
throw details;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,8 +194,9 @@ export default class DiscoverView extends Vue {
|
|||||||
const plans: ProjectData[] = results.data;
|
const plans: ProjectData[] = results.data;
|
||||||
if (plans) {
|
if (plans) {
|
||||||
for (const plan of plans) {
|
for (const plan of plans) {
|
||||||
const { name, description, handleId, rowid, issuerDid } = plan;
|
const { name, description, handleId = plan.handleId, rowid } = plan;
|
||||||
this.projects.push({ name, description, handleId, rowid, issuerDid });
|
console.log("here");
|
||||||
|
this.projects.push({ name, description, handleId, rowid });
|
||||||
}
|
}
|
||||||
this.remoteCount = this.projects.length;
|
this.remoteCount = this.projects.length;
|
||||||
} else {
|
} else {
|
||||||
@@ -227,15 +204,9 @@ export default class DiscoverView extends Vue {
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log("Error with feed load:", e);
|
console.log("Error with feed load:", e);
|
||||||
this.$notify(
|
this.alertMessage =
|
||||||
{
|
e.userMessage || "There was an error retrieving projects.";
|
||||||
group: "alert",
|
this.alertTitle = "Error";
|
||||||
type: "danger",
|
|
||||||
title: "Error",
|
|
||||||
text: e.userMessage || "There was a problem retrieving projects.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
} finally {
|
} finally {
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
}
|
}
|
||||||
@@ -269,16 +240,6 @@ export default class DiscoverView extends Vue {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.status !== 200) {
|
if (response.status !== 200) {
|
||||||
const details = await response.text();
|
|
||||||
this.$notify(
|
|
||||||
{
|
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Error",
|
|
||||||
text: `There was a problem accessing the server. Please try again later. (${details})`,
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
throw await response.text();
|
throw await response.text();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -302,15 +263,9 @@ export default class DiscoverView extends Vue {
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log("Error with feed load:", e);
|
console.log("Error with feed load:", e);
|
||||||
this.$notify(
|
this.alertMessage =
|
||||||
{
|
e.userMessage || "There was an error retrieving projects.";
|
||||||
group: "alert",
|
this.alertTitle = "Error";
|
||||||
type: "danger",
|
|
||||||
title: "Error",
|
|
||||||
text: e.userMessage || "There was a problem retrieving projects.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
} finally {
|
} finally {
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
}
|
}
|
||||||
@@ -323,6 +278,8 @@ export default class DiscoverView extends Vue {
|
|||||||
async loadMoreData(payload: boolean) {
|
async loadMoreData(payload: boolean) {
|
||||||
if (this.projects.length > 0 && payload) {
|
if (this.projects.length > 0 && payload) {
|
||||||
const latestProject = this.projects[this.projects.length - 1];
|
const latestProject = this.projects[this.projects.length - 1];
|
||||||
|
console.log("rowid", latestProject, payload);
|
||||||
|
console.log(Object.keys(latestProject));
|
||||||
if (this.isLocalActive) {
|
if (this.isLocalActive) {
|
||||||
this.searchLocal(latestProject["rowid"]);
|
this.searchLocal(latestProject["rowid"]);
|
||||||
} else if (this.isRemoteActive) {
|
} else if (this.isRemoteActive) {
|
||||||
|
|||||||
@@ -6,94 +6,6 @@
|
|||||||
Time Safari
|
Time Safari
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<div class="mb-8">
|
|
||||||
<h2 class="text-xl font-bold mb-4">Notiwind Alert Test Suite</h2>
|
|
||||||
|
|
||||||
<button
|
|
||||||
@click="
|
|
||||||
this.$notify(
|
|
||||||
{
|
|
||||||
group: 'alert',
|
|
||||||
type: 'toast',
|
|
||||||
text: 'I\'m a toast. Don\'t mind me.',
|
|
||||||
},
|
|
||||||
5000,
|
|
||||||
)
|
|
||||||
"
|
|
||||||
class="font-bold uppercase bg-slate-400 text-white px-3 py-2 rounded-md mr-2"
|
|
||||||
>
|
|
||||||
Toast (self-dismiss)
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button
|
|
||||||
@click="
|
|
||||||
this.$notify(
|
|
||||||
{
|
|
||||||
group: 'alert',
|
|
||||||
type: 'info',
|
|
||||||
title: 'Information Alert',
|
|
||||||
text: 'Just wanted you to know.',
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
)
|
|
||||||
"
|
|
||||||
class="font-bold uppercase bg-slate-600 text-white px-3 py-2 rounded-md mr-2"
|
|
||||||
>
|
|
||||||
Info
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button
|
|
||||||
@click="
|
|
||||||
this.$notify(
|
|
||||||
{
|
|
||||||
group: 'alert',
|
|
||||||
type: 'success',
|
|
||||||
title: 'Success Alert',
|
|
||||||
text: 'Congratulations!',
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
)
|
|
||||||
"
|
|
||||||
class="font-bold uppercase bg-emerald-600 text-white px-3 py-2 rounded-md mr-2"
|
|
||||||
>
|
|
||||||
Success
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button
|
|
||||||
@click="
|
|
||||||
this.$notify(
|
|
||||||
{
|
|
||||||
group: 'alert',
|
|
||||||
type: 'warning',
|
|
||||||
title: 'Warning Alert',
|
|
||||||
text: 'You might wanna look at this.',
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
)
|
|
||||||
"
|
|
||||||
class="font-bold uppercase bg-amber-600 text-white px-3 py-2 rounded-md mr-2"
|
|
||||||
>
|
|
||||||
Warning
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button
|
|
||||||
@click="
|
|
||||||
this.$notify(
|
|
||||||
{
|
|
||||||
group: 'alert',
|
|
||||||
type: 'danger',
|
|
||||||
title: 'Danger Alert',
|
|
||||||
text: 'Something terrible has happened!',
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
)
|
|
||||||
"
|
|
||||||
class="font-bold uppercase bg-rose-600 text-white px-3 py-2 rounded-md mr-2"
|
|
||||||
>
|
|
||||||
Danger
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-8">
|
<div class="mb-8">
|
||||||
<h2 class="text-xl font-bold">Quick Action</h2>
|
<h2 class="text-xl font-bold">Quick Action</h2>
|
||||||
<p class="mb-4">Show appreciation to a contact:</p>
|
<p class="mb-4">Show appreciation to a contact:</p>
|
||||||
@@ -245,17 +157,10 @@ export default class HomeView extends Vue {
|
|||||||
this.feedLastViewedId = settings?.lastViewedClaimId;
|
this.feedLastViewedId = settings?.lastViewedClaimId;
|
||||||
this.updateAllFeed();
|
this.updateAllFeed();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.$notify(
|
this.alertTitle = "Error";
|
||||||
{
|
this.alertMessage =
|
||||||
group: "alert",
|
err.userMessage ||
|
||||||
type: "danger",
|
"There was an error retrieving the latest sweet, sweet action.";
|
||||||
title: "Error",
|
|
||||||
text:
|
|
||||||
err.userMessage ||
|
|
||||||
"There was an error retrieving the latest sweet, sweet action.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -304,15 +209,9 @@ export default class HomeView extends Vue {
|
|||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.log("Error with feed load:", e);
|
console.log("Error with feed load:", e);
|
||||||
this.$notify(
|
this.alertMessage =
|
||||||
{
|
e.userMessage || "There was an error retrieving feed data.";
|
||||||
group: "alert",
|
this.alertTitle = "Error";
|
||||||
type: "danger",
|
|
||||||
title: "Export Error",
|
|
||||||
text: e.userMessage || "There was an error retrieving feed data.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.isHiddenSpinner = true;
|
this.isHiddenSpinner = true;
|
||||||
@@ -403,27 +302,17 @@ export default class HomeView extends Vue {
|
|||||||
*/
|
*/
|
||||||
public async recordGive(giverDid, description, hours) {
|
public async recordGive(giverDid, description, hours) {
|
||||||
if (!this.activeDid) {
|
if (!this.activeDid) {
|
||||||
this.$notify(
|
this.setAlert(
|
||||||
{
|
"Error",
|
||||||
group: "alert",
|
"You must select an identity before you can record a give.",
|
||||||
type: "danger",
|
|
||||||
title: "Error",
|
|
||||||
text: "You must select an identity before you can record a give.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!description && !hours) {
|
if (!description && !hours) {
|
||||||
this.$notify(
|
this.setAlert(
|
||||||
{
|
"Error",
|
||||||
group: "alert",
|
"You must enter a description or some number of hours.",
|
||||||
type: "danger",
|
|
||||||
title: "Error",
|
|
||||||
text: "You must enter a description or some number of hours.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -443,38 +332,19 @@ export default class HomeView extends Vue {
|
|||||||
if (this.isGiveCreationError(result)) {
|
if (this.isGiveCreationError(result)) {
|
||||||
const errorMessage = this.getGiveCreationErrorMessage(result);
|
const errorMessage = this.getGiveCreationErrorMessage(result);
|
||||||
console.log("Error with give result:", result);
|
console.log("Error with give result:", result);
|
||||||
this.$notify(
|
this.setAlert(
|
||||||
{
|
"Error",
|
||||||
group: "alert",
|
errorMessage || "There was an error recording the give.",
|
||||||
type: "danger",
|
|
||||||
title: "Error",
|
|
||||||
text: errorMessage || "There was an error recording the give.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
this.$notify(
|
this.setAlert("Success", "That gift was recorded.");
|
||||||
{
|
|
||||||
group: "alert",
|
|
||||||
type: "success",
|
|
||||||
title: "Success",
|
|
||||||
text: "That gift was recorded.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Error with give caught:", error);
|
console.log("Error with give caught:", error);
|
||||||
this.$notify(
|
this.setAlert(
|
||||||
{
|
"Error",
|
||||||
group: "alert",
|
this.getGiveErrorMessage(error) ||
|
||||||
type: "danger",
|
"There was an error recording the give.",
|
||||||
title: "Error",
|
|
||||||
text:
|
|
||||||
this.getGiveErrorMessage(error) ||
|
|
||||||
"There was an error recording the give.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,19 +133,13 @@ export default class IdentitySwitcherView extends Vue {
|
|||||||
this.limitsMessage = "No identity.";
|
this.limitsMessage = "No identity.";
|
||||||
this.loadingLimits = false;
|
this.loadingLimits = false;
|
||||||
} else {
|
} else {
|
||||||
this.$notify(
|
this.alertMessage =
|
||||||
{
|
"Clear your cache and start over (after data backup).";
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Error Creating Account",
|
|
||||||
text: "Clear your cache and start over (after data backup).",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
console.error(
|
console.error(
|
||||||
"Telling user to clear cache at page create because:",
|
"Telling user to clear cache at page create because:",
|
||||||
err,
|
err,
|
||||||
);
|
);
|
||||||
|
this.alertTitle = "Error Creating Account";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -245,41 +245,20 @@ export default class NewEditProjectView extends Vue {
|
|||||||
if (serverError) {
|
if (serverError) {
|
||||||
if (Object.prototype.hasOwnProperty.call(serverError, "message")) {
|
if (Object.prototype.hasOwnProperty.call(serverError, "message")) {
|
||||||
console.log(serverError);
|
console.log(serverError);
|
||||||
|
this.alertTitle = "User Message";
|
||||||
userMessage = serverError.response.data.error.message; // This is info for the user.
|
userMessage = serverError.response.data.error.message; // This is info for the user.
|
||||||
this.$notify(
|
this.alertMessage = userMessage;
|
||||||
{
|
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "User Message",
|
|
||||||
text: userMessage,
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
this.$notify(
|
this.alertTitle = "Server Message";
|
||||||
{
|
this.alertMessage = JSON.stringify(serverError.toJSON());
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Server Message",
|
|
||||||
text: JSON.stringify(serverError.toJSON()),
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.error(
|
console.error(
|
||||||
"Here's the full error trying to save the claim:",
|
"Here's the full error trying to save the claim:",
|
||||||
error,
|
error,
|
||||||
);
|
);
|
||||||
this.$notify(
|
this.alertTitle = "Claim Error";
|
||||||
{
|
this.alertMessage = error as string;
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Claim Error",
|
|
||||||
text: error as string,
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
// Now set that error for the user to see.
|
// Now set that error for the user to see.
|
||||||
this.errorMessage = userMessage;
|
this.errorMessage = userMessage;
|
||||||
|
|||||||
@@ -93,7 +93,7 @@
|
|||||||
<h1 class="text-xl">Given to this Project</h1>
|
<h1 class="text-xl">Given to this Project</h1>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<h1 class="text-xl">... and paid forward from this Project</h1>
|
<h1 class="text-xl">... and from this Project</h1>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-around">
|
<div class="flex justify-around">
|
||||||
@@ -108,12 +108,7 @@
|
|||||||
}}</span>
|
}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex gap-2" v-if="give.amount">
|
<div class="flex gap-2" v-if="give.amount">
|
||||||
<fa
|
<fa icon="coins" class="fa-fw text-slate-400"></fa>
|
||||||
icon="clock"
|
|
||||||
v-if="give.unit === 'HUR'"
|
|
||||||
class="fa-fw text-slate-400"
|
|
||||||
></fa>
|
|
||||||
<fa icon="coins" v-else class="fa-fw text-slate-400"></fa>
|
|
||||||
<span>{{ give.amount }}</span>
|
<span>{{ give.amount }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex gap-2" v-if="give.description">
|
<div class="flex gap-2" v-if="give.description">
|
||||||
@@ -135,12 +130,7 @@
|
|||||||
}}</span>
|
}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex gap-2" v-if="give.amount">
|
<div class="flex gap-2" v-if="give.amount">
|
||||||
<fa
|
<fa icon="coins" class="fa-fw text-slate-400"></fa>
|
||||||
icon="clock"
|
|
||||||
v-if="give.unit === 'HUR'"
|
|
||||||
class="fa-fw text-slate-400"
|
|
||||||
></fa>
|
|
||||||
<fa icon="coins" v-else class="fa-fw text-slate-400"></fa>
|
|
||||||
<span>{{ give.amount }}</span>
|
<span>{{ give.amount }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex gap-2">
|
<div class="flex gap-2">
|
||||||
@@ -295,38 +285,16 @@ export default class ProjectViewView extends Vue {
|
|||||||
this.truncatedDesc = this.description.slice(0, this.truncateLength);
|
this.truncatedDesc = this.description.slice(0, this.truncateLength);
|
||||||
} else if (resp.status === 404) {
|
} else if (resp.status === 404) {
|
||||||
// actually, axios throws an error so we never get here
|
// actually, axios throws an error so we never get here
|
||||||
this.$notify(
|
this.alertMessage = "That project does not exist.";
|
||||||
{
|
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Error",
|
|
||||||
text: "That project does not exist.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
const serverError = error as AxiosError;
|
const serverError = error as AxiosError;
|
||||||
if (serverError.response?.status === 404) {
|
if (serverError.response?.status === 404) {
|
||||||
this.$notify(
|
this.alertMessage = "That project does not exist.";
|
||||||
{
|
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Error",
|
|
||||||
text: "That project does not exist.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
this.$notify(
|
this.alertMessage =
|
||||||
{
|
"Something went wrong retrieving that project." +
|
||||||
group: "alert",
|
" See logs for more info.";
|
||||||
type: "danger",
|
|
||||||
title: "Error",
|
|
||||||
text: "Something went wrong retrieving that project. See logs for more info.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
console.error("Error retrieving project:", serverError.message);
|
console.error("Error retrieving project:", serverError.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -340,27 +308,12 @@ export default class ProjectViewView extends Vue {
|
|||||||
if (resp.status === 200 && resp.data.data) {
|
if (resp.status === 200 && resp.data.data) {
|
||||||
this.givesToThis = resp.data.data;
|
this.givesToThis = resp.data.data;
|
||||||
} else {
|
} else {
|
||||||
this.$notify(
|
this.alertMessage = "Failed to retrieve gives to this project.";
|
||||||
{
|
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Error",
|
|
||||||
text: "Failed to retrieve gives to this project.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
const serverError = error as AxiosError;
|
const serverError = error as AxiosError;
|
||||||
this.$notify(
|
this.alertMessage =
|
||||||
{
|
"Something went wrong retrieving gives to this project.";
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Error",
|
|
||||||
text: "Something went wrong retrieving gives to this project.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
console.error(
|
console.error(
|
||||||
"Error retrieving gives to this project:",
|
"Error retrieving gives to this project:",
|
||||||
serverError.message,
|
serverError.message,
|
||||||
@@ -376,27 +329,11 @@ export default class ProjectViewView extends Vue {
|
|||||||
if (resp.status === 200 && resp.data.data) {
|
if (resp.status === 200 && resp.data.data) {
|
||||||
this.givesByThis = resp.data.data;
|
this.givesByThis = resp.data.data;
|
||||||
} else {
|
} else {
|
||||||
this.$notify(
|
this.alertMessage = "Failed to retrieve gives by this project.";
|
||||||
{
|
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Error",
|
|
||||||
text: "Failed to retrieve gives by this project.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
const serverError = error as AxiosError;
|
const serverError = error as AxiosError;
|
||||||
this.$notify(
|
this.alertMessage = "Something went wrong retrieving gives by project.";
|
||||||
{
|
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Error",
|
|
||||||
text: "Something went wrong retrieving gives by project.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
console.error(
|
console.error(
|
||||||
"Error retrieving gives by this project:",
|
"Error retrieving gives by this project:",
|
||||||
serverError.message,
|
serverError.message,
|
||||||
@@ -427,28 +364,16 @@ export default class ProjectViewView extends Vue {
|
|||||||
*/
|
*/
|
||||||
async recordGive(giverDid, description, hours) {
|
async recordGive(giverDid, description, hours) {
|
||||||
if (!this.activeDid) {
|
if (!this.activeDid) {
|
||||||
this.$notify(
|
this.alertTitle = "Error";
|
||||||
{
|
this.alertMessage =
|
||||||
group: "alert",
|
"You must select an identity before you can record a give.";
|
||||||
type: "danger",
|
|
||||||
title: "Error",
|
|
||||||
text: "You must select an identity before you can record a give.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!description && !hours) {
|
if (!description && !hours) {
|
||||||
this.$notify(
|
this.alertTitle = "Error";
|
||||||
{
|
this.alertMessage =
|
||||||
group: "alert",
|
"You must enter a description or some number of hours.";
|
||||||
type: "danger",
|
|
||||||
title: "Error",
|
|
||||||
text: "You must enter a description or some number of hours.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -467,42 +392,21 @@ export default class ProjectViewView extends Vue {
|
|||||||
|
|
||||||
if (result.status !== 201 || result.data?.error) {
|
if (result.status !== 201 || result.data?.error) {
|
||||||
console.log("Error with give result:", result);
|
console.log("Error with give result:", result);
|
||||||
this.$notify(
|
this.alertTitle = "Error";
|
||||||
{
|
this.alertMessage =
|
||||||
group: "alert",
|
result.data?.error?.message ||
|
||||||
type: "danger",
|
"There was an error recording the give.";
|
||||||
title: "Error",
|
|
||||||
text:
|
|
||||||
result.data?.error?.message ||
|
|
||||||
"There was an error recording the give.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
this.$notify(
|
this.alertTitle = "Success";
|
||||||
{
|
this.alertMessage = "That gift was recorded.";
|
||||||
group: "alert",
|
|
||||||
type: "success",
|
|
||||||
title: "Success",
|
|
||||||
text: "That gift was recorded.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log("Error with give caught:", e);
|
console.log("Error with give caught:", e);
|
||||||
this.$notify(
|
this.alertTitle = "Error";
|
||||||
{
|
this.alertMessage =
|
||||||
group: "alert",
|
e.userMessage ||
|
||||||
type: "danger",
|
e.response?.data?.error?.message ||
|
||||||
title: "Error",
|
"There was an error recording the give.";
|
||||||
text:
|
|
||||||
e.userMessage ||
|
|
||||||
e.response?.data?.error?.message ||
|
|
||||||
"There was an error recording the give.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,15 +126,8 @@ export default class ProjectsView extends Vue {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Got error loading projects:", error.message);
|
console.error("Got error loading projects:", error.message);
|
||||||
this.$notify(
|
this.alertTitle = "Error";
|
||||||
{
|
this.alertMessage = "Got an error loading projects:" + error.message;
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Error",
|
|
||||||
text: "Got an error loading projects: " + error.message,
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
} finally {
|
} finally {
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
}
|
}
|
||||||
@@ -203,15 +196,8 @@ export default class ProjectsView extends Vue {
|
|||||||
|
|
||||||
if (this.numAccounts === 0) {
|
if (this.numAccounts === 0) {
|
||||||
console.error("No accounts found.");
|
console.error("No accounts found.");
|
||||||
this.$notify(
|
this.alertTitle = "Error";
|
||||||
{
|
this.alertMessage = "You need an identity to load your projects.";
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Error",
|
|
||||||
text: "You need an identity to load your projects.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
const identity = await this.getIdentity(activeDid);
|
const identity = await this.getIdentity(activeDid);
|
||||||
this.current = identity;
|
this.current = identity;
|
||||||
@@ -219,15 +205,8 @@ export default class ProjectsView extends Vue {
|
|||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log("Error initializing:", err);
|
console.log("Error initializing:", err);
|
||||||
this.$notify(
|
this.alertTitle = "Error";
|
||||||
{
|
this.alertMessage = "Something went wrong loading your projects.";
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Error",
|
|
||||||
text: "Something went wrong loading your projects.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -72,15 +72,8 @@ export default class SeedBackupView extends Vue {
|
|||||||
this.activeAccount = R.find((acc) => acc.did === activeDid, accounts);
|
this.activeAccount = R.find((acc) => acc.did === activeDid, accounts);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Got an error loading an identity:", err);
|
console.error("Got an error loading an identity:", err);
|
||||||
this.$notify(
|
this.alertTitle = "Error Loading Account";
|
||||||
{
|
this.alertMessage = "Got an error loading your seed data.";
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Error Loading Account",
|
|
||||||
text: "Got an error loading your seed data.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,15 +62,8 @@ export default class StatisticsView extends Vue {
|
|||||||
this.world = newWorld;
|
this.world = newWorld;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
this.$notify(
|
this.alertTitle = "Mounting error";
|
||||||
{
|
this.alertMessage = err.message;
|
||||||
group: "alert",
|
|
||||||
type: "danger",
|
|
||||||
title: "Mounting Error",
|
|
||||||
text: err.message,
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user