diff --git a/src/router/index.ts b/src/router/index.ts index bc4b683e5..f9f5f8221 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -23,12 +23,6 @@ const routes: Array = [ component: () => import(/* webpackChunkName: "about" */ "../views/AboutView.vue"), }, - { - path: "/start", - name: "start", - component: () => - import(/* webpackChunkName: "start" */ "../views/StartView.vue"), - }, { path: "/account", name: "account", @@ -43,6 +37,14 @@ const routes: Array = [ /* webpackChunkName: "confirm-contact" */ "../views/ConfirmContactView.vue" ), }, + { + path: "/contact-amounts", + name: "contact-amounts", + component: () => + import( + /* webpackChunkName: "contact-amounts" */ "../views/ContactAmountsView.vue" + ), + }, { path: "/contacts", name: "contacts", @@ -93,12 +95,6 @@ const routes: Array = [ /* webpackChunkName: "new-edit-commitment" */ "../views/NewEditCommitmentView.vue" ), }, - { - path: "/project", - name: "project", - component: () => - import(/* webpackChunkName: "project" */ "../views/ProjectViewView.vue"), - }, { path: "/new-edit-project", name: "new-edit-project", @@ -107,6 +103,12 @@ const routes: Array = [ /* webpackChunkName: "new-edit-project" */ "../views/NewEditProjectView.vue" ), }, + { + path: "/project", + name: "project", + component: () => + import(/* webpackChunkName: "project" */ "../views/ProjectViewView.vue"), + }, { path: "/projects", name: "projects", @@ -114,12 +116,10 @@ const routes: Array = [ import(/* webpackChunkName: "projects" */ "../views/ProjectsView.vue"), }, { - path: "/commitments", - name: "commitments", + path: "/start", + name: "start", component: () => - import( - /* webpackChunkName: "commitments" */ "../views/CommitmentsView.vue" - ), + import(/* webpackChunkName: "start" */ "../views/StartView.vue"), }, ]; diff --git a/src/views/CommitmentsView.vue b/src/views/CommitmentsView.vue deleted file mode 100644 index afa816790..000000000 --- a/src/views/CommitmentsView.vue +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/src/views/ContactAmountsView.vue b/src/views/ContactAmountsView.vue new file mode 100644 index 000000000..9ee06fbe1 --- /dev/null +++ b/src/views/ContactAmountsView.vue @@ -0,0 +1,70 @@ + + + diff --git a/src/views/ContactsView.vue b/src/views/ContactsView.vue index d02d7930f..80ecc901d 100644 --- a/src/views/ContactsView.vue +++ b/src/views/ContactsView.vue @@ -661,35 +661,61 @@ export default class ContactsView extends Vue { this.alertMessage = "No identity is available."; this.isAlertVisible = true; } else { - let toFrom; - if (fromDid == this.identity?.did) { - toFrom = "from you to " + this.nameForDid(this.contacts, toDid); - } else { - toFrom = "from " + this.nameForDid(this.contacts, fromDid) + " to you"; - } - let description; - if (this.hourDescriptionInput) { - description = " with description '" + this.hourDescriptionInput + "'"; - } else { - description = " with no description"; - } + // if they have unconfirmed amounts, ask to confirm those first + let wantsToConfirm = false; if ( - confirm( - "Are you sure you want to record " + - this.hourInput + - " hours " + - toFrom + - description + - "?" - ) + toDid == this.identity?.did && + this.givenToMeUnconfirmed[fromDid] > 0 ) { - this.createAndSubmitGive( - this.identity, - fromDid, - toDid, - parseFloat(this.hourInput), - this.hourDescriptionInput - ); + if ( + confirm( + "There are " + + this.givenToMeUnconfirmed[fromDid] + + " unconfirmed hours from them." + + " Would you like to confirm some of those hours?" + ) + ) { + wantsToConfirm = true; + } + } + if (wantsToConfirm) { + this.$router.push({ + name: "contact-amounts", + query: { contactDid: fromDid }, + }); + } else { + // ask to confirm amount + let toFrom; + if (fromDid == this.identity?.did) { + toFrom = "from you to " + this.nameForDid(this.contacts, toDid); + } else { + toFrom = + "from " + this.nameForDid(this.contacts, fromDid) + " to you"; + } + let description; + if (this.hourDescriptionInput) { + description = " with description '" + this.hourDescriptionInput + "'"; + } else { + description = " with no description"; + } + if ( + confirm( + "Are you sure you want to record " + + this.hourInput + + " hours " + + toFrom + + description + + "?" + ) + ) { + this.createAndSubmitGive( + this.identity, + fromDid, + toDid, + parseFloat(this.hourInput), + this.hourDescriptionInput + ); + } } } }