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/views/ContactsView.vue b/src/views/ContactsView.vue index 3bcfa0f..baac46f 100644 --- a/src/views/ContactsView.vue +++ b/src/views/ContactsView.vue @@ -93,6 +93,13 @@ class="inline-block align-text-bottom border border-slate-300 rounded" > {{ contact.name || "(no name)" }} +
{{ contact.did }}
@@ -209,6 +216,24 @@

This identity has no contacts.

+ +
+
+

Edit Name

+ + +
+
@@ -251,6 +276,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 +988,13 @@ export default class ContactsView extends Vue { } } + 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 +1019,26 @@ export default class ContactsView extends Vue {