Compare commits
49 Commits
notify-tim
...
profile-pi
| Author | SHA1 | Date | |
|---|---|---|---|
| 6d6e5266b4 | |||
| 581a374b05 | |||
| 1009574721 | |||
| 50cae65214 | |||
| 48a46cf6f1 | |||
| 60b2bf35fb | |||
| cb5a7135ac | |||
| a7a9e35766 | |||
| f029835e15 | |||
| 017a172df3 | |||
| 7837122a95 | |||
| 0093255246 | |||
| 30bd53fb6f | |||
| ca22930012 | |||
| c7c5bda014 | |||
| 19aa572c95 | |||
| 03fae5dd95 | |||
| 80818a8861 | |||
| d29a8d9637 | |||
| f0b0231515 | |||
| b73d2a3b58 | |||
| 22cba5babf | |||
| 708ac51f23 | |||
| a91ffc88b9 | |||
| d727c2841b | |||
| 226a97732d | |||
| c94dd7743b | |||
| 64e38cb8ff | |||
| e61ac31710 | |||
| 3fbf68b117 | |||
| d4390483d9 | |||
| 8dea2091af | |||
| e3696e3ac5 | |||
|
|
027825b155 | ||
|
|
8da2c8cc30 | ||
|
|
570b31e2d6 | ||
|
|
07f542ca16 | ||
|
|
62e0fc51c2 | ||
|
|
94b600e527 | ||
|
|
5388e6052c | ||
|
|
21fe5a0279 | ||
|
|
ffba89a7b5 | ||
|
|
31954d2690 | ||
| 2d2785d6a0 | |||
| 41d6e5fc73 | |||
| 5dead960ae | |||
| 12d81b79c7 | |||
| f3dc81e6eb | |||
| ef5f81932d |
@@ -1,7 +1,3 @@
|
|||||||
|
|
||||||
# I tried setting values here and using `vue-cli-service build --mode development`
|
# I tried and failed to set things here with vue-cli-service but
|
||||||
# but it didn't create some things in "dist":
|
# things may be more reliable with vite so let's try again.
|
||||||
# - the "css" directory with the CSS extracted from Vue files
|
|
||||||
# - the sw_scripts-combined* files
|
|
||||||
#
|
|
||||||
# ¯\_(ツ)_/¯
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Only the variables that start with VUE_APP_ are seen in the application process.env in Vue.
|
# Only the variables that start with VITE_ are seen in the application process.env in Vue.
|
||||||
VUE_APP_BVC_MEETUPS_PROJECT_CLAIM_ID=https://endorser.ch/entity/01GXYPFF7FA03NXKPYY142PY4H
|
VITE_BVC_MEETUPS_PROJECT_CLAIM_ID=https://endorser.ch/entity/01GXYPFF7FA03NXKPYY142PY4H
|
||||||
VUE_APP_DEFAULT_ENDORSER_API_SERVER=https://api.endorser.ch
|
VITE_DEFAULT_ENDORSER_API_SERVER=https://api.endorser.ch
|
||||||
VUE_APP_DEFAULT_IMAGE_API_SERVER=https://image-api.timesafari.app
|
VITE_DEFAULT_IMAGE_API_SERVER=https://image-api.timesafari.app
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ module.exports = {
|
|||||||
root: true,
|
root: true,
|
||||||
env: {
|
env: {
|
||||||
node: true,
|
node: true,
|
||||||
|
es2022: true,
|
||||||
},
|
},
|
||||||
extends: [
|
extends: [
|
||||||
"plugin:vue/vue3-essential",
|
"plugin:vue/vue3-essential",
|
||||||
@@ -9,9 +10,9 @@ module.exports = {
|
|||||||
"@vue/typescript/recommended",
|
"@vue/typescript/recommended",
|
||||||
"plugin:prettier/recommended",
|
"plugin:prettier/recommended",
|
||||||
],
|
],
|
||||||
parserOptions: {
|
// parserOptions: {
|
||||||
ecmaVersion: 2020,
|
// ecmaVersion: 2020,
|
||||||
},
|
// },
|
||||||
rules: {
|
rules: {
|
||||||
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
|
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
|
||||||
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
|
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
|
||||||
|
|||||||
12
CHANGELOG.md
12
CHANGELOG.md
@@ -10,6 +10,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Nothing
|
- Nothing
|
||||||
|
|
||||||
|
|
||||||
|
## [0.3.7] - 2024.04-10 - cf18f1543a700d62a5f9e764905a4aafe1fb229b
|
||||||
|
### Added
|
||||||
|
- Filter on home page feed
|
||||||
|
- Ability to set time of daily notification
|
||||||
|
- Jump to app on click of notification
|
||||||
|
### Changed
|
||||||
|
- Built with vite
|
||||||
|
- Descriptions on home page to include projects
|
||||||
|
### Changed in DB or environment
|
||||||
|
- Nothing
|
||||||
|
|
||||||
|
|
||||||
## [0.3.6] - 2024.03.24 - 3a07e31d6313ab95711265562d9023c42916e141
|
## [0.3.6] - 2024.03.24 - 3a07e31d6313ab95711265562d9023c42916e141
|
||||||
### Added
|
### Added
|
||||||
- Button to mirror photo during video
|
- Button to mirror photo during video
|
||||||
|
|||||||
11
README.md
11
README.md
@@ -18,6 +18,11 @@ npm install
|
|||||||
|
|
||||||
### Compiles and hot-reloads for development
|
### Compiles and hot-reloads for development
|
||||||
```
|
```
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
### Builds the production app
|
||||||
|
```
|
||||||
npm run serve
|
npm run serve
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -40,9 +45,9 @@ npm run lint
|
|||||||
|
|
||||||
* Test
|
* Test
|
||||||
```
|
```
|
||||||
# (See .env.development for more details.)
|
# (Let's replace this with a .env.development or .env.staging file.)
|
||||||
# The test BVC_MEETUPS_PROJECT_CLAIM_ID does not resolve as a URL because it's only in the test DB and the prod redirect won't redirect there.
|
# The test BVC_MEETUPS_PROJECT_CLAIM_ID does not resolve as a URL because it's only in the test DB and the prod redirect won't redirect there.
|
||||||
TIME_SAFARI_APP_TITLE="TimeSafari_Test" VUE_APP_BVC_MEETUPS_PROJECT_CLAIM_ID=https://endorser.ch/entity/01HNTZYJJXTGT0EZS3VEJGX7AK VUE_APP_DEFAULT_ENDORSER_API_SERVER=https://test-api.endorser.ch VUE_APP_DEFAULT_IMAGE_API_SERVER=https://test-image-api.timesafari.app npm run build
|
TIME_SAFARI_APP_TITLE="TimeSafari_Test" VITE_BVC_MEETUPS_PROJECT_CLAIM_ID=https://endorser.ch/entity/01HNTZYJJXTGT0EZS3VEJGX7AK VITE_DEFAULT_ENDORSER_API_SERVER=https://test-api.endorser.ch VITE_DEFAULT_IMAGE_API_SERVER=https://test-image-api.timesafari.app npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
* Production
|
* Production
|
||||||
@@ -94,7 +99,7 @@ To add an icon, add to main.ts and reference with `fa` element and `icon` attrib
|
|||||||
- Use a mobile user as well as a desktop user.
|
- Use a mobile user as well as a desktop user.
|
||||||
- Backup seed & data & get a CSV dump from Endorser Mobile.
|
- Backup seed & data & get a CSV dump from Endorser Mobile.
|
||||||
- Check that the version is updated.
|
- Check that the version is updated.
|
||||||
- Clear the browser data & add identity & import Time Safari contacts and then CSV contacts.
|
- Clear the browser data & add identity & import Time Safari contacts and then CSV contacts.
|
||||||
- Make sure that it's using the test API (under Identity in 'Advanced').
|
- Make sure that it's using the test API (under Identity in 'Advanced').
|
||||||
- Clear the browser data again. (See "Reset" below.)
|
- Clear the browser data again. (See "Reset" below.)
|
||||||
- Go to the account page before visiting the home page to see that there is no ID.
|
- Go to the account page before visiting the home page to see that there is no ID.
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
presets: ["@vue/cli-plugin-babel/preset"],
|
|
||||||
};
|
|
||||||
17
index.html
Normal file
17
index.html
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||||
|
<link rel="icon" href="/favicon.ico">
|
||||||
|
<title>TimeSafari</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<noscript>
|
||||||
|
<strong>We're sorry but TimeSafari doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||||
|
</noscript>
|
||||||
|
<div id="app"></div>
|
||||||
|
<script type="module" src="/src/main.ts"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
17986
package-lock.json
generated
17986
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
110
package.json
110
package.json
@@ -1,95 +1,93 @@
|
|||||||
{
|
{
|
||||||
"name": "TimeSafari",
|
"name": "TimeSafari",
|
||||||
"version": "0.3.7-beta",
|
"version": "0.3.8-beta",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "vue-cli-service serve",
|
"dev": "vite",
|
||||||
"build": "vue-cli-service build",
|
"serve": "vite preview",
|
||||||
"lint": "vue-cli-service lint"
|
"build": "VITE_GIT_HASH=`git log -1 --pretty=format:%h` vite build",
|
||||||
|
"lint": "eslint --ext .js,.ts,.vue --ignore-path .gitignore src",
|
||||||
|
"lint-fix": "eslint --ext .js,.ts,.vue --ignore-path .gitignore --fix src",
|
||||||
|
"prebuild": "eslint --ext .js,.ts,.vue --ignore-path .gitignore src && node sw_combine.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@dicebear/collection": "^5.3.5",
|
"@dicebear/collection": "^5.4.1",
|
||||||
"@dicebear/core": "^5.3.5",
|
"@dicebear/core": "^5.4.1",
|
||||||
"@ethersproject/hdnode": "^5.7.0",
|
"@ethersproject/hdnode": "^5.7.0",
|
||||||
"@fortawesome/fontawesome-svg-core": "^6.4.2",
|
"@fortawesome/fontawesome-svg-core": "^6.5.1",
|
||||||
"@fortawesome/free-solid-svg-icons": "^6.4.2",
|
"@fortawesome/free-solid-svg-icons": "^6.5.1",
|
||||||
"@fortawesome/vue-fontawesome": "^3.0.3",
|
"@fortawesome/vue-fontawesome": "^3.0.6",
|
||||||
"@pvermeer/dexie-encrypted-addon": "^3.0.0",
|
"@pvermeer/dexie-encrypted-addon": "^3.0.0",
|
||||||
"@tweenjs/tween.js": "^21.0.0",
|
"@tweenjs/tween.js": "^21.1.1",
|
||||||
"@types/js-yaml": "^4.0.9",
|
"@types/js-yaml": "^4.0.9",
|
||||||
"@types/luxon": "^3.4.2",
|
"@types/luxon": "^3.4.2",
|
||||||
"@veramo/core": "^5.4.1",
|
"@veramo/core": "^5.6.0",
|
||||||
"@veramo/credential-w3c": "^5.4.1",
|
"@veramo/credential-w3c": "^5.6.0",
|
||||||
"@veramo/data-store": "^5.4.1",
|
"@veramo/data-store": "^5.6.0",
|
||||||
"@veramo/did-manager": "^5.4.1",
|
"@veramo/did-manager": "^5.6.0",
|
||||||
"@veramo/did-provider-ethr": "^5.4.1",
|
"@veramo/did-provider-ethr": "^5.6.0",
|
||||||
"@veramo/did-resolver": "^5.4.1",
|
"@veramo/did-resolver": "^5.6.0",
|
||||||
"@veramo/key-manager": "^5.4.1",
|
"@veramo/key-manager": "^5.6.0",
|
||||||
"@vueuse/core": "^10.4.1",
|
"@vueuse/core": "^10.9.0",
|
||||||
"@zxing/text-encoding": "^0.9.0",
|
"@zxing/text-encoding": "^0.9.0",
|
||||||
"axios": "^1.5.0",
|
"axios": "^1.6.8",
|
||||||
"buffer": "^6.0.3",
|
|
||||||
"class-transformer": "^0.5.1",
|
"class-transformer": "^0.5.1",
|
||||||
"core-js": "^3.32.1",
|
"dexie": "^3.2.7",
|
||||||
"dexie": "^3.2.4",
|
"dexie-export-import": "^4.1.1",
|
||||||
"dexie-export-import": "^4.0.7",
|
"did-jwt": "^7.4.7",
|
||||||
"did-jwt": "^7.2.7",
|
"ethereum-cryptography": "^2.1.3",
|
||||||
"ethereum-cryptography": "^2.1.2",
|
|
||||||
"ethereumjs-util": "^7.1.5",
|
"ethereumjs-util": "^7.1.5",
|
||||||
"ethr-did-resolver": "^8.1.2",
|
"ethr-did-resolver": "^8.1.2",
|
||||||
"git-describe": "^4.1.1",
|
|
||||||
"jdenticon": "^3.2.0",
|
"jdenticon": "^3.2.0",
|
||||||
"js-generate-password": "^0.1.9",
|
"js-generate-password": "^0.1.9",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"localstorage-slim": "^2.5.0",
|
"localstorage-slim": "^2.7.0",
|
||||||
|
"lru-cache": "^10.2.0",
|
||||||
"luxon": "^3.4.4",
|
"luxon": "^3.4.4",
|
||||||
"merkletreejs": "^0.3.11",
|
"merkletreejs": "^0.3.11",
|
||||||
"moment": "^2.29.4",
|
"moment": "^2.30.1",
|
||||||
"notiwind": "^2.0.2",
|
"notiwind": "^2.0.2",
|
||||||
"papaparse": "^5.4.1",
|
"papaparse": "^5.4.1",
|
||||||
"pina": "^0.20.2204228",
|
"pina": "^0.20.2204228",
|
||||||
"pinia-plugin-persistedstate": "^3.2.0",
|
"pinia-plugin-persistedstate": "^3.2.1",
|
||||||
"qr-code-generator-vue3": "^1.4.21",
|
"qr-code-generator-vue3": "^1.4.21",
|
||||||
"ramda": "^0.29.0",
|
"ramda": "^0.29.1",
|
||||||
"readable-stream": "^4.4.2",
|
"readable-stream": "^4.5.2",
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.14",
|
||||||
"register-service-worker": "^1.7.2",
|
"register-service-worker": "^1.7.2",
|
||||||
"simple-vue-camera": "^1.1.3",
|
"simple-vue-camera": "^1.1.3",
|
||||||
"three": "^0.156.1",
|
"three": "^0.156.1",
|
||||||
"ua-parser-js": "^1.0.37",
|
"ua-parser-js": "^1.0.37",
|
||||||
"util": "^0.12.5",
|
"util": "^0.12.5",
|
||||||
"vue": "^3.3.4",
|
"vue": "^3.4.21",
|
||||||
"vue-axios": "^3.5.2",
|
"vue-axios": "^3.5.2",
|
||||||
"vue-facing-decorator": "^3.0.2",
|
"vue-facing-decorator": "^3.0.4",
|
||||||
"vue-qrcode-reader": "^5.4.1",
|
"vue-picture-cropper": "^0.7.0",
|
||||||
"vue-router": "^4.2.4",
|
"vue-qrcode-reader": "^5.5.3",
|
||||||
|
"vue-router": "^4.3.0",
|
||||||
"web-did-resolver": "^2.0.27"
|
"web-did-resolver": "^2.0.27"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/leaflet": "^1.9.4",
|
"@types/leaflet": "^1.9.8",
|
||||||
"@types/ramda": "^0.29.3",
|
"@types/ramda": "^0.29.11",
|
||||||
"@types/three": "^0.155.1",
|
"@types/three": "^0.155.1",
|
||||||
"@types/ua-parser-js": "^0.7.39",
|
"@types/ua-parser-js": "^0.7.39",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.6.0",
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
||||||
"@typescript-eslint/parser": "^6.6.0",
|
"@typescript-eslint/parser": "^6.21.0",
|
||||||
|
"@vitejs/plugin-vue": "^5.0.4",
|
||||||
"@vue-leaflet/vue-leaflet": "^0.10.1",
|
"@vue-leaflet/vue-leaflet": "^0.10.1",
|
||||||
"@vue/cli-plugin-babel": "~5.0.8",
|
|
||||||
"@vue/cli-plugin-eslint": "~5.0.8",
|
|
||||||
"@vue/cli-plugin-pwa": "~5.0.8",
|
|
||||||
"@vue/cli-plugin-router": "~5.0.8",
|
|
||||||
"@vue/cli-plugin-typescript": "~5.0.8",
|
|
||||||
"@vue/cli-plugin-vuex": "~5.0.8",
|
|
||||||
"@vue/cli-service": "~5.0.8",
|
|
||||||
"@vue/eslint-config-typescript": "^11.0.3",
|
"@vue/eslint-config-typescript": "^11.0.3",
|
||||||
"autoprefixer": "^10.4.15",
|
"autoprefixer": "^10.4.19",
|
||||||
"eslint": "^8.53.0",
|
"eslint": "^8.57.0",
|
||||||
"eslint-config-prettier": "^9.0.0",
|
"eslint-config-prettier": "^9.1.0",
|
||||||
"eslint-plugin-prettier": "^5.0.0",
|
"eslint-plugin-prettier": "^5.1.3",
|
||||||
"eslint-plugin-vue": "^9.17.0",
|
"eslint-plugin-vue": "^9.23.0",
|
||||||
"leaflet": "^1.9.4",
|
"leaflet": "^1.9.4",
|
||||||
"postcss": "^8.4.29",
|
"postcss": "^8.4.38",
|
||||||
"prettier": "^3.1.0",
|
"prettier": "^3.2.5",
|
||||||
"tailwindcss": "^3.3.3",
|
"tailwindcss": "^3.4.1",
|
||||||
"typescript": "~5.2.2"
|
"typescript": "~5.2.2",
|
||||||
|
"vite": "^5.2.0",
|
||||||
|
"vite-plugin-pwa": "^0.19.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,182 +1,4 @@
|
|||||||
|
|
||||||
tasks :
|
tasks :
|
||||||
|
|
||||||
- finish push server:
|
- This list has moved - see https://sharing.clickup.com/9014278710/l/h/6-901402735154-1/685f1be3f9b150d
|
||||||
- get utcHour parameter working
|
|
||||||
- add back the explicit wait for browser subscription timing problems
|
|
||||||
- 01 change scanning flow - allow them to stay on the QR/scanning screen after scanning someone
|
|
||||||
|
|
||||||
- 24 contextual tutorials https://docs.google.com/document/d/11C_K3RM0rgo0onih20KFhcIzukZyq_CRWqaWX5om_kM/edit#heading=h.iwiwcydou5hw
|
|
||||||
|
|
||||||
- 24 Move to Vite assignee:jason
|
|
||||||
|
|
||||||
- .1 add shortcut from project (etc?) to the public project page in a browser
|
|
||||||
- .1 add KindSpring link to ideas
|
|
||||||
- .1 on feed, don't show "to someone anonymous" if it's to a project
|
|
||||||
- 16 save data backups in Google
|
|
||||||
- 16 generate and use passkeys for identities
|
|
||||||
- .5 show "give" buttons (eg. from anonymous) even if they can't give, greyed out, and give them a warning and instructions
|
|
||||||
- .2 when adding a claim on home screen, push that claim to the top of the list
|
|
||||||
|
|
||||||
- .2 fix give dialog from "more contacts" off home page to allow giving to this user
|
|
||||||
- .5 stop from seeing an error on the first page when browser doesn't support service workers (which I've seen on iPhone; visible in Firefox private window)
|
|
||||||
- .2 don't show a warning on a totally new project when the authorized agent is set
|
|
||||||
- .2 anchor hash into BTC
|
|
||||||
- .2 list the "show more" contacts alphabetically
|
|
||||||
|
|
||||||
- .5 make Time Safari a share_target for images
|
|
||||||
|
|
||||||
- 08 add image on profile
|
|
||||||
|
|
||||||
- 01 ask to detect location & record it in settings
|
|
||||||
- 01 if personal location is set, show potential local affiliations
|
|
||||||
- 02 refactor the buttons for chosing a search location so that the actions are clear assignee-group:ui
|
|
||||||
|
|
||||||
- 24 compelling UI for credential presentations
|
|
||||||
- discover who in my network has activity on a project
|
|
||||||
|
|
||||||
- 24 compelling UI for statistics (eg. World?)
|
|
||||||
|
|
||||||
- 01 in the feed, group by project or contact or topic or time/$ (via BC); new projects, offers, search area, etc assignee-group:ui
|
|
||||||
- 01 separate not-on-platform vs totally anonymous; terminology "unidentified"?
|
|
||||||
- .2 add links between projects assignee-group:ui
|
|
||||||
- 24 make the contact browsing on the front page something that invites more action
|
|
||||||
|
|
||||||
- .5 change server plan & project endpoints to use jwtId as identifier rather than rowid
|
|
||||||
- 16 edit offers & gives, or revoke allowing re-creation
|
|
||||||
- .1 When available in the server, give message for 'nonAmountGiven' on offers on ProjectsView page.
|
|
||||||
- .1 Add help instructions for "Encryption key has changed" error. (It is a problem if localStorage is cleared, but the contacts & settings remain and they have to restore their seeds.)
|
|
||||||
- .1 show better error when user with no ID goes to the "My Project" page
|
|
||||||
- 01 in front page prompt for ideas for gratitude :
|
|
||||||
- randomize (not show in order)
|
|
||||||
- checkboxes - show non-person-oriented messages, show only contacts, show only projects
|
|
||||||
|
|
||||||
- .5 add a notice on the front page if their notifications are off
|
|
||||||
- 08 allow user to add a time when they want their daily notification
|
|
||||||
|
|
||||||
- .5 prompt for the name directly when they visit the QR scan page
|
|
||||||
- 01 mark a project as inactive
|
|
||||||
- 01 add share button for sending a message to confirmers when we can't see the claim (like the "visible" links)
|
|
||||||
- .5 add TimeSafari as a shareable app https://developer.mozilla.org/en-US/docs/Web/Manifest/share_target
|
|
||||||
- .5 choose a project's alternative agent ("authorized representative") via a contact chooser (not just copy-paste a DID)
|
|
||||||
- .5 find out why clicking quickly back-and-forth onto the "my project" page often shows error "You need an identifier to load your projects." (easier to reproduce on desktop?)
|
|
||||||
- .5 bug - it didn't show the "fulfills offer" on the claim detail page for a give that had one - https://test.timesafari.app/claim/01HMFWRPA3PD6Q9EYFKX3MC41J
|
|
||||||
- 01 replace all "confirm" prompts with nicer modal
|
|
||||||
- .1 hide project-create button on project page if not registered
|
|
||||||
- .1 hide offer & give buttons on project list page if not registered
|
|
||||||
- .1 add cursor-pointer on the icons for giving on the project page, and on the list of projects on the discover page
|
|
||||||
- .2 record when InfiniteScroll hits the end of the list and don't trigger any more loads (feed, project list, give & offer lists)
|
|
||||||
|
|
||||||
- bug (that is hard to reproduce) - got blank screen and errors on iPhone with no bottom tabs
|
|
||||||
- bug - turning notifications on from the help screen did not stay, though account screen toggle did stay (From Jason on iPhone.)
|
|
||||||
- refactor - supply the projectId to the OfferDialog just like we do with the GiftedDialog offerId (in the "open" method, maybe as well as an attribute)
|
|
||||||
- the confirm button on each give on the ProjectViewView page doesn't have all the context of the ClaimView page, so it can show sometimes inappropriately; consider consolidation
|
|
||||||
- make the "give" on contact screen work like other give (allowing donation vs current blank)
|
|
||||||
- .2 on ClaimView, the "ask someone" should refer to "visible" IDs, or to confirmations only if confirmations are visible
|
|
||||||
- message "send them to this page" on ClaimView should be a link (for installed app)
|
|
||||||
- When we update a version, desktop browser users have seen nothing happen after clicking on the contact page QR and on the account page "Help"; errors show in the console. Reload fixed it. If this happens on mobile, ask the user to reload.
|
|
||||||
|
|
||||||
- 01 show my VCs - most interesting, or via search
|
|
||||||
- 04 allow user to download & prove chains of VCs, mine + ones I can see about me from others
|
|
||||||
|
|
||||||
- revenue to support server operation
|
|
||||||
|
|
||||||
- .1 copy button for seed
|
|
||||||
- .5 If notifications are not enabled, add message to front page with link/button to enable
|
|
||||||
- make server endpoint for full English description of limits
|
|
||||||
- create a help-desk document & add screenshots
|
|
||||||
|
|
||||||
- .1 update "offer" units to have same functionality as "give" units
|
|
||||||
- .5 add a link to any 'give' records that fulfill an offer on ClaimView
|
|
||||||
- 01 on home page, prompt for install check in addition to "supports notifications" check (since they won't get notified if Chrome is closed)
|
|
||||||
- 01 on Mac (& Windows?) desktop, add a help blurb so that they can find it again (since it doesn't show in Application list)
|
|
||||||
- bug (that is hard to reproduce) - got error adding on Firefox user #0 as contact for themselves
|
|
||||||
- bug (that is hard to reproduce) - in Chrome, install app then delete app and try from Chrome browser and see log errors "Uncaught TypeError: self.appendDailyLog is not a function"
|
|
||||||
- bug (that is hard to reproduce) - on the second 'give' recorded on prod it showed me as the agent
|
|
||||||
- 04 remove 'rowid' references (that are sqlite-specific); may involve server
|
|
||||||
- 04 look at other examples for better onboarding UI, eg friend.tech
|
|
||||||
- .5 Add inactive flag / end date, 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?
|
|
||||||
- .2 Show a warning if both giver and recipient are the same (but still allow?)
|
|
||||||
- .5 Shrink the buttons on project 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 remove references to localStorage for projectId (now that it's pulling from the path)
|
|
||||||
- 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)
|
|
||||||
- warn if they're using the web (android only?)
|
|
||||||
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/getInstalledRelatedApps
|
|
||||||
https://web.dev/articles/get-installed-related-apps
|
|
||||||
- .5 fix the "onboarding help" list of instructions so that it always formats right (currently doesn't show numbers aligned on Google Pixel 6a, iPhone 11 Pro, iPhone 12 mini)
|
|
||||||
- .5 make the "onboarding help" it so that it doesn't cover the QR icon on the contacts page
|
|
||||||
- .5 fix masked icon (because some of the top-right of the binoculars is cut off)
|
|
||||||
|
|
||||||
- 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
|
|
||||||
- 01 link to world for specific stats
|
|
||||||
- .5 don't load another instance of a bush if it already exists
|
|
||||||
- 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)
|
|
||||||
|
|
||||||
- .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
|
|
||||||
- 01 especially for iOS, check for new version & update, eg. https://stackoverflow.com/questions/52221805/any-way-yet-to-auto-update-or-just-clear-the-cache-on-a-pwa-on-ios
|
|
||||||
|
|
||||||
- 24 allow a person record with interests, including location; purpose? contact methods? enhance other connections the same? (suggestion from Philippines) assignee-group:ui
|
|
||||||
- 24 brief introduction slides https://docs.google.com/document/d/11C_K3RM0rgo0onih20KFhcIzukZyq_CRWqaWX5om_kM/edit#heading=h.iwiwcydou5hw
|
|
||||||
- 12 feedback https://docs.google.com/document/d/11C_K3RM0rgo0onih20KFhcIzukZyq_CRWqaWX5om_kM/edit#heading=h.iwiwcydou5hw
|
|
||||||
|
|
||||||
- 32 accept images for projects
|
|
||||||
- 32 accept images for contacts
|
|
||||||
- import project interactions from GitHub/GitLab and manage signing
|
|
||||||
|
|
||||||
- show total time offered to & fulfilled to a project
|
|
||||||
- show total time offered by & fulfilled by a contact
|
|
||||||
|
|
||||||
- linking between projects or plans :
|
|
||||||
- show total time given to & from a project
|
|
||||||
- terminology:
|
|
||||||
- for subtasks: fulfills (is it really the same?), feeds, contributes to, supplies, boosts, advances
|
|
||||||
- for blocking: blocks, precedes, comes before, is sought by -- vs follows, seeks, builds on ("contributes to" isn't specific enough, "succeeds" has different, possibly confusing meaning)
|
|
||||||
|
|
||||||
- .5 Replace Gifted/Give in ContactsView with GiftedDialog
|
|
||||||
|
|
||||||
- Stats :
|
|
||||||
- 01 point out user's location on the world
|
|
||||||
- 01 present a credential selected from the stats
|
|
||||||
- 04 show gives spreading to other places
|
|
||||||
- badge for most gives/receives/confirms per day/week/month
|
|
||||||
- badge for amount given/offered to your project
|
|
||||||
- set a goal of given/offers
|
|
||||||
|
|
||||||
- automated tests, eg. pup-test or cypress
|
|
||||||
|
|
||||||
- Notifications (wake on the phone, push notifications)
|
|
||||||
- 02 change push server so that the web-push/subscribe call sets up a thread for the 10-seconds-later push notification, but returns immediately to the callee
|
|
||||||
- pull instead of push, maybe via scheduled runs
|
|
||||||
- have a notification pop-up on Mac screen
|
|
||||||
|
|
||||||
- 16 Connect with phone contacts - this may be a whole different app, because we want a quick link A) to the same phone contact and B) from the phone contact app
|
|
||||||
|
|
||||||
- Support KERI AIDs
|
|
||||||
- Support Peer DIDs
|
|
||||||
- Support messaging through DIDComm
|
|
||||||
- Write to or read from a different ledger (eg. private ACDC, EAS & attest.sh)
|
|
||||||
|
|
||||||
- 01 On nearby search, if user starts changing their box but cancels and goes back to the map it is zoomed far out. Fix to fit the box better.
|
|
||||||
|
|
||||||
- allow some gives even if they aren't registered - maybe someday as a gift to the world, but we really want this to be built via personal connections -- and that allows spam
|
|
||||||
- .1 When Chrome shows compatibility https://developer.mozilla.org/en-US/docs/Web/API/Web_Share_API#api.navigator.canshare
|
|
||||||
then change the canShare check in this app to check the real canShare() method.
|
|
||||||
|
|
||||||
log :
|
|
||||||
- videos for multiple identities https://youtu.be/p8L87AeD76w and for adding time to contacts https://youtu.be/7Yylczevp10 done:2023-03-29
|
|
||||||
- project lists, contact totals & actions, multiple identifiers, stats-world, activity feed, rename of this project file (use "--follow --") milestone:2 done:2023-06-27
|
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
||||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
|
||||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<noscript>
|
|
||||||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
|
||||||
</noscript>
|
|
||||||
<div id="app"></div>
|
|
||||||
<!-- built files will be auto injected -->
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
40
src/App.vue
40
src/App.vue
@@ -372,25 +372,29 @@ export default class App extends Vue {
|
|||||||
pushUrl = settings.webPushServer;
|
pushUrl = settings.webPushServer;
|
||||||
}
|
}
|
||||||
|
|
||||||
await axios
|
if (pushUrl.startsWith("http://localhost")) {
|
||||||
.get(pushUrl + "/web-push/vapid")
|
console.log("Not checking for VAPID in this local environment.");
|
||||||
.then((response: VapidResponse) => {
|
} else {
|
||||||
this.b64 = response.data?.vapidKey || "";
|
await axios
|
||||||
console.log("Got vapid key:", this.b64);
|
.get(pushUrl + "/web-push/vapid")
|
||||||
navigator.serviceWorker.addEventListener("controllerchange", () => {
|
.then((response: VapidResponse) => {
|
||||||
console.log("New service worker is now controlling the page");
|
this.b64 = response.data?.vapidKey || "";
|
||||||
|
console.log("Got vapid key:", this.b64);
|
||||||
|
navigator.serviceWorker.addEventListener("controllerchange", () => {
|
||||||
|
console.log("New service worker is now controlling the page");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
if (!this.b64) {
|
||||||
if (!this.b64) {
|
this.$notify(
|
||||||
this.$notify(
|
{
|
||||||
{
|
group: "alert",
|
||||||
group: "alert",
|
type: "danger",
|
||||||
type: "danger",
|
title: "Error Setting Notifications",
|
||||||
title: "Error Setting Notifications",
|
text: "Could not set notifications.",
|
||||||
text: "Could not set notifications.",
|
},
|
||||||
},
|
-1,
|
||||||
-1,
|
);
|
||||||
);
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (window.location.host.startsWith("localhost")) {
|
if (window.location.host.startsWith("localhost")) {
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
|
@import url('https://fonts.googleapis.com/css2?family=Work+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap');
|
||||||
@tailwind base;
|
@tailwind base;
|
||||||
@tailwind components;
|
@tailwind components;
|
||||||
@tailwind utilities;
|
@tailwind utilities;
|
||||||
|
|
||||||
@import url('https://fonts.googleapis.com/css2?family=Work+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap');
|
|
||||||
|
|
||||||
@layer base {
|
@layer base {
|
||||||
html {
|
html {
|
||||||
font-family: 'Work Sans', ui-sans-serif, system-ui, sans-serif !important;
|
font-family: 'Work Sans', ui-sans-serif, system-ui, sans-serif !important;
|
||||||
|
|||||||
@@ -5,20 +5,29 @@
|
|||||||
import { createAvatar, StyleOptions } from "@dicebear/core";
|
import { createAvatar, StyleOptions } from "@dicebear/core";
|
||||||
import { avataaars } from "@dicebear/collection";
|
import { avataaars } from "@dicebear/collection";
|
||||||
import { Vue, Component, Prop } from "vue-facing-decorator";
|
import { Vue, Component, Prop } from "vue-facing-decorator";
|
||||||
|
import { Contact } from "@/db/tables/contacts";
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
export default class EntityIcon extends Vue {
|
export default class EntityIcon extends Vue {
|
||||||
@Prop entityId = "";
|
@Prop contact: Contact;
|
||||||
|
@Prop entityId = ""; // overridden by contact.did or profileImageUrl
|
||||||
@Prop iconSize = 0;
|
@Prop iconSize = 0;
|
||||||
|
@Prop profileImageUrl = ""; // overridden by contact.profileImageUrl
|
||||||
|
|
||||||
generateIcon() {
|
generateIcon() {
|
||||||
const options: StyleOptions<object> = {
|
const imageUrl = this.contact?.profileImageUrl || this.profileImageUrl;
|
||||||
seed: this.entityId || "",
|
if (imageUrl) {
|
||||||
size: this.iconSize,
|
return `<img src="${imageUrl}" alt="avatar" width="${this.iconSize}" height="${this.iconSize}" />`;
|
||||||
};
|
} else {
|
||||||
const avatar = createAvatar(avataaars, options);
|
const identifier = this.contact?.did || this.entityId;
|
||||||
const svgString = avatar.toString();
|
const options: StyleOptions<object> = {
|
||||||
return svgString;
|
seed: (identifier as string) || "",
|
||||||
|
size: this.iconSize,
|
||||||
|
};
|
||||||
|
const avatar = createAvatar(avataaars, options);
|
||||||
|
const svgString = avatar.toString();
|
||||||
|
return svgString;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
219
src/components/FeedFilters.vue
Normal file
219
src/components/FeedFilters.vue
Normal file
@@ -0,0 +1,219 @@
|
|||||||
|
<template>
|
||||||
|
<div v-if="visible" id="dialogFeedFilters" class="dialog-overlay">
|
||||||
|
<div class="dialog">
|
||||||
|
<h1 class="text-xl font-bold text-center mb-4">Feed Filters</h1>
|
||||||
|
|
||||||
|
<p class="mb-4 font-bold">Show only activities that…</p>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-1 gap-2">
|
||||||
|
<div
|
||||||
|
class="flex items-center justify-between cursor-pointer"
|
||||||
|
@click="toggleHasVisibleDid()"
|
||||||
|
>
|
||||||
|
<!-- label -->
|
||||||
|
<div>Include someone visible to me</div>
|
||||||
|
<!-- toggle -->
|
||||||
|
<div class="relative ml-2">
|
||||||
|
<!-- input -->
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
v-model="hasVisibleDid"
|
||||||
|
name="toggleFilterFromMyContacts"
|
||||||
|
class="sr-only"
|
||||||
|
/>
|
||||||
|
<!-- line -->
|
||||||
|
<div class="block bg-slate-500 w-14 h-8 rounded-full"></div>
|
||||||
|
<!-- dot -->
|
||||||
|
<div
|
||||||
|
class="dot absolute left-1 top-1 bg-slate-400 w-6 h-6 rounded-full transition"
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<em>or</em>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="flex items-center justify-between cursor-pointer"
|
||||||
|
@click="
|
||||||
|
hasSearchBox
|
||||||
|
? toggleNearby()
|
||||||
|
: $router.push({ name: 'search-area' })
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<!-- label -->
|
||||||
|
<div>Are nearby</div>
|
||||||
|
<!-- toggle -->
|
||||||
|
<div v-if="hasSearchBox" class="relative ml-2">
|
||||||
|
<!-- input -->
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
v-model="isNearby"
|
||||||
|
name="toggleFilterNearby"
|
||||||
|
class="sr-only"
|
||||||
|
/>
|
||||||
|
<!-- line -->
|
||||||
|
<div class="block bg-slate-500 w-14 h-8 rounded-full"></div>
|
||||||
|
<!-- dot -->
|
||||||
|
<div
|
||||||
|
class="dot absolute left-1 top-1 bg-slate-400 w-6 h-6 rounded-full transition"
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
<div v-else class="relative ml-2">
|
||||||
|
<button class="ml-2 px-4 py-2 rounded-md bg-blue-200 text-blue-500">
|
||||||
|
Select Location
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-1 sm:grid-cols-3 gap-2 mt-4">
|
||||||
|
<button
|
||||||
|
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
||||||
|
@click="setAll()"
|
||||||
|
>
|
||||||
|
Set All
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
||||||
|
@click="clearAll()"
|
||||||
|
>
|
||||||
|
Clear All
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
||||||
|
@click="done()"
|
||||||
|
>
|
||||||
|
Done
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { Vue, Component } from "vue-facing-decorator";
|
||||||
|
import {
|
||||||
|
LMap,
|
||||||
|
LMarker,
|
||||||
|
LRectangle,
|
||||||
|
LTileLayer,
|
||||||
|
} from "@vue-leaflet/vue-leaflet";
|
||||||
|
|
||||||
|
import { MASTER_SETTINGS_KEY } from "@/db/tables/settings";
|
||||||
|
import { db } from "@/db/index";
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
components: {
|
||||||
|
LRectangle,
|
||||||
|
LMap,
|
||||||
|
LMarker,
|
||||||
|
LTileLayer,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
export default class FeedFilters extends Vue {
|
||||||
|
onCloseIfChanged = () => {};
|
||||||
|
hasSearchBox = false;
|
||||||
|
hasVisibleDid = false;
|
||||||
|
isNearby = false;
|
||||||
|
settingChanged = false;
|
||||||
|
visible = false;
|
||||||
|
|
||||||
|
async open(onCloseIfChanged: () => void) {
|
||||||
|
this.onCloseIfChanged = onCloseIfChanged;
|
||||||
|
|
||||||
|
await db.open();
|
||||||
|
const settings = await db.settings.get(MASTER_SETTINGS_KEY);
|
||||||
|
this.hasVisibleDid = !!settings?.filterFeedByVisible;
|
||||||
|
this.isNearby = !!settings?.filterFeedByNearby;
|
||||||
|
if (settings?.searchBoxes && settings.searchBoxes.length > 0) {
|
||||||
|
this.hasSearchBox = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.settingChanged = false;
|
||||||
|
this.visible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
toggleHasVisibleDid() {
|
||||||
|
this.settingChanged = true;
|
||||||
|
this.hasVisibleDid = !this.hasVisibleDid;
|
||||||
|
db.settings.update(MASTER_SETTINGS_KEY, {
|
||||||
|
filterFeedByVisible: this.hasVisibleDid,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
toggleNearby() {
|
||||||
|
this.settingChanged = true;
|
||||||
|
this.isNearby = !this.isNearby;
|
||||||
|
db.settings.update(MASTER_SETTINGS_KEY, {
|
||||||
|
filterFeedByNearby: this.isNearby,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async clearAll() {
|
||||||
|
if (this.hasVisibleDid || this.isNearby) {
|
||||||
|
this.settingChanged = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
db.settings.update(MASTER_SETTINGS_KEY, {
|
||||||
|
filterFeedByNearby: false,
|
||||||
|
filterFeedByVisible: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
this.hasVisibleDid = false;
|
||||||
|
this.isNearby = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
async setAll() {
|
||||||
|
if (!this.hasVisibleDid || !this.isNearby) {
|
||||||
|
this.settingChanged = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
db.settings.update(MASTER_SETTINGS_KEY, {
|
||||||
|
filterFeedByNearby: true,
|
||||||
|
filterFeedByVisible: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
this.hasVisibleDid = true;
|
||||||
|
this.isNearby = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
close() {
|
||||||
|
if (this.settingChanged) {
|
||||||
|
this.onCloseIfChanged();
|
||||||
|
}
|
||||||
|
this.visible = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
done() {
|
||||||
|
this.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.dialog-overlay {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background-color: rgba(0, 0, 0, 0.5);
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
padding: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#dialogFeedFilters.dialog-overlay {
|
||||||
|
z-index: 99999;
|
||||||
|
overflow: scroll;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dialog {
|
||||||
|
background-color: white;
|
||||||
|
padding: 1rem;
|
||||||
|
border-radius: 0.5rem;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 500px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -65,18 +65,20 @@
|
|||||||
@click="explainData()"
|
@click="explainData()"
|
||||||
/>
|
/>
|
||||||
</p>
|
</p>
|
||||||
<button
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-2">
|
||||||
class="block w-full text-center text-lg font-bold uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-3 rounded-md mb-2"
|
<button
|
||||||
@click="confirm"
|
class="block w-full text-center text-lg font-bold uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-3 rounded-md"
|
||||||
>
|
@click="confirm"
|
||||||
Sign & Send
|
>
|
||||||
</button>
|
Sign & Send
|
||||||
<button
|
</button>
|
||||||
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
<button
|
||||||
@click="cancel"
|
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
||||||
>
|
@click="cancel"
|
||||||
Cancel
|
>
|
||||||
</button>
|
Cancel
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -20,28 +20,54 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="uploading" class="flex justify-center">
|
<div v-if="uploading" class="flex justify-center">
|
||||||
<fa icon="spinner" class="fa-spin fa-3x text-center block" />
|
<fa
|
||||||
|
icon="spinner"
|
||||||
|
class="fa-spin fa-3x text-center block px-12 py-12"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="blob">
|
<div v-else-if="blob">
|
||||||
<div
|
<div v-if="crop">
|
||||||
class="flex justify-center gap-2 absolute bottom-[1rem] left-[1rem] right-[1rem] bg-black/50 px-4 py-2"
|
<VuePictureCropper
|
||||||
>
|
:boxStyle="{
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
backgroundColor: '#f8f8f8',
|
||||||
|
margin: 'auto',
|
||||||
|
}"
|
||||||
|
:img="URL.createObjectURL(blob)"
|
||||||
|
:options="{
|
||||||
|
viewMode: 1,
|
||||||
|
dragMode: 'crop',
|
||||||
|
aspectRatio: 9 / 9,
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
<!-- This gives a round cropper.
|
||||||
|
:presetMode="{
|
||||||
|
mode: 'round',
|
||||||
|
}"
|
||||||
|
-->
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<div class="flex justify-center">
|
||||||
|
<img :src="URL.createObjectURL(blob)" class="mt-2 rounded" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="absolute bottom-[1rem] left-[1rem] px-2 py-1">
|
||||||
<button
|
<button
|
||||||
@click="uploadImage"
|
@click="uploadImage"
|
||||||
class="bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white font-bold py-2 px-4 rounded-md"
|
class="bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white py-1 px-2 rounded-md"
|
||||||
>
|
>
|
||||||
<span>Upload</span>
|
<span>Upload</span>
|
||||||
</button>
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="absolute bottom-[1rem] right-[1rem] px-2 py-1">
|
||||||
<button
|
<button
|
||||||
@click="retryImage"
|
@click="retryImage"
|
||||||
class="bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white font-bold py-2 px-4 rounded-md"
|
class="bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white py-1 px-2 rounded-md"
|
||||||
>
|
>
|
||||||
<span>Retry</span>
|
<span>Retry</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-center">
|
|
||||||
<img :src="URL.createObjectURL(blob)" class="mt-2 rounded" />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div v-else ref="cameraContainer">
|
<div v-else ref="cameraContainer">
|
||||||
<!--
|
<!--
|
||||||
@@ -92,6 +118,7 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import Camera from "simple-vue-camera";
|
import Camera from "simple-vue-camera";
|
||||||
import { Component, Vue } from "vue-facing-decorator";
|
import { Component, Vue } from "vue-facing-decorator";
|
||||||
|
import VuePictureCropper, { cropper } from "vue-picture-cropper";
|
||||||
|
|
||||||
import { DEFAULT_IMAGE_API_SERVER, NotificationIface } from "@/constants/app";
|
import { DEFAULT_IMAGE_API_SERVER, NotificationIface } from "@/constants/app";
|
||||||
import { getIdentity } from "@/libs/util";
|
import { getIdentity } from "@/libs/util";
|
||||||
@@ -99,13 +126,15 @@ import { db } from "@/db/index";
|
|||||||
import { MASTER_SETTINGS_KEY, Settings } from "@/db/tables/settings";
|
import { MASTER_SETTINGS_KEY, Settings } from "@/db/tables/settings";
|
||||||
import { accessToken } from "@/libs/crypto";
|
import { accessToken } from "@/libs/crypto";
|
||||||
|
|
||||||
@Component({ components: { Camera } })
|
@Component({ components: { Camera, VuePictureCropper } })
|
||||||
export default class GiftedPhotoDialog extends Vue {
|
export default class GiftedPhotoDialog extends Vue {
|
||||||
$notify!: (notification: NotificationIface, timeout?: number) => void;
|
$notify!: (notification: NotificationIface, timeout?: number) => void;
|
||||||
|
|
||||||
activeDeviceNumber = 0;
|
activeDeviceNumber = 0;
|
||||||
activeDid = "";
|
activeDid = "";
|
||||||
blob: Blob | null = null;
|
blob: Blob | null = null;
|
||||||
|
claimType = "GiveAction";
|
||||||
|
crop = false;
|
||||||
mirror = false;
|
mirror = false;
|
||||||
numDevices = 0;
|
numDevices = 0;
|
||||||
setImage: (arg: string) => void = () => {};
|
setImage: (arg: string) => void = () => {};
|
||||||
@@ -134,8 +163,10 @@ export default class GiftedPhotoDialog extends Vue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open(setImageFn: (arg: string) => void) {
|
open(setImageFn: (arg: string) => void, crop?: boolean, claimType?: string) {
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
|
this.crop = !!crop;
|
||||||
|
this.claimType = claimType || "GiveAction";
|
||||||
const bottomNav = document.querySelector("#QuickNav") as HTMLElement;
|
const bottomNav = document.querySelector("#QuickNav") as HTMLElement;
|
||||||
if (bottomNav) {
|
if (bottomNav) {
|
||||||
bottomNav.style.display = "none";
|
bottomNav.style.display = "none";
|
||||||
@@ -274,6 +305,11 @@ export default class GiftedPhotoDialog extends Vue {
|
|||||||
|
|
||||||
async uploadImage() {
|
async uploadImage() {
|
||||||
this.uploading = true;
|
this.uploading = true;
|
||||||
|
|
||||||
|
if (this.crop) {
|
||||||
|
this.blob = await cropper?.getBlob();
|
||||||
|
}
|
||||||
|
|
||||||
const identifier = await getIdentity(this.activeDid);
|
const identifier = await getIdentity(this.activeDid);
|
||||||
const token = await accessToken(identifier);
|
const token = await accessToken(identifier);
|
||||||
const headers = {
|
const headers = {
|
||||||
@@ -295,7 +331,7 @@ export default class GiftedPhotoDialog extends Vue {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
formData.append("image", this.blob, "snapshot.png"); // png is set in snapshot()
|
formData.append("image", this.blob, "snapshot.png"); // png is set in snapshot()
|
||||||
formData.append("claimType", "GiveAction");
|
formData.append("claimType", this.claimType);
|
||||||
try {
|
try {
|
||||||
const response = await axios.post(
|
const response = await axios.post(
|
||||||
DEFAULT_IMAGE_API_SERVER + "/image",
|
DEFAULT_IMAGE_API_SERVER + "/image",
|
||||||
|
|||||||
@@ -1,7 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-if="visible" class="dialog-overlay">
|
<div v-if="visible" class="dialog-overlay">
|
||||||
<div class="dialog">
|
<div class="dialog">
|
||||||
<h1 class="text-xl font-bold text-center mb-4">Here's one:</h1>
|
<h1 class="text-xl font-bold text-center mb-4 relative">
|
||||||
|
Here's one:
|
||||||
|
<div
|
||||||
|
class="text-lg text-center p-2 leading-none absolute right-0 -top-1"
|
||||||
|
@click="cancel"
|
||||||
|
>
|
||||||
|
<fa icon="xmark" class="w-[1em]"></fa>
|
||||||
|
</div>
|
||||||
|
</h1>
|
||||||
<span class="flex justify-between">
|
<span class="flex justify-between">
|
||||||
<span
|
<span
|
||||||
class="rounded-l border border-slate-400 bg-slate-200 px-4 py-2 flex"
|
class="rounded-l border border-slate-400 bg-slate-200 px-4 py-2 flex"
|
||||||
|
|||||||
@@ -50,18 +50,20 @@
|
|||||||
<p class="text-center mt-6 mb-2 italic">
|
<p class="text-center mt-6 mb-2 italic">
|
||||||
Sign & Send to publish to the world
|
Sign & Send to publish to the world
|
||||||
</p>
|
</p>
|
||||||
<button
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-2">
|
||||||
class="block w-full text-center text-lg font-bold uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-3 rounded-md mb-2"
|
<button
|
||||||
@click="confirm"
|
class="block w-full text-center text-lg font-bold uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-3 rounded-md"
|
||||||
>
|
@click="confirm"
|
||||||
Sign & Send
|
>
|
||||||
</button>
|
Sign & Send
|
||||||
<button
|
</button>
|
||||||
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
<button
|
||||||
@click="cancel"
|
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
||||||
>
|
@click="cancel"
|
||||||
Cancel
|
>
|
||||||
</button>
|
Cancel
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -20,11 +20,11 @@ export enum AppString {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const DEFAULT_ENDORSER_API_SERVER =
|
export const DEFAULT_ENDORSER_API_SERVER =
|
||||||
process.env.VUE_APP_DEFAULT_ENDORSER_API_SERVER ||
|
import.meta.env.VITE_DEFAULT_ENDORSER_API_SERVER ||
|
||||||
AppString.TEST_ENDORSER_API_SERVER;
|
AppString.TEST_ENDORSER_API_SERVER;
|
||||||
|
|
||||||
export const DEFAULT_IMAGE_API_SERVER =
|
export const DEFAULT_IMAGE_API_SERVER =
|
||||||
process.env.VUE_APP_DEFAULT_IMAGE_API_SERVER ||
|
import.meta.env.VITE_DEFAULT_IMAGE_API_SERVER ||
|
||||||
AppString.TEST_IMAGE_API_SERVER;
|
AppString.TEST_IMAGE_API_SERVER;
|
||||||
|
|
||||||
export const DEFAULT_PUSH_SERVER =
|
export const DEFAULT_PUSH_SERVER =
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ export interface Contact {
|
|||||||
did: string;
|
did: string;
|
||||||
name?: string;
|
name?: string;
|
||||||
nextPubKeyHashB64?: string; // base64-encoded SHA256 hash of next public key
|
nextPubKeyHashB64?: string; // base64-encoded SHA256 hash of next public key
|
||||||
|
profileImageUrl?: string;
|
||||||
publicKeyBase64?: string;
|
publicKeyBase64?: string;
|
||||||
seesMe?: boolean;
|
seesMe?: boolean;
|
||||||
registered?: boolean;
|
registered?: boolean;
|
||||||
|
|||||||
@@ -16,11 +16,16 @@ export type Settings = {
|
|||||||
|
|
||||||
activeDid?: string; // Active Decentralized ID
|
activeDid?: string; // Active Decentralized ID
|
||||||
apiServer?: string; // API server URL
|
apiServer?: string; // API server URL
|
||||||
firstName?: string; // User's first name
|
|
||||||
|
filterFeedByNearby?: boolean; // filter by nearby
|
||||||
|
filterFeedByVisible?: boolean; // filter by visible users ie. anyone not hidden
|
||||||
|
|
||||||
|
firstName?: string; // user's full name
|
||||||
isRegistered?: boolean;
|
isRegistered?: boolean;
|
||||||
lastName?: string; // deprecated - put all names in firstName
|
lastName?: string; // deprecated - put all names in firstName
|
||||||
lastNotifiedClaimId?: string; // Last notified claim ID
|
lastNotifiedClaimId?: string;
|
||||||
lastViewedClaimId?: string; // Last viewed claim ID
|
lastViewedClaimId?: string;
|
||||||
|
profileImageUrl?: string;
|
||||||
reminderTime?: number; // Time in milliseconds since UNIX epoch for reminders
|
reminderTime?: number; // Time in milliseconds since UNIX epoch for reminders
|
||||||
reminderOn?: boolean; // Toggle to enable or disable reminders
|
reminderOn?: boolean; // Toggle to enable or disable reminders
|
||||||
|
|
||||||
@@ -38,6 +43,10 @@ export type Settings = {
|
|||||||
webPushServer?: string; // Web Push server URL
|
webPushServer?: string; // Web Push server URL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export function isAnyFeedFilterOn(settings: Settings): boolean {
|
||||||
|
return !!(settings.filterFeedByNearby || settings.filterFeedByVisible);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Schema for the Settings table in the database.
|
* Schema for the Settings table in the database.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ export const sign = async (privateKeyHex: string) => {
|
|||||||
* The SimpleSigner returns a configured function for signing data.
|
* The SimpleSigner returns a configured function for signing data.
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* const signer = SimpleSigner(process.env.PRIVATE_KEY)
|
* const signer = SimpleSigner(import.meta.env.PRIVATE_KEY)
|
||||||
* signer(data, (err, signature) => {
|
* signer(data, (err, signature) => {
|
||||||
* ...
|
* ...
|
||||||
* })
|
* })
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
|
import { Axios, AxiosResponse, RawAxiosRequestHeaders } from "axios";
|
||||||
|
import * as didJwt from "did-jwt";
|
||||||
|
import { LRUCache } from "lru-cache";
|
||||||
import * as R from "ramda";
|
import * as R from "ramda";
|
||||||
import { IIdentifier } from "@veramo/core";
|
import { IIdentifier } from "@veramo/core";
|
||||||
import { accessToken, SimpleSigner } from "@/libs/crypto";
|
|
||||||
import * as didJwt from "did-jwt";
|
|
||||||
import { Axios, AxiosResponse } from "axios";
|
|
||||||
import { Contact } from "@/db/tables/contacts";
|
import { Contact } from "@/db/tables/contacts";
|
||||||
|
import { accessToken, SimpleSigner } from "@/libs/crypto";
|
||||||
|
|
||||||
export const SCHEMA_ORG_CONTEXT = "https://schema.org";
|
export const SCHEMA_ORG_CONTEXT = "https://schema.org";
|
||||||
// the object in RegisterAction claims
|
// the object in RegisterAction claims
|
||||||
@@ -49,7 +51,7 @@ export interface GenericVerifiableCredential {
|
|||||||
[key: string]: any; // eslint-disable-line @typescript-eslint/no-explicit-any
|
[key: string]: any; // eslint-disable-line @typescript-eslint/no-explicit-any
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GenericServerRecord extends GenericVerifiableCredential {
|
export interface GenericCredWrapper extends GenericVerifiableCredential {
|
||||||
handleId?: string;
|
handleId?: string;
|
||||||
id: string;
|
id: string;
|
||||||
issuedAt: string;
|
issuedAt: string;
|
||||||
@@ -58,7 +60,7 @@ export interface GenericServerRecord extends GenericVerifiableCredential {
|
|||||||
claim: Record<string, any>;
|
claim: Record<string, any>;
|
||||||
claimType?: string;
|
claimType?: string;
|
||||||
}
|
}
|
||||||
export const BLANK_GENERIC_SERVER_RECORD: GenericServerRecord = {
|
export const BLANK_GENERIC_SERVER_RECORD: GenericCredWrapper = {
|
||||||
"@context": SCHEMA_ORG_CONTEXT,
|
"@context": SCHEMA_ORG_CONTEXT,
|
||||||
"@type": "",
|
"@type": "",
|
||||||
claim: {},
|
claim: {},
|
||||||
@@ -68,7 +70,7 @@ export const BLANK_GENERIC_SERVER_RECORD: GenericServerRecord = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// a summary record; the VC is found the fullClaim field
|
// a summary record; the VC is found the fullClaim field
|
||||||
export interface GiveServerRecord {
|
export interface GiveSummaryRecord {
|
||||||
agentDid: string;
|
agentDid: string;
|
||||||
amount: number;
|
amount: number;
|
||||||
amountConfirmed: number;
|
amountConfirmed: number;
|
||||||
@@ -83,7 +85,7 @@ export interface GiveServerRecord {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// a summary record; the VC is found the fullClaim field
|
// a summary record; the VC is found the fullClaim field
|
||||||
export interface OfferServerRecord {
|
export interface OfferSummaryRecord {
|
||||||
amount: number;
|
amount: number;
|
||||||
amountGiven: number;
|
amountGiven: number;
|
||||||
amountGivenConfirmed: number;
|
amountGivenConfirmed: number;
|
||||||
@@ -101,7 +103,7 @@ export interface OfferServerRecord {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// a summary record; the VC is not currently part of this record
|
// a summary record; the VC is not currently part of this record
|
||||||
export interface PlanServerRecord {
|
export interface PlanSummaryRecord {
|
||||||
agentDid?: string; // optional, if the issuer wants someone else to manage as well
|
agentDid?: string; // optional, if the issuer wants someone else to manage as well
|
||||||
description: string;
|
description: string;
|
||||||
endTime?: string;
|
endTime?: string;
|
||||||
@@ -110,6 +112,7 @@ export interface PlanServerRecord {
|
|||||||
issuerDid: string;
|
issuerDid: string;
|
||||||
locLat?: number;
|
locLat?: number;
|
||||||
locLon?: number;
|
locLon?: number;
|
||||||
|
name?: string;
|
||||||
startTime?: string;
|
startTime?: string;
|
||||||
url?: string;
|
url?: string;
|
||||||
}
|
}
|
||||||
@@ -256,6 +259,10 @@ export type CreateAndSubmitClaimResult = SuccessResult | ErrorResult;
|
|||||||
// See https://github.com/trentlarson/endorser-ch/blob/0cb626f803028e7d9c67f095858a9fc8542e3dbd/server/api/services/util.js#L6
|
// See https://github.com/trentlarson/endorser-ch/blob/0cb626f803028e7d9c67f095858a9fc8542e3dbd/server/api/services/util.js#L6
|
||||||
const HIDDEN_DID = "did:none:HIDDEN";
|
const HIDDEN_DID = "did:none:HIDDEN";
|
||||||
|
|
||||||
|
const planCache: LRUCache<string, PlanSummaryRecord> = new LRUCache({
|
||||||
|
max: 500,
|
||||||
|
});
|
||||||
|
|
||||||
export function isDid(did: string) {
|
export function isDid(did: string) {
|
||||||
return did.startsWith("did:");
|
return did.startsWith("did:");
|
||||||
}
|
}
|
||||||
@@ -269,7 +276,7 @@ export function isEmptyOrHiddenDid(did?: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true for any nested string where func(input) === true
|
* @return true for any string within this primitive/object/array where func(input) === true
|
||||||
*
|
*
|
||||||
* Similar logic is found in endorser-mobile.
|
* Similar logic is found in endorser-mobile.
|
||||||
*/
|
*/
|
||||||
@@ -304,6 +311,12 @@ export function containsHiddenDid(obj: any) {
|
|||||||
return testRecursivelyOnStrings(isHiddenDid, obj);
|
return testRecursivelyOnStrings(isHiddenDid, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
export const containsNonHiddenDid = (obj: any) => {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
return testRecursivelyOnStrings((s: any) => isDid(s) && !isHiddenDid(s), obj);
|
||||||
|
};
|
||||||
|
|
||||||
export function stripEndorserPrefix(claimId: string) {
|
export function stripEndorserPrefix(claimId: string) {
|
||||||
if (claimId && claimId.startsWith(ENDORSER_CH_HANDLE_PREFIX)) {
|
if (claimId && claimId.startsWith(ENDORSER_CH_HANDLE_PREFIX)) {
|
||||||
return claimId.substring(ENDORSER_CH_HANDLE_PREFIX.length);
|
return claimId.substring(ENDORSER_CH_HANDLE_PREFIX.length);
|
||||||
@@ -403,8 +416,11 @@ export function didInfoForContact(
|
|||||||
return myId
|
return myId
|
||||||
? { displayName: "You (Alt ID)", known: true }
|
? { displayName: "You (Alt ID)", known: true }
|
||||||
: isHiddenDid(did)
|
: isHiddenDid(did)
|
||||||
? { displayName: "Someone Outside Your Network", known: false }
|
? { displayName: "Someone Totally Outside Your View", known: false }
|
||||||
: { displayName: "Someone Outside Contacts", known: false };
|
: {
|
||||||
|
displayName: "Someone Visible But Outside Your Contact List",
|
||||||
|
known: false,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -423,6 +439,71 @@ export function didInfo(
|
|||||||
return didInfoForContact(did, activeDid, contact, allMyDids).displayName;
|
return didInfoForContact(did, activeDid, contact, allMyDids).displayName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function getHeaders(identity: IIdentifier | null) {
|
||||||
|
const headers: RawAxiosRequestHeaders = {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
};
|
||||||
|
if (identity) {
|
||||||
|
const token = await accessToken(identity);
|
||||||
|
headers["Authorization"] = "Bearer " + token;
|
||||||
|
}
|
||||||
|
return headers;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param handleId nullable -- which means that "undefined" will be returned
|
||||||
|
* @param identity nullable -- which means no private info will be returned
|
||||||
|
* @param axios
|
||||||
|
* @param apiServer
|
||||||
|
*/
|
||||||
|
export async function getPlanFromCache(
|
||||||
|
handleId: string | null,
|
||||||
|
identity: IIdentifier | null,
|
||||||
|
axios: Axios,
|
||||||
|
apiServer: string,
|
||||||
|
) {
|
||||||
|
if (!handleId) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
let cred = planCache.get(handleId);
|
||||||
|
if (!cred) {
|
||||||
|
const url =
|
||||||
|
apiServer +
|
||||||
|
"/api/v2/report/plans?handleId=" +
|
||||||
|
encodeURIComponent(handleId);
|
||||||
|
const headers = await getHeaders(identity);
|
||||||
|
try {
|
||||||
|
const resp = await axios.get(url, { headers });
|
||||||
|
if (resp.status === 200 && resp.data?.data?.length > 0) {
|
||||||
|
cred = resp.data.data[0];
|
||||||
|
planCache.set(handleId, cred);
|
||||||
|
} else {
|
||||||
|
console.log(
|
||||||
|
"Failed to load plan with handle",
|
||||||
|
handleId,
|
||||||
|
" Got data:",
|
||||||
|
resp.data,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(
|
||||||
|
"Failed to load plan with handle",
|
||||||
|
handleId,
|
||||||
|
" Got error:",
|
||||||
|
error,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return cred;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function setPlanInCache(
|
||||||
|
handleId: string,
|
||||||
|
planSummary: PlanSummaryRecord,
|
||||||
|
) {
|
||||||
|
planCache.set(handleId, planSummary);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For result, see https://api.endorser.ch/api-docs/#/claims/post_api_v2_claim
|
* For result, see https://api.endorser.ch/api-docs/#/claims/post_api_v2_claim
|
||||||
*
|
*
|
||||||
@@ -475,7 +556,7 @@ export async function createAndSubmitGive(
|
|||||||
vcClaim.image = imageUrl;
|
vcClaim.image = imageUrl;
|
||||||
}
|
}
|
||||||
return createAndSubmitClaim(
|
return createAndSubmitClaim(
|
||||||
vcClaim as GenericServerRecord,
|
vcClaim as GenericCredWrapper,
|
||||||
identity,
|
identity,
|
||||||
apiServer,
|
apiServer,
|
||||||
axios,
|
axios,
|
||||||
@@ -524,7 +605,7 @@ export async function createAndSubmitOffer(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
return createAndSubmitClaim(
|
return createAndSubmitClaim(
|
||||||
vcClaim as GenericServerRecord,
|
vcClaim as GenericCredWrapper,
|
||||||
identity,
|
identity,
|
||||||
apiServer,
|
apiServer,
|
||||||
axios,
|
axios,
|
||||||
@@ -695,7 +776,7 @@ const claimSummary = (claim: Record<string, any>) => {
|
|||||||
similar code is also contained in endorser-mobile
|
similar code is also contained in endorser-mobile
|
||||||
**/
|
**/
|
||||||
export const claimSpecialDescription = (
|
export const claimSpecialDescription = (
|
||||||
record: GenericServerRecord,
|
record: GenericCredWrapper,
|
||||||
activeDid: string,
|
activeDid: string,
|
||||||
identifiers: Array<string>,
|
identifiers: Array<string>,
|
||||||
contacts: Array<Contact>,
|
contacts: Array<Contact>,
|
||||||
@@ -789,12 +870,12 @@ export const claimSpecialDescription = (
|
|||||||
"...]"
|
"...]"
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return issuer + " declared " + claimSummary(claim as GenericServerRecord);
|
return issuer + " declared " + claimSummary(claim as GenericCredWrapper);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const BVC_MEETUPS_PROJECT_CLAIM_ID =
|
export const BVC_MEETUPS_PROJECT_CLAIM_ID =
|
||||||
process.env.VUE_APP_BVC_MEETUPS_PROJECT_CLAIM_ID ||
|
import.meta.env.VITE_BVC_MEETUPS_PROJECT_CLAIM_ID ||
|
||||||
"https://endorser.ch/entity/01HNTZYJJXTGT0EZS3VEJGX7AK"; // this won't resolve as a URL on production; it's a URN only found in the test system
|
"https://endorser.ch/entity/01HNTZYJJXTGT0EZS3VEJGX7AK"; // this won't resolve as a URL on production; it's a URN only found in the test system
|
||||||
|
|
||||||
export const bvcMeetingJoinClaim = (did: string, startTime: string) => {
|
export const bvcMeetingJoinClaim = (did: string, startTime: string) => {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { accountsDB, db } from "@/db/index";
|
|||||||
import { Account } from "@/db/tables/accounts";
|
import { Account } from "@/db/tables/accounts";
|
||||||
import { MASTER_SETTINGS_KEY } from "@/db/tables/settings";
|
import { MASTER_SETTINGS_KEY } from "@/db/tables/settings";
|
||||||
import { deriveAddress, generateSeed, newIdentifier } from "@/libs/crypto";
|
import { deriveAddress, generateSeed, newIdentifier } from "@/libs/crypto";
|
||||||
import { GenericServerRecord, containsHiddenDid } from "@/libs/endorserServer";
|
import { GenericCredWrapper, containsHiddenDid } from "@/libs/endorserServer";
|
||||||
import * as serverUtil from "@/libs/endorserServer";
|
import * as serverUtil from "@/libs/endorserServer";
|
||||||
|
|
||||||
export const PRIVACY_MESSAGE =
|
export const PRIVACY_MESSAGE =
|
||||||
@@ -70,7 +70,7 @@ export const isGlobalUri = (uri: string) => {
|
|||||||
return uri && uri.match(new RegExp(/^[A-Za-z][A-Za-z0-9+.-]+:/));
|
return uri && uri.match(new RegExp(/^[A-Za-z][A-Za-z0-9+.-]+:/));
|
||||||
};
|
};
|
||||||
|
|
||||||
export const giveIsConfirmable = (veriClaim: GenericServerRecord) => {
|
export const giveIsConfirmable = (veriClaim: GenericCredWrapper) => {
|
||||||
return veriClaim.claimType === "GiveAction";
|
return veriClaim.claimType === "GiveAction";
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ export const doCopyTwoSecRedo = (text: string, fn: () => void) => {
|
|||||||
* @param veriClaim is expected to have fields: claim, claimType, and issuer
|
* @param veriClaim is expected to have fields: claim, claimType, and issuer
|
||||||
*/
|
*/
|
||||||
export const isGiveRecordTheUserCanConfirm = (
|
export const isGiveRecordTheUserCanConfirm = (
|
||||||
veriClaim: GenericServerRecord,
|
veriClaim: GenericCredWrapper,
|
||||||
activeDid: string,
|
activeDid: string,
|
||||||
confirmerIdList: string[] = [],
|
confirmerIdList: string[] = [],
|
||||||
) => {
|
) => {
|
||||||
@@ -102,9 +102,9 @@ export const isGiveRecordTheUserCanConfirm = (
|
|||||||
* @returns the DID of the person who offered, or undefined if hidden
|
* @returns the DID of the person who offered, or undefined if hidden
|
||||||
* @param veriClaim is expected to have fields: claim and issuer
|
* @param veriClaim is expected to have fields: claim and issuer
|
||||||
*/
|
*/
|
||||||
export const offerGiverDid: (
|
export const offerGiverDid: (arg0: GenericCredWrapper) => string | undefined = (
|
||||||
arg0: GenericServerRecord,
|
veriClaim,
|
||||||
) => string | undefined = (veriClaim) => {
|
) => {
|
||||||
let giver;
|
let giver;
|
||||||
if (
|
if (
|
||||||
veriClaim.claim.offeredBy?.identifier &&
|
veriClaim.claim.offeredBy?.identifier &&
|
||||||
@@ -121,7 +121,7 @@ export const offerGiverDid: (
|
|||||||
* @returns true if the user can fulfill the offer
|
* @returns true if the user can fulfill the offer
|
||||||
* @param veriClaim is expected to have fields: claim, claimType, and issuer
|
* @param veriClaim is expected to have fields: claim, claimType, and issuer
|
||||||
*/
|
*/
|
||||||
export const canFulfillOffer = (veriClaim: GenericServerRecord) => {
|
export const canFulfillOffer = (veriClaim: GenericCredWrapper) => {
|
||||||
return !!(veriClaim.claimType === "Offer" && offerGiverDid(veriClaim));
|
return !!(veriClaim.claimType === "Offer" && offerGiverDid(veriClaim));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { register } from "register-service-worker";
|
import { register } from "register-service-worker";
|
||||||
|
|
||||||
if (process.env.NODE_ENV === "production") {
|
if (import.meta.env.NODE_ENV === "production") {
|
||||||
register("/sw_scripts-combined.js", {
|
register("/sw_scripts-combined.js", {
|
||||||
ready() {
|
ready() {
|
||||||
console.log(
|
console.log(
|
||||||
|
|||||||
@@ -31,229 +31,159 @@ const routes: Array<RouteRecordRaw> = [
|
|||||||
{
|
{
|
||||||
path: "/account",
|
path: "/account",
|
||||||
name: "account",
|
name: "account",
|
||||||
component: () =>
|
component: () => import("../views/AccountViewView.vue"),
|
||||||
import(/* webpackChunkName: "account" */ "../views/AccountViewView.vue"),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/claim/:id?",
|
path: "/claim/:id?",
|
||||||
name: "claim",
|
name: "claim",
|
||||||
component: () =>
|
component: () => import("../views/ClaimView.vue"),
|
||||||
import(/* webpackChunkName: "claim" */ "../views/ClaimView.vue"),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/confirm-contact",
|
path: "/confirm-contact",
|
||||||
name: "confirm-contact",
|
name: "confirm-contact",
|
||||||
component: () =>
|
component: () => import("../views/ConfirmContactView.vue"),
|
||||||
import(
|
|
||||||
/* webpackChunkName: "confirm-contact" */ "../views/ConfirmContactView.vue"
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/contact-amounts",
|
path: "/contact-amounts",
|
||||||
name: "contact-amounts",
|
name: "contact-amounts",
|
||||||
component: () =>
|
component: () => import("../views/ContactAmountsView.vue"),
|
||||||
import(
|
|
||||||
/* webpackChunkName: "contact-amounts" */ "../views/ContactAmountsView.vue"
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/contact-gives",
|
path: "/contact-gives",
|
||||||
name: "contact-gives",
|
name: "contact-gives",
|
||||||
component: () =>
|
component: () => import("../views/ContactGiftingView.vue"),
|
||||||
import(
|
|
||||||
/* webpackChunkName: "contact-gives" */ "../views/ContactGiftingView.vue"
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/contact-qr",
|
path: "/contact-qr",
|
||||||
name: "contact-qr",
|
name: "contact-qr",
|
||||||
component: () =>
|
component: () => import("../views/ContactQRScanShowView.vue"),
|
||||||
import(
|
|
||||||
/* webpackChunkName: "contact-qr" */ "../views/ContactQRScanShowView.vue"
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/contacts",
|
path: "/contacts",
|
||||||
name: "contacts",
|
name: "contacts",
|
||||||
component: () =>
|
component: () => import("../views/ContactsView.vue"),
|
||||||
import(/* webpackChunkName: "contacts" */ "../views/ContactsView.vue"),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/discover",
|
path: "/discover",
|
||||||
name: "discover",
|
name: "discover",
|
||||||
component: () =>
|
component: () => import("../views/DiscoverView.vue"),
|
||||||
import(/* webpackChunkName: "discover" */ "../views/DiscoverView.vue"),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/gifted-details",
|
path: "/gifted-details",
|
||||||
name: "gifted-details",
|
name: "gifted-details",
|
||||||
component: () =>
|
component: () => import("../views/GiftedDetails.vue"),
|
||||||
import(
|
|
||||||
/* webpackChunkName: "gifted-details" */ "../views/GiftedDetails.vue"
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/help",
|
path: "/help",
|
||||||
name: "help",
|
name: "help",
|
||||||
component: () =>
|
component: () => import("../views/HelpView.vue"),
|
||||||
import(/* webpackChunkName: "help" */ "../views/HelpView.vue"),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/help-notifications",
|
path: "/help-notifications",
|
||||||
name: "help-notifications",
|
name: "help-notifications",
|
||||||
component: () =>
|
component: () => import("../views/HelpNotificationsView.vue"),
|
||||||
import(
|
|
||||||
/* webpackChunkName: "help-notifications" */ "../views/HelpNotificationsView.vue"
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/help-onboarding",
|
path: "/help-onboarding",
|
||||||
name: "help-onboarding",
|
name: "help-onboarding",
|
||||||
component: () =>
|
component: () => import("../views/HelpOnboardingView.vue"),
|
||||||
import(
|
|
||||||
/* webpackChunkName: "help-onboarding" */ "../views/HelpOnboardingView.vue"
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/",
|
path: "/",
|
||||||
name: "home",
|
name: "home",
|
||||||
component: () =>
|
component: () => import("../views/HomeView.vue"),
|
||||||
import(/* webpackChunkName: "home" */ "../views/HomeView.vue"),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/identity-switcher",
|
path: "/identity-switcher",
|
||||||
name: "identity-switcher",
|
name: "identity-switcher",
|
||||||
component: () =>
|
component: () => import("../views/IdentitySwitcherView.vue"),
|
||||||
import(
|
|
||||||
/* webpackChunkName: "identity-switcher" */ "../views/IdentitySwitcherView.vue"
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/import-account",
|
path: "/import-account",
|
||||||
name: "import-account",
|
name: "import-account",
|
||||||
component: () =>
|
component: () => import("../views/ImportAccountView.vue"),
|
||||||
import(
|
|
||||||
/* webpackChunkName: "import-account" */ "../views/ImportAccountView.vue"
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/import-derive",
|
path: "/import-derive",
|
||||||
name: "import-derive",
|
name: "import-derive",
|
||||||
component: () =>
|
component: () => import("../views/ImportDerivedAccountView.vue"),
|
||||||
import(
|
|
||||||
/* webpackChunkName: "import-derive" */ "../views/ImportDerivedAccountView.vue"
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/new-edit-account",
|
path: "/new-edit-account",
|
||||||
name: "new-edit-account",
|
name: "new-edit-account",
|
||||||
component: () =>
|
component: () => import("../views/NewEditAccountView.vue"),
|
||||||
import(
|
|
||||||
/* webpackChunkName: "new-edit-account" */ "../views/NewEditAccountView.vue"
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/new-edit-project",
|
path: "/new-edit-project",
|
||||||
name: "new-edit-project",
|
name: "new-edit-project",
|
||||||
component: () =>
|
component: () => import("../views/NewEditProjectView.vue"),
|
||||||
import(
|
|
||||||
/* webpackChunkName: "new-edit-project" */ "../views/NewEditProjectView.vue"
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/new-identifier",
|
path: "/new-identifier",
|
||||||
name: "new-identifier",
|
name: "new-identifier",
|
||||||
component: () =>
|
component: () => import("../views/NewIdentifierView.vue"),
|
||||||
import(
|
|
||||||
/* webpackChunkName: "new-identifier" */ "../views/NewIdentifierView.vue"
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/project/:id?",
|
path: "/project/:id?",
|
||||||
name: "project",
|
name: "project",
|
||||||
component: () =>
|
component: () => import("../views/ProjectViewView.vue"),
|
||||||
import(/* webpackChunkName: "project" */ "../views/ProjectViewView.vue"),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/projects",
|
path: "/projects",
|
||||||
name: "projects",
|
name: "projects",
|
||||||
component: () =>
|
component: () => import("../views/ProjectsView.vue"),
|
||||||
import(/* webpackChunkName: "projects" */ "../views/ProjectsView.vue"),
|
|
||||||
beforeEnter: enterOrStart,
|
beforeEnter: enterOrStart,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/quick-action-bvc",
|
path: "/quick-action-bvc",
|
||||||
name: "quick-action-bvc",
|
name: "quick-action-bvc",
|
||||||
component: () =>
|
component: () => import("../views/QuickActionBvcView.vue"),
|
||||||
import(
|
|
||||||
/* webpackChunkName: "quick-action-bvc" */ "../views/QuickActionBvcView.vue"
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/quick-action-bvc-begin",
|
path: "/quick-action-bvc-begin",
|
||||||
name: "quick-action-bvc-begin",
|
name: "quick-action-bvc-begin",
|
||||||
component: () =>
|
component: () => import("../views/QuickActionBvcBeginView.vue"),
|
||||||
import(
|
|
||||||
/* webpackChunkName: "quick-action-bvc-begin" */ "../views/QuickActionBvcBeginView.vue"
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/quick-action-bvc-end",
|
path: "/quick-action-bvc-end",
|
||||||
name: "quick-action-bvc-end",
|
name: "quick-action-bvc-end",
|
||||||
component: () =>
|
component: () => import("../views/QuickActionBvcEndView.vue"),
|
||||||
import(
|
|
||||||
/* webpackChunkName: "quick-action-bvc-end" */ "../views/QuickActionBvcEndView.vue"
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/scan-contact",
|
path: "/scan-contact",
|
||||||
name: "scan-contact",
|
name: "scan-contact",
|
||||||
component: () =>
|
component: () => import("../views/ContactScanView.vue"),
|
||||||
import(
|
|
||||||
/* webpackChunkName: "scan-contact" */ "../views/ContactScanView.vue"
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/search-area",
|
path: "/search-area",
|
||||||
name: "search-area",
|
name: "search-area",
|
||||||
component: () =>
|
component: () => import("../views/SearchAreaView.vue"),
|
||||||
import(
|
|
||||||
/* webpackChunkName: "search-area" */ "../views/SearchAreaView.vue"
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/seed-backup",
|
path: "/seed-backup",
|
||||||
name: "seed-backup",
|
name: "seed-backup",
|
||||||
component: () =>
|
component: () => import("../views/SeedBackupView.vue"),
|
||||||
import(
|
|
||||||
/* webpackChunkName: "seed-backup" */ "../views/SeedBackupView.vue"
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/start",
|
path: "/start",
|
||||||
name: "start",
|
name: "start",
|
||||||
component: () =>
|
component: () => import("../views/StartView.vue"),
|
||||||
import(/* webpackChunkName: "start" */ "../views/StartView.vue"),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/statistics",
|
path: "/statistics",
|
||||||
name: "statistics",
|
name: "statistics",
|
||||||
component: () =>
|
component: () => import("../views/StatisticsView.vue"),
|
||||||
import(
|
|
||||||
/* webpackChunkName: "statistics" */ "../views/StatisticsView.vue"
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/test",
|
path: "/test",
|
||||||
name: "test",
|
name: "test",
|
||||||
component: () =>
|
component: () => import("../views/TestView.vue"),
|
||||||
import(/* webpackChunkName: "test" */ "../views/TestView.vue"),
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
/** @type {*} */
|
/** @type {*} */
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(process.env.BASE_URL),
|
history: createWebHistory(import.meta.env.BASE_URL),
|
||||||
routes,
|
routes,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
1
src/util.d.ts
vendored
1
src/util.d.ts
vendored
@@ -1,4 +1,5 @@
|
|||||||
// from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/util.d.ts
|
// from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/util.d.ts
|
||||||
|
/* eslint-disable */
|
||||||
/**
|
/**
|
||||||
* The `node:util` module supports the needs of Node.js internal APIs. Many of the
|
* The `node:util` module supports the needs of Node.js internal APIs. Many of the
|
||||||
* utilities are useful for application and module developers as well. To access
|
* utilities are useful for application and module developers as well. To access
|
||||||
|
|||||||
@@ -63,12 +63,14 @@
|
|||||||
|
|
||||||
<!-- Identity Details -->
|
<!-- Identity Details -->
|
||||||
<div class="bg-slate-100 rounded-md overflow-hidden px-4 py-3 mb-4">
|
<div class="bg-slate-100 rounded-md overflow-hidden px-4 py-3 mb-4">
|
||||||
<h2 v-if="givenName" class="text-xl font-semibold mb-2">
|
<div v-if="givenName">
|
||||||
{{ givenName }}
|
<h2 class="text-xl font-semibold mb-2">
|
||||||
<router-link :to="{ name: 'new-edit-account' }">
|
{{ givenName }}
|
||||||
<fa icon="pen" class="text-xs text-blue-500 mb-1"></fa>
|
<router-link :to="{ name: 'new-edit-account' }">
|
||||||
</router-link>
|
<fa icon="pen" class="text-xs text-blue-500 mb-1"></fa>
|
||||||
</h2>
|
</router-link>
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
<span v-else>
|
<span v-else>
|
||||||
<router-link
|
<router-link
|
||||||
:to="{ name: 'new-edit-account' }"
|
:to="{ name: 'new-edit-account' }"
|
||||||
@@ -77,6 +79,61 @@
|
|||||||
Set Your Name
|
Set Your Name
|
||||||
</router-link>
|
</router-link>
|
||||||
</span>
|
</span>
|
||||||
|
<div class="flex justify-center mt-4">
|
||||||
|
<span v-if="profileImageUrl" class="flex justify-between">
|
||||||
|
<EntityIcon
|
||||||
|
:icon-size="96"
|
||||||
|
:profileImageUrl="profileImageUrl"
|
||||||
|
class="inline-block align-text-bottom border border-slate-300 rounded"
|
||||||
|
@click="showLargeIdenticonUrl = profileImageUrl"
|
||||||
|
/>
|
||||||
|
<fa
|
||||||
|
icon="trash-can"
|
||||||
|
@click="confirmDeleteImage"
|
||||||
|
class="text-red-500 fa-fw ml-8 mt-8 w-12 h-12"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
<span v-else>
|
||||||
|
<fa
|
||||||
|
icon="camera"
|
||||||
|
class="bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-2 rounded-md"
|
||||||
|
@click="openPhotoDialog"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
<GiftedPhotoDialog ref="photoDialog" />
|
||||||
|
</div>
|
||||||
|
<div class="mt-4">
|
||||||
|
<div class="flex justify-center">
|
||||||
|
... and those without your image see this:
|
||||||
|
</div>
|
||||||
|
<div class="flex justify-center">
|
||||||
|
<EntityIcon
|
||||||
|
:entityId="activeDid"
|
||||||
|
:iconSize="64"
|
||||||
|
class="inline-block align-middle border border-slate-300 rounded-md mr-1"
|
||||||
|
@click="showLargeIdenticonId = activeDid"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="showLargeIdenticonId || showLargeIdenticonUrl"
|
||||||
|
class="fixed z-[100] top-0 inset-x-0 w-full"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="absolute inset-0 h-screen flex flex-col items-center justify-center bg-slate-900/50"
|
||||||
|
>
|
||||||
|
<EntityIcon
|
||||||
|
:entityId="showLargeIdenticonId"
|
||||||
|
:iconSize="512"
|
||||||
|
:profileImageUrl="showLargeIdenticonUrl"
|
||||||
|
class="flex w-11/12 max-w-sm mx-auto mb-3 overflow-hidden bg-white rounded-lg shadow-lg"
|
||||||
|
@click="
|
||||||
|
showLargeIdenticonId = undefined;
|
||||||
|
showLargeIdenticonUrl = undefined;
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="text-slate-500 text-sm font-bold">ID</div>
|
<div class="text-slate-500 text-sm font-bold">ID</div>
|
||||||
<div class="text-sm text-slate-500 flex justify-start items-center mb-1">
|
<div class="text-sm text-slate-500 flex justify-start items-center mb-1">
|
||||||
@@ -112,6 +169,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="bg-slate-100 rounded-md overflow-hidden px-4 py-4 mt-8 mb-8">
|
<div class="bg-slate-100 rounded-md overflow-hidden px-4 py-4 mt-8 mb-8">
|
||||||
|
<!-- label -->
|
||||||
|
<div class="mb-2 font-bold">Notifications</div>
|
||||||
<div
|
<div
|
||||||
v-if="!notificationMaybeChanged"
|
v-if="!notificationMaybeChanged"
|
||||||
class="flex items-center justify-between cursor-pointer"
|
class="flex items-center justify-between cursor-pointer"
|
||||||
@@ -140,16 +199,29 @@
|
|||||||
Notification status may have changed. Refresh this page to see the
|
Notification status may have changed. Refresh this page to see the
|
||||||
latest setting.
|
latest setting.
|
||||||
</div>
|
</div>
|
||||||
<router-link class="px-4 text-sm text-blue-500" to="/help-notifications">
|
<router-link class="pl-4 text-sm text-blue-500" to="/help-notifications">
|
||||||
Troubleshoot your notification setup.
|
Troubleshoot your notification setup.
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="bg-slate-100 rounded-md overflow-hidden px-4 py-4 mt-8 mb-8">
|
||||||
|
<!-- label -->
|
||||||
|
<div class="mb-2 font-bold">Location</div>
|
||||||
|
<router-link
|
||||||
|
:to="{ name: 'search-area' }"
|
||||||
|
v-if="activeDid"
|
||||||
|
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md mb-2 mt-6"
|
||||||
|
>
|
||||||
|
Set Search Area…
|
||||||
|
<!-- If already set, change button label to "Change Search Area" -->
|
||||||
|
</router-link>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-if="activeDid"
|
v-if="activeDid"
|
||||||
class="bg-slate-100 rounded-md overflow-hidden px-4 py-4 mt-8 mb-8"
|
class="bg-slate-100 rounded-md overflow-hidden px-4 py-4 mt-8 mb-8"
|
||||||
>
|
>
|
||||||
<div class="mb-2">Usage Limits</div>
|
<div class="mb-2 font-bold">Usage Limits</div>
|
||||||
<!-- show spinner if loading limits -->
|
<!-- show spinner if loading limits -->
|
||||||
<div v-if="loadingLimits" class="text-center">
|
<div v-if="loadingLimits" class="text-center">
|
||||||
Checking… <fa icon="spinner" class="fa-spin"></fa>
|
Checking… <fa icon="spinner" class="fa-spin"></fa>
|
||||||
@@ -200,7 +272,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="bg-slate-100 rounded-md overflow-hidden px-4 py-4 mt-8 mb-8">
|
<div class="bg-slate-100 rounded-md overflow-hidden px-4 py-4 mt-8 mb-8">
|
||||||
<div>Data Export</div>
|
<div class="mb-2 font-bold">Data Export</div>
|
||||||
<router-link
|
<router-link
|
||||||
:to="{ name: 'seed-backup' }"
|
:to="{ name: 'seed-backup' }"
|
||||||
v-if="activeDid"
|
v-if="activeDid"
|
||||||
@@ -211,7 +283,7 @@
|
|||||||
|
|
||||||
<button
|
<button
|
||||||
v-bind:class="computedStartDownloadLinkClassNames()"
|
v-bind:class="computedStartDownloadLinkClassNames()"
|
||||||
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md mb-6"
|
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
||||||
@click="exportDatabase()"
|
@click="exportDatabase()"
|
||||||
>
|
>
|
||||||
Download Settings & Contacts
|
Download Settings & Contacts
|
||||||
@@ -221,7 +293,7 @@
|
|||||||
<a
|
<a
|
||||||
ref="downloadLink"
|
ref="downloadLink"
|
||||||
v-bind:class="computedDownloadLinkClassNames()"
|
v-bind:class="computedDownloadLinkClassNames()"
|
||||||
class="block w-full text-center text-md uppercase bg-gradient-to-b from-green-500 to-green-800 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
class="block w-full text-center text-md uppercase bg-gradient-to-b from-green-500 to-green-800 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md mb-6"
|
||||||
>
|
>
|
||||||
If no download happened yet, click again here to download now.
|
If no download happened yet, click again here to download now.
|
||||||
</a>
|
</a>
|
||||||
@@ -503,7 +575,7 @@
|
|||||||
<button>
|
<button>
|
||||||
<router-link
|
<router-link
|
||||||
:to="{ name: 'statistics' }"
|
:to="{ name: 'statistics' }"
|
||||||
class="block w-fit text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md mb-2"
|
class="block w-fit text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-4 py-2 rounded-md mb-2"
|
||||||
>
|
>
|
||||||
See Global Animated History of Giving
|
See Global Animated History of Giving
|
||||||
</router-link>
|
</router-link>
|
||||||
@@ -522,6 +594,7 @@ import { ref } from "vue";
|
|||||||
import { Component, Vue } from "vue-facing-decorator";
|
import { Component, Vue } from "vue-facing-decorator";
|
||||||
import { useClipboard } from "@vueuse/core";
|
import { useClipboard } from "@vueuse/core";
|
||||||
|
|
||||||
|
import GiftedPhotoDialog from "@/components/GiftedPhotoDialog.vue";
|
||||||
import QuickNav from "@/components/QuickNav.vue";
|
import QuickNav from "@/components/QuickNav.vue";
|
||||||
import TopMessage from "@/components/TopMessage.vue";
|
import TopMessage from "@/components/TopMessage.vue";
|
||||||
import {
|
import {
|
||||||
@@ -539,9 +612,9 @@ import {
|
|||||||
EndorserRateLimits,
|
EndorserRateLimits,
|
||||||
ImageRateLimits,
|
ImageRateLimits,
|
||||||
} from "@/libs/endorserServer";
|
} from "@/libs/endorserServer";
|
||||||
|
import { Buffer } from "buffer/";
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
import EntityIcon from "@/components/EntityIcon.vue";
|
||||||
const Buffer = require("buffer/").Buffer;
|
import {Contact} from "@/db/tables/contacts";
|
||||||
|
|
||||||
interface IAccount {
|
interface IAccount {
|
||||||
did: string;
|
did: string;
|
||||||
@@ -553,7 +626,7 @@ interface IAccount {
|
|||||||
const inputFileNameRef = ref<Blob>();
|
const inputFileNameRef = ref<Blob>();
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: { QuickNav, TopMessage },
|
components: {EntityIcon, GiftedPhotoDialog, QuickNav, TopMessage },
|
||||||
})
|
})
|
||||||
export default class AccountViewView extends Vue {
|
export default class AccountViewView extends Vue {
|
||||||
$notify!: (notification: NotificationIface, timeout?: number) => void;
|
$notify!: (notification: NotificationIface, timeout?: number) => void;
|
||||||
@@ -573,10 +646,14 @@ export default class AccountViewView extends Vue {
|
|||||||
isRegistered = false;
|
isRegistered = false;
|
||||||
isSubscribed = false;
|
isSubscribed = false;
|
||||||
notificationMaybeChanged = false;
|
notificationMaybeChanged = false;
|
||||||
|
profileImageUrl?: string;
|
||||||
publicHex = "";
|
publicHex = "";
|
||||||
publicBase64 = "";
|
publicBase64 = "";
|
||||||
|
showLargeIdenticonId?: string;
|
||||||
|
showLargeIdenticonUrl?: string;
|
||||||
webPushServer = "";
|
webPushServer = "";
|
||||||
webPushServerInput = "";
|
webPushServerInput = "";
|
||||||
|
|
||||||
limitsMessage = "";
|
limitsMessage = "";
|
||||||
loadingLimits = false;
|
loadingLimits = false;
|
||||||
showContactGives = false;
|
showContactGives = false;
|
||||||
@@ -644,6 +721,7 @@ export default class AccountViewView extends Vue {
|
|||||||
(settings?.firstName || "") +
|
(settings?.firstName || "") +
|
||||||
(settings?.lastName ? ` ${settings.lastName}` : ""); // pre v 0.1.3
|
(settings?.lastName ? ` ${settings.lastName}` : ""); // pre v 0.1.3
|
||||||
this.isRegistered = !!settings?.isRegistered;
|
this.isRegistered = !!settings?.isRegistered;
|
||||||
|
this.profileImageUrl = settings?.profileImageUrl as string;
|
||||||
this.showContactGives = !!settings?.showContactGivesInline;
|
this.showContactGives = !!settings?.showContactGivesInline;
|
||||||
this.showShortcutBvc = !!settings?.showShortcutBvc;
|
this.showShortcutBvc = !!settings?.showShortcutBvc;
|
||||||
this.warnIfProdServer = !!settings?.warnIfProdServer;
|
this.warnIfProdServer = !!settings?.warnIfProdServer;
|
||||||
@@ -909,11 +987,11 @@ export default class AccountViewView extends Vue {
|
|||||||
// Trigger the download
|
// Trigger the download
|
||||||
this.downloadDatabaseBackup(this.downloadUrl);
|
this.downloadDatabaseBackup(this.downloadUrl);
|
||||||
|
|
||||||
// Revoke the temporary URL -- not yet because of DuckDuckGo download failure
|
|
||||||
//URL.revokeObjectURL(this.downloadUrl);
|
|
||||||
|
|
||||||
// Notify the user that the download has started
|
// Notify the user that the download has started
|
||||||
this.notifyDownloadStarted();
|
this.notifyDownloadStarted();
|
||||||
|
|
||||||
|
// Revoke the temporary URL -- after a pause to avoid DuckDuckGo download failure
|
||||||
|
setTimeout(() => URL.revokeObjectURL(this.downloadUrl), 1000);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.handleExportError(error);
|
this.handleExportError(error);
|
||||||
}
|
}
|
||||||
@@ -952,13 +1030,13 @@ export default class AccountViewView extends Vue {
|
|||||||
|
|
||||||
public computedStartDownloadLinkClassNames() {
|
public computedStartDownloadLinkClassNames() {
|
||||||
return {
|
return {
|
||||||
invisible: this.downloadUrl,
|
hidden: this.downloadUrl,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public computedDownloadLinkClassNames() {
|
public computedDownloadLinkClassNames() {
|
||||||
return {
|
return {
|
||||||
invisible: !this.downloadUrl,
|
hidden: !this.downloadUrl,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1146,9 +1224,9 @@ export default class AccountViewView extends Vue {
|
|||||||
this.limitsMessage =
|
this.limitsMessage =
|
||||||
(data?.error?.message as string) || "Bad server response.";
|
(data?.error?.message as string) || "Bad server response.";
|
||||||
console.error(
|
console.error(
|
||||||
"Got bad response retrieving limits, which usually means user isn't registered:",
|
"Got bad response retrieving limits, which usually means user isn't registered.",
|
||||||
error,
|
|
||||||
);
|
);
|
||||||
|
//console.error(error);
|
||||||
} else {
|
} else {
|
||||||
this.limitsMessage = "Got an error retrieving limits.";
|
this.limitsMessage = "Got an error retrieving limits.";
|
||||||
console.error("Got some error retrieving limits:", error);
|
console.error("Got some error retrieving limits:", error);
|
||||||
@@ -1247,5 +1325,95 @@ export default class AccountViewView extends Vue {
|
|||||||
-1,
|
-1,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
openPhotoDialog() {
|
||||||
|
(this.$refs.photoDialog as GiftedPhotoDialog).open(
|
||||||
|
async (imgUrl) => {
|
||||||
|
await db.open();
|
||||||
|
db.settings.update(MASTER_SETTINGS_KEY, {
|
||||||
|
profileImageUrl: imgUrl,
|
||||||
|
});
|
||||||
|
this.profileImageUrl = imgUrl;
|
||||||
|
//console.log("Got image URL:", imgUrl);
|
||||||
|
},
|
||||||
|
true,
|
||||||
|
"profile",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
confirmDeleteImage() {
|
||||||
|
this.$notify(
|
||||||
|
{
|
||||||
|
group: "modal",
|
||||||
|
type: "confirm",
|
||||||
|
title: "Are you sure you want to delete your profile picture?",
|
||||||
|
text: "",
|
||||||
|
onYes: this.deleteImage,
|
||||||
|
},
|
||||||
|
-1,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
async deleteImage() {
|
||||||
|
if (!this.profileImageUrl) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const identity = await this.getIdentity(this.activeDid);
|
||||||
|
if (!identity) {
|
||||||
|
throw Error("No identity found.");
|
||||||
|
}
|
||||||
|
const token = await accessToken(identity);
|
||||||
|
const response = await this.axios.delete(
|
||||||
|
DEFAULT_IMAGE_API_SERVER +
|
||||||
|
"/image/" +
|
||||||
|
encodeURIComponent(this.profileImageUrl),
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${token}`,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
|
if (response.status === 204) {
|
||||||
|
// don't bother with a notification
|
||||||
|
// (either they'll simply continue or they're canceling and going back)
|
||||||
|
} else {
|
||||||
|
console.error("Non-success deleting image:", response);
|
||||||
|
this.$notify(
|
||||||
|
{
|
||||||
|
group: "alert",
|
||||||
|
type: "danger",
|
||||||
|
title: "Error",
|
||||||
|
text: "There was a problem deleting the image.",
|
||||||
|
},
|
||||||
|
5000,
|
||||||
|
);
|
||||||
|
// keep the imageUrl in localStorage so the user can try again if they want
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.profileImageUrl = undefined;
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error deleting image:", error);
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
if ((error as any).response.status === 404) {
|
||||||
|
console.log("The image was already deleted:", error);
|
||||||
|
|
||||||
|
this.profileImageUrl = undefined;
|
||||||
|
|
||||||
|
// it already doesn't exist so we won't say anything to the user
|
||||||
|
} else {
|
||||||
|
this.$notify(
|
||||||
|
{
|
||||||
|
group: "alert",
|
||||||
|
type: "danger",
|
||||||
|
title: "Error",
|
||||||
|
text: "There was an error deleting the image.",
|
||||||
|
},
|
||||||
|
5000,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -415,12 +415,11 @@ import { accessToken } from "@/libs/crypto";
|
|||||||
import * as serverUtil from "@/libs/endorserServer";
|
import * as serverUtil from "@/libs/endorserServer";
|
||||||
import * as libsUtil from "@/libs/util";
|
import * as libsUtil from "@/libs/util";
|
||||||
import QuickNav from "@/components/QuickNav.vue";
|
import QuickNav from "@/components/QuickNav.vue";
|
||||||
import EntityIcon from "@/components/EntityIcon.vue";
|
|
||||||
import { Account } from "@/db/tables/accounts";
|
import { Account } from "@/db/tables/accounts";
|
||||||
import { GiverInputInfo } from "@/libs/endorserServer";
|
import { GiverInputInfo } from "@/libs/endorserServer";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: { EntityIcon, GiftedDialog, OfferDialog, QuickNav },
|
components: { GiftedDialog, OfferDialog, QuickNav },
|
||||||
})
|
})
|
||||||
export default class ClaimView extends Vue {
|
export default class ClaimView extends Vue {
|
||||||
$notify!: (notification: NotificationIface, timeout?: number) => void;
|
$notify!: (notification: NotificationIface, timeout?: number) => void;
|
||||||
|
|||||||
@@ -30,17 +30,19 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mt-8">
|
<div class="mt-8">
|
||||||
<input
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-2">
|
||||||
type="submit"
|
<input
|
||||||
class="block w-full text-center text-lg font-bold uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-3 rounded-md mb-2"
|
type="submit"
|
||||||
value="Add Contact"
|
class="block w-full text-center text-lg font-bold uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-3 rounded-md"
|
||||||
/>
|
value="Add Contact"
|
||||||
<button
|
/>
|
||||||
type="button"
|
<button
|
||||||
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
type="button"
|
||||||
>
|
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
||||||
Cancel
|
>
|
||||||
</button>
|
Cancel
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ import { MASTER_SETTINGS_KEY } from "@/db/tables/settings";
|
|||||||
import { accessToken, SimpleSigner } from "@/libs/crypto";
|
import { accessToken, SimpleSigner } from "@/libs/crypto";
|
||||||
import {
|
import {
|
||||||
AgreeVerifiableCredential,
|
AgreeVerifiableCredential,
|
||||||
GiveServerRecord,
|
GiveSummaryRecord,
|
||||||
GiveVerifiableCredential,
|
GiveVerifiableCredential,
|
||||||
SCHEMA_ORG_CONTEXT,
|
SCHEMA_ORG_CONTEXT,
|
||||||
} from "@/libs/endorserServer";
|
} from "@/libs/endorserServer";
|
||||||
@@ -131,7 +131,7 @@ export default class ContactAmountssView extends Vue {
|
|||||||
activeDid = "";
|
activeDid = "";
|
||||||
apiServer = "";
|
apiServer = "";
|
||||||
contact: Contact | null = null;
|
contact: Contact | null = null;
|
||||||
giveRecords: Array<GiveServerRecord> = [];
|
giveRecords: Array<GiveSummaryRecord> = [];
|
||||||
numAccounts = 0;
|
numAccounts = 0;
|
||||||
|
|
||||||
async beforeCreate() {
|
async beforeCreate() {
|
||||||
@@ -197,7 +197,7 @@ export default class ContactAmountssView extends Vue {
|
|||||||
async loadGives(activeDid: string, contact: Contact) {
|
async loadGives(activeDid: string, contact: Contact) {
|
||||||
try {
|
try {
|
||||||
const identity = await this.getIdentity(this.activeDid);
|
const identity = await this.getIdentity(this.activeDid);
|
||||||
let result: Array<GiveServerRecord> = [];
|
let result: Array<GiveSummaryRecord> = [];
|
||||||
const url =
|
const url =
|
||||||
this.apiServer +
|
this.apiServer +
|
||||||
"/api/v2/report/gives?agentDid=" +
|
"/api/v2/report/gives?agentDid=" +
|
||||||
@@ -252,7 +252,7 @@ export default class ContactAmountssView extends Vue {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const sortedResult: Array<GiveServerRecord> = R.sort(
|
const sortedResult: Array<GiveSummaryRecord> = R.sort(
|
||||||
(a, b) =>
|
(a, b) =>
|
||||||
new Date(b.issuedAt).getTime() - new Date(a.issuedAt).getTime(),
|
new Date(b.issuedAt).getTime() - new Date(a.issuedAt).getTime(),
|
||||||
result,
|
result,
|
||||||
@@ -271,7 +271,7 @@ export default class ContactAmountssView extends Vue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async confirm(record: GiveServerRecord) {
|
async confirm(record: GiveSummaryRecord) {
|
||||||
// Make claim
|
// Make claim
|
||||||
// I use clone here because otherwise it gets a Proxy object.
|
// I use clone here because otherwise it gets a Proxy object.
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
<h2 class="text-base flex gap-4 items-center">
|
<h2 class="text-base flex gap-4 items-center">
|
||||||
<span class="grow font-semibold">
|
<span class="grow font-semibold">
|
||||||
<EntityIcon
|
<EntityIcon
|
||||||
:entityId="contact.did"
|
:contact="contact"
|
||||||
:iconSize="32"
|
:iconSize="32"
|
||||||
class="inline-block align-middle border border-slate-300 rounded-md mr-1"
|
class="inline-block align-middle border border-slate-300 rounded-md mr-1"
|
||||||
/>
|
/>
|
||||||
@@ -99,12 +99,10 @@ export default class ContactGiftingView extends Vue {
|
|||||||
allContacts: Array<Contact> = [];
|
allContacts: Array<Contact> = [];
|
||||||
apiServer = "";
|
apiServer = "";
|
||||||
accounts: typeof AccountsSchema;
|
accounts: typeof AccountsSchema;
|
||||||
numAccounts = 0;
|
|
||||||
projectId = localStorage.getItem("projectId") || "";
|
projectId = localStorage.getItem("projectId") || "";
|
||||||
|
|
||||||
async beforeCreate() {
|
async beforeCreate() {
|
||||||
accountsDB.open();
|
accountsDB.open();
|
||||||
this.numAccounts = await accountsDB.accounts.count();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async created() {
|
async created() {
|
||||||
@@ -113,7 +111,13 @@ export default class ContactGiftingView extends Vue {
|
|||||||
const settings = (await db.settings.get(MASTER_SETTINGS_KEY)) as Settings;
|
const settings = (await db.settings.get(MASTER_SETTINGS_KEY)) as Settings;
|
||||||
this.apiServer = settings?.apiServer || "";
|
this.apiServer = settings?.apiServer || "";
|
||||||
this.activeDid = settings?.activeDid || "";
|
this.activeDid = settings?.activeDid || "";
|
||||||
this.allContacts = await db.contacts.orderBy("name").toArray();
|
|
||||||
|
// .orderBy("name") wouldn't retrieve any entries with a blank name
|
||||||
|
// .toCollection.sortBy("name") didn't sort in an order I understood
|
||||||
|
const baseContacts = await db.contacts.toArray();
|
||||||
|
this.allContacts = baseContacts.sort((a, b) =>
|
||||||
|
(a.name || "").localeCompare(b.name || ""),
|
||||||
|
);
|
||||||
|
|
||||||
localStorage.removeItem("projectId");
|
localStorage.removeItem("projectId");
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,8 @@
|
|||||||
:dotsOptions="{ type: 'square' }"
|
:dotsOptions="{ type: 'square' }"
|
||||||
class="flex justify-center"
|
class="flex justify-center"
|
||||||
/>
|
/>
|
||||||
<span> Click QR to copy your contact URL to your clipboard. </span>
|
<span> Click that QR to copy your contact URL to your clipboard. </span>
|
||||||
|
<div>Not scanning? Show it in pieces.</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-center" v-else>
|
<div class="text-center" v-else>
|
||||||
You have no identitifiers yet, so
|
You have no identitifiers yet, so
|
||||||
@@ -81,16 +82,14 @@ import { useClipboard } from "@vueuse/core";
|
|||||||
import { NotificationIface } from "@/constants/app";
|
import { NotificationIface } from "@/constants/app";
|
||||||
import { accountsDB, db } from "@/db/index";
|
import { accountsDB, db } from "@/db/index";
|
||||||
import { MASTER_SETTINGS_KEY } from "@/db/tables/settings";
|
import { MASTER_SETTINGS_KEY } from "@/db/tables/settings";
|
||||||
import { deriveAddress, nextDerivationPath, SimpleSigner } from "@/libs/crypto";
|
import {deriveAddress, getContactPayloadFromJwtUrl, nextDerivationPath, SimpleSigner} from "@/libs/crypto";
|
||||||
import QuickNav from "@/components/QuickNav.vue";
|
import QuickNav from "@/components/QuickNav.vue";
|
||||||
import { Account } from "@/db/tables/accounts";
|
import { Account } from "@/db/tables/accounts";
|
||||||
import {
|
import {
|
||||||
CONTACT_URL_PREFIX,
|
CONTACT_URL_PREFIX,
|
||||||
ENDORSER_JWT_URL_LOCATION,
|
ENDORSER_JWT_URL_LOCATION,
|
||||||
} from "@/libs/endorserServer";
|
} from "@/libs/endorserServer";
|
||||||
|
import { Buffer } from "buffer/";
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
||||||
const Buffer = require("buffer/").Buffer;
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: {
|
components: {
|
||||||
@@ -155,6 +154,7 @@ export default class ContactQRScanShow extends Vue {
|
|||||||
(settings?.lastName ? ` ${settings.lastName}` : ""), // deprecated, pre v 0.1.3
|
(settings?.lastName ? ` ${settings.lastName}` : ""), // deprecated, pre v 0.1.3
|
||||||
publicEncKey,
|
publicEncKey,
|
||||||
nextPublicEncKeyHash: nextPublicEncKeyHashBase64,
|
nextPublicEncKeyHash: nextPublicEncKeyHashBase64,
|
||||||
|
profileImageUrl: settings?.profileImageUrl,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -179,9 +179,24 @@ export default class ContactQRScanShow extends Vue {
|
|||||||
// Unfortunately, there are not typescript definitions for the qrcode-stream component yet.
|
// Unfortunately, there are not typescript definitions for the qrcode-stream component yet.
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
onScanDetect(content: any) {
|
onScanDetect(content: any) {
|
||||||
if (content[0]?.rawValue) {
|
const url = content[0]?.rawValue;
|
||||||
localStorage.setItem("contactEndorserUrl", content[0].rawValue);
|
if (url) {
|
||||||
this.$router.push({ name: "contacts" });
|
try {
|
||||||
|
const fullData = getContactPayloadFromJwtUrl(url);
|
||||||
|
console.log("fullData", fullData);
|
||||||
|
localStorage.setItem("contactEndorserUrl", url);
|
||||||
|
this.$router.push({ name: "contacts" });
|
||||||
|
} catch (e) {
|
||||||
|
this.$notify(
|
||||||
|
{
|
||||||
|
group: "alert",
|
||||||
|
type: "warning",
|
||||||
|
title: "Invalid Contact QR Code",
|
||||||
|
text: "The QR code isn't in the right format.",
|
||||||
|
},
|
||||||
|
5000,
|
||||||
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$notify(
|
this.$notify(
|
||||||
{
|
{
|
||||||
@@ -190,7 +205,7 @@ export default class ContactQRScanShow extends Vue {
|
|||||||
title: "Invalid Contact QR Code",
|
title: "Invalid Contact QR Code",
|
||||||
text: "No QR code detected with contact information.",
|
text: "No QR code detected with contact information.",
|
||||||
},
|
},
|
||||||
-1,
|
5000,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -205,7 +220,7 @@ export default class ContactQRScanShow extends Vue {
|
|||||||
title: "Invalid Scan",
|
title: "Invalid Scan",
|
||||||
text: "The scan was invalid.",
|
text: "The scan was invalid.",
|
||||||
},
|
},
|
||||||
-1,
|
5000,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,17 +65,19 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<div class="mt-8">
|
<div class="mt-8">
|
||||||
<input
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-2">
|
||||||
type="submit"
|
<input
|
||||||
class="block w-full text-center text-lg font-bold uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-3 rounded-md mb-2"
|
type="submit"
|
||||||
value="Look Up Contact"
|
class="block w-full text-center text-lg font-bold uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-3 rounded-md"
|
||||||
/>
|
value="Look Up Contact"
|
||||||
<button
|
/>
|
||||||
type="button"
|
<button
|
||||||
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
type="button"
|
||||||
>
|
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
||||||
Cancel
|
>
|
||||||
</button>
|
Cancel
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -94,17 +94,17 @@
|
|||||||
<div class="grow overflow-hidden">
|
<div class="grow overflow-hidden">
|
||||||
<h2 class="text-base font-semibold">
|
<h2 class="text-base font-semibold">
|
||||||
<EntityIcon
|
<EntityIcon
|
||||||
:entityId="contact.did"
|
:contact="contact"
|
||||||
:iconSize="24"
|
:iconSize="24"
|
||||||
class="inline-block align-text-bottom border border-slate-300 rounded"
|
class="inline-block align-text-bottom border border-slate-300 rounded"
|
||||||
@click="showLargeIdenticon = contact.did"
|
@click="showLargeIdenticon = contact"
|
||||||
></EntityIcon>
|
/>
|
||||||
{{ contact.name || AppString.NO_CONTACT_NAME }}
|
{{ contact.name || AppString.NO_CONTACT_NAME }}
|
||||||
<button
|
<button
|
||||||
class="text-sm uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1 rounded-md"
|
class="text-sm uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1 rounded-md"
|
||||||
@click="
|
@click="
|
||||||
contactEdit = contact;
|
contactEdit = contact;
|
||||||
contactNewName = contact.name;
|
contactNewName = contact.name || '';
|
||||||
"
|
"
|
||||||
title="Edit"
|
title="Edit"
|
||||||
>
|
>
|
||||||
@@ -246,10 +246,10 @@
|
|||||||
class="absolute inset-0 h-screen flex flex-col items-center justify-center bg-slate-900/50"
|
class="absolute inset-0 h-screen flex flex-col items-center justify-center bg-slate-900/50"
|
||||||
>
|
>
|
||||||
<EntityIcon
|
<EntityIcon
|
||||||
:entityId="showLargeIdenticon"
|
:contact="showLargeIdenticon"
|
||||||
:iconSize="512"
|
:iconSize="512"
|
||||||
class="flex w-11/12 max-w-sm mx-auto mb-3 overflow-hidden bg-white rounded-lg shadow-lg"
|
class="flex w-11/12 max-w-sm mx-auto mb-3 overflow-hidden bg-white rounded-lg shadow-lg"
|
||||||
@click="showLargeIdenticon = ''"
|
@click="showLargeIdenticon = undefined"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -303,7 +303,7 @@ import {
|
|||||||
import {
|
import {
|
||||||
CONTACT_CSV_HEADER,
|
CONTACT_CSV_HEADER,
|
||||||
CONTACT_URL_PREFIX,
|
CONTACT_URL_PREFIX,
|
||||||
GiveServerRecord,
|
GiveSummaryRecord,
|
||||||
GiveVerifiableCredential,
|
GiveVerifiableCredential,
|
||||||
isDid,
|
isDid,
|
||||||
RegisterVerifiableCredential,
|
RegisterVerifiableCredential,
|
||||||
@@ -314,8 +314,7 @@ import QuickNav from "@/components/QuickNav.vue";
|
|||||||
import EntityIcon from "@/components/EntityIcon.vue";
|
import EntityIcon from "@/components/EntityIcon.vue";
|
||||||
import { Account } from "@/db/tables/accounts";
|
import { Account } from "@/db/tables/accounts";
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
import { Buffer } from "buffer/";
|
||||||
const Buffer = require("buffer/").Buffer;
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: { QuickNav, EntityIcon },
|
components: { QuickNav, EntityIcon },
|
||||||
@@ -349,7 +348,7 @@ export default class ContactsView extends Vue {
|
|||||||
showGiveNumbers = false;
|
showGiveNumbers = false;
|
||||||
showGiveTotals = true;
|
showGiveTotals = true;
|
||||||
showGiveConfirmed = true;
|
showGiveConfirmed = true;
|
||||||
showLargeIdenticon = "";
|
showLargeIdenticon?: Contact;
|
||||||
|
|
||||||
AppString = AppString;
|
AppString = AppString;
|
||||||
libsUtil = libsUtil;
|
libsUtil = libsUtil;
|
||||||
@@ -365,7 +364,13 @@ export default class ContactsView extends Vue {
|
|||||||
if (this.showGiveNumbers) {
|
if (this.showGiveNumbers) {
|
||||||
this.loadGives();
|
this.loadGives();
|
||||||
}
|
}
|
||||||
this.contacts = await db.contacts.orderBy("name").toArray();
|
|
||||||
|
// .orderBy("name") wouldn't retrieve any entries with a blank name
|
||||||
|
// .toCollection.sortBy("name") didn't sort in an order I understood
|
||||||
|
const baseContacts = await db.contacts.toArray();
|
||||||
|
this.contacts = baseContacts.sort((a, b) =>
|
||||||
|
(a.name || "").localeCompare(b.name || ""),
|
||||||
|
);
|
||||||
|
|
||||||
if (this.contactEndorserUrl) {
|
if (this.contactEndorserUrl) {
|
||||||
await this.addContactFromScan(this.contactEndorserUrl);
|
await this.addContactFromScan(this.contactEndorserUrl);
|
||||||
@@ -410,7 +415,7 @@ export default class ContactsView extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleResponse = (
|
const handleResponse = (
|
||||||
resp: { status: number; data: { data: GiveServerRecord[] } },
|
resp: { status: number; data: { data: GiveSummaryRecord[] } },
|
||||||
descriptions: Record<string, string>,
|
descriptions: Record<string, string>,
|
||||||
confirmed: Record<string, number>,
|
confirmed: Record<string, number>,
|
||||||
unconfirmed: Record<string, number>,
|
unconfirmed: Record<string, number>,
|
||||||
@@ -561,7 +566,13 @@ export default class ContactsView extends Vue {
|
|||||||
-1,
|
-1,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
this.contacts = await db.contacts.orderBy("name").toArray();
|
|
||||||
|
// .orderBy("name") wouldn't retrieve any entries with a blank name
|
||||||
|
// .toCollection.sortBy("name") didn't sort in an order I understood
|
||||||
|
const baseContacts = await db.contacts.toArray();
|
||||||
|
this.contacts = baseContacts.sort((a, b) =>
|
||||||
|
(a.name || "").localeCompare(b.name || ""),
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -661,6 +672,7 @@ export default class ContactsView extends Vue {
|
|||||||
did: payload.iss,
|
did: payload.iss,
|
||||||
name: payload.own.name,
|
name: payload.own.name,
|
||||||
nextPubKeyHashB64: payload.own.nextPublicEncKeyHash,
|
nextPubKeyHashB64: payload.own.nextPublicEncKeyHash,
|
||||||
|
profileImageUrl: payload.own.profileImageUrl,
|
||||||
publicKeyBase64: payload.own.publicEncKey,
|
publicKeyBase64: payload.own.publicEncKey,
|
||||||
} as Contact);
|
} as Contact);
|
||||||
}
|
}
|
||||||
@@ -865,7 +877,9 @@ export default class ContactsView extends Vue {
|
|||||||
let userMessage = "There was an error. See logs for more info.";
|
let userMessage = "There was an error. See logs for more info.";
|
||||||
const serverError = error as AxiosError;
|
const serverError = error as AxiosError;
|
||||||
if (serverError) {
|
if (serverError) {
|
||||||
if (serverError.message) {
|
if (serverError.response?.data?.error?.message) {
|
||||||
|
userMessage = serverError.response.data.error.message;
|
||||||
|
} else if (serverError.message) {
|
||||||
userMessage = serverError.message; // Info for the user
|
userMessage = serverError.message; // Info for the user
|
||||||
} else {
|
} else {
|
||||||
userMessage = JSON.stringify(serverError.toJSON());
|
userMessage = JSON.stringify(serverError.toJSON());
|
||||||
|
|||||||
@@ -131,7 +131,6 @@ import { Component, Vue } from "vue-facing-decorator";
|
|||||||
|
|
||||||
import QuickNav from "@/components/QuickNav.vue";
|
import QuickNav from "@/components/QuickNav.vue";
|
||||||
import InfiniteScroll from "@/components/InfiniteScroll.vue";
|
import InfiniteScroll from "@/components/InfiniteScroll.vue";
|
||||||
import EntityIcon from "@/components/EntityIcon.vue";
|
|
||||||
import ProjectIcon from "@/components/ProjectIcon.vue";
|
import ProjectIcon from "@/components/ProjectIcon.vue";
|
||||||
import TopMessage from "@/components/TopMessage.vue";
|
import TopMessage from "@/components/TopMessage.vue";
|
||||||
import { NotificationIface } from "@/constants/app";
|
import { NotificationIface } from "@/constants/app";
|
||||||
@@ -143,7 +142,6 @@ import { didInfo, PlanData } from "@/libs/endorserServer";
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: {
|
components: {
|
||||||
EntityIcon,
|
|
||||||
InfiniteScroll,
|
InfiniteScroll,
|
||||||
ProjectIcon,
|
ProjectIcon,
|
||||||
QuickNav,
|
QuickNav,
|
||||||
|
|||||||
@@ -98,18 +98,20 @@
|
|||||||
@click="explainData()"
|
@click="explainData()"
|
||||||
/>
|
/>
|
||||||
</p>
|
</p>
|
||||||
<button
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-2">
|
||||||
class="block w-full text-center text-lg font-bold uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-3 rounded-md mb-2"
|
<button
|
||||||
@click="confirm"
|
class="block w-full text-center text-lg font-bold uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-3 rounded-md"
|
||||||
>
|
@click="confirm"
|
||||||
Sign & Send
|
>
|
||||||
</button>
|
Sign & Send
|
||||||
<button
|
</button>
|
||||||
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
<button
|
||||||
@click="cancel"
|
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
||||||
>
|
@click="cancel"
|
||||||
Cancel
|
>
|
||||||
</button>
|
Cancel
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -285,6 +285,11 @@
|
|||||||
and you may have to close all your tabs. In addition, it may be running as an
|
and you may have to close all your tabs. In addition, it may be running as an
|
||||||
installed app, so look for any Time Safari app that may be running outside a browser.
|
installed app, so look for any Time Safari app that may be running outside a browser.
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
There may be a problem with your identity. Go to the Identity
|
||||||
|
<fa icon="circle-user" class="fa-fw" /> page, then "Advanced", and "Switch Identifier"
|
||||||
|
and you may see helpful info there. If it shows a problem, try adding your identifier again.
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
It can help to reregister the service worker:
|
It can help to reregister the service worker:
|
||||||
<ul>
|
<ul>
|
||||||
@@ -382,6 +387,6 @@ export default class Help extends Vue {
|
|||||||
$notify!: (notification: NotificationIface, timeout?: number) => void;
|
$notify!: (notification: NotificationIface, timeout?: number) => void;
|
||||||
|
|
||||||
package = Package;
|
package = Package;
|
||||||
commitHash = process.env.VUE_APP_GIT_HASH;
|
commitHash = import.meta.env.VITE_GIT_HASH;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -118,7 +118,9 @@
|
|||||||
<h2 class="text-xl font-bold">Record Something Given By:</h2>
|
<h2 class="text-xl font-bold">Record Something Given By:</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul class="grid grid-cols-4 gap-x-3 gap-y-5 text-center mb-5">
|
<ul
|
||||||
|
class="grid grid-cols-4 sm:grid-cols-5 md:grid-cols-6 gap-x-3 gap-y-5 text-center mb-5"
|
||||||
|
>
|
||||||
<li @click="openDialog()">
|
<li @click="openDialog()">
|
||||||
<img
|
<img
|
||||||
src="../assets/blank-square.svg"
|
src="../assets/blank-square.svg"
|
||||||
@@ -136,7 +138,7 @@
|
|||||||
@click="openDialog(contact)"
|
@click="openDialog(contact)"
|
||||||
>
|
>
|
||||||
<EntityIcon
|
<EntityIcon
|
||||||
:entityId="contact.did"
|
:contact="contact"
|
||||||
:iconSize="64"
|
:iconSize="64"
|
||||||
class="mx-auto border border-slate-300 rounded-md mb-1"
|
class="mx-auto border border-slate-300 rounded-md mb-1"
|
||||||
/>
|
/>
|
||||||
@@ -158,7 +160,7 @@
|
|||||||
</router-link>
|
</router-link>
|
||||||
<button
|
<button
|
||||||
@click="openGiftedPrompts()"
|
@click="openGiftedPrompts()"
|
||||||
class="block text-center text-md font-bold bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-3 rounded-md"
|
class="block text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-4 py-2 rounded-md"
|
||||||
>
|
>
|
||||||
Ideas...
|
Ideas...
|
||||||
</button>
|
</button>
|
||||||
@@ -172,10 +174,29 @@
|
|||||||
showGivenToUser="true"
|
showGivenToUser="true"
|
||||||
/>
|
/>
|
||||||
<GiftedPrompts ref="giftedPrompts" />
|
<GiftedPrompts ref="giftedPrompts" />
|
||||||
|
<FeedFilters ref="feedFilters" />
|
||||||
|
|
||||||
<!-- Results List -->
|
<!-- Results List -->
|
||||||
<div class="bg-slate-100 rounded-md overflow-hidden px-4 py-3 mb-4">
|
<div class="bg-slate-100 rounded-md overflow-hidden px-4 py-3 mb-4">
|
||||||
<h2 class="text-xl font-bold mb-4">Latest Activity</h2>
|
<div class="flex items-center mb-4">
|
||||||
|
<h2 class="text-xl font-bold">Latest Activity</h2>
|
||||||
|
<button @click="openFeedFilters()" class="block text-center ml-auto">
|
||||||
|
<span class="text-sm uppercase text-white">
|
||||||
|
<span
|
||||||
|
v-if="resultsAreFiltered()"
|
||||||
|
class="bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] px-3 py-1.5 rounded-md"
|
||||||
|
>
|
||||||
|
Filtered
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
v-else
|
||||||
|
class="bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] px-3 py-1.5 rounded-md"
|
||||||
|
>
|
||||||
|
Unfiltered
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<InfiniteScroll @reached-bottom="loadMoreGives">
|
<InfiniteScroll @reached-bottom="loadMoreGives">
|
||||||
<ul class="border-t border-slate-300">
|
<ul class="border-t border-slate-300">
|
||||||
<li
|
<li
|
||||||
@@ -191,20 +212,20 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="grid grid-cols-12">
|
<div class="grid grid-cols-12">
|
||||||
<span class="col-span-11 justify-self-start">
|
<span class="col-span-1 justify-self-start">
|
||||||
<span>
|
<span>
|
||||||
<fa
|
<fa
|
||||||
v-if="record.giver.known || record.receiver.known"
|
v-if="record.giver.known || record.receiver.known"
|
||||||
icon="circle-user"
|
icon="circle-user"
|
||||||
class="col-span-1 pt-1 pl-0 pr-3 text-slate-500"
|
class="pt-1 text-slate-500"
|
||||||
/>
|
|
||||||
<fa
|
|
||||||
v-else
|
|
||||||
icon="gift"
|
|
||||||
class="col-span-1 pt-1 pl-3 pr-0 text-slate-500"
|
|
||||||
/>
|
/>
|
||||||
|
<fa v-else icon="gift" class="pt-1 pl-3 text-slate-500" />
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<span class="col-span-10 justify-self-stretch">
|
||||||
|
<span class="pl-2">
|
||||||
|
{{ giveDescription(record) }}
|
||||||
</span>
|
</span>
|
||||||
{{ giveDescription(record) }}
|
|
||||||
<a @click="onClickLoadClaim(record.jwtId)">
|
<a @click="onClickLoadClaim(record.jwtId)">
|
||||||
<fa
|
<fa
|
||||||
icon="file-lines"
|
icon="file-lines"
|
||||||
@@ -212,16 +233,15 @@
|
|||||||
></fa>
|
></fa>
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
<span class="col-span-1 justify-self-end shrink">
|
<span class="col-span-1 justify-self-end">
|
||||||
<router-link
|
<router-link
|
||||||
v-if="record.fulfillsPlanHandleId"
|
v-if="record.fulfillsPlanHandleId"
|
||||||
:to="
|
:to="
|
||||||
'/project/' +
|
'/project/' +
|
||||||
encodeURIComponent(record.fulfillsPlanHandleId)
|
encodeURIComponent(record.fulfillsPlanHandleId)
|
||||||
"
|
"
|
||||||
class="justify-end"
|
|
||||||
>
|
>
|
||||||
<fa icon="hammer" class="ml-4 pl-2 text-blue-500"></fa>
|
<fa icon="hammer" class="text-blue-500"></fa>
|
||||||
</router-link>
|
</router-link>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -238,6 +258,11 @@
|
|||||||
<fa icon="spinner" class="fa-spin-pulse"></fa> Loading…
|
<fa icon="spinner" class="fa-spin-pulse"></fa> Loading…
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="!isFeedLoading && feedData.length === 0">
|
||||||
|
<p class="text-slate-500 text-center italic mt-4 mb-4">
|
||||||
|
No claims match your filters.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
@@ -250,6 +275,7 @@ import { Component, Vue } from "vue-facing-decorator";
|
|||||||
import EntityIcon from "@/components/EntityIcon.vue";
|
import EntityIcon from "@/components/EntityIcon.vue";
|
||||||
import GiftedDialog from "@/components/GiftedDialog.vue";
|
import GiftedDialog from "@/components/GiftedDialog.vue";
|
||||||
import GiftedPrompts from "@/components/GiftedPrompts.vue";
|
import GiftedPrompts from "@/components/GiftedPrompts.vue";
|
||||||
|
import FeedFilters from "@/components/FeedFilters.vue";
|
||||||
import InfiniteScroll from "@/components/InfiniteScroll.vue";
|
import InfiniteScroll from "@/components/InfiniteScroll.vue";
|
||||||
import QuickNav from "@/components/QuickNav.vue";
|
import QuickNav from "@/components/QuickNav.vue";
|
||||||
import TopMessage from "@/components/TopMessage.vue";
|
import TopMessage from "@/components/TopMessage.vue";
|
||||||
@@ -257,22 +283,30 @@ import { NotificationIface } from "@/constants/app";
|
|||||||
import { db, accountsDB } from "@/db/index";
|
import { db, accountsDB } from "@/db/index";
|
||||||
import { Account } from "@/db/tables/accounts";
|
import { Account } from "@/db/tables/accounts";
|
||||||
import { Contact } from "@/db/tables/contacts";
|
import { Contact } from "@/db/tables/contacts";
|
||||||
import { MASTER_SETTINGS_KEY, Settings } from "@/db/tables/settings";
|
import {
|
||||||
|
BoundingBox,
|
||||||
|
isAnyFeedFilterOn,
|
||||||
|
MASTER_SETTINGS_KEY,
|
||||||
|
Settings,
|
||||||
|
} from "@/db/tables/settings";
|
||||||
import { accessToken } from "@/libs/crypto";
|
import { accessToken } from "@/libs/crypto";
|
||||||
import {
|
import {
|
||||||
contactForDid,
|
contactForDid,
|
||||||
|
containsNonHiddenDid,
|
||||||
didInfoForContact,
|
didInfoForContact,
|
||||||
|
getPlanFromCache,
|
||||||
GiverInputInfo,
|
GiverInputInfo,
|
||||||
GiveServerRecord,
|
GiveSummaryRecord,
|
||||||
} from "@/libs/endorserServer";
|
} from "@/libs/endorserServer";
|
||||||
import { generateSaveAndActivateIdentity } from "@/libs/util";
|
import { generateSaveAndActivateIdentity } from "@/libs/util";
|
||||||
|
|
||||||
interface GiveRecordWithContactInfo extends GiveServerRecord {
|
interface GiveRecordWithContactInfo extends GiveSummaryRecord {
|
||||||
giver: {
|
giver: {
|
||||||
displayName: string;
|
displayName: string;
|
||||||
known: boolean;
|
known: boolean;
|
||||||
};
|
};
|
||||||
image: string;
|
image?: string;
|
||||||
|
recipientProjectName?: string;
|
||||||
receiver: {
|
receiver: {
|
||||||
displayName: string;
|
displayName: string;
|
||||||
known: boolean;
|
known: boolean;
|
||||||
@@ -283,6 +317,7 @@ interface GiveRecordWithContactInfo extends GiveServerRecord {
|
|||||||
components: {
|
components: {
|
||||||
GiftedDialog,
|
GiftedDialog,
|
||||||
GiftedPrompts,
|
GiftedPrompts,
|
||||||
|
FeedFilters,
|
||||||
QuickNav,
|
QuickNav,
|
||||||
EntityIcon,
|
EntityIcon,
|
||||||
InfiniteScroll,
|
InfiniteScroll,
|
||||||
@@ -299,9 +334,16 @@ export default class HomeView extends Vue {
|
|||||||
feedData: GiveRecordWithContactInfo[] = [];
|
feedData: GiveRecordWithContactInfo[] = [];
|
||||||
feedPreviousOldestId?: string;
|
feedPreviousOldestId?: string;
|
||||||
feedLastViewedClaimId?: string;
|
feedLastViewedClaimId?: string;
|
||||||
|
isAnyFeedFilterOn: boolean;
|
||||||
isCreatingIdentifier = false;
|
isCreatingIdentifier = false;
|
||||||
|
isFeedFilteredByVisible = false;
|
||||||
|
isFeedFilteredByNearby = false;
|
||||||
isFeedLoading = true;
|
isFeedLoading = true;
|
||||||
isRegistered = false;
|
isRegistered = false;
|
||||||
|
searchBoxes: Array<{
|
||||||
|
name: string;
|
||||||
|
bbox: BoundingBox;
|
||||||
|
}> = [];
|
||||||
showShortcutBvc = false;
|
showShortcutBvc = false;
|
||||||
userAgentInfo = new UAParser(); // see https://docs.uaparser.js.org/v2/api/ua-parser-js/get-os.html
|
userAgentInfo = new UAParser(); // see https://docs.uaparser.js.org/v2/api/ua-parser-js/get-os.html
|
||||||
|
|
||||||
@@ -324,7 +366,7 @@ export default class HomeView extends Vue {
|
|||||||
return headers;
|
return headers;
|
||||||
}
|
}
|
||||||
|
|
||||||
async created() {
|
async mounted() {
|
||||||
try {
|
try {
|
||||||
await accountsDB.open();
|
await accountsDB.open();
|
||||||
const allAccounts = await accountsDB.accounts.toArray();
|
const allAccounts = await accountsDB.accounts.toArray();
|
||||||
@@ -336,9 +378,14 @@ export default class HomeView extends Vue {
|
|||||||
this.activeDid = settings?.activeDid || "";
|
this.activeDid = settings?.activeDid || "";
|
||||||
this.allContacts = await db.contacts.toArray();
|
this.allContacts = await db.contacts.toArray();
|
||||||
this.feedLastViewedClaimId = settings?.lastViewedClaimId;
|
this.feedLastViewedClaimId = settings?.lastViewedClaimId;
|
||||||
|
this.isFeedFilteredByVisible = !!settings?.filterFeedByVisible;
|
||||||
|
this.isFeedFilteredByNearby = !!settings?.filterFeedByNearby;
|
||||||
this.isRegistered = !!settings?.isRegistered;
|
this.isRegistered = !!settings?.isRegistered;
|
||||||
|
this.searchBoxes = settings?.searchBoxes || [];
|
||||||
this.showShortcutBvc = !!settings?.showShortcutBvc;
|
this.showShortcutBvc = !!settings?.showShortcutBvc;
|
||||||
|
|
||||||
|
this.isAnyFeedFilterOn = isAnyFeedFilterOn(settings);
|
||||||
|
|
||||||
if (this.allMyDids.length === 0) {
|
if (this.allMyDids.length === 0) {
|
||||||
this.isCreatingIdentifier = true;
|
this.isCreatingIdentifier = true;
|
||||||
this.activeDid = await generateSaveAndActivateIdentity();
|
this.activeDid = await generateSaveAndActivateIdentity();
|
||||||
@@ -367,6 +414,10 @@ export default class HomeView extends Vue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resultsAreFiltered() {
|
||||||
|
return this.isFeedFilteredByVisible || this.isFeedFilteredByNearby;
|
||||||
|
}
|
||||||
|
|
||||||
notificationsSupported() {
|
notificationsSupported() {
|
||||||
return "Notification" in window;
|
return "Notification" in window;
|
||||||
}
|
}
|
||||||
@@ -376,27 +427,34 @@ export default class HomeView extends Vue {
|
|||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const identity = await this.getIdentity(this.activeDid);
|
||||||
if (this.activeDid) {
|
if (this.activeDid) {
|
||||||
await accountsDB.open();
|
if (identity) {
|
||||||
const allAccounts = await accountsDB.accounts.toArray();
|
headers["Authorization"] = "Bearer " + (await accessToken(identity));
|
||||||
const account = allAccounts.find(
|
} else {
|
||||||
(acc) => acc.did === this.activeDid,
|
|
||||||
) as Account;
|
|
||||||
const identity = JSON.parse(account?.identity || "null");
|
|
||||||
|
|
||||||
if (!identity) {
|
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"An ID is chosen but there are no keys for it so it cannot be used to talk with the service. Switch your ID.",
|
"An ID is chosen but there are no keys for it so it cannot be used to talk with the service. Switch your ID.",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
headers["Authorization"] = "Bearer " + (await accessToken(identity));
|
|
||||||
} else {
|
} else {
|
||||||
// it's OK without auth... we just won't get any identifiers
|
// it's OK without auth... we just won't get any identifiers
|
||||||
}
|
}
|
||||||
return headers;
|
return headers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// only called when a setting was changed
|
||||||
|
async reloadFeedOnChange() {
|
||||||
|
await db.open();
|
||||||
|
const settings = (await db.settings.get(MASTER_SETTINGS_KEY)) as Settings;
|
||||||
|
this.isFeedFilteredByVisible = !!settings?.filterFeedByVisible;
|
||||||
|
this.isFeedFilteredByNearby = !!settings?.filterFeedByNearby;
|
||||||
|
this.isAnyFeedFilterOn = isAnyFeedFilterOn(settings);
|
||||||
|
|
||||||
|
this.feedData = [];
|
||||||
|
this.feedPreviousOldestId = undefined;
|
||||||
|
this.updateAllFeed();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data loader used by infinite scroller
|
* Data loader used by infinite scroller
|
||||||
* @param payload is the flag from the InfiniteScroll indicating if it should load
|
* @param payload is the flag from the InfiniteScroll indicating if it should load
|
||||||
@@ -407,43 +465,85 @@ export default class HomeView extends Vue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
latLongInAnySearchBox(lat: number, long: number) {
|
||||||
|
for (const boxInfo of this.searchBoxes) {
|
||||||
|
if (
|
||||||
|
boxInfo.bbox.westLong <= long &&
|
||||||
|
long <= boxInfo.bbox.eastLong &&
|
||||||
|
boxInfo.bbox.minLat <= lat &&
|
||||||
|
lat <= boxInfo.bbox.maxLat
|
||||||
|
) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public async updateAllFeed() {
|
public async updateAllFeed() {
|
||||||
this.isFeedLoading = true;
|
this.isFeedLoading = true;
|
||||||
|
let endOfResults = true;
|
||||||
await this.retrieveGives(this.apiServer, this.feedPreviousOldestId)
|
await this.retrieveGives(this.apiServer, this.feedPreviousOldestId)
|
||||||
.then(async (results) => {
|
.then(async (results) => {
|
||||||
if (results.data.length > 0) {
|
if (results.data.length > 0) {
|
||||||
|
endOfResults = false;
|
||||||
// include the descriptions of the giver and receiver
|
// include the descriptions of the giver and receiver
|
||||||
const newFeedData: GiveRecordWithContactInfo = results.data.map(
|
const identity = await this.getIdentity(this.activeDid);
|
||||||
(record: GiveServerRecord) => {
|
for (const record: GiveSummaryRecord of results.data) {
|
||||||
// similar code is in endorser-mobile utility.ts
|
// similar code is in endorser-mobile utility.ts
|
||||||
// claim.claim happen for some claims wrapped in a Verifiable Credential
|
// claim.claim happen for some claims wrapped in a Verifiable Credential
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
const claim = (record.fullClaim as any).claim || record.fullClaim;
|
const claim = (record.fullClaim as any).claim || record.fullClaim;
|
||||||
// agent.did is for legacy data, before March 2023
|
// agent.did is for legacy data, before March 2023
|
||||||
const giverDid =
|
const giverDid =
|
||||||
claim.agent?.identifier || (claim.agent as any)?.did; // eslint-disable-line @typescript-eslint/no-explicit-any
|
claim.agent?.identifier || (claim.agent as any)?.did; // eslint-disable-line @typescript-eslint/no-explicit-any
|
||||||
// recipient.did is for legacy data, before March 2023
|
// recipient.did is for legacy data, before March 2023
|
||||||
const recipientDid =
|
const recipientDid =
|
||||||
claim.recipient?.identifier || (claim.recipient as any)?.did; // eslint-disable-line @typescript-eslint/no-explicit-any
|
claim.recipient?.identifier || (claim.recipient as any)?.did; // eslint-disable-line @typescript-eslint/no-explicit-any
|
||||||
return {
|
const plan = await getPlanFromCache(
|
||||||
...record,
|
record.fulfillsPlanHandleId,
|
||||||
giver: didInfoForContact(
|
identity,
|
||||||
giverDid,
|
this.axios,
|
||||||
this.activeDid,
|
this.apiServer,
|
||||||
contactForDid(giverDid, this.allContacts),
|
);
|
||||||
this.allMyDids,
|
|
||||||
),
|
// check if the record should be filtered out
|
||||||
image: claim.image,
|
let anyMatch = false;
|
||||||
receiver: didInfoForContact(
|
if (this.isFeedFilteredByVisible && containsNonHiddenDid(record)) {
|
||||||
recipientDid,
|
// has a visible DID so it's a keeper
|
||||||
this.activeDid,
|
anyMatch = true;
|
||||||
contactForDid(recipientDid, this.allContacts),
|
}
|
||||||
this.allMyDids,
|
if (!anyMatch && this.isFeedFilteredByNearby) {
|
||||||
),
|
// check if the associated project has a location inside user's search box
|
||||||
};
|
if (record.fulfillsPlanHandleId) {
|
||||||
},
|
if (plan?.locLat && plan?.locLon) {
|
||||||
);
|
if (this.latLongInAnySearchBox(plan.locLat, plan.locLon)) {
|
||||||
this.feedData = this.feedData.concat(newFeedData);
|
anyMatch = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.isAnyFeedFilterOn && !anyMatch) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const newRecord: GiveRecordWithContactInfo = {
|
||||||
|
...record,
|
||||||
|
giver: didInfoForContact(
|
||||||
|
giverDid,
|
||||||
|
this.activeDid,
|
||||||
|
contactForDid(giverDid, this.allContacts),
|
||||||
|
this.allMyDids,
|
||||||
|
),
|
||||||
|
image: claim.image,
|
||||||
|
recipientProjectName: plan?.name as string,
|
||||||
|
receiver: didInfoForContact(
|
||||||
|
recipientDid,
|
||||||
|
this.activeDid,
|
||||||
|
contactForDid(recipientDid, this.allContacts),
|
||||||
|
this.allMyDids,
|
||||||
|
),
|
||||||
|
};
|
||||||
|
this.feedData.push(newRecord);
|
||||||
|
}
|
||||||
this.feedPreviousOldestId =
|
this.feedPreviousOldestId =
|
||||||
results.data[results.data.length - 1].jwtId;
|
results.data[results.data.length - 1].jwtId;
|
||||||
// The following update is only done on the first load.
|
// The following update is only done on the first load.
|
||||||
@@ -470,6 +570,10 @@ export default class HomeView extends Vue {
|
|||||||
-1,
|
-1,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
if (this.feedData.length === 0 && !endOfResults) {
|
||||||
|
// repeat until there's at least some data
|
||||||
|
this.updateAllFeed();
|
||||||
|
}
|
||||||
this.isFeedLoading = false;
|
this.isFeedLoading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -536,12 +640,28 @@ export default class HomeView extends Vue {
|
|||||||
return `${giverInfo.displayName} gave to ${recipientInfo.displayName}: ${gaveAmount}`;
|
return `${giverInfo.displayName} gave to ${recipientInfo.displayName}: ${gaveAmount}`;
|
||||||
} else if (giverInfo.known) {
|
} else if (giverInfo.known) {
|
||||||
// giver is named but recipient is not
|
// giver is named but recipient is not
|
||||||
|
|
||||||
|
// show the project name if to one
|
||||||
|
if (giveRecord.recipientProjectName) {
|
||||||
|
// retrieve the project name
|
||||||
|
return `${giverInfo.displayName} gave: ${gaveAmount} (to the project ${giveRecord.recipientProjectName})`;
|
||||||
|
}
|
||||||
|
|
||||||
|
// it's not to a project
|
||||||
return `${giverInfo.displayName} gave: ${gaveAmount} (to ${recipientInfo.displayName})`;
|
return `${giverInfo.displayName} gave: ${gaveAmount} (to ${recipientInfo.displayName})`;
|
||||||
} else if (recipientInfo.known) {
|
} else if (recipientInfo.known) {
|
||||||
// recipient is named but giver is not
|
// recipient is named but giver is not
|
||||||
return `${recipientInfo.displayName} received: ${gaveAmount} (from ${giverInfo.displayName})`;
|
return `${recipientInfo.displayName} received: ${gaveAmount} (from ${giverInfo.displayName})`;
|
||||||
} else {
|
} else {
|
||||||
// neither giver nor recipient are named
|
// neither giver nor recipient are named
|
||||||
|
|
||||||
|
// show the project name if to one
|
||||||
|
if (giveRecord.recipientProjectName) {
|
||||||
|
// retrieve the project name
|
||||||
|
return `${gaveAmount} (to the project ${giveRecord.recipientProjectName})`;
|
||||||
|
}
|
||||||
|
|
||||||
|
// it's not to a project
|
||||||
let peopleInfo;
|
let peopleInfo;
|
||||||
if (giverInfo.displayName === recipientInfo.displayName) {
|
if (giverInfo.displayName === recipientInfo.displayName) {
|
||||||
peopleInfo = `between two who are ${giverInfo.displayName}`;
|
peopleInfo = `between two who are ${giverInfo.displayName}`;
|
||||||
@@ -574,5 +694,9 @@ export default class HomeView extends Vue {
|
|||||||
openGiftedPrompts() {
|
openGiftedPrompts() {
|
||||||
(this.$refs.giftedPrompts as GiftedPrompts).open();
|
(this.$refs.giftedPrompts as GiftedPrompts).open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
openFeedFilters() {
|
||||||
|
(this.$refs.feedFilters as FeedFilters).open(this.reloadFeedOnChange);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -56,19 +56,21 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mt-8">
|
<div class="mt-8">
|
||||||
<button
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-2">
|
||||||
@click="fromMnemonic()"
|
<button
|
||||||
class="block w-full text-center text-lg font-bold uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-3 rounded-md mb-2"
|
@click="fromMnemonic()"
|
||||||
>
|
class="block w-full text-center text-lg font-bold uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-3 rounded-md"
|
||||||
Import
|
>
|
||||||
</button>
|
Import
|
||||||
<button
|
</button>
|
||||||
@click="onCancelClick()"
|
<button
|
||||||
type="button"
|
@click="onCancelClick()"
|
||||||
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
type="button"
|
||||||
>
|
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
||||||
Cancel
|
>
|
||||||
</button>
|
Cancel
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -49,19 +49,21 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-8">
|
<div class="mt-8">
|
||||||
<button
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-2">
|
||||||
@click="incrementDerivation()"
|
<button
|
||||||
class="block w-full text-center text-lg font-bold uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-3 rounded-md mb-2"
|
@click="incrementDerivation()"
|
||||||
>
|
class="block w-full text-center text-lg font-bold uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-3 rounded-md"
|
||||||
Increment and Import
|
>
|
||||||
</button>
|
Increment and Import
|
||||||
<button
|
</button>
|
||||||
@click="onCancelClick()"
|
<button
|
||||||
type="button"
|
@click="onCancelClick()"
|
||||||
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
type="button"
|
||||||
>
|
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
||||||
Cancel
|
>
|
||||||
</button>
|
Cancel
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -22,21 +22,23 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<div class="mt-8">
|
<div class="mt-8">
|
||||||
<button
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-2">
|
||||||
type="button"
|
<button
|
||||||
class="block w-full text-center text-lg font-bold uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-3 rounded-md mb-2"
|
type="button"
|
||||||
@click="onClickSaveChanges()"
|
class="block w-full text-center text-lg font-bold uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-3 rounded-md mb-2"
|
||||||
>
|
@click="onClickSaveChanges()"
|
||||||
Save Changes
|
>
|
||||||
</button>
|
Save Changes
|
||||||
<!-- SHOW ME instead while processing saving changes -->
|
</button>
|
||||||
<button
|
<!-- SHOW ME instead while processing saving changes -->
|
||||||
type="button"
|
<button
|
||||||
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
type="button"
|
||||||
@click="onClickCancel()"
|
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-3 rounded-md mb-2"
|
||||||
>
|
@click="onClickCancel()"
|
||||||
Cancel
|
>
|
||||||
</button>
|
Cancel
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -73,16 +73,17 @@
|
|||||||
/>
|
/>
|
||||||
<label for="includeLocation">Include Location</label>
|
<label for="includeLocation">Include Location</label>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="includeLocation" style="height: 600px; width: 800px">
|
<div v-if="includeLocation" class="mb-4 aspect-video">
|
||||||
<div class="px-2 py-2">
|
<p class="text-sm mb-2 text-slate-500">
|
||||||
For your security, choose a location nearby but not exactly at the
|
For your security, choose a location nearby but not exactly at the
|
||||||
place.
|
place.
|
||||||
</div>
|
</p>
|
||||||
|
|
||||||
<l-map
|
<l-map
|
||||||
ref="map"
|
ref="map"
|
||||||
v-model:zoom="zoom"
|
v-model:zoom="zoom"
|
||||||
:center="[0, 0]"
|
:center="[0, 0]"
|
||||||
|
class="!z-40 rounded-md"
|
||||||
@click="
|
@click="
|
||||||
(event) => {
|
(event) => {
|
||||||
latitude = event.latlng.lat;
|
latitude = event.latlng.lat;
|
||||||
@@ -104,28 +105,30 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mt-8">
|
<div class="mt-8">
|
||||||
<button
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-2">
|
||||||
:disabled="isHiddenSave"
|
<button
|
||||||
class="block w-full text-center text-lg font-bold uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-3 rounded-md mb-2"
|
:disabled="isHiddenSave"
|
||||||
@click="onSaveProjectClick()"
|
class="block w-full text-center text-lg font-bold uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-3 rounded-md mb-2"
|
||||||
>
|
@click="onSaveProjectClick()"
|
||||||
<!-- SHOW if in idle state -->
|
|
||||||
<span :class="{ hidden: isHiddenSave }">Save Project</span>
|
|
||||||
|
|
||||||
<!-- SHOW if in saving state; DISABLE button while in saving state -->
|
|
||||||
<span :class="{ hidden: isHiddenSpinner }">
|
|
||||||
<!-- icon no worky? -->
|
|
||||||
<i class="fa-solid fa-spinner fa-spin-pulse"></i>
|
|
||||||
Saving...</span
|
|
||||||
>
|
>
|
||||||
</button>
|
<!-- SHOW if in idle state -->
|
||||||
<button
|
<span :class="{ hidden: isHiddenSave }">Save Project</span>
|
||||||
type="button"
|
|
||||||
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
<!-- SHOW if in saving state; DISABLE button while in saving state -->
|
||||||
@click="onCancelClick()"
|
<span :class="{ hidden: isHiddenSpinner }">
|
||||||
>
|
<!-- icon no worky? -->
|
||||||
Cancel
|
<i class="fa-solid fa-spinner fa-spin-pulse"></i>
|
||||||
</button>
|
Saving...</span
|
||||||
|
>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
||||||
|
@click="onCancelClick()"
|
||||||
|
>
|
||||||
|
Cancel
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -134,7 +134,9 @@
|
|||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<p class="mt-2 mb-4 text-center">Record a contribution from:</p>
|
<p class="mt-2 mb-4 text-center">Record a contribution from:</p>
|
||||||
</div>
|
</div>
|
||||||
<ul class="grid grid-cols-4 gap-x-3 gap-y-5 text-center mb-5">
|
<ul
|
||||||
|
class="grid grid-cols-4 sm:grid-cols-5 md:grid-cols-6 gap-x-3 gap-y-5 text-center mb-5"
|
||||||
|
>
|
||||||
<li @click="openGiftDialog({ name: 'you', did: activeDid })">
|
<li @click="openGiftDialog({ name: 'you', did: activeDid })">
|
||||||
<fa icon="hand" class="fa-fw text-slate-400 text-5xl" />
|
<fa icon="hand" class="fa-fw text-slate-400 text-5xl" />
|
||||||
<h3
|
<h3
|
||||||
@@ -160,7 +162,7 @@
|
|||||||
@click="openGiftDialog(contact)"
|
@click="openGiftDialog(contact)"
|
||||||
>
|
>
|
||||||
<EntityIcon
|
<EntityIcon
|
||||||
:entityId="contact.did"
|
:contact="contact"
|
||||||
:iconSize="64"
|
:iconSize="64"
|
||||||
class="mx-auto border border-slate-300 rounded-md mb-1"
|
class="mx-auto border border-slate-300 rounded-md mb-1"
|
||||||
/>
|
/>
|
||||||
@@ -360,11 +362,11 @@ import { accessToken } from "@/libs/crypto";
|
|||||||
import * as libsUtil from "@/libs/util";
|
import * as libsUtil from "@/libs/util";
|
||||||
import {
|
import {
|
||||||
BLANK_GENERIC_SERVER_RECORD,
|
BLANK_GENERIC_SERVER_RECORD,
|
||||||
GenericServerRecord,
|
GenericCredWrapper,
|
||||||
GiverInputInfo,
|
GiverInputInfo,
|
||||||
GiveServerRecord,
|
GiveSummaryRecord,
|
||||||
OfferServerRecord,
|
OfferSummaryRecord,
|
||||||
PlanServerRecord,
|
PlanSummaryRecord,
|
||||||
} from "@/libs/endorserServer";
|
} from "@/libs/endorserServer";
|
||||||
import * as serverUtil from "@/libs/endorserServer";
|
import * as serverUtil from "@/libs/endorserServer";
|
||||||
|
|
||||||
@@ -388,14 +390,14 @@ export default class ProjectViewView extends Vue {
|
|||||||
apiServer = "";
|
apiServer = "";
|
||||||
description = "";
|
description = "";
|
||||||
expanded = false;
|
expanded = false;
|
||||||
fulfilledByThis: PlanServerRecord | null = null;
|
fulfilledByThis: PlanSummaryRecord | null = null;
|
||||||
fulfillersToThis: Array<PlanServerRecord> = [];
|
fulfillersToThis: Array<PlanSummaryRecord> = [];
|
||||||
givesToThis: Array<GiveServerRecord> = [];
|
givesToThis: Array<GiveSummaryRecord> = [];
|
||||||
issuer = "";
|
issuer = "";
|
||||||
latitude = 0;
|
latitude = 0;
|
||||||
longitude = 0;
|
longitude = 0;
|
||||||
name = "";
|
name = "";
|
||||||
offersToThis: Array<OfferServerRecord> = [];
|
offersToThis: Array<OfferSummaryRecord> = [];
|
||||||
projectId = localStorage.getItem("projectId") || ""; // handle ID
|
projectId = localStorage.getItem("projectId") || ""; // handle ID
|
||||||
showDidCopy = false;
|
showDidCopy = false;
|
||||||
timeSince = "";
|
timeSince = "";
|
||||||
@@ -718,8 +720,8 @@ export default class ProjectViewView extends Vue {
|
|||||||
this.$router.push(route);
|
this.$router.push(route);
|
||||||
}
|
}
|
||||||
|
|
||||||
checkIsFulfillable(offer: OfferServerRecord) {
|
checkIsFulfillable(offer: OfferSummaryRecord) {
|
||||||
const offerRecord: GenericServerRecord = {
|
const offerRecord: GenericCredWrapper = {
|
||||||
...BLANK_GENERIC_SERVER_RECORD,
|
...BLANK_GENERIC_SERVER_RECORD,
|
||||||
claim: offer.fullClaim,
|
claim: offer.fullClaim,
|
||||||
claimType: "Offer",
|
claimType: "Offer",
|
||||||
@@ -728,8 +730,8 @@ export default class ProjectViewView extends Vue {
|
|||||||
return libsUtil.canFulfillOffer(offerRecord);
|
return libsUtil.canFulfillOffer(offerRecord);
|
||||||
}
|
}
|
||||||
|
|
||||||
onClickFulfillGiveToOffer(offer: OfferServerRecord) {
|
onClickFulfillGiveToOffer(offer: OfferSummaryRecord) {
|
||||||
const offerRecord: GenericServerRecord = {
|
const offerRecord: GenericCredWrapper = {
|
||||||
...BLANK_GENERIC_SERVER_RECORD,
|
...BLANK_GENERIC_SERVER_RECORD,
|
||||||
claim: offer.fullClaim,
|
claim: offer.fullClaim,
|
||||||
issuer: offer.offeredByDid,
|
issuer: offer.offeredByDid,
|
||||||
@@ -768,8 +770,8 @@ export default class ProjectViewView extends Vue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
checkIsConfirmable(give: GiveServerRecord) {
|
checkIsConfirmable(give: GiveSummaryRecord) {
|
||||||
const giveDetails: GenericServerRecord = {
|
const giveDetails: GenericCredWrapper = {
|
||||||
...BLANK_GENERIC_SERVER_RECORD,
|
...BLANK_GENERIC_SERVER_RECORD,
|
||||||
claim: give.fullClaim,
|
claim: give.fullClaim,
|
||||||
claimType: "GiveAction",
|
claimType: "GiveAction",
|
||||||
@@ -779,7 +781,7 @@ export default class ProjectViewView extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// similar code is found in ClaimView
|
// similar code is found in ClaimView
|
||||||
async confirmClaim(give: GiveServerRecord) {
|
async confirmClaim(give: GiveSummaryRecord) {
|
||||||
if (confirm("Do you personally confirm that this is true?")) {
|
if (confirm("Do you personally confirm that this is true?")) {
|
||||||
// similar logic is found in endorser-mobile
|
// similar logic is found in endorser-mobile
|
||||||
const goodClaim = serverUtil.removeSchemaContext(
|
const goodClaim = serverUtil.removeSchemaContext(
|
||||||
|
|||||||
@@ -98,7 +98,7 @@
|
|||||||
:entityId="offer.recipientDid"
|
:entityId="offer.recipientDid"
|
||||||
:iconSize="48"
|
:iconSize="48"
|
||||||
class="inline-block align-middle border border-slate-300 rounded-md"
|
class="inline-block align-middle border border-slate-300 rounded-md"
|
||||||
></EntityIcon>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
@@ -223,7 +223,7 @@ import InfiniteScroll from "@/components/InfiniteScroll.vue";
|
|||||||
import QuickNav from "@/components/QuickNav.vue";
|
import QuickNav from "@/components/QuickNav.vue";
|
||||||
import ProjectIcon from "@/components/ProjectIcon.vue";
|
import ProjectIcon from "@/components/ProjectIcon.vue";
|
||||||
import TopMessage from "@/components/TopMessage.vue";
|
import TopMessage from "@/components/TopMessage.vue";
|
||||||
import { OfferServerRecord, PlanData } from "@/libs/endorserServer";
|
import { OfferSummaryRecord, PlanData } from "@/libs/endorserServer";
|
||||||
import EntityIcon from "@/components/EntityIcon.vue";
|
import EntityIcon from "@/components/EntityIcon.vue";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -237,7 +237,7 @@ export default class ProjectsView extends Vue {
|
|||||||
currentIid: IIdentifier;
|
currentIid: IIdentifier;
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
numAccounts = 0;
|
numAccounts = 0;
|
||||||
offers: OfferServerRecord[] = [];
|
offers: OfferSummaryRecord[] = [];
|
||||||
showOffers = true;
|
showOffers = true;
|
||||||
showProjects = false;
|
showProjects = false;
|
||||||
|
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ import {
|
|||||||
createAndSubmitConfirmation,
|
createAndSubmitConfirmation,
|
||||||
createAndSubmitGive,
|
createAndSubmitGive,
|
||||||
ErrorResult,
|
ErrorResult,
|
||||||
GenericServerRecord,
|
GenericCredWrapper,
|
||||||
GenericVerifiableCredential,
|
GenericVerifiableCredential,
|
||||||
} from "@/libs/endorserServer";
|
} from "@/libs/endorserServer";
|
||||||
import * as libsUtil from "@/libs/util";
|
import * as libsUtil from "@/libs/util";
|
||||||
@@ -166,7 +166,7 @@ export default class QuickActionBvcBeginView extends Vue {
|
|||||||
allMyDids: Array<string> = [];
|
allMyDids: Array<string> = [];
|
||||||
apiServer = "";
|
apiServer = "";
|
||||||
claimCountWithHidden = 0;
|
claimCountWithHidden = 0;
|
||||||
claimsToConfirm: GenericServerRecord[] = [];
|
claimsToConfirm: GenericCredWrapper[] = [];
|
||||||
claimsToConfirmSelected: string[] = [];
|
claimsToConfirmSelected: string[] = [];
|
||||||
description = "breakfast";
|
description = "breakfast";
|
||||||
loadingConfirms = true;
|
loadingConfirms = true;
|
||||||
@@ -228,7 +228,7 @@ export default class QuickActionBvcBeginView extends Vue {
|
|||||||
}
|
}
|
||||||
await response.json().then((data) => {
|
await response.json().then((data) => {
|
||||||
const dataByOthers = R.reject(
|
const dataByOthers = R.reject(
|
||||||
(claim: GenericServerRecord) => claim.issuer === this.activeDid,
|
(claim: GenericCredWrapper) => claim.issuer === this.activeDid,
|
||||||
data,
|
data,
|
||||||
);
|
);
|
||||||
const dataByOthersWithoutHidden = R.reject(
|
const dataByOthersWithoutHidden = R.reject(
|
||||||
|
|||||||
@@ -22,8 +22,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="px-2 py-4">
|
<div class="px-2 py-4">
|
||||||
This location is only stored on your device. It is used to show you more
|
This location is only stored on your device. It is sometimes sent from
|
||||||
appropriate projects but is not stored on any servers.
|
your device to run searches but it is not stored on our servers.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
@@ -64,10 +64,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="height: 600px; width: 800px">
|
<div class="mb-4 aspect-video">
|
||||||
<l-map
|
<l-map
|
||||||
ref="map"
|
ref="map"
|
||||||
:center="[localCenterLat, localCenterLong]"
|
:center="[localCenterLat, localCenterLong]"
|
||||||
|
class="!z-40 rounded-md"
|
||||||
v-model:zoom="localZoom"
|
v-model:zoom="localZoom"
|
||||||
@click="setMapPoint"
|
@click="setMapPoint"
|
||||||
>
|
>
|
||||||
@@ -208,9 +209,9 @@ export default class DiscoverView extends Vue {
|
|||||||
group: "alert",
|
group: "alert",
|
||||||
type: "success",
|
type: "success",
|
||||||
title: "Saved",
|
title: "Saved",
|
||||||
text: "That has been saved in your preferences.",
|
text: "That has been saved in your preferences. You can now filter by it on your home screen feed.",
|
||||||
},
|
},
|
||||||
-1,
|
7000,
|
||||||
);
|
);
|
||||||
this.$router.back();
|
this.$router.back();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -246,6 +247,7 @@ export default class DiscoverView extends Vue {
|
|||||||
await db.open();
|
await db.open();
|
||||||
db.settings.update(MASTER_SETTINGS_KEY, {
|
db.settings.update(MASTER_SETTINGS_KEY, {
|
||||||
searchBoxes: [],
|
searchBoxes: [],
|
||||||
|
filterFeedByNearby: false,
|
||||||
});
|
});
|
||||||
this.searchBox = null;
|
this.searchBox = null;
|
||||||
this.localCenterLat = 0;
|
this.localCenterLat = 0;
|
||||||
|
|||||||
@@ -23,36 +23,40 @@
|
|||||||
|
|
||||||
<!-- id used by puppeteer test script -->
|
<!-- id used by puppeteer test script -->
|
||||||
<div id="start-question" class="mt-8">
|
<div id="start-question" class="mt-8">
|
||||||
<p class="text-center text-xl font-light">
|
<div class="max-w-3xl mx-auto">
|
||||||
Do you want a new identifier of your own?
|
<p class="text-center text-xl font-light">
|
||||||
</p>
|
Do you want a new identifier of your own?
|
||||||
<p class="text-center font-light">
|
</p>
|
||||||
If you haven't used this before, click "Yes" to generate a new
|
<p class="text-center font-light">
|
||||||
identifier.
|
If you haven't used this before, click "Yes" to generate a new
|
||||||
</p>
|
identifier.
|
||||||
<p class="text-center mb-4 font-light">
|
</p>
|
||||||
Only click "No" if you have a seed of 12 or 24 words generated
|
<p class="text-center mb-4 font-light">
|
||||||
elsewhere.
|
Only click "No" if you have a seed of 12 or 24 words generated
|
||||||
</p>
|
elsewhere.
|
||||||
<a
|
</p>
|
||||||
@click="onClickYes()"
|
<a
|
||||||
class="block w-full text-center text-lg uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-3 rounded-md"
|
@click="onClickYes()"
|
||||||
>
|
class="block w-full text-center text-lg uppercase bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-3 rounded-md mb-2"
|
||||||
Yes, generate one
|
>
|
||||||
</a>
|
Yes, generate one
|
||||||
<a
|
</a>
|
||||||
@click="onClickNo()"
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-2">
|
||||||
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md mt-2"
|
<a
|
||||||
>
|
@click="onClickNo()"
|
||||||
No, I have a seed
|
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
||||||
</a>
|
>
|
||||||
<a
|
No, I have a seed
|
||||||
v-if="numAccounts > 0"
|
</a>
|
||||||
@click="onClickDerive()"
|
<a
|
||||||
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md mt-2"
|
v-if="numAccounts > 0"
|
||||||
>
|
@click="onClickDerive()"
|
||||||
Derive new address from existing seed
|
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
||||||
</a>
|
>
|
||||||
|
Derive new address from existing seed
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -112,6 +112,25 @@ self.addEventListener("message", (event) => {
|
|||||||
logConsoleAndDb("Service worker posted a message.");
|
logConsoleAndDb("Service worker posted a message.");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
self.addEventListener("notificationclick", (event) => {
|
||||||
|
logConsoleAndDb("Notification got clicked.", event);
|
||||||
|
event.notification.close();
|
||||||
|
// from https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/notificationclick_event
|
||||||
|
// ... though I don't see any benefit over just "clients.openWindow"
|
||||||
|
event.waitUntil(
|
||||||
|
clients
|
||||||
|
.matchAll({
|
||||||
|
type: "window",
|
||||||
|
})
|
||||||
|
.then((clientList) => {
|
||||||
|
for (const client of clientList) {
|
||||||
|
if (client.url === "/" && "focus" in client) return client.focus();
|
||||||
|
}
|
||||||
|
if (clients.openWindow) return clients.openWindow("/");
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
self.addEventListener("fetch", (event) => {
|
self.addEventListener("fetch", (event) => {
|
||||||
logConsoleAndDb("Service worker got fetch event.", event);
|
logConsoleAndDb("Service worker got fetch event.", event);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,47 +1,35 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"allowJs": true,
|
"target": "ES2020", // Latest ECMAScript features that are widely supported by modern browsers
|
||||||
"resolveJsonModule": true,
|
"module": "ESNext", // Use ES modules
|
||||||
"target": "esnext",
|
"strict": true, // Enable all strict type checking options
|
||||||
"module": "esnext",
|
"jsx": "preserve", // Preserves JSX to be transformed by Babel or another transpiler
|
||||||
"strict": true,
|
"moduleResolution": "node", // Use Node.js style module resolution
|
||||||
"strictPropertyInitialization": false,
|
"experimentalDecorators": true,
|
||||||
"jsx": "preserve",
|
"esModuleInterop": true, // Enables compatibility with CommonJS modules for default imports
|
||||||
"moduleResolution": "node",
|
"allowSyntheticDefaultImports": true, // Allow default imports from modules with no default export
|
||||||
"experimentalDecorators": true,
|
"forceConsistentCasingInFileNames": true, // Disallow inconsistently-cased references to the same file
|
||||||
"skipLibCheck": true,
|
"useDefineForClassFields": true,
|
||||||
"esModuleInterop": true,
|
"sourceMap": true,
|
||||||
"allowSyntheticDefaultImports": true,
|
"baseUrl": "./src", // Base directory to resolve non-relative module names
|
||||||
"forceConsistentCasingInFileNames": true,
|
"paths": {
|
||||||
"useDefineForClassFields": true,
|
"@/components/*": ["components/*"],
|
||||||
"sourceMap": true,
|
"@/views/*": ["views/*"],
|
||||||
"baseUrl": "./src",
|
"@/db/*": ["db/*"],
|
||||||
"types": [
|
"@/libs/*": ["libs/*"],
|
||||||
"webpack-env"
|
"@/constants/*": ["constants/*"],
|
||||||
],
|
"@/store/*": ["store/*"]
|
||||||
"paths": {
|
},
|
||||||
"@/components/*": ["components/*"],
|
"lib": ["ES2020", "dom", "dom.iterable"], // Include typings for ES2020 and DOM APIs
|
||||||
"@/views/*": ["views/*"],
|
|
||||||
"@/db/*": ["db/*"],
|
|
||||||
"@/libs/*": ["libs/*"],
|
|
||||||
"@/constants/*": ["constants/*"],
|
|
||||||
"@/store/*": ["store/*"],
|
|
||||||
},
|
},
|
||||||
"lib": [
|
"include": [
|
||||||
"esnext",
|
"src/**/*.ts",
|
||||||
"dom",
|
"src/**/*.tsx",
|
||||||
"dom.iterable",
|
"src/**/*.vue",
|
||||||
"scripthost"
|
"tests/**/*.ts",
|
||||||
|
"tests/**/*.tsx"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"node_modules"
|
||||||
]
|
]
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
"src/**/*.ts",
|
|
||||||
"src/**/*.tsx",
|
|
||||||
"src/**/*.vue",
|
|
||||||
"tests/**/*.ts",
|
|
||||||
"tests/**/*.tsx"
|
|
||||||
],
|
|
||||||
"exclude": [
|
|
||||||
"node_modules"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
30
vite.config.mjs
Normal file
30
vite.config.mjs
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import * as path from 'path';
|
||||||
|
import { defineConfig } from 'vite';
|
||||||
|
import { VitePWA } from 'vite-plugin-pwa';
|
||||||
|
import vue from '@vitejs/plugin-vue';
|
||||||
|
|
||||||
|
// https://vitejs.dev/config/
|
||||||
|
export default defineConfig({
|
||||||
|
server: {
|
||||||
|
port: 8080
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
vue(),
|
||||||
|
VitePWA({
|
||||||
|
registerType: 'autoUpdate',
|
||||||
|
strategies: 'injectManifest',
|
||||||
|
srcDir: '.',
|
||||||
|
filename: 'sw_scripts-combined.js',
|
||||||
|
manifest: {
|
||||||
|
name: process.env.TIME_SAFARI_APP_TITLE || require('./package.json').name,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
'@': path.resolve(__dirname, './src'),
|
||||||
|
buffer: path.resolve(__dirname, 'node_modules', 'buffer'),
|
||||||
|
'dexie-export-import/dist/import': 'dexie-export-import/dist/import/index.js',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
const { defineConfig } = require("@vue/cli-service");
|
|
||||||
const { gitDescribeSync } = require("git-describe");
|
|
||||||
const { exec } = require("child_process");
|
|
||||||
|
|
||||||
process.env.VUE_APP_GIT_HASH = gitDescribeSync().hash;
|
|
||||||
const TIME_SAFARI_APP_TITLE =
|
|
||||||
process.env.TIME_SAFARI_APP_TITLE || require("./package.json").name;
|
|
||||||
|
|
||||||
module.exports = defineConfig({
|
|
||||||
transpileDependencies: true,
|
|
||||||
configureWebpack: {
|
|
||||||
devtool: "source-map",
|
|
||||||
experiments: {
|
|
||||||
topLevelAwait: true,
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
{
|
|
||||||
// Still don't know why this runs three times.
|
|
||||||
apply: (compiler) => {
|
|
||||||
compiler.hooks.beforeCompile.tap("BeforeCompile", () => {
|
|
||||||
// Execute combine-sw.js script
|
|
||||||
exec("node sw_combine.js", (error, stdout, stderr) => {
|
|
||||||
if (error || stderr) {
|
|
||||||
console.error("Service worker files error:", error || stderr);
|
|
||||||
} else {
|
|
||||||
console.log("Finished combining service worker files.", stdout);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
pwa: {
|
|
||||||
name: TIME_SAFARI_APP_TITLE,
|
|
||||||
iconPaths: {
|
|
||||||
faviconSVG: "img/icons/safari-pinned-tab.svg",
|
|
||||||
},
|
|
||||||
workboxPluginMode: "InjectManifest",
|
|
||||||
workboxOptions: {
|
|
||||||
// this script will be checked for linting (sw_scripts/* files generate about 1000 linting errors)
|
|
||||||
swSrc: "./sw_scripts-combined.js",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
Reference in New Issue
Block a user