diff --git a/project.task.yaml b/project.task.yaml index af2801c..f29d34b 100644 --- a/project.task.yaml +++ b/project.task.yaml @@ -31,7 +31,6 @@ tasks: - .1 Remove notification alert visuals on home page - .5 Add infinite scroll to gifts on the home page -- .5 Allow edit of a contact name (but not the DID) - .5 bug - search for "Safari" does not find the project, but if already on the "Anywhere" tab it shows all - .2 figure out why endorser-mobile search doesn't find recently created PlanAction - .1 when creating a plan, select location and then make sure you can deselect on Android diff --git a/src/main.ts b/src/main.ts index 980b0e8..7bcaade 100644 --- a/src/main.ts +++ b/src/main.ts @@ -13,6 +13,7 @@ import { library } from "@fortawesome/fontawesome-svg-core"; import { faArrowLeft, faArrowRight, + faBan, faBurst, faCalendar, faChevronLeft, @@ -59,6 +60,7 @@ import { library.add( faArrowLeft, faArrowRight, + faBan, faBurst, faCalendar, faChevronLeft, diff --git a/src/views/ContactsView.vue b/src/views/ContactsView.vue index 3bcfa0f..7c0a81e 100644 --- a/src/views/ContactsView.vue +++ b/src/views/ContactsView.vue @@ -93,6 +93,16 @@ class="inline-block align-text-bottom border border-slate-300 rounded" > {{ contact.name || "(no name)" }} +
{{ contact.did }}
@@ -209,6 +219,31 @@

This identity has no contacts.

+ +
+
+

Edit Name

+ + + + +
+
@@ -251,6 +286,8 @@ export default class ContactsView extends Vue { contacts: Array = []; contactEndorserUrl = localStorage.getItem("contactEndorserUrl") || ""; contactInput = ""; + contactEdit: Contact | null = null; + contactNewName = ""; // { "did:...": concatenated-descriptions } entry for each contact givenByMeDescriptions: Record = {}; // { "did:...": amount } entry for each contact @@ -961,6 +998,18 @@ export default class ContactsView extends Vue { } } + private async onClickCancelName() { + this.contactEdit = null; + this.contactNewName = ""; + } + + private async onClickSaveName(contact: Contact, newName: string) { + contact.name = newName; + return db.contacts + .update(contact.did, { name: newName }) + .then(() => (this.contactEdit = null)); + } + public toggleShowGiveTotals() { if (this.showGiveTotals) { this.showGiveTotals = false; @@ -985,6 +1034,26 @@ export default class ContactsView extends Vue {