diff --git a/CHANGELOG.md b/CHANGELOG.md index d3d2b26..581683a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,8 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added +- Web push notifications -## [0.1.3] - 2023.11 +## [0.1.3] - 2023.11.08 - 910f57ec7d2e50803ae3d04f4b927e0f5219fbde ### Added - Contact name editing ### Changed diff --git a/README.md b/README.md index 5bc6b63..8dc2818 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,10 @@ Under the "Your Identity" screen, click "Advanced", click "Switch Identity / No For your own web-push tests, change the 'vapid' URL in App.vue, and install apps on the same domain. +### Icons + +To add an icon, add to main.ts and reference with `fa` element and `icon` attribute with the hyphenated name. + ### Manual walk-through - Clear the browser cache for localhost for a new user. @@ -90,7 +94,7 @@ For your own web-push tests, change the 'vapid' URL in App.vue, and install apps - Create a new identity as prompted. Go to "Your Identity" screen and copy the ID to the clipboard. - Go back to /start and import test User `did:ethr:0x000Ee5654b9742f6Fe18ea970e32b97ee2247B51` with this this seed phrase: - `seminar accuse mystery assist delay law thing deal image undo guard initial shallow wrestle list fragile borrow velvet tomorrow awake explain test offer control` + `rigid shrug mobile smart veteran half all pond toilet brave review universe ship congress found yard skate elite apology jar uniform subway slender luggage` (Other test users are found [here](https://github.com/trentlarson/endorser-ch/blob/master/test/util.js).) - Go to "Your Contacts" screen and add the ID you copied to the clipboard, and hit "+" to add them. @@ -99,10 +103,9 @@ For your own web-push tests, change the 'vapid' URL in App.vue, and install apps ### Clear/Reset data & restart -* Data: Clear the browser cache for localhost. -* Notifications: - * Under browser settings, look for "notification" and remove this server. - * Under about:debugging, find the service worker and Unregister. +* Clear cache for localhost. +* Unregister service worker (in Chrome, go to `chrome://serviceworker-internals/`; in Firefox, go to `about:serviceworkers` or `about:debugging`). +* Clear notification permission (in Chrome, go to `chrome://settings/content/notifications`; in Firefox, go to `about:preferences` and search). diff --git a/project.task.yaml b/project.task.yaml index 9b56584..40ff1fb 100644 --- a/project.task.yaml +++ b/project.task.yaml @@ -1,51 +1,59 @@ tasks: -- remove hard-coded anomalistlabs.com - -- don't show "Give" & "Offer" on project screen if they don't have an identifier -- allow some gives even if they aren't registered - -- in endorser-push-server - mount folder for persistent sqlite DB outside of container -- extract private_key_hex in webpush.py - 40 notifications : - push, where we trigger a ServiceWorker(?) in the app to reach out and check for new data assignee:matthew + - extract private_key_hex in py-push-server webpush.py + - lock down regenerate_vapid endpoint (so only we admins can do it on demand) + - remove sleep in py-push-server app.py + - revisit "maybe" and "never" buttons on accont screen + - see if we can detect OS-level notifications if turned off + - write troubleshooting docs for notifications -- .2 change the "claims" verbiage in feeds (eg. safari-notifications.js) -- .5 allow to manage their notifications even without an identity -- 01 Ensure each action sent to the server has a confirmation - eg registration (ie a toast something that dismisses after 5-10s) - .3 fix the Project-location-selection map display to not show on top of bottom icons (and any other UI tweaks on the map flow) assignee-group:ui - .5 Add infinite scroll to gifts on the home page -- .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 -- .5 fix where user 0 sees no txns from user 1 on contacts page but sees them on list page -- .1 remove the logic to exclude beforeId in list of plans after server has commit 26b25af605e715600d4f12b6416ed9fd7142d164 assignee:trent -- .2 in SeedBackupView, don't load the mnemonic and keep it in memory; only load it when they click "show" -- fix cert generation (since it didn't happen automatically for Nov 30) -- Discuss whether the remaining tasks are worthwhile before MVP release. +- .5 If notifications are not enabled, add message to front page with link/button to enable + +- show VC details... somehow: + - .5 make a VC details page, or link to endorser.ch (including confirmations) + - 01 allow download of each VC (& confirmations, to show that they actually own their data) + - 04 allow user to download VCs, mine + ones I can see about me from others + - add VC confirmation? + +- Release Minimum Viable Product : + - generate new webpush.db entry, webpush.py private_key_hex & subscription_info & vapid_claims email + - .5 deploy endorser.ch server above Dec 1 (to get plan searches by names as well as descriptions) + - 08 thorough testing for errors & edge cases + - 01 ensure ability to recover server remotely, and add redundant access + - Turn off stats-world or ensure it's usable (eg. cannot zoom out too far and lose world, cannot screenshot). + - Add disclaimers. + - Switch default server to the public server. + - Deploy to a server. + - Ensure public server has limits that work for group adoption. + - Test PWA features on Android and iOS. + blocks: ref:https://raw.githubusercontent.com/trentlarson/lives-of-gifts/master/project.yaml#kickstarter%20for%20time +- make identicons for contacts into more-memorable faces (and maybe change project identicons, too) +- allow some gives even if they aren't registered +- .5 Add start date to project +- .3 check that Android shows "back" buttons on screens without bottom tray - .1 Make give description text box into something that expands as they type? -- 04 allow user to download claims, mine + ones I can see about me from others - .5 customize favicon assignee-group:ui - .2 Show a warning if both giver and recipient are the same (but still allow?) - 01 Would it look better to shrink the buttons on many pages so they don't expand to the width of the screen? assignee-group:ui - .5 Display a more appealing confirmation on the map when erasing the marker -- .5 make a VC details page, or link to endorser.ch -- .1 Add units or different icon to the coins (to distinguish $, BTC, hours, etc) - .5 include the hash of the latest commit on help page next to version (maybe Trent's git-hash branch) - .5 remove references to localStorage for projectId (now that it's pulling from the path) - bug (that is hard to reproduce) - on the second 'give' recorded on prod it showed me as the agent -- make identicons for contacts into more-memorable faces (and maybe change project identicons, too) -- allow download of each VC (to show that they can actually own their data) - +- switch some checks for activeDid to check for isRegistered +- .2 in SeedBackupView, don't load the mnemonic and keep it in memory; only load it when they click "show" +- .5 fix cert generation on server (since it didn't happen automatically for Nov 30) - contacts v+ : - 01 Import all the non-sensitive data (ie. contacts & settings). - .2 show error to user when adding a duplicate contact - 01 parse input more robustly (with CSV lib and not commas) - - stats v1 : - 01 show numeric stats - 04 show different graphic for projects vs people (gnome?) on world @@ -54,21 +62,9 @@ tasks: - maybe - allow type annotations in World.js & landmarks.js (since we get this error - "Types are not supported by current JavaScript version") - 08 convert to cleaner implementation (maybe Drie -- https://github.com/janvorisek/drie) -- Release Minimum Viable Product : - - generate new webpush.db entries, data/webpush.db private_key_hex & subscription_info & vapid_claims email - - .5 deploy endorser.ch server above Dec 1 (to get plan searches by names as well as descriptions) - - 08 thorough testing for errors & edge cases - - 01 ensure ability to recover server remotely, and add redundant access - - Turn off stats-world or ensure it's usable (eg. cannot zoom out too far and lose world, cannot screenshot). - - Add disclaimers. - - Switch default server to the public server. - - Deploy to a server. - - Ensure public server has limits that work for group adoption. - - Test PWA features on Android and iOS. - blocks: ref:https://raw.githubusercontent.com/trentlarson/lives-of-gifts/master/project.yaml#kickstarter%20for%20time - - .5 show seed phrase in a QR code for transfer to another device - .5 on DiscoverView, switch to a filter UI (eg. just from friend +- .5 don't show "Offer" on project screen if they aren't registered - 24 Move to Vite - 32 accept images for projects diff --git a/src/App.vue b/src/App.vue index 31bbc32..3de93c5 100644 --- a/src/App.vue +++ b/src/App.vue @@ -261,7 +261,7 @@ diff --git a/src/views/ContactQRScanShowView.vue b/src/views/ContactQRScanShowView.vue index 7b42337..15870ea 100644 --- a/src/views/ContactQRScanShowView.vue +++ b/src/views/ContactQRScanShowView.vue @@ -20,7 +20,7 @@ -
+
+
+ +
+ +
+

+ +

+
+ + +

+ Notification Help +

+
+ +
+

Here are things to try to get notifications working.

+ +

Test

+

Somehow call the service-worker self.showNotification

+ +

Check OS-level permissions

+

+ Walk-throughs & screenshots, maybe for all combinations of OS & + browsers. +

+ +

Check browser-level permissions

+

Walk-throughs & screenshots for browser settings

+ +

Explain full reset to start again

+

+ Walk-throughs for clearing everything & subscribing anew to get a + message +

+ +

Auto-detection

+

Show results of auto-detection whether they're turned on

+
+
+ + diff --git a/src/views/HelpView.vue b/src/views/HelpView.vue index 37cae27..f16d1f5 100644 --- a/src/views/HelpView.vue +++ b/src/views/HelpView.vue @@ -181,6 +181,21 @@ different page.

+

+ How do I access even more functionality? +

+

+ There is an "Advanced" section at the bottom of the Account + page. +

+

+ There is a even more functionality in a mobile app (and more + documentation) at + + EndorserSearch.com + +

+

What is your privacy policy?

See diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index af00edc..8db8c24 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -104,7 +104,7 @@ class="border-b border-dashed border-slate-400 text-orange-400 pb-2 mb-2 font-bold uppercase text-sm" v-if="record.jwtId == feedLastViewedId" > - You've seen all the following before + You've seen all the following

@@ -171,13 +171,7 @@ export default class HomeView extends Vue { .equals(activeDid) .first()) as Account; const identity = JSON.parse(account?.identity || "null"); - - if (!identity) { - throw new Error( - "Attempted to load Give records with no identity available.", - ); - } - return identity; + return identity; // may be null } public async getHeaders(identity: IIdentifier) { diff --git a/src/views/NewEditProjectView.vue b/src/views/NewEditProjectView.vue index e02427a..eaff9b0 100644 --- a/src/views/NewEditProjectView.vue +++ b/src/views/NewEditProjectView.vue @@ -11,7 +11,7 @@ class="text-lg text-center px-2 py-1 absolute -left-2 -top-1" > - [New/Edit] Plan + Edit Idea
@@ -24,22 +24,28 @@
- {{ description.length }}/500 max. characters + {{ fullClaim.description.length }}/5000 max. characters
+ +
@@ -136,13 +142,17 @@ export default class NewEditProjectView extends Vue { activeDid = ""; apiServer = ""; - description = ""; errorMessage = ""; + fullClaim: PlanVerifiableCredential = { + "@context": "https://schema.org", + "@type": "PlanAction", + name: "", + description: "", + }; // this default is only to avoid errors before plan is loaded includeLocation = false; latitude = 0; longitude = 0; numAccounts = 0; - projectName = ""; zoom = 2; async beforeCreate() { @@ -214,9 +224,12 @@ export default class NewEditProjectView extends Vue { try { const resp = await this.axios.get(url, { headers }); if (resp.status === 200) { - const claim = resp.data.claim; - this.projectName = claim.name; - this.description = claim.description; + this.fullClaim = resp.data.claim; + if (this.fullClaim?.location) { + this.includeLocation = true; + this.latitude = this.fullClaim.location.geo.latitude; + this.longitude = this.fullClaim.location.geo.longitude; + } } } catch (error) { console.error("Got error retrieving that project", error); @@ -225,13 +238,7 @@ export default class NewEditProjectView extends Vue { private async SaveProject(identity: IIdentifier) { // Make a claim - const vcClaim: PlanVerifiableCredential = { - "@context": "https://schema.org", - "@type": "PlanAction", - name: this.projectName, - description: this.description, - identifier: this.projectId || undefined, - }; + const vcClaim: PlanVerifiableCredential = this.fullClaim; if (this.projectId) { vcClaim.identifier = this.projectId; } @@ -293,6 +300,20 @@ export default class NewEditProjectView extends Vue { 2000, this, ); + } else { + console.log( + "Got unexpected 'data' inside response from server", + resp, + ); + this.$notify( + { + group: "alert", + type: "danger", + title: "Error Saving Idea", + text: "Server did not save the idea. Try again.", + }, + -1, + ); } } catch (error) { let userMessage = "There was an error saving the project."; @@ -300,8 +321,8 @@ export default class NewEditProjectView extends Vue { error?: { message?: string }; }>; if (serverError) { + console.log("Got error from server", serverError); if (Object.prototype.hasOwnProperty.call(serverError, "message")) { - console.log(serverError); userMessage = serverError.response?.data?.error?.message || ""; // This is info for the user. this.$notify( { diff --git a/src/views/ProjectViewView.vue b/src/views/ProjectViewView.vue index 0bd1471..a72ff9d 100644 --- a/src/views/ProjectViewView.vue +++ b/src/views/ProjectViewView.vue @@ -12,7 +12,7 @@ > - View Plan + Idea
@@ -35,7 +35,7 @@ {{ issuer }}
-
+
{{ timeSince }}
@@ -45,8 +45,13 @@ :href="getOpenStreetMapUrl()" target="_blank" class="underline" - > - Map View + >Map View + +
+
+ + {{ domainForWebsite(this.url) }}
@@ -56,8 +61,11 @@
{{ truncatedDesc }} - Read More... Read More
@@ -65,7 +73,7 @@ Read Less- Read Less
@@ -148,7 +156,7 @@

- Offered To This Project + Offered To This Idea

@@ -167,8 +175,10 @@ {{ didInfo(offer.agentDid, activeDid, allMyDids, allContacts) }} - - {{ offer.amount }} + {{ offer.amount }}
@@ -180,9 +190,7 @@
-

- Given To This Project -

+

Given To This Idea

(None yet. Record one above.)
@@ -197,9 +205,11 @@ > {{ didInfo(give.agentDid, activeDid, allMyDids, allContacts) }} - - {{ give.amount }} + + {{ give.amount }}
@@ -216,7 +226,7 @@ class="bg-slate-100 px-4 py-3 rounded-md" >

- Contributions To This Project + Contributions To This Idea

  • @@ -232,7 +242,7 @@

    - Contributions By This Project + Contributions By This Idea