Compare commits
89 Commits
sw-cleanup
...
claim-view
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4b78f6a2c | ||
|
|
3c0f6ce0de | ||
| 5534f8fa50 | |||
| a5004d475e | |||
| b445b1234f | |||
| 17c96dd01a | |||
| 6ad17101b2 | |||
| b4085ffaa7 | |||
| 4f2cb55753 | |||
| ebf9164ecc | |||
| 540cc21839 | |||
| c182068901 | |||
| aaa1f31945 | |||
| 17c632eb16 | |||
| 41c4cbe61a | |||
| c8402797ad | |||
| 4a09b9b9b1 | |||
| 5db3423301 | |||
| 2b00b243e8 | |||
| f2e5d8168d | |||
| 1d262b8da9 | |||
| 8ed74b71f2 | |||
| 8fb21c3d89 | |||
| 8dbfcd38d3 | |||
| 04df0d4eff | |||
|
|
ab523639a5 | ||
|
|
0484dfb253 | ||
|
|
c2839e8a99 | ||
|
|
e533cd3d34 | ||
|
|
18e00b95c7 | ||
|
|
e97cd1b1fa | ||
| ccca93b9f1 | |||
| 1be6c04699 | |||
| 2c33febb0e | |||
| e6f73dc81c | |||
| 0d55a722c5 | |||
| 97ef78f5dd | |||
| 672abac9a9 | |||
| 0607fad3e5 | |||
| 6aa89a1d1d | |||
| 2556d5feb9 | |||
| 3c1654764c | |||
| 4c1e229d62 | |||
| 17444d75de | |||
| f2fb432d2e | |||
| e45689daed | |||
| 041308ebc9 | |||
| 9c36bb509a | |||
| 2c300614ef | |||
| 8849e8806a | |||
| f75094283a | |||
| 0fabccd410 | |||
|
|
8ddf7d9532 | ||
|
|
4078853558 | ||
|
|
f4df5ffa9a | ||
| fa856f7594 | |||
| a0db6433a6 | |||
| 59d0772881 | |||
| b18e554886 | |||
| 098ef3c644 | |||
| 6045975b79 | |||
| a6bb036ceb | |||
| 1e2ad85547 | |||
| 4daffe8f40 | |||
| efb1922826 | |||
| c6e10bfdad | |||
| bb122be319 | |||
| 3f436476a2 | |||
| a77d20b572 | |||
| 393d1583ae | |||
| 69a25ddd6c | |||
| a12d7fcc1b | |||
| 69c60e5426 | |||
| 4806acc30e | |||
| 1127d7079b | |||
| 0bbadfec6d | |||
| 276d8b2f19 | |||
| a7fbbbd4cd | |||
| a8d362c14d | |||
| ce5933f645 | |||
| 5cbf917ada | |||
| 7335412145 | |||
| feea1a1d3b | |||
| 7f4d31a79c | |||
| 4041a7d08e | |||
| 681d949098 | |||
| 3bf8fd0c22 | |||
| ee6a344daf | |||
| 65a5edf26b |
26
CHANGELOG.md
26
CHANGELOG.md
@@ -9,7 +9,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
|
||||||
## [0.1.3] - 2023.11
|
## [0.1.6] - 2023.12.17
|
||||||
|
### Added
|
||||||
|
- Infinite scroll on home page
|
||||||
|
### Changed
|
||||||
|
- UI improvements
|
||||||
|
- Show web-push subscription info
|
||||||
|
- Icon
|
||||||
|
|
||||||
|
|
||||||
|
## [0.1.5] - 2023.12.09 - 9c36bb509a9bae9bb3306d3bd9eeb144b67aa8ad
|
||||||
|
### Added
|
||||||
|
- Web push notifications (though not finalized)
|
||||||
|
- Credentials details page
|
||||||
|
- See more data without an ID
|
||||||
|
- Change units of a give
|
||||||
|
|
||||||
|
|
||||||
|
## [0.1.4] - 2023.11.20 - 7311d36726f3667ec4c68f241f91d404273ad4db
|
||||||
|
### Added
|
||||||
|
- Offer on a project
|
||||||
|
### Changed
|
||||||
|
- Automatically set as visible when importing a contact
|
||||||
|
|
||||||
|
|
||||||
|
## [0.1.3] - 2023.11.08 - 910f57ec7d2e50803ae3d04f4b927e0f5219fbde
|
||||||
### Added
|
### Added
|
||||||
- Contact name editing
|
- Contact name editing
|
||||||
### Changed
|
### Changed
|
||||||
|
|||||||
41
README.md
41
README.md
@@ -22,16 +22,25 @@ npm run lint
|
|||||||
|
|
||||||
If you are deploying in a subdirectory, add it to `publicPath` in vue.config.js, eg: `publicPath: "/app/time-tracker/",`
|
If you are deploying in a subdirectory, add it to `publicPath` in vue.config.js, eg: `publicPath: "/app/time-tracker/",`
|
||||||
|
|
||||||
```
|
* `npx prettier --write ./sw_scripts/`
|
||||||
npm run build
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
...to make sure the service worker scripts are in proper form
|
||||||
npx prettier --write ./sw_scripts/
|
|
||||||
```
|
|
||||||
to make sure the service worker scripts are in proper form
|
|
||||||
|
|
||||||
... then copy the contents of the `sw_scripts` folder to the `dist` folder - except additional_scripts.js.
|
* Update the CHANGELOG.md & the version in package.json, run `npm install`, and commit.
|
||||||
|
|
||||||
|
* Tag wth the new version: `git tag 0.1.0`. Increment version, add "-beta", `npm install`, and commit.
|
||||||
|
|
||||||
|
* If production, change src/constants/app.ts DEFAULT_*_SERVER to be PROD.
|
||||||
|
|
||||||
|
* `npm run build`
|
||||||
|
|
||||||
|
* Revert src/constants/app.ts
|
||||||
|
|
||||||
|
* `cp sw_scripts/[ns]* dist/`
|
||||||
|
|
||||||
|
... to copy the contents of the `sw_scripts` folder to the `dist` folder - except additional_scripts.js.
|
||||||
|
|
||||||
|
* `rsync -azvu -e "ssh -i ~/.ssh/..." dist ubuntu@endorser.ch:time-safari`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -62,7 +71,11 @@ Under the "Your Identity" screen, click "Advanced", click "Switch Identity / No
|
|||||||
|
|
||||||
### Web-push
|
### Web-push
|
||||||
|
|
||||||
For your own web-push tests, change the 'vapid' URL in App.vue, and install apps on the same domain.
|
For your own web-push tests, change the push server URL in Advanced settings on the account page, and install Time Safari & push server on the same domain.
|
||||||
|
|
||||||
|
### Icons
|
||||||
|
|
||||||
|
To add an icon, add to main.ts and reference with `fa` element and `icon` attribute with the hyphenated name.
|
||||||
|
|
||||||
### Manual walk-through
|
### Manual walk-through
|
||||||
|
|
||||||
@@ -90,7 +103,7 @@ For your own web-push tests, change the 'vapid' URL in App.vue, and install apps
|
|||||||
- Create a new identity as prompted. Go to "Your Identity" screen and copy the ID to the clipboard.
|
- Create a new identity as prompted. Go to "Your Identity" screen and copy the ID to the clipboard.
|
||||||
|
|
||||||
- Go back to /start and import test User `did:ethr:0x000Ee5654b9742f6Fe18ea970e32b97ee2247B51` with this this seed phrase:
|
- Go back to /start and import test User `did:ethr:0x000Ee5654b9742f6Fe18ea970e32b97ee2247B51` with this this seed phrase:
|
||||||
`seminar accuse mystery assist delay law thing deal image undo guard initial shallow wrestle list fragile borrow velvet tomorrow awake explain test offer control`
|
`rigid shrug mobile smart veteran half all pond toilet brave review universe ship congress found yard skate elite apology jar uniform subway slender luggage`
|
||||||
(Other test users are found [here](https://github.com/trentlarson/endorser-ch/blob/master/test/util.js).)
|
(Other test users are found [here](https://github.com/trentlarson/endorser-ch/blob/master/test/util.js).)
|
||||||
|
|
||||||
- Go to "Your Contacts" screen and add the ID you copied to the clipboard, and hit "+" to add them.
|
- Go to "Your Contacts" screen and add the ID you copied to the clipboard, and hit "+" to add them.
|
||||||
@@ -99,10 +112,10 @@ For your own web-push tests, change the 'vapid' URL in App.vue, and install apps
|
|||||||
|
|
||||||
### Clear/Reset data & restart
|
### Clear/Reset data & restart
|
||||||
|
|
||||||
* Data: Clear the browser cache for localhost.
|
* Clear cache for site. (In Chrome, go to `chrome://settings/cookies` and "all site data and permissions"; in Firefox, go to `about:preferences` and search for "cache" then "Manage Data".)
|
||||||
* Notifications:
|
* Unregister service worker (in Chrome, go to `chrome://serviceworker-internals/`; in Firefox, go to `about:serviceworkers`).
|
||||||
* Under browser settings, look for "notification" and remove this server.
|
* Clear notification permission (in Chrome, go to `chrome://settings/content/notifications`; in Firefox, go to `about:preferences` and search for "notifications").
|
||||||
* Under about:debugging, find the service worker and Unregister.
|
* Clear Cache Storage (in Chrome, in dev tools under Application; in Firefox, in dev tools under Storage).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
163
package-lock.json
generated
163
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "crowd-funder-for-time-pwa",
|
"name": "TimeSafari",
|
||||||
"version": "0.1.4",
|
"version": "0.1.7-beta",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "crowd-funder-for-time-pwa",
|
"name": "TimeSafari",
|
||||||
"version": "0.1.4",
|
"version": "0.1.7-beta",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ethersproject/hdnode": "^5.7.0",
|
"@ethersproject/hdnode": "^5.7.0",
|
||||||
"@fortawesome/fontawesome-svg-core": "^6.4.2",
|
"@fortawesome/fontawesome-svg-core": "^6.4.2",
|
||||||
@@ -33,6 +33,7 @@
|
|||||||
"ethereum-cryptography": "^2.1.2",
|
"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",
|
||||||
"localstorage-slim": "^2.5.0",
|
"localstorage-slim": "^2.5.0",
|
||||||
@@ -49,6 +50,7 @@
|
|||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.13",
|
||||||
"register-service-worker": "^1.7.2",
|
"register-service-worker": "^1.7.2",
|
||||||
"three": "^0.156.1",
|
"three": "^0.156.1",
|
||||||
|
"util": "^0.12.5",
|
||||||
"vue": "^3.3.4",
|
"vue": "^3.3.4",
|
||||||
"vue-axios": "^3.5.2",
|
"vue-axios": "^3.5.2",
|
||||||
"vue-facing-decorator": "^3.0.2",
|
"vue-facing-decorator": "^3.0.2",
|
||||||
@@ -72,13 +74,13 @@
|
|||||||
"@vue/cli-service": "~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.15",
|
||||||
"eslint": "^8.48.0",
|
"eslint": "^8.53.0",
|
||||||
"eslint-config-prettier": "^9.0.0",
|
"eslint-config-prettier": "^9.0.0",
|
||||||
"eslint-plugin-prettier": "^5.0.0",
|
"eslint-plugin-prettier": "^5.0.0",
|
||||||
"eslint-plugin-vue": "^9.17.0",
|
"eslint-plugin-vue": "^9.17.0",
|
||||||
"leaflet": "^1.9.4",
|
"leaflet": "^1.9.4",
|
||||||
"postcss": "^8.4.29",
|
"postcss": "^8.4.29",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.1.0",
|
||||||
"tailwindcss": "^3.3.3",
|
"tailwindcss": "^3.3.3",
|
||||||
"typescript": "~5.2.2"
|
"typescript": "~5.2.2"
|
||||||
}
|
}
|
||||||
@@ -2821,9 +2823,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/eslintrc": {
|
"node_modules/@eslint/eslintrc": {
|
||||||
"version": "2.1.2",
|
"version": "2.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz",
|
||||||
"integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==",
|
"integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ajv": "^6.12.4",
|
"ajv": "^6.12.4",
|
||||||
@@ -2871,9 +2873,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/js": {
|
"node_modules/@eslint/js": {
|
||||||
"version": "8.51.0",
|
"version": "8.55.0",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.51.0.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.55.0.tgz",
|
||||||
"integrity": "sha512-HxjQ8Qn+4SI3/AFv6sOrDB+g6PpUTDwSJiQqOrnneEk8L71161srI9gjzzZvYVbzHiVg/BvcH95+cK/zfIt4pg==",
|
"integrity": "sha512-qQfo2mxH5yVom1kacMtZZJFVdW+E70mqHMJvVg6WTLo+VBuQJ4TojZlfWBjK0ve5BdEeNAVxOsl/nvNMpJOaJA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||||
@@ -5498,12 +5500,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@humanwhocodes/config-array": {
|
"node_modules/@humanwhocodes/config-array": {
|
||||||
"version": "0.11.11",
|
"version": "0.11.13",
|
||||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.11.tgz",
|
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz",
|
||||||
"integrity": "sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==",
|
"integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@humanwhocodes/object-schema": "^1.2.1",
|
"@humanwhocodes/object-schema": "^2.0.1",
|
||||||
"debug": "^4.1.1",
|
"debug": "^4.1.1",
|
||||||
"minimatch": "^3.0.5"
|
"minimatch": "^3.0.5"
|
||||||
},
|
},
|
||||||
@@ -5525,9 +5527,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@humanwhocodes/object-schema": {
|
"node_modules/@humanwhocodes/object-schema": {
|
||||||
"version": "1.2.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz",
|
||||||
"integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==",
|
"integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@jest/create-cache-key-function": {
|
"node_modules/@jest/create-cache-key-function": {
|
||||||
@@ -8819,11 +8821,11 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "20.8.6",
|
"version": "20.10.4",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.6.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.4.tgz",
|
||||||
"integrity": "sha512-eWO4K2Ji70QzKUqRy6oyJWUeB7+g2cRagT3T/nxYibYcT4y2BDL8lqolRXjTHmkZCdJfIPaY73KbJAZmcryxTQ==",
|
"integrity": "sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"undici-types": "~5.25.1"
|
"undici-types": "~5.26.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/normalize-package-data": {
|
"node_modules/@types/normalize-package-data": {
|
||||||
@@ -8893,8 +8895,7 @@
|
|||||||
"node_modules/@types/semver": {
|
"node_modules/@types/semver": {
|
||||||
"version": "7.5.3",
|
"version": "7.5.3",
|
||||||
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.3.tgz",
|
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.3.tgz",
|
||||||
"integrity": "sha512-OxepLK9EuNEIPxWNME+C6WwbRAOOI2o2BaQEGzz5Lu2e4Z5eDnEo+/aVEDMIXywoJitJ7xWd641wrGLZdtwRyw==",
|
"integrity": "sha512-OxepLK9EuNEIPxWNME+C6WwbRAOOI2o2BaQEGzz5Lu2e4Z5eDnEo+/aVEDMIXywoJitJ7xWd641wrGLZdtwRyw=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"node_modules/@types/send": {
|
"node_modules/@types/send": {
|
||||||
"version": "0.17.2",
|
"version": "0.17.2",
|
||||||
@@ -9206,6 +9207,12 @@
|
|||||||
"url": "https://opencollective.com/typescript-eslint"
|
"url": "https://opencollective.com/typescript-eslint"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@ungap/structured-clone": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz",
|
||||||
|
"integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"node_modules/@unimodules/core": {
|
"node_modules/@unimodules/core": {
|
||||||
"version": "7.1.2",
|
"version": "7.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/@unimodules/core/-/core-7.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/@unimodules/core/-/core-7.1.2.tgz",
|
||||||
@@ -11245,7 +11252,6 @@
|
|||||||
"version": "1.0.5",
|
"version": "1.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz",
|
||||||
"integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==",
|
"integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==",
|
||||||
"dev": true,
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 0.4"
|
"node": ">= 0.4"
|
||||||
},
|
},
|
||||||
@@ -12063,7 +12069,6 @@
|
|||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
|
||||||
"integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
|
"integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
|
||||||
"devOptional": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"function-bind": "^1.1.1",
|
"function-bind": "^1.1.1",
|
||||||
"get-intrinsic": "^1.0.2"
|
"get-intrinsic": "^1.0.2"
|
||||||
@@ -14220,18 +14225,19 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint": {
|
"node_modules/eslint": {
|
||||||
"version": "8.51.0",
|
"version": "8.55.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.51.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.55.0.tgz",
|
||||||
"integrity": "sha512-2WuxRZBrlwnXi+/vFSJyjMqrNjtJqiasMzehF0shoLaW7DzS3/9Yvrmq5JiT66+pNjiX4UBnLDiKHcWAr/OInA==",
|
"integrity": "sha512-iyUUAM0PCKj5QpwGfmCAG9XXbZCWsqP/eWAWrG/W0umvjuLRBECwSFdt+rCntju0xEH7teIABPwXpahftIaTdA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-utils": "^4.2.0",
|
"@eslint-community/eslint-utils": "^4.2.0",
|
||||||
"@eslint-community/regexpp": "^4.6.1",
|
"@eslint-community/regexpp": "^4.6.1",
|
||||||
"@eslint/eslintrc": "^2.1.2",
|
"@eslint/eslintrc": "^2.1.4",
|
||||||
"@eslint/js": "8.51.0",
|
"@eslint/js": "8.55.0",
|
||||||
"@humanwhocodes/config-array": "^0.11.11",
|
"@humanwhocodes/config-array": "^0.11.13",
|
||||||
"@humanwhocodes/module-importer": "^1.0.1",
|
"@humanwhocodes/module-importer": "^1.0.1",
|
||||||
"@nodelib/fs.walk": "^1.2.8",
|
"@nodelib/fs.walk": "^1.2.8",
|
||||||
|
"@ungap/structured-clone": "^1.2.0",
|
||||||
"ajv": "^6.12.4",
|
"ajv": "^6.12.4",
|
||||||
"chalk": "^4.0.0",
|
"chalk": "^4.0.0",
|
||||||
"cross-spawn": "^7.0.2",
|
"cross-spawn": "^7.0.2",
|
||||||
@@ -15891,7 +15897,6 @@
|
|||||||
"version": "0.3.3",
|
"version": "0.3.3",
|
||||||
"resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz",
|
"resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz",
|
||||||
"integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==",
|
"integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==",
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"is-callable": "^1.1.3"
|
"is-callable": "^1.1.3"
|
||||||
}
|
}
|
||||||
@@ -16151,7 +16156,6 @@
|
|||||||
"version": "1.1.2",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
||||||
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
|
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
|
||||||
"devOptional": true,
|
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
@@ -16204,7 +16208,6 @@
|
|||||||
"version": "1.2.1",
|
"version": "1.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz",
|
||||||
"integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==",
|
"integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==",
|
||||||
"devOptional": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"function-bind": "^1.1.1",
|
"function-bind": "^1.1.1",
|
||||||
"has": "^1.0.3",
|
"has": "^1.0.3",
|
||||||
@@ -16269,6 +16272,30 @@
|
|||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/git-describe": {
|
||||||
|
"version": "4.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/git-describe/-/git-describe-4.1.1.tgz",
|
||||||
|
"integrity": "sha512-JC8ganO5kO80G8+XE98TDDjnMXQN3Estk3qdJuG2EGRF/l6zuMTMcN+8OSfQZ5FWpqIRLB015anWX4aSRgnxAQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/semver": "^7.3.8",
|
||||||
|
"lodash": "^4.17.21"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4.0.0"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"semver": "^5.6.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/git-describe/node_modules/semver": {
|
||||||
|
"version": "5.7.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
|
||||||
|
"integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
|
||||||
|
"optional": true,
|
||||||
|
"bin": {
|
||||||
|
"semver": "bin/semver"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/glob": {
|
"node_modules/glob": {
|
||||||
"version": "7.2.3",
|
"version": "7.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
||||||
@@ -16355,7 +16382,6 @@
|
|||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz",
|
||||||
"integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==",
|
"integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==",
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"get-intrinsic": "^1.1.3"
|
"get-intrinsic": "^1.1.3"
|
||||||
},
|
},
|
||||||
@@ -16426,7 +16452,6 @@
|
|||||||
"version": "1.0.4",
|
"version": "1.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz",
|
||||||
"integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==",
|
"integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==",
|
||||||
"devOptional": true,
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 0.4.0"
|
"node": ">= 0.4.0"
|
||||||
}
|
}
|
||||||
@@ -16465,7 +16490,6 @@
|
|||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz",
|
||||||
"integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==",
|
"integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==",
|
||||||
"devOptional": true,
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 0.4"
|
"node": ">= 0.4"
|
||||||
},
|
},
|
||||||
@@ -16477,7 +16501,6 @@
|
|||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
|
||||||
"integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==",
|
"integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==",
|
||||||
"devOptional": true,
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 0.4"
|
"node": ">= 0.4"
|
||||||
},
|
},
|
||||||
@@ -16489,7 +16512,6 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz",
|
||||||
"integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==",
|
"integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==",
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"has-symbols": "^1.0.2"
|
"has-symbols": "^1.0.2"
|
||||||
},
|
},
|
||||||
@@ -17081,6 +17103,21 @@
|
|||||||
"node": ">= 0.10"
|
"node": ">= 0.10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/is-arguments": {
|
||||||
|
"version": "1.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz",
|
||||||
|
"integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==",
|
||||||
|
"dependencies": {
|
||||||
|
"call-bind": "^1.0.2",
|
||||||
|
"has-tostringtag": "^1.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/is-array-buffer": {
|
"node_modules/is-array-buffer": {
|
||||||
"version": "3.0.2",
|
"version": "3.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz",
|
||||||
@@ -17152,7 +17189,6 @@
|
|||||||
"version": "1.2.7",
|
"version": "1.2.7",
|
||||||
"resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz",
|
"resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz",
|
||||||
"integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==",
|
"integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==",
|
||||||
"dev": true,
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 0.4"
|
"node": ">= 0.4"
|
||||||
},
|
},
|
||||||
@@ -17257,6 +17293,20 @@
|
|||||||
"node": ">=4"
|
"node": ">=4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/is-generator-function": {
|
||||||
|
"version": "1.0.10",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz",
|
||||||
|
"integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==",
|
||||||
|
"dependencies": {
|
||||||
|
"has-tostringtag": "^1.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/is-glob": {
|
"node_modules/is-glob": {
|
||||||
"version": "4.0.3",
|
"version": "4.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
|
||||||
@@ -17530,7 +17580,6 @@
|
|||||||
"version": "1.1.12",
|
"version": "1.1.12",
|
||||||
"resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz",
|
"resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz",
|
||||||
"integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==",
|
"integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==",
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"which-typed-array": "^1.1.11"
|
"which-typed-array": "^1.1.11"
|
||||||
},
|
},
|
||||||
@@ -19313,8 +19362,7 @@
|
|||||||
"node_modules/lodash": {
|
"node_modules/lodash": {
|
||||||
"version": "4.17.21",
|
"version": "4.17.21",
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
||||||
"devOptional": true
|
|
||||||
},
|
},
|
||||||
"node_modules/lodash.clonedeep": {
|
"node_modules/lodash.clonedeep": {
|
||||||
"version": "4.5.0",
|
"version": "4.5.0",
|
||||||
@@ -23137,9 +23185,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/prettier": {
|
"node_modules/prettier": {
|
||||||
"version": "3.0.3",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.0.tgz",
|
||||||
"integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==",
|
"integrity": "sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"prettier": "bin/prettier.cjs"
|
"prettier": "bin/prettier.cjs"
|
||||||
@@ -26870,9 +26918,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/undici-types": {
|
"node_modules/undici-types": {
|
||||||
"version": "5.25.3",
|
"version": "5.26.5",
|
||||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.25.3.tgz",
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
|
||||||
"integrity": "sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA=="
|
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="
|
||||||
},
|
},
|
||||||
"node_modules/unicode-canonical-property-names-ecmascript": {
|
"node_modules/unicode-canonical-property-names-ecmascript": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
@@ -27055,6 +27103,18 @@
|
|||||||
"resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz",
|
||||||
"integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ=="
|
"integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ=="
|
||||||
},
|
},
|
||||||
|
"node_modules/util": {
|
||||||
|
"version": "0.12.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz",
|
||||||
|
"integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==",
|
||||||
|
"dependencies": {
|
||||||
|
"inherits": "^2.0.3",
|
||||||
|
"is-arguments": "^1.0.4",
|
||||||
|
"is-generator-function": "^1.0.7",
|
||||||
|
"is-typed-array": "^1.1.3",
|
||||||
|
"which-typed-array": "^1.1.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/util-deprecate": {
|
"node_modules/util-deprecate": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||||
@@ -27966,7 +28026,6 @@
|
|||||||
"version": "1.1.11",
|
"version": "1.1.11",
|
||||||
"resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz",
|
"resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz",
|
||||||
"integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==",
|
"integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==",
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"available-typed-arrays": "^1.0.5",
|
"available-typed-arrays": "^1.0.5",
|
||||||
"call-bind": "^1.0.2",
|
"call-bind": "^1.0.2",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "crowd-funder-for-time-pwa",
|
"name": "TimeSafari",
|
||||||
"version": "0.1.4",
|
"version": "0.1.7-beta",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "vue-cli-service serve",
|
"serve": "vue-cli-service serve",
|
||||||
@@ -33,6 +33,7 @@
|
|||||||
"ethereum-cryptography": "^2.1.2",
|
"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",
|
||||||
"localstorage-slim": "^2.5.0",
|
"localstorage-slim": "^2.5.0",
|
||||||
@@ -49,6 +50,7 @@
|
|||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.13",
|
||||||
"register-service-worker": "^1.7.2",
|
"register-service-worker": "^1.7.2",
|
||||||
"three": "^0.156.1",
|
"three": "^0.156.1",
|
||||||
|
"util": "^0.12.5",
|
||||||
"vue": "^3.3.4",
|
"vue": "^3.3.4",
|
||||||
"vue-axios": "^3.5.2",
|
"vue-axios": "^3.5.2",
|
||||||
"vue-facing-decorator": "^3.0.2",
|
"vue-facing-decorator": "^3.0.2",
|
||||||
|
|||||||
@@ -1,61 +1,39 @@
|
|||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
- remove hard-coded anomalistlabs.com
|
- 08 notifications :
|
||||||
|
- get it to work on Android - background data in apps
|
||||||
|
- get it to work on iOS
|
||||||
|
- make the app behave correctly when App Notifications are turned off
|
||||||
|
- write troubleshooting docs for notifications
|
||||||
|
- hide the "App Notifications" toggle when they switch notifications
|
||||||
|
- prompt user to install on their home screen https://developer.mozilla.org/en-US/docs/Web/API/Navigator/getInstalledRelatedApps
|
||||||
|
- 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
|
||||||
|
- add windows & mac help at OS & browser level
|
||||||
|
|
||||||
- don't show "Give" & "Offer" on project screen if they don't have an identifier
|
- back-and-forth on discovery & project pages led to "You need an identity to load your projects." error on product page when I had an identity
|
||||||
- allow some gives even if they aren't registered
|
- fix the projects on /discover to show the issuer (currently all "Someone Anonymous")
|
||||||
|
|
||||||
- in endorser-push-server - mount folder for persistent sqlite DB outside of container
|
- .3 bug - make or edit a project, choose "Include location", and see the map display shows on top of the bottom icons assignee-group:ui
|
||||||
- extract private_key_hex in webpush.py
|
- Got error adding on Firefox user #0 as contact for themselves
|
||||||
- 40 notifications :
|
|
||||||
- push, where we trigger a ServiceWorker(?) in the app to reach out and check for new data assignee:matthew
|
|
||||||
|
|
||||||
- .2 change the "claims" verbiage in feeds (eg. safari-notifications.js)
|
- .5 If notifications are not enabled, add message to front page with link/button to enable
|
||||||
- .5 allow to manage their notifications even without an identity
|
|
||||||
- 01 Ensure each action sent to the server has a confirmation - eg registration (ie a toast something that dismisses after 5-10s)
|
|
||||||
- .3 fix the Project-location-selection map display to not show on top of bottom icons (and any other UI tweaks on the map flow) assignee-group:ui
|
|
||||||
|
|
||||||
- .5 Add infinite scroll to gifts on the home page
|
- 01 server - show all claim details when issued by the issuer
|
||||||
- .5 bug - search for "Safari" does not find the project, but if already on the "Anywhere" tab it shows all
|
- enhance help page instructions for debugging
|
||||||
- .2 figure out why endorser-mobile search doesn't find recently created PlanAction
|
- add way to test quickly a push notification
|
||||||
- .1 when creating a plan, select location and then make sure you can deselect on Android
|
- help instructions for PWA install problems (secret failed, must reinstall)
|
||||||
- .5 fix where user 0 sees no txns from user 1 on contacts page but sees them on list page
|
- look at other examples for better UI friend.tech
|
||||||
- .1 remove the logic to exclude beforeId in list of plans after server has commit 26b25af605e715600d4f12b6416ed9fd7142d164 assignee:trent
|
|
||||||
- .2 in SeedBackupView, don't load the mnemonic and keep it in memory; only load it when they click "show"
|
|
||||||
- fix cert generation (since it didn't happen automatically for Nov 30)
|
|
||||||
|
|
||||||
- Discuss whether the remaining tasks are worthwhile before MVP release.
|
- show VC details... somehow:
|
||||||
|
- 01 show my VCs - most interesting, or via search
|
||||||
- .1 Make give description text box into something that expands as they type?
|
- 01 allow download of each VC (& confirmations, to show that they actually own their data)
|
||||||
- 04 allow user to download claims, mine + ones I can see about me from others
|
- 04 allow user to download VCs, mine + ones I can see about me from others
|
||||||
- .5 customize favicon assignee-group:ui
|
- add VC confirmation?
|
||||||
- .2 Show a warning if both giver and recipient are the same (but still allow?)
|
|
||||||
- 01 Would it look better to shrink the buttons on many pages so they don't expand to the width of the screen? assignee-group:ui
|
|
||||||
- .5 Display a more appealing confirmation on the map when erasing the marker
|
|
||||||
- .5 make a VC details page, or link to endorser.ch
|
|
||||||
- .1 Add units or different icon to the coins (to distinguish $, BTC, hours, etc)
|
|
||||||
- .5 include the hash of the latest commit on help page next to version (maybe Trent's git-hash branch)
|
|
||||||
- .5 remove references to localStorage for projectId (now that it's pulling from the path)
|
|
||||||
- bug (that is hard to reproduce) - on the second 'give' recorded on prod it showed me as the agent
|
|
||||||
- make identicons for contacts into more-memorable faces (and maybe change project identicons, too)
|
|
||||||
- allow download of each VC (to show that they can actually own their data)
|
|
||||||
|
|
||||||
- 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)
|
|
||||||
|
|
||||||
- Release Minimum Viable Product :
|
- Release Minimum Viable Product :
|
||||||
- generate new webpush.db entries, data/webpush.db private_key_hex & subscription_info & vapid_claims email
|
|
||||||
- .5 deploy endorser.ch server above Dec 1 (to get plan searches by names as well as descriptions)
|
- .5 deploy endorser.ch server above Dec 1 (to get plan searches by names as well as descriptions)
|
||||||
- 08 thorough testing for errors & edge cases
|
- 08 thorough testing for errors & edge cases
|
||||||
- 01 ensure ability to recover server remotely, and add redundant access
|
- 01 ensure ability to recover server remotely, and add redundant access
|
||||||
@@ -65,10 +43,44 @@ tasks:
|
|||||||
- Deploy to a server.
|
- Deploy to a server.
|
||||||
- Ensure public server has limits that work for group adoption.
|
- Ensure public server has limits that work for group adoption.
|
||||||
- Test PWA features on Android and iOS.
|
- Test PWA features on Android and iOS.
|
||||||
|
- Other features - donation vs give, show offers, show give & outstanding totals, show network view, restrict registration, connect to contacts
|
||||||
blocks: ref:https://raw.githubusercontent.com/trentlarson/lives-of-gifts/master/project.yaml#kickstarter%20for%20time
|
blocks: ref:https://raw.githubusercontent.com/trentlarson/lives-of-gifts/master/project.yaml#kickstarter%20for%20time
|
||||||
|
|
||||||
|
- 01 send visibility signal as a VC and store it
|
||||||
|
- remove 'rowid' references (that are sqlite-specific)
|
||||||
|
- make identicons for contacts into more-memorable faces (and maybe change project identicons, too)
|
||||||
|
- 01 make the prod build copy the sw_scripts
|
||||||
|
- .5 Add start date to project
|
||||||
|
- .3 check that Android shows "back" buttons on screens without bottom tray
|
||||||
|
- .1 Make give description text box into something that expands as they type?
|
||||||
|
- .5 customize favicon assignee-group:ui
|
||||||
|
- .2 Show a warning if both giver and recipient are the same (but still allow?)
|
||||||
|
- 01 Would it look better to shrink the buttons on many pages so they don't expand to the width of the screen? assignee-group:ui
|
||||||
|
- .5 Display a more appealing confirmation on the map when erasing the marker
|
||||||
|
- .5 include the hash of the latest commit on help page next to version (maybe Trent's git-hash branch)
|
||||||
|
- .5 remove references to localStorage for projectId (now that it's pulling from the path)
|
||||||
|
- bug (that is hard to reproduce) - on the second 'give' recorded on prod it showed me as the agent
|
||||||
|
- 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)
|
||||||
|
|
||||||
|
- 04 fix lack of initial notification in Firefox (on MacOS, maybe others)
|
||||||
|
|
||||||
|
- 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 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 on DiscoverView, switch to a filter UI (eg. just from friend
|
||||||
|
- .5 don't show "Offer" on project screen if they aren't registered
|
||||||
|
|
||||||
- 24 Move to Vite
|
- 24 Move to Vite
|
||||||
- 32 accept images for projects
|
- 32 accept images for projects
|
||||||
@@ -95,6 +107,8 @@ tasks:
|
|||||||
- automated tests, eg. cypress
|
- automated tests, eg. cypress
|
||||||
|
|
||||||
- Notifications (wake on the phone, push notifications)
|
- Notifications (wake on the phone, push notifications)
|
||||||
|
- pull instead of push, maybe via scheduled runs
|
||||||
|
- have a notification pop-up on Mac screen
|
||||||
|
|
||||||
- Connect with phone contacts
|
- Connect with phone contacts
|
||||||
|
|
||||||
@@ -107,12 +121,11 @@ tasks:
|
|||||||
|
|
||||||
- Do we want split first name & last name?
|
- Do we want split first name & last name?
|
||||||
|
|
||||||
- 40 notifications v+ :
|
|
||||||
- pull, w/ scheduled runs
|
|
||||||
|
|
||||||
- 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.
|
- 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.
|
||||||
- 16 From the home screen, make the quick action even easier.
|
- 16 From the home screen, make the quick action even easier.
|
||||||
|
|
||||||
|
- 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
|
||||||
|
|
||||||
log:
|
log:
|
||||||
- videos for multiple identities https://youtu.be/p8L87AeD76w and for adding time to contacts https://youtu.be/7Yylczevp10 done:2023-03-29
|
- 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
|
- project lists, contact totals & actions, multiple identifiers, stats-world, activity feed, rename of this project file (use "--follow --") milestone:2 done:2023-06-27
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 3.2 KiB |
167
src/App.vue
167
src/App.vue
@@ -169,20 +169,12 @@
|
|||||||
>
|
>
|
||||||
Turn on Notifications
|
Turn on Notifications
|
||||||
</button>
|
</button>
|
||||||
<div class="grid grid-cols-2 gap-2">
|
<button
|
||||||
<button
|
@click="close(notification.id)"
|
||||||
@click="maybeLater(notification.id)"
|
class="block w-full text-center text-md font-bold uppercase bg-slate-600 text-white px-2 py-2 rounded-md"
|
||||||
class="block w-full text-center text-md font-bold uppercase bg-slate-600 text-white px-2 py-2 rounded-md"
|
>
|
||||||
>
|
Maybe Later
|
||||||
Maybe Later
|
</button>
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
@click="never(notification.id)"
|
|
||||||
class="block w-full text-center text-md font-bold uppercase bg-rose-600 text-white px-2 py-2 rounded-md"
|
|
||||||
>
|
|
||||||
Never
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -238,6 +230,10 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
|
@click="
|
||||||
|
close(notification.id);
|
||||||
|
turnOffNotifications();
|
||||||
|
"
|
||||||
class="block w-full text-center text-md font-bold uppercase bg-rose-600 text-white px-2 py-2 rounded-md mb-2"
|
class="block w-full text-center text-md font-bold uppercase bg-rose-600 text-white px-2 py-2 rounded-md mb-2"
|
||||||
>
|
>
|
||||||
Turn Off Notifications
|
Turn Off Notifications
|
||||||
@@ -261,7 +257,7 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Vue, Component } from "vue-facing-decorator";
|
import { Vue, Component } from "vue-facing-decorator";
|
||||||
import axios, { AxiosError } from "axios";
|
import axios from "axios";
|
||||||
interface ServiceWorkerMessage {
|
interface ServiceWorkerMessage {
|
||||||
type: string;
|
type: string;
|
||||||
data: string;
|
data: string;
|
||||||
@@ -285,22 +281,71 @@ interface VapidResponse {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
import { AppString } from "@/constants/app";
|
||||||
|
import { db } from "@/db/index";
|
||||||
|
import { MASTER_SETTINGS_KEY } from "@/db/tables/settings";
|
||||||
|
|
||||||
|
interface Notification {
|
||||||
|
group: string;
|
||||||
|
type: string;
|
||||||
|
title: string;
|
||||||
|
text: string;
|
||||||
|
}
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
export default class App extends Vue {
|
export default class App extends Vue {
|
||||||
|
$notify!: (notification: Notification, timeout?: number) => void;
|
||||||
|
|
||||||
b64 = "";
|
b64 = "";
|
||||||
mounted() {
|
|
||||||
axios
|
async mounted() {
|
||||||
.get("https://timesafari-pwa.anomalistlabs.com/web-push/vapid")
|
try {
|
||||||
.then((response: VapidResponse) => {
|
await db.open();
|
||||||
this.b64 = response.data.vapidKey;
|
const settings = await db.settings.get(MASTER_SETTINGS_KEY);
|
||||||
console.log(this.b64);
|
let pushUrl: string = AppString.DEFAULT_PUSH_SERVER;
|
||||||
navigator.serviceWorker.addEventListener("controllerchange", () => {
|
if (settings?.webPushServer) {
|
||||||
console.log("New service worker is now controlling the page");
|
pushUrl = settings.webPushServer;
|
||||||
|
}
|
||||||
|
|
||||||
|
await axios
|
||||||
|
.get(pushUrl + "/web-push/vapid")
|
||||||
|
.then((response: VapidResponse) => {
|
||||||
|
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) {
|
||||||
.catch((error: AxiosError) => {
|
this.$notify(
|
||||||
console.error("API error", error);
|
{
|
||||||
});
|
group: "alert",
|
||||||
|
type: "danger",
|
||||||
|
title: "Error Setting Notifications",
|
||||||
|
text: "Could not set notifications.",
|
||||||
|
},
|
||||||
|
-1,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
if (window.location.host.startsWith("localhost")) {
|
||||||
|
console.log(
|
||||||
|
"Ignoring this error getting VAPID for local development:",
|
||||||
|
error,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
console.error("Got an error initializing notifications:", error);
|
||||||
|
this.$notify(
|
||||||
|
{
|
||||||
|
group: "alert",
|
||||||
|
type: "danger",
|
||||||
|
title: "Error Setting Notifications",
|
||||||
|
text: "Got an error setting notifications.",
|
||||||
|
},
|
||||||
|
-1,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private sendMessageToServiceWorker(
|
private sendMessageToServiceWorker(
|
||||||
@@ -368,7 +413,10 @@ export default class App extends Vue {
|
|||||||
private requestNotificationPermission(): Promise<NotificationPermission> {
|
private requestNotificationPermission(): Promise<NotificationPermission> {
|
||||||
return Notification.requestPermission().then((permission) => {
|
return Notification.requestPermission().then((permission) => {
|
||||||
if (permission !== "granted") {
|
if (permission !== "granted") {
|
||||||
alert("We need notification permission to provide certain features.");
|
alert(
|
||||||
|
"Allow this app permission to make notifications for personal reminders." +
|
||||||
|
" You can adjust them at any time in your settings.",
|
||||||
|
);
|
||||||
throw new Error("We weren't granted permission.");
|
throw new Error("We weren't granted permission.");
|
||||||
}
|
}
|
||||||
return permission;
|
return permission;
|
||||||
@@ -404,16 +452,22 @@ export default class App extends Vue {
|
|||||||
"Subscription or server communication failed:",
|
"Subscription or server communication failed:",
|
||||||
error,
|
error,
|
||||||
);
|
);
|
||||||
alert( "Subscription or server communication failed. Try again in a while." );
|
alert(
|
||||||
|
"Subscription or server communication failed. Try again in a while.",
|
||||||
|
);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error("An error occurred:", error);
|
console.error(
|
||||||
alert( "Some error occurred." + error );
|
"An error occurred setting notification permissions:",
|
||||||
|
error,
|
||||||
|
);
|
||||||
|
alert(
|
||||||
|
"Some error occurred setting notification permissions. See logs.",
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private urlBase64ToUint8Array(base64String: string): Uint8Array {
|
private urlBase64ToUint8Array(base64String: string): Uint8Array {
|
||||||
const padding = "=".repeat((4 - (base64String.length % 4)) % 4);
|
const padding = "=".repeat((4 - (base64String.length % 4)) % 4);
|
||||||
const base64 = (base64String + padding)
|
const base64 = (base64String + padding)
|
||||||
@@ -477,7 +531,7 @@ export default class App extends Vue {
|
|||||||
private sendSubscriptionToServer(
|
private sendSubscriptionToServer(
|
||||||
subscription: PushSubscription,
|
subscription: PushSubscription,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
console.log(subscription);
|
console.log("About to send subscription", subscription);
|
||||||
return fetch("/web-push/subscribe", {
|
return fetch("/web-push/subscribe", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
@@ -492,12 +546,49 @@ export default class App extends Vue {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
never(ID: string) {
|
async turnOffNotifications() {
|
||||||
alert(ID);
|
let subscription;
|
||||||
}
|
const pushProviderSuccess = await navigator.serviceWorker.ready
|
||||||
|
.then((registration) => {
|
||||||
|
return registration.pushManager.getSubscription();
|
||||||
|
})
|
||||||
|
.then((subscript) => {
|
||||||
|
subscription = subscript;
|
||||||
|
if (subscription) {
|
||||||
|
return subscription.unsubscribe();
|
||||||
|
} else {
|
||||||
|
console.log("Subscription object is not available.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.log("Push provider server communication failed:", error);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
maybeLater(ID: string) {
|
const pushServerSuccess = await fetch("/web-push/unsubscribe", {
|
||||||
alert(ID);
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
body: JSON.stringify(subscription),
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
return response.ok;
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.log("Push server communication failed:", error);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
alert(
|
||||||
|
"Notifications are off. Push provider unsubscribe " +
|
||||||
|
(pushProviderSuccess ? "succeeded" : "failed") +
|
||||||
|
(pushProviderSuccess === pushServerSuccess ? " and" : " but") +
|
||||||
|
" push server unsubscribe " +
|
||||||
|
(pushServerSuccess ? "succeeded" : "failed") +
|
||||||
|
".",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 85 KiB |
@@ -13,18 +13,21 @@
|
|||||||
<div class="flex flex-row">
|
<div class="flex flex-row">
|
||||||
<span
|
<span
|
||||||
class="rounded-l border border-r-0 border-slate-400 bg-slate-200 w-1/3 text-center px-2 py-2"
|
class="rounded-l border border-r-0 border-slate-400 bg-slate-200 w-1/3 text-center px-2 py-2"
|
||||||
>Hours</span
|
@click="changeUnitCode()"
|
||||||
>
|
>
|
||||||
|
{{ UNIT_SHORT[unitCode] }}
|
||||||
|
</span>
|
||||||
<div
|
<div
|
||||||
class="border border-r-0 border-slate-400 bg-slate-200 px-4 py-2"
|
class="border border-r-0 border-slate-400 bg-slate-200 px-4 py-2"
|
||||||
@click="decrement()"
|
@click="decrement()"
|
||||||
|
v-if="amountInput !== '0'"
|
||||||
>
|
>
|
||||||
<fa icon="chevron-left" />
|
<fa icon="chevron-left" />
|
||||||
</div>
|
</div>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
class="w-full border border-r-0 border-slate-400 px-2 py-2 text-center"
|
class="w-full border border-r-0 border-slate-400 px-2 py-2 text-center"
|
||||||
v-model="hours"
|
v-model="amountInput"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
class="rounded-r border border-slate-400 bg-slate-200 px-4 py-2"
|
class="rounded-r border border-slate-400 bg-slate-200 px-4 py-2"
|
||||||
@@ -81,12 +84,31 @@ export default class GiftedDialog extends Vue {
|
|||||||
activeDid = "";
|
activeDid = "";
|
||||||
apiServer = "";
|
apiServer = "";
|
||||||
|
|
||||||
|
amountInput = "0";
|
||||||
giver?: GiverInputInfo; // undefined means no identified giver agent
|
giver?: GiverInputInfo; // undefined means no identified giver agent
|
||||||
description = "";
|
description = "";
|
||||||
givenToUser = false;
|
givenToUser = false;
|
||||||
hours = "0";
|
unitCode = "HUR";
|
||||||
visible = false;
|
visible = false;
|
||||||
|
|
||||||
|
/* eslint-disable prettier/prettier */
|
||||||
|
UNIT_SHORT: Record<string, string> = {
|
||||||
|
"BTC": "BTC",
|
||||||
|
"ETH": "ETH",
|
||||||
|
"HUR": "Hours",
|
||||||
|
"USD": "US $",
|
||||||
|
};
|
||||||
|
/* eslint-enable prettier/prettier */
|
||||||
|
|
||||||
|
/* eslint-disable prettier/prettier */
|
||||||
|
UNIT_LONG: Record<string, string> = {
|
||||||
|
"BTC": "BTC",
|
||||||
|
"ETH": "ETH",
|
||||||
|
"HUR": "hours",
|
||||||
|
"USD": "dollars",
|
||||||
|
};
|
||||||
|
/* eslint-enable prettier/prettier */
|
||||||
|
|
||||||
async created() {
|
async created() {
|
||||||
try {
|
try {
|
||||||
await db.open();
|
await db.open();
|
||||||
@@ -115,7 +137,7 @@ export default class GiftedDialog extends Vue {
|
|||||||
this.giver = giver;
|
this.giver = giver;
|
||||||
// if we show "given to user" selection, default checkbox to true
|
// if we show "given to user" selection, default checkbox to true
|
||||||
this.givenToUser = this.showGivenToUser;
|
this.givenToUser = this.showGivenToUser;
|
||||||
this.hours = "0";
|
this.amountInput = "0";
|
||||||
|
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
}
|
}
|
||||||
@@ -125,12 +147,21 @@ export default class GiftedDialog extends Vue {
|
|||||||
this.visible = false;
|
this.visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
changeUnitCode() {
|
||||||
|
const units = Object.keys(this.UNIT_SHORT);
|
||||||
|
const index = units.indexOf(this.unitCode);
|
||||||
|
this.unitCode = units[(index + 1) % units.length];
|
||||||
|
}
|
||||||
|
|
||||||
increment() {
|
increment() {
|
||||||
this.hours = `${(parseFloat(this.hours) || 0) + 1}`;
|
this.amountInput = `${(parseFloat(this.amountInput) || 0) + 1}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
decrement() {
|
decrement() {
|
||||||
this.hours = `${Math.max(0, (parseFloat(this.hours) || 1) - 1)}`;
|
this.amountInput = `${Math.max(
|
||||||
|
0,
|
||||||
|
(parseFloat(this.amountInput) || 1) - 1,
|
||||||
|
)}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
cancel() {
|
cancel() {
|
||||||
@@ -142,7 +173,7 @@ export default class GiftedDialog extends Vue {
|
|||||||
this.description = "";
|
this.description = "";
|
||||||
this.giver = undefined;
|
this.giver = undefined;
|
||||||
this.givenToUser = this.showGivenToUser;
|
this.givenToUser = this.showGivenToUser;
|
||||||
this.hours = "0";
|
this.amountInput = "0";
|
||||||
}
|
}
|
||||||
|
|
||||||
async confirm() {
|
async confirm() {
|
||||||
@@ -160,7 +191,8 @@ export default class GiftedDialog extends Vue {
|
|||||||
await this.recordGive(
|
await this.recordGive(
|
||||||
this.giver?.did as string | undefined,
|
this.giver?.did as string | undefined,
|
||||||
this.description,
|
this.description,
|
||||||
parseFloat(this.hours),
|
parseFloat(this.amountInput),
|
||||||
|
this.unitCode,
|
||||||
).then(() => {
|
).then(() => {
|
||||||
this.eraseValues();
|
this.eraseValues();
|
||||||
});
|
});
|
||||||
@@ -186,12 +218,13 @@ export default class GiftedDialog extends Vue {
|
|||||||
*
|
*
|
||||||
* @param giverDid may be null
|
* @param giverDid may be null
|
||||||
* @param description may be an empty string
|
* @param description may be an empty string
|
||||||
* @param hours may be 0
|
* @param amountInput may be 0
|
||||||
*/
|
*/
|
||||||
public async recordGive(
|
public async recordGive(
|
||||||
giverDid?: string,
|
giverDid?: string,
|
||||||
description?: string,
|
description?: string,
|
||||||
hours?: number,
|
amountInput?: number,
|
||||||
|
unitCode?: string,
|
||||||
) {
|
) {
|
||||||
if (!this.activeDid) {
|
if (!this.activeDid) {
|
||||||
this.$notify(
|
this.$notify(
|
||||||
@@ -206,13 +239,15 @@ export default class GiftedDialog extends Vue {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!description && !hours) {
|
if (!description && !amountInput) {
|
||||||
this.$notify(
|
this.$notify(
|
||||||
{
|
{
|
||||||
group: "alert",
|
group: "alert",
|
||||||
type: "danger",
|
type: "danger",
|
||||||
title: "Error",
|
title: "Error",
|
||||||
text: "You must enter a description or some number of hours.",
|
text: `You must enter a description or some number of ${
|
||||||
|
this.UNIT_LONG[this.unitCode]
|
||||||
|
}.`,
|
||||||
},
|
},
|
||||||
-1,
|
-1,
|
||||||
);
|
);
|
||||||
@@ -228,7 +263,8 @@ export default class GiftedDialog extends Vue {
|
|||||||
giverDid,
|
giverDid,
|
||||||
this.givenToUser ? this.activeDid : undefined,
|
this.givenToUser ? this.activeDid : undefined,
|
||||||
description,
|
description,
|
||||||
hours,
|
amountInput,
|
||||||
|
unitCode,
|
||||||
this.projectId,
|
this.projectId,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
58
src/components/TopMessage.vue
Normal file
58
src/components/TopMessage.vue
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<template>
|
||||||
|
<div class="text-center text-red-500">{{ message }}</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { Component, Vue, Prop } from "vue-facing-decorator";
|
||||||
|
import { db } from "@/db/index";
|
||||||
|
import { MASTER_SETTINGS_KEY } from "@/db/tables/settings";
|
||||||
|
import { AppString } from "@/constants/app";
|
||||||
|
|
||||||
|
interface Notification {
|
||||||
|
group: string;
|
||||||
|
type: string;
|
||||||
|
title: string;
|
||||||
|
text: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component
|
||||||
|
export default class TopMessage extends Vue {
|
||||||
|
$notify!: (notification: Notification, timeout?: number) => void;
|
||||||
|
|
||||||
|
@Prop selected = "";
|
||||||
|
|
||||||
|
message = "";
|
||||||
|
|
||||||
|
async mounted() {
|
||||||
|
try {
|
||||||
|
await db.open();
|
||||||
|
|
||||||
|
const settings = await db.settings.get(MASTER_SETTINGS_KEY);
|
||||||
|
if (
|
||||||
|
settings?.warnIfTestServer &&
|
||||||
|
window.location.hostname !== AppString.PROD_TIME_SAFARI_SERVER_HOST
|
||||||
|
) {
|
||||||
|
const didPrefix = settings.activeDid?.slice(11, 14);
|
||||||
|
this.message = "You're linked to a test server, user " + didPrefix;
|
||||||
|
} else if (
|
||||||
|
settings?.warnIfProdServer &&
|
||||||
|
window.location.hostname === AppString.PROD_TIME_SAFARI_SERVER_HOST
|
||||||
|
) {
|
||||||
|
const didPrefix = settings.activeDid?.slice(1, 14);
|
||||||
|
this.message =
|
||||||
|
"You're linked to the production server, user " + didPrefix;
|
||||||
|
}
|
||||||
|
} catch (err: unknown) {
|
||||||
|
this.$notify(
|
||||||
|
{
|
||||||
|
group: "alert",
|
||||||
|
type: "danger",
|
||||||
|
title: "Error Detecting Server",
|
||||||
|
text: JSON.stringify(err),
|
||||||
|
},
|
||||||
|
10000,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -4,20 +4,31 @@
|
|||||||
* See also ../libs/veramo/setup.ts
|
* See also ../libs/veramo/setup.ts
|
||||||
*/
|
*/
|
||||||
export enum AppString {
|
export enum AppString {
|
||||||
APP_NAME = "TimeSafari",
|
APP_NAME = "Time Safari",
|
||||||
|
|
||||||
|
PROD_TIME_SAFARI_SERVER_HOST = "timesafari.app",
|
||||||
|
PROD_TIME_SAFARI_SERVER = "https://" + PROD_TIME_SAFARI_SERVER_HOST,
|
||||||
|
|
||||||
PROD_ENDORSER_API_SERVER = "https://api.endorser.ch",
|
PROD_ENDORSER_API_SERVER = "https://api.endorser.ch",
|
||||||
TEST_ENDORSER_API_SERVER = "https://test-api.endorser.ch",
|
TEST_ENDORSER_API_SERVER = "https://test-api.endorser.ch",
|
||||||
LOCAL_ENDORSER_API_SERVER = "http://localhost:3000",
|
LOCAL_ENDORSER_API_SERVER = "http://localhost:3000",
|
||||||
|
|
||||||
DEFAULT_ENDORSER_API_SERVER = TEST_ENDORSER_API_SERVER,
|
DEFAULT_ENDORSER_API_SERVER = TEST_ENDORSER_API_SERVER,
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
|
||||||
|
PROD_PUSH_SERVER = "https://timesafari.app",
|
||||||
|
TEST1_PUSH_SERVER = "https://test.timesafari.app",
|
||||||
|
TEST2_PUSH_SERVER = "https://timesafari-pwa.anomalistlabs.com",
|
||||||
|
|
||||||
|
DEFAULT_PUSH_SERVER = TEST1_PUSH_SERVER,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* See notiwind package
|
* The possible values for "group" and "type" are in App.vue.
|
||||||
|
* From the notiwind package
|
||||||
*/
|
*/
|
||||||
export interface NotificationIface {
|
export interface NotificationIface {
|
||||||
group: string;
|
group: string; // "alert" | "modal"
|
||||||
type: string; // "toast" | "info" | "success" | "warning" | "danger"
|
type: string; // "toast" | "info" | "success" | "warning" | "danger"
|
||||||
title: string;
|
title: string;
|
||||||
text: string;
|
text: string;
|
||||||
|
|||||||
@@ -12,17 +12,19 @@ export type BoundingBox = {
|
|||||||
* Settings type encompasses user-specific configuration details.
|
* Settings type encompasses user-specific configuration details.
|
||||||
*/
|
*/
|
||||||
export type Settings = {
|
export type Settings = {
|
||||||
id: number; // Only one entry using MASTER_SETTINGS_KEY
|
id: number; // Only one entry, keyed with MASTER_SETTINGS_KEY
|
||||||
|
|
||||||
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
|
firstName?: string; // User's first name
|
||||||
lastName?: string; // User's last name
|
|
||||||
lastViewedClaimId?: string; // Last viewed claim ID
|
|
||||||
lastNotifiedClaimId?: string; // Last notified claim ID
|
|
||||||
isRegistered?: boolean;
|
isRegistered?: boolean;
|
||||||
|
lastName?: string; // deprecated - put all names in firstName
|
||||||
|
lastNotifiedClaimId?: string; // Last notified claim ID
|
||||||
|
lastViewedClaimId?: string; // Last viewed claim ID
|
||||||
|
reminderTime?: number; // Time in milliseconds since UNIX epoch for reminders
|
||||||
|
reminderOn?: boolean; // Toggle to enable or disable reminders
|
||||||
|
|
||||||
// Array of named search boxes defined by bounding boxes
|
// Array of named search boxes defined by bounding boxes
|
||||||
|
|
||||||
searchBoxes?: Array<{
|
searchBoxes?: Array<{
|
||||||
name: string;
|
name: string;
|
||||||
bbox: BoundingBox;
|
bbox: BoundingBox;
|
||||||
@@ -30,8 +32,9 @@ export type Settings = {
|
|||||||
|
|
||||||
showContactGivesInline?: boolean; // Display contact inline or not
|
showContactGivesInline?: boolean; // Display contact inline or not
|
||||||
vapid?: string; // VAPID (Voluntary Application Server Identification) field for web push
|
vapid?: string; // VAPID (Voluntary Application Server Identification) field for web push
|
||||||
reminderTime?: number; // Time in milliseconds since UNIX epoch for reminders
|
warnIfProdServer?: boolean; // Warn if using a production server
|
||||||
reminderOn?: boolean; // Toggle to enable or disable reminders
|
warnIfTestServer?: boolean; // Warn if using a testing server
|
||||||
|
webPushServer?: string; // Web Push server URL
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ export const SERVICE_ID = "endorser.ch";
|
|||||||
export const CONTACT_URL_PREFIX = "https://endorser.ch";
|
export const CONTACT_URL_PREFIX = "https://endorser.ch";
|
||||||
// the suffix for the contact URL
|
// the suffix for the contact URL
|
||||||
export const ENDORSER_JWT_URL_LOCATION = "/contact?jwt=";
|
export const ENDORSER_JWT_URL_LOCATION = "/contact?jwt=";
|
||||||
|
// the prefix for handle IDs, the permanent ID for claims on Endorser
|
||||||
|
export const ENDORSER_CH_HANDLE_PREFIX = "https://endorser.ch/entity/";
|
||||||
|
|
||||||
export interface AgreeVerifiableCredential {
|
export interface AgreeVerifiableCredential {
|
||||||
"@context": string;
|
"@context": string;
|
||||||
@@ -38,14 +40,24 @@ export interface ClaimResult {
|
|||||||
error: { code: string; message: string };
|
error: { code: string; message: string };
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GenericClaim {
|
export interface GenericVerifiableCredential {
|
||||||
"@context": string;
|
"@context": string;
|
||||||
"@type": string;
|
"@type": string;
|
||||||
issuedAt: string;
|
}
|
||||||
// "any" because arbitrary objects can be subject of agreement
|
|
||||||
|
export interface GenericServerRecord extends GenericVerifiableCredential {
|
||||||
|
handleId?: string;
|
||||||
|
id?: string;
|
||||||
|
issuedAt?: string;
|
||||||
|
issuer?: string;
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
claim: Record<any, any>;
|
claim: Record<any, any>;
|
||||||
}
|
}
|
||||||
|
export const BLANK_GENERIC_SERVER_RECORD: GenericServerRecord = {
|
||||||
|
"@context": SCHEMA_ORG_CONTEXT,
|
||||||
|
"@type": "",
|
||||||
|
claim: {},
|
||||||
|
};
|
||||||
|
|
||||||
export interface GiveServerRecord {
|
export interface GiveServerRecord {
|
||||||
agentDid: string;
|
agentDid: string;
|
||||||
@@ -69,6 +81,8 @@ export interface OfferServerRecord {
|
|||||||
validThrough: string;
|
validThrough: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Note that previous VCs may have additional fields.
|
||||||
|
// https://endorser.ch/doc/html/transactions.html#id4
|
||||||
export interface GiveVerifiableCredential {
|
export interface GiveVerifiableCredential {
|
||||||
"@context"?: string; // optional when embedded, eg. in an Agree
|
"@context"?: string; // optional when embedded, eg. in an Agree
|
||||||
"@type": "GiveAction";
|
"@type": "GiveAction";
|
||||||
@@ -80,6 +94,8 @@ export interface GiveVerifiableCredential {
|
|||||||
recipient?: { identifier: string };
|
recipient?: { identifier: string };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Note that previous VCs may have additional fields.
|
||||||
|
// https://endorser.ch/doc/html/transactions.html#id8
|
||||||
export interface OfferVerifiableCredential {
|
export interface OfferVerifiableCredential {
|
||||||
"@context"?: string; // optional when embedded, eg. in an Agree
|
"@context"?: string; // optional when embedded, eg. in an Agree
|
||||||
"@type": "Offer";
|
"@type": "Offer";
|
||||||
@@ -93,6 +109,8 @@ export interface OfferVerifiableCredential {
|
|||||||
validThrough?: string;
|
validThrough?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Note that previous VCs may have additional fields.
|
||||||
|
// https://endorser.ch/doc/html/transactions.html#id7
|
||||||
export interface PlanVerifiableCredential {
|
export interface PlanVerifiableCredential {
|
||||||
"@context": "https://schema.org";
|
"@context": "https://schema.org";
|
||||||
"@type": "PlanAction";
|
"@type": "PlanAction";
|
||||||
@@ -137,6 +155,104 @@ export function isHiddenDid(did: string) {
|
|||||||
return did === HIDDEN_DID;
|
return did === HIDDEN_DID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true for any nested string where func(input) === true
|
||||||
|
*
|
||||||
|
* Similar logic is found in endorser-mobile.
|
||||||
|
*/
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
function testRecursivelyOnString(func: (arg0: any) => boolean, input: any) {
|
||||||
|
if (Object.prototype.toString.call(input) === "[object String]") {
|
||||||
|
return func(input);
|
||||||
|
} else if (input instanceof Object) {
|
||||||
|
if (!Array.isArray(input)) {
|
||||||
|
// it's an object
|
||||||
|
for (const key in input) {
|
||||||
|
if (testRecursivelyOnString(func, input[key])) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// it's an array
|
||||||
|
for (const value of input) {
|
||||||
|
if (testRecursivelyOnString(func, value)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
export function containsHiddenDid(obj: any) {
|
||||||
|
return testRecursivelyOnString(isHiddenDid, obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function stripEndorserPrefix(claimId: string) {
|
||||||
|
if (claimId && claimId.startsWith(ENDORSER_CH_HANDLE_PREFIX)) {
|
||||||
|
return claimId.substring(ENDORSER_CH_HANDLE_PREFIX.length);
|
||||||
|
} else {
|
||||||
|
return claimId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// similar logic is found in endorser-mobile
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
export function removeSchemaContext(obj: any) {
|
||||||
|
return obj["@context"] === SCHEMA_ORG_CONTEXT
|
||||||
|
? R.omit(["@context"], obj)
|
||||||
|
: obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
// similar logic is found in endorser-mobile
|
||||||
|
export function addLastClaimOrHandleAsIdIfMissing(
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
obj: any,
|
||||||
|
lastClaimId?: string,
|
||||||
|
handleId?: string,
|
||||||
|
) {
|
||||||
|
if (!obj.identifier && lastClaimId) {
|
||||||
|
const result = R.clone(obj);
|
||||||
|
result.lastClaimId = lastClaimId;
|
||||||
|
return result;
|
||||||
|
} else if (!obj.identifier && handleId) {
|
||||||
|
const result = R.clone(obj);
|
||||||
|
result.identifier = handleId;
|
||||||
|
return result;
|
||||||
|
} else {
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// return clone of object without any nested *VisibleToDids keys
|
||||||
|
// similar logic is found in endorser-mobile
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
export function removeVisibleToDids(input: any): any {
|
||||||
|
if (input instanceof Object) {
|
||||||
|
if (!Array.isArray(input)) {
|
||||||
|
// it's an object
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
const result: Record<string, any> = {};
|
||||||
|
for (const key in input) {
|
||||||
|
if (!key.endsWith("VisibleToDids")) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
result[key] = removeVisibleToDids(R.clone(input[key]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
} else {
|
||||||
|
// it's an array
|
||||||
|
return R.map(removeVisibleToDids, input);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
always returns text, maybe UNNAMED_VISIBLE or UNKNOWN_ENTITY
|
always returns text, maybe UNNAMED_VISIBLE or UNKNOWN_ENTITY
|
||||||
|
|
||||||
@@ -194,6 +310,7 @@ export async function createAndSubmitGive(
|
|||||||
toDid?: string,
|
toDid?: string,
|
||||||
description?: string,
|
description?: string,
|
||||||
hours?: number,
|
hours?: number,
|
||||||
|
unitCode?: string,
|
||||||
fulfillsProjectHandleId?: string,
|
fulfillsProjectHandleId?: string,
|
||||||
): Promise<CreateAndSubmitClaimResult> {
|
): Promise<CreateAndSubmitClaimResult> {
|
||||||
const vcClaim: GiveVerifiableCredential = {
|
const vcClaim: GiveVerifiableCredential = {
|
||||||
@@ -202,13 +319,15 @@ export async function createAndSubmitGive(
|
|||||||
recipient: toDid ? { identifier: toDid } : undefined,
|
recipient: toDid ? { identifier: toDid } : undefined,
|
||||||
agent: fromDid ? { identifier: fromDid } : undefined,
|
agent: fromDid ? { identifier: fromDid } : undefined,
|
||||||
description: description || undefined,
|
description: description || undefined,
|
||||||
object: hours ? { amountOfThisGood: hours, unitCode: "HUR" } : undefined,
|
object: hours
|
||||||
|
? { amountOfThisGood: hours, unitCode: unitCode || "HUR" }
|
||||||
|
: undefined,
|
||||||
fulfills: fulfillsProjectHandleId
|
fulfills: fulfillsProjectHandleId
|
||||||
? { "@type": "PlanAction", identifier: fulfillsProjectHandleId }
|
? { "@type": "PlanAction", identifier: fulfillsProjectHandleId }
|
||||||
: undefined,
|
: undefined,
|
||||||
};
|
};
|
||||||
return createAndSubmitClaim(
|
return createAndSubmitClaim(
|
||||||
vcClaim as GenericClaim,
|
vcClaim as GenericServerRecord,
|
||||||
identity,
|
identity,
|
||||||
apiServer,
|
apiServer,
|
||||||
axios,
|
axios,
|
||||||
@@ -256,7 +375,7 @@ export async function createAndSubmitOffer(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
return createAndSubmitClaim(
|
return createAndSubmitClaim(
|
||||||
vcClaim as GenericClaim,
|
vcClaim as GenericServerRecord,
|
||||||
identity,
|
identity,
|
||||||
apiServer,
|
apiServer,
|
||||||
axios,
|
axios,
|
||||||
@@ -264,7 +383,7 @@ export async function createAndSubmitOffer(
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function createAndSubmitClaim(
|
export async function createAndSubmitClaim(
|
||||||
vcClaim: GenericClaim,
|
vcClaim: GenericVerifiableCredential,
|
||||||
identity: IIdentifier,
|
identity: IIdentifier,
|
||||||
apiServer: string,
|
apiServer: string,
|
||||||
axios: Axios,
|
axios: Axios,
|
||||||
|
|||||||
5
src/libs/util.ts
Normal file
5
src/libs/util.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
// many of these are also found in endorser-mobile utility.ts
|
||||||
|
|
||||||
|
export const isGlobalUri = (uri: string) => {
|
||||||
|
return uri && uri.match(new RegExp(/^[A-Za-z][A-Za-z0-9+.-]+:/));
|
||||||
|
};
|
||||||
10
src/main.ts
10
src/main.ts
@@ -14,6 +14,7 @@ import {
|
|||||||
faArrowLeft,
|
faArrowLeft,
|
||||||
faArrowRight,
|
faArrowRight,
|
||||||
faBan,
|
faBan,
|
||||||
|
faBitcoinSign,
|
||||||
faBurst,
|
faBurst,
|
||||||
faCalendar,
|
faCalendar,
|
||||||
faChevronLeft,
|
faChevronLeft,
|
||||||
@@ -27,6 +28,7 @@ import {
|
|||||||
faCoins,
|
faCoins,
|
||||||
faComment,
|
faComment,
|
||||||
faCopy,
|
faCopy,
|
||||||
|
faDollar,
|
||||||
faEllipsisVertical,
|
faEllipsisVertical,
|
||||||
faEye,
|
faEye,
|
||||||
faEyeSlash,
|
faEyeSlash,
|
||||||
@@ -34,16 +36,19 @@ import {
|
|||||||
faFloppyDisk,
|
faFloppyDisk,
|
||||||
faFolderOpen,
|
faFolderOpen,
|
||||||
faGift,
|
faGift,
|
||||||
|
faGlobe,
|
||||||
faHand,
|
faHand,
|
||||||
faHouseChimney,
|
faHouseChimney,
|
||||||
faLocationDot,
|
faLocationDot,
|
||||||
faLongArrowAltLeft,
|
faLongArrowAltLeft,
|
||||||
faLongArrowAltRight,
|
faLongArrowAltRight,
|
||||||
faMagnifyingGlass,
|
faMagnifyingGlass,
|
||||||
|
faMessage,
|
||||||
faPen,
|
faPen,
|
||||||
faPersonCircleCheck,
|
faPersonCircleCheck,
|
||||||
faPersonCircleQuestion,
|
faPersonCircleQuestion,
|
||||||
faPlus,
|
faPlus,
|
||||||
|
faQuestion,
|
||||||
faQrcode,
|
faQrcode,
|
||||||
faRotate,
|
faRotate,
|
||||||
faShareNodes,
|
faShareNodes,
|
||||||
@@ -61,6 +66,7 @@ library.add(
|
|||||||
faArrowLeft,
|
faArrowLeft,
|
||||||
faArrowRight,
|
faArrowRight,
|
||||||
faBan,
|
faBan,
|
||||||
|
faBitcoinSign,
|
||||||
faBurst,
|
faBurst,
|
||||||
faCalendar,
|
faCalendar,
|
||||||
faChevronLeft,
|
faChevronLeft,
|
||||||
@@ -74,6 +80,7 @@ library.add(
|
|||||||
faCoins,
|
faCoins,
|
||||||
faComment,
|
faComment,
|
||||||
faCopy,
|
faCopy,
|
||||||
|
faDollar,
|
||||||
faEllipsisVertical,
|
faEllipsisVertical,
|
||||||
faEye,
|
faEye,
|
||||||
faEyeSlash,
|
faEyeSlash,
|
||||||
@@ -81,17 +88,20 @@ library.add(
|
|||||||
faFloppyDisk,
|
faFloppyDisk,
|
||||||
faFolderOpen,
|
faFolderOpen,
|
||||||
faGift,
|
faGift,
|
||||||
|
faGlobe,
|
||||||
faHand,
|
faHand,
|
||||||
faHouseChimney,
|
faHouseChimney,
|
||||||
faLocationDot,
|
faLocationDot,
|
||||||
faLongArrowAltLeft,
|
faLongArrowAltLeft,
|
||||||
faLongArrowAltRight,
|
faLongArrowAltRight,
|
||||||
faMagnifyingGlass,
|
faMagnifyingGlass,
|
||||||
|
faMessage,
|
||||||
faPen,
|
faPen,
|
||||||
faPersonCircleCheck,
|
faPersonCircleCheck,
|
||||||
faPersonCircleQuestion,
|
faPersonCircleQuestion,
|
||||||
faPlus,
|
faPlus,
|
||||||
faQrcode,
|
faQrcode,
|
||||||
|
faQuestion,
|
||||||
faRotate,
|
faRotate,
|
||||||
faShareNodes,
|
faShareNodes,
|
||||||
faSpinner,
|
faSpinner,
|
||||||
|
|||||||
@@ -39,7 +39,12 @@ const routes: Array<RouteRecordRaw> = [
|
|||||||
name: "account",
|
name: "account",
|
||||||
component: () =>
|
component: () =>
|
||||||
import(/* webpackChunkName: "account" */ "../views/AccountViewView.vue"),
|
import(/* webpackChunkName: "account" */ "../views/AccountViewView.vue"),
|
||||||
beforeEnter: enterOrStart,
|
},
|
||||||
|
{
|
||||||
|
path: "/claim/:id?",
|
||||||
|
name: "claim",
|
||||||
|
component: () =>
|
||||||
|
import(/* webpackChunkName: "claim" */ "../views/ClaimView.vue"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/confirm-contact",
|
path: "/confirm-contact",
|
||||||
@@ -91,6 +96,14 @@ const routes: Array<RouteRecordRaw> = [
|
|||||||
component: () =>
|
component: () =>
|
||||||
import(/* webpackChunkName: "help" */ "../views/HelpView.vue"),
|
import(/* webpackChunkName: "help" */ "../views/HelpView.vue"),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/help-notifications",
|
||||||
|
name: "help-notifications",
|
||||||
|
component: () =>
|
||||||
|
import(
|
||||||
|
/* webpackChunkName: "help-notifications" */ "../views/HelpNotificationsView.vue"
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "/identity-switcher",
|
path: "/identity-switcher",
|
||||||
name: "identity-switcher",
|
name: "identity-switcher",
|
||||||
|
|||||||
2184
src/util.d.ts
vendored
Normal file
2184
src/util.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<QuickNav selected="Profile"></QuickNav>
|
<QuickNav selected="Profile"></QuickNav>
|
||||||
|
<TopMessage />
|
||||||
|
|
||||||
<!-- CONTENT -->
|
<!-- CONTENT -->
|
||||||
<section id="Content" class="p-6 pb-24">
|
<section id="Content" class="p-6 pb-24">
|
||||||
<!-- Heading -->
|
<!-- Heading -->
|
||||||
@@ -32,8 +34,24 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- ID notice -->
|
||||||
|
<div
|
||||||
|
v-if="!activeDid"
|
||||||
|
class="bg-amber-200 text-amber-900 border-amber-500 border-dashed border text-center rounded-md overflow-hidden px-4 py-3 mb-4"
|
||||||
|
>
|
||||||
|
<p class="mb-4">
|
||||||
|
<b>Note:</b> Before you can take any action, you need an ID.
|
||||||
|
</p>
|
||||||
|
<router-link
|
||||||
|
:to="{ name: 'start' }"
|
||||||
|
class="inline-block text-md uppercase bg-amber-600 text-white px-4 py-2 rounded-md"
|
||||||
|
>
|
||||||
|
Generate Identity
|
||||||
|
</router-link>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Registration notice -->
|
<!-- Registration notice -->
|
||||||
<!-- We won't show any loading indicator; we'll just pop the message in once we know they need it. -->
|
<!-- We won't show any loading indicator because it usually doesn't change anything. We'll just pop the message in only if we discover that they need it. -->
|
||||||
<div
|
<div
|
||||||
v-if="!loadingLimits && !limits?.nextWeekBeginDateTime"
|
v-if="!loadingLimits && !limits?.nextWeekBeginDateTime"
|
||||||
class="bg-amber-200 text-amber-900 border-amber-500 border-dashed border text-center rounded-md overflow-hidden px-4 py-3 mb-4"
|
class="bg-amber-200 text-amber-900 border-amber-500 border-dashed border text-center rounded-md overflow-hidden px-4 py-3 mb-4"
|
||||||
@@ -58,9 +76,9 @@
|
|||||||
<span v-else>
|
<span v-else>
|
||||||
<router-link
|
<router-link
|
||||||
:to="{ name: 'new-edit-account' }"
|
:to="{ name: 'new-edit-account' }"
|
||||||
class="text-xs bg-blue-500 text-white px-1.5 py-1 rounded-md"
|
class="block w-full text-center text-md text-slate-500 uppercase border border-dashed border-slate-400 px-1.5 py-2 rounded-md mb-2"
|
||||||
>
|
>
|
||||||
(set name)
|
(Set Your Name)
|
||||||
</router-link>
|
</router-link>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
@@ -88,16 +106,25 @@
|
|||||||
|
|
||||||
<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
|
<label
|
||||||
|
v-if="notificationUnchanged"
|
||||||
for="toggleNotifications"
|
for="toggleNotifications"
|
||||||
class="flex items-center cursor-pointer"
|
class="flex items-center justify-between cursor-pointer"
|
||||||
@click="
|
@click="
|
||||||
this.$notify(
|
!toggleNotifications
|
||||||
{
|
? this.$notify(
|
||||||
group: 'modal',
|
{
|
||||||
type: 'notification-permission',
|
group: 'modal',
|
||||||
},
|
type: 'notification-permission',
|
||||||
-1,
|
},
|
||||||
)
|
-1,
|
||||||
|
)
|
||||||
|
: this.$notify(
|
||||||
|
{
|
||||||
|
group: 'modal',
|
||||||
|
type: 'notification-off',
|
||||||
|
},
|
||||||
|
-1,
|
||||||
|
)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<!-- label -->
|
<!-- label -->
|
||||||
@@ -119,37 +146,9 @@
|
|||||||
></div>
|
></div>
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
<label
|
<label v-else>
|
||||||
for="toggleMuteNotifications"
|
Notification status may have changed. Revisit this page to see the
|
||||||
class="flex items-center cursor-pointer mt-4"
|
latest setting.
|
||||||
@click="
|
|
||||||
this.$notify(
|
|
||||||
{
|
|
||||||
group: 'modal',
|
|
||||||
type: 'notification-mute',
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
)
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<!-- label -->
|
|
||||||
<div>Mute Notifications</div>
|
|
||||||
<!-- toggle -->
|
|
||||||
<div class="relative ml-2">
|
|
||||||
<!-- input -->
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
name="toggleMuteNotifications"
|
|
||||||
class="sr-only"
|
|
||||||
disabled
|
|
||||||
/>
|
|
||||||
<!-- 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>
|
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -157,7 +156,7 @@
|
|||||||
|
|
||||||
<router-link
|
<router-link
|
||||||
:to="{ name: 'seed-backup' }"
|
:to="{ name: 'seed-backup' }"
|
||||||
href=""
|
v-if="activeDid"
|
||||||
class="block w-full text-center text-md uppercase bg-slate-500 text-white px-1.5 py-2 rounded-md mb-2"
|
class="block w-full text-center text-md uppercase bg-slate-500 text-white px-1.5 py-2 rounded-md mb-2"
|
||||||
>
|
>
|
||||||
Backup Identifier Seed
|
Backup Identifier Seed
|
||||||
@@ -172,30 +171,42 @@
|
|||||||
</a>
|
</a>
|
||||||
<a ref="downloadLink" />
|
<a ref="downloadLink" />
|
||||||
|
|
||||||
<div v-if="activeDid" class="flex py-2">
|
<div v-if="activeDid" class="my-8">
|
||||||
<button class="text-center text-md text-blue-500" @click="checkLimits()">
|
<h3 class="text-sm uppercase font-semibold mb-3">Rate Limits</h3>
|
||||||
|
<button
|
||||||
|
class="block w-full text-center text-md uppercase bg-slate-500 text-white px-1.5 py-2 rounded-md mb-2"
|
||||||
|
@click="checkLimits()"
|
||||||
|
>
|
||||||
Check Limits
|
Check Limits
|
||||||
</button>
|
</button>
|
||||||
<!-- show spinner if loading limits -->
|
<!-- show spinner if loading limits -->
|
||||||
<div v-if="loadingLimits" class="ml-2">
|
<div v-if="loadingLimits" class="text-center mb-4">
|
||||||
Checking... <fa icon="spinner" class="fa-spin"></fa>
|
Checking… <fa icon="spinner" class="fa-spin"></fa>
|
||||||
</div>
|
</div>
|
||||||
<div class="ml-2">
|
<div class="mb-4">
|
||||||
{{ limitsMessage }}
|
{{ limitsMessage }}
|
||||||
</div>
|
</div>
|
||||||
<div v-if="!!limits?.nextWeekBeginDateTime" class="px-9">
|
<div v-if="!!limits?.nextWeekBeginDateTime">
|
||||||
<span class="font-bold">Rate Limits</span>
|
<p class="mb-3 text-sm">
|
||||||
<p>
|
You have done <b>{{ limits.doneClaimsThisWeek }}</b> claims out of
|
||||||
You have done {{ limits.doneClaimsThisWeek }} claims out of
|
<b>{{ limits.maxClaimsPerWeek }}</b> for this week. Your claims
|
||||||
{{ limits.maxClaimsPerWeek }} for this week. Your claims counter
|
counter resets at
|
||||||
resets at {{ readableTime(limits.nextWeekBeginDateTime) }}
|
<b class="whitespace-nowrap">{{
|
||||||
|
readableTime(limits.nextWeekBeginDateTime)
|
||||||
|
}}</b>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p class="text-sm">
|
||||||
You have done {{ limits.doneRegistrationsThisMonth }} registrations
|
You have done
|
||||||
out of {{ limits.maxRegistrationsPerMonth }} for this month. (You can
|
<b>{{ limits.doneRegistrationsThisMonth }}</b> registrations out of
|
||||||
register nobody on your first day, and after that only one a day in
|
<b>{{ limits.maxRegistrationsPerMonth }}</b> for this month.
|
||||||
your first month.) Your registration counter resets at
|
<i
|
||||||
{{ readableTime(limits.nextMonthBeginDateTime) }}
|
>(You can register nobody on your first day, and after that only one
|
||||||
|
a day in your first month.)</i
|
||||||
|
>
|
||||||
|
Your registration counter resets at
|
||||||
|
<b class="whitespace-nowrap">
|
||||||
|
{{ readableTime(limits.nextMonthBeginDateTime) }}
|
||||||
|
</b>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -208,10 +219,14 @@
|
|||||||
>
|
>
|
||||||
Advanced
|
Advanced
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<div v-if="showAdvanced">
|
<div v-if="showAdvanced">
|
||||||
|
<p class="text-rose-600 mb-8">
|
||||||
|
Beware: the features here can be confusing and even change data in ways
|
||||||
|
you do not expect. But we support your freedom!
|
||||||
|
</p>
|
||||||
|
|
||||||
<!-- Deep Identity Details -->
|
<!-- Deep Identity Details -->
|
||||||
<h2 class="text-slate-500 text-sm font-bold mb-2 py-2">
|
<h2 class="text-sm uppercase font-semibold mb-3">
|
||||||
Deep Identity Details
|
Deep Identity Details
|
||||||
</h2>
|
</h2>
|
||||||
<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">
|
||||||
@@ -269,13 +284,11 @@
|
|||||||
|
|
||||||
<label
|
<label
|
||||||
for="toggleShowAmounts"
|
for="toggleShowAmounts"
|
||||||
class="flex items-center cursor-pointer py-2"
|
class="flex items-center justify-between cursor-pointer my-4"
|
||||||
@click="handleChange"
|
@click="handleChange"
|
||||||
>
|
>
|
||||||
<!-- label -->
|
<!-- label -->
|
||||||
<h2 class="text-slate-500 text-sm font-bold mb-2">
|
<h2>Show amounts given with contacts</h2>
|
||||||
Show amounts given with contacts
|
|
||||||
</h2>
|
|
||||||
<!-- toggle -->
|
<!-- toggle -->
|
||||||
<div class="relative ml-2">
|
<div class="relative ml-2">
|
||||||
<!-- input -->
|
<!-- input -->
|
||||||
@@ -294,26 +307,28 @@
|
|||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<div class="flex py-2">
|
<router-link
|
||||||
<button class="text-blue-500">
|
:to="{ name: 'statistics' }"
|
||||||
<!-- id used by puppeteer test script -->
|
class="block w-full text-center text-md uppercase bg-slate-500 text-white px-1.5 py-2 rounded-md mb-2"
|
||||||
<router-link
|
>
|
||||||
id="switch-identity-link"
|
See Global Animated History of Giving
|
||||||
:to="{ name: 'identity-switcher' }"
|
</router-link>
|
||||||
class="block text-center"
|
|
||||||
>
|
|
||||||
Switch Identity / No Identity
|
|
||||||
</router-link>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex py-2">
|
<!-- id used by puppeteer test script -->
|
||||||
<button class="text-blue-500">
|
<router-link
|
||||||
<router-link :to="{ name: 'statistics' }" class="block text-center">
|
id="switch-identity-link"
|
||||||
See Achievements & Statistics
|
:to="{ name: 'identity-switcher' }"
|
||||||
</router-link>
|
class="block w-full text-center text-md uppercase bg-slate-500 text-white px-1.5 py-2 rounded-md mb-2"
|
||||||
</button>
|
>
|
||||||
</div>
|
Switch Identity
|
||||||
|
</router-link>
|
||||||
|
|
||||||
|
<button
|
||||||
|
@click="alertWebPushSubscription()"
|
||||||
|
class="block w-full text-center text-md uppercase bg-slate-500 text-white px-1.5 py-2 rounded-md mb-2"
|
||||||
|
>
|
||||||
|
Show Subscription from Web Push Server
|
||||||
|
</button>
|
||||||
|
|
||||||
<div class="flex py-4">
|
<div class="flex py-4">
|
||||||
<h2 class="text-slate-500 text-sm font-bold mb-2">Claim Server</h2>
|
<h2 class="text-slate-500 text-sm font-bold mb-2">Claim Server</h2>
|
||||||
@@ -330,35 +345,117 @@
|
|||||||
<fa icon="floppy-disk" class="fa-fw" color="white"></fa>
|
<fa icon="floppy-disk" class="fa-fw" color="white"></fa>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="px-4 rounded bg-slate-200 border border-slate-400"
|
class="px-3 rounded bg-slate-200 border border-slate-400"
|
||||||
@click="setApiServerInput(Constants.PROD_ENDORSER_API_SERVER)"
|
@click="apiServerInput = AppConstants.PROD_ENDORSER_API_SERVER"
|
||||||
>
|
>
|
||||||
Use Prod
|
Use Prod
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="px-4 rounded bg-slate-200 border border-slate-400"
|
class="px-3 rounded bg-slate-200 border border-slate-400"
|
||||||
@click="setApiServerInput(Constants.TEST_ENDORSER_API_SERVER)"
|
@click="apiServerInput = AppConstants.TEST_ENDORSER_API_SERVER"
|
||||||
>
|
>
|
||||||
Use Test
|
Use Test
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="px-4 rounded bg-slate-200 border border-slate-400"
|
class="px-3 rounded bg-slate-200 border border-slate-400"
|
||||||
@click="setApiServerInput(Constants.LOCAL_ENDORSER_API_SERVER)"
|
@click="apiServerInput = AppConstants.LOCAL_ENDORSER_API_SERVER"
|
||||||
>
|
>
|
||||||
Use Local
|
Use Local
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<label
|
||||||
|
for="toggleProdWarningMessage"
|
||||||
|
class="flex items-center justify-between cursor-pointer my-4"
|
||||||
|
@click="toggleProdWarning"
|
||||||
|
>
|
||||||
|
<!-- label -->
|
||||||
|
<h2>Show warning if on prod server</h2>
|
||||||
|
<!-- toggle -->
|
||||||
|
<div class="relative ml-2">
|
||||||
|
<!-- input -->
|
||||||
|
<input type="checkbox" v-model="warnIfProdServer" 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>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label
|
||||||
|
for="toggleTestWarningMessage"
|
||||||
|
class="flex items-center justify-between cursor-pointer my-4"
|
||||||
|
@click="toggleTestWarning"
|
||||||
|
>
|
||||||
|
<!-- label -->
|
||||||
|
<h2>Show warning if on test server</h2>
|
||||||
|
<!-- toggle -->
|
||||||
|
<div class="relative ml-2">
|
||||||
|
<!-- input -->
|
||||||
|
<input type="checkbox" v-model="warnIfTestServer" 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>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<div class="flex py-4">
|
||||||
|
<h2 class="text-slate-500 text-sm font-bold mb-2">
|
||||||
|
Notification Push Server
|
||||||
|
</h2>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="block w-full rounded border border-slate-400 px-3 py-2"
|
||||||
|
v-model="webPushServerInput"
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
v-if="webPushServerInput != webPushServer"
|
||||||
|
class="px-4 rounded bg-red-500 border border-slate-400"
|
||||||
|
@click="onClickSavePushServer()"
|
||||||
|
>
|
||||||
|
<fa icon="floppy-disk" class="fa-fw" color="white"></fa>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="px-3 rounded bg-slate-200 border border-slate-400"
|
||||||
|
@click="webPushServerInput = AppConstants.PROD_PUSH_SERVER"
|
||||||
|
>
|
||||||
|
Use Prod
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="px-3 rounded bg-slate-200 border border-slate-400"
|
||||||
|
@click="webPushServerInput = AppConstants.TEST1_PUSH_SERVER"
|
||||||
|
>
|
||||||
|
Use Test 1
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="px-3 rounded bg-slate-200 border border-slate-400"
|
||||||
|
@click="webPushServerInput = AppConstants.TEST2_PUSH_SERVER"
|
||||||
|
>
|
||||||
|
Use Test 2
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<span class="px-4 text-sm" v-if="!webPushServerInput">
|
||||||
|
When that setting is blank, this app will use the default web push
|
||||||
|
server URL:
|
||||||
|
{{ AppConstants.DEFAULT_PUSH_SERVER }}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { AxiosError } from "axios";
|
import { AxiosError, AxiosRequestConfig } from "axios";
|
||||||
import "dexie-export-import";
|
import "dexie-export-import";
|
||||||
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 QuickNav from "@/components/QuickNav.vue";
|
import QuickNav from "@/components/QuickNav.vue";
|
||||||
|
import TopMessage from "@/components/TopMessage.vue";
|
||||||
import { AppString } from "@/constants/app";
|
import { AppString } from "@/constants/app";
|
||||||
import { db, accountsDB } from "@/db/index";
|
import { db, accountsDB } from "@/db/index";
|
||||||
import { MASTER_SETTINGS_KEY, Settings } from "@/db/tables/settings";
|
import { MASTER_SETTINGS_KEY, Settings } from "@/db/tables/settings";
|
||||||
@@ -383,11 +480,11 @@ interface IAccount {
|
|||||||
derivationPath: string;
|
derivationPath: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Component({ components: { QuickNav } })
|
@Component({ components: { QuickNav, TopMessage } })
|
||||||
export default class AccountViewView extends Vue {
|
export default class AccountViewView extends Vue {
|
||||||
$notify!: (notification: Notification, timeout?: number) => void;
|
$notify!: (notification: Notification, timeout?: number) => void;
|
||||||
|
|
||||||
Constants = AppString;
|
AppConstants = AppString;
|
||||||
|
|
||||||
activeDid = "";
|
activeDid = "";
|
||||||
apiServer = "";
|
apiServer = "";
|
||||||
@@ -395,9 +492,12 @@ export default class AccountViewView extends Vue {
|
|||||||
derivationPath = "";
|
derivationPath = "";
|
||||||
givenName = "";
|
givenName = "";
|
||||||
isRegistered = false;
|
isRegistered = false;
|
||||||
|
notificationUnchanged = true;
|
||||||
numAccounts = 0;
|
numAccounts = 0;
|
||||||
publicHex = "";
|
publicHex = "";
|
||||||
publicBase64 = "";
|
publicBase64 = "";
|
||||||
|
webPushServer = "";
|
||||||
|
webPushServerInput = "";
|
||||||
limits: RateLimits | null = null;
|
limits: RateLimits | null = null;
|
||||||
limitsMessage = "";
|
limitsMessage = "";
|
||||||
loadingLimits = true; // might as well now that we do it on mount, to avoid flashing the registration message
|
loadingLimits = true; // might as well now that we do it on mount, to avoid flashing the registration message
|
||||||
@@ -410,14 +510,73 @@ export default class AccountViewView extends Vue {
|
|||||||
|
|
||||||
showAdvanced = false;
|
showAdvanced = false;
|
||||||
|
|
||||||
private isSubscribed = false;
|
subscription: PushSubscription | null = null;
|
||||||
|
warnIfProdServer = false;
|
||||||
|
warnIfTestServer = false;
|
||||||
|
|
||||||
|
private isSubscribed = false;
|
||||||
get toggleNotifications() {
|
get toggleNotifications() {
|
||||||
return this.isSubscribed;
|
return this.isSubscribed;
|
||||||
}
|
}
|
||||||
|
|
||||||
set toggleNotifications(value) {
|
set toggleNotifications(value) {
|
||||||
this.isSubscribed = value;
|
this.isSubscribed = value;
|
||||||
|
this.notificationUnchanged = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Async function executed when the component is created.
|
||||||
|
* Initializes the component's state with values from the database,
|
||||||
|
* handles identity-related tasks, and checks limitations.
|
||||||
|
*
|
||||||
|
* @throws Will display specific messages to the user based on different errors.
|
||||||
|
*/
|
||||||
|
async created() {
|
||||||
|
try {
|
||||||
|
await db.open();
|
||||||
|
|
||||||
|
const settings = await db.settings.get(MASTER_SETTINGS_KEY);
|
||||||
|
|
||||||
|
// Initialize component state with values from the database or defaults
|
||||||
|
this.initializeState(settings);
|
||||||
|
|
||||||
|
// Get and process the identity
|
||||||
|
const identity = await this.getIdentity(this.activeDid);
|
||||||
|
if (identity) {
|
||||||
|
this.processIdentity(identity);
|
||||||
|
}
|
||||||
|
} catch (err: unknown) {
|
||||||
|
this.handleError(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async mounted() {
|
||||||
|
try {
|
||||||
|
const registration = await navigator.serviceWorker.ready;
|
||||||
|
this.subscription = await registration.pushManager.getSubscription();
|
||||||
|
this.toggleNotifications = !!this.subscription;
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Mount error:", error);
|
||||||
|
this.toggleNotifications = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes component state with values from the database or defaults.
|
||||||
|
* @param {SettingsType} settings - Object containing settings from the database.
|
||||||
|
*/
|
||||||
|
initializeState(settings: Settings | undefined) {
|
||||||
|
this.activeDid = (settings?.activeDid as string) || "";
|
||||||
|
this.apiServer = (settings?.apiServer as string) || "";
|
||||||
|
this.apiServerInput = (settings?.apiServer as string) || "";
|
||||||
|
this.givenName =
|
||||||
|
(settings?.firstName || "") +
|
||||||
|
(settings?.lastName ? ` ${settings.lastName}` : ""); // pre v 0.1.3
|
||||||
|
this.isRegistered = !!settings?.isRegistered;
|
||||||
|
this.showContactGives = !!settings?.showContactGivesInline;
|
||||||
|
this.warnIfProdServer = !!settings?.warnIfProdServer;
|
||||||
|
this.warnIfTestServer = !!settings?.warnIfTestServer;
|
||||||
|
this.webPushServer = (settings?.webPushServer as string) || "";
|
||||||
|
this.webPushServerInput = (settings?.webPushServer as string) || "";
|
||||||
}
|
}
|
||||||
|
|
||||||
public async getIdentity(activeDid: string): Promise<IIdentifier | null> {
|
public async getIdentity(activeDid: string): Promise<IIdentifier | null> {
|
||||||
@@ -485,6 +644,16 @@ export default class AccountViewView extends Vue {
|
|||||||
this.updateShowContactAmounts();
|
this.updateShowContactAmounts();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toggleProdWarning() {
|
||||||
|
this.warnIfProdServer = !this.warnIfProdServer;
|
||||||
|
this.updateWarnIfProdServer(this.warnIfProdServer);
|
||||||
|
}
|
||||||
|
|
||||||
|
toggleTestWarning() {
|
||||||
|
this.warnIfTestServer = !this.warnIfTestServer;
|
||||||
|
this.updateWarnIfTestServer(this.warnIfTestServer);
|
||||||
|
}
|
||||||
|
|
||||||
readableTime(timeStr: string) {
|
readableTime(timeStr: string) {
|
||||||
return timeStr.substring(0, timeStr.indexOf("T"));
|
return timeStr.substring(0, timeStr.indexOf("T"));
|
||||||
}
|
}
|
||||||
@@ -494,60 +663,6 @@ export default class AccountViewView extends Vue {
|
|||||||
this.numAccounts = await accountsDB.accounts.count();
|
this.numAccounts = await accountsDB.accounts.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Async function executed when the component is created.
|
|
||||||
* Initializes the component's state with values from the database,
|
|
||||||
* handles identity-related tasks, and checks limitations.
|
|
||||||
*
|
|
||||||
* @throws Will display specific messages to the user based on different errors.
|
|
||||||
*/
|
|
||||||
async created() {
|
|
||||||
console.error("created");
|
|
||||||
try {
|
|
||||||
await db.open();
|
|
||||||
|
|
||||||
const settings = await db.settings.get(MASTER_SETTINGS_KEY);
|
|
||||||
|
|
||||||
// Initialize component state with values from the database or defaults
|
|
||||||
this.initializeState(settings);
|
|
||||||
|
|
||||||
// Get and process the identity
|
|
||||||
const identity = await this.getIdentity(this.activeDid);
|
|
||||||
if (identity) {
|
|
||||||
this.processIdentity(identity);
|
|
||||||
}
|
|
||||||
} catch (err: unknown) {
|
|
||||||
this.handleError(err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async mounted() {
|
|
||||||
console.error("mounted()");
|
|
||||||
try {
|
|
||||||
const registration = await navigator.serviceWorker.ready;
|
|
||||||
const subscription = await registration.pushManager.getSubscription();
|
|
||||||
this.toggleNotifications = !!subscription;
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
this.toggleNotifications = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes component state with values from the database or defaults.
|
|
||||||
* @param {SettingsType} settings - Object containing settings from the database.
|
|
||||||
*/
|
|
||||||
initializeState(settings: Settings | undefined) {
|
|
||||||
this.activeDid = (settings?.activeDid as string) || "";
|
|
||||||
this.apiServer = (settings?.apiServer as string) || "";
|
|
||||||
this.apiServerInput = (settings?.apiServer as string) || "";
|
|
||||||
this.givenName =
|
|
||||||
(settings?.firstName || "") +
|
|
||||||
(settings?.lastName ? ` ${settings.lastName}` : ""); // pre v 0.1.3
|
|
||||||
this.isRegistered = !!settings?.isRegistered;
|
|
||||||
this.showContactGives = !!settings?.showContactGivesInline;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Processes the identity and updates the component's state.
|
* Processes the identity and updates the component's state.
|
||||||
* @param {IdentityType} identity - Object containing identity information.
|
* @param {IdentityType} identity - Object containing identity information.
|
||||||
@@ -621,6 +736,52 @@ export default class AccountViewView extends Vue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async updateWarnIfProdServer(newSetting: boolean) {
|
||||||
|
try {
|
||||||
|
await db.open();
|
||||||
|
db.settings.update(MASTER_SETTINGS_KEY, {
|
||||||
|
warnIfProdServer: newSetting,
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
this.$notify(
|
||||||
|
{
|
||||||
|
group: "alert",
|
||||||
|
type: "danger",
|
||||||
|
title: "Error Updating Prod Warning",
|
||||||
|
text: "Clear your cache and start over (after data backup).",
|
||||||
|
},
|
||||||
|
-1,
|
||||||
|
);
|
||||||
|
console.error(
|
||||||
|
"Telling user to clear cache after contact setting update because:",
|
||||||
|
err,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async updateWarnIfTestServer(newSetting: boolean) {
|
||||||
|
try {
|
||||||
|
await db.open();
|
||||||
|
db.settings.update(MASTER_SETTINGS_KEY, {
|
||||||
|
warnIfTestServer: newSetting,
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
this.$notify(
|
||||||
|
{
|
||||||
|
group: "alert",
|
||||||
|
type: "danger",
|
||||||
|
title: "Error Updating Test Warning",
|
||||||
|
text: "Clear your cache and start over (after data backup).",
|
||||||
|
},
|
||||||
|
-1,
|
||||||
|
);
|
||||||
|
console.error(
|
||||||
|
"Telling user to clear cache after contact setting update because:",
|
||||||
|
err,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Asynchronously exports the database into a downloadable JSON file.
|
* Asynchronously exports the database into a downloadable JSON file.
|
||||||
*
|
*
|
||||||
@@ -769,7 +930,7 @@ export default class AccountViewView extends Vue {
|
|||||||
private async fetchRateLimits(identity: IIdentifier) {
|
private async fetchRateLimits(identity: IIdentifier) {
|
||||||
const url = `${this.apiServer}/api/report/rateLimits`;
|
const url = `${this.apiServer}/api/report/rateLimits`;
|
||||||
const headers = await this.getHeaders(identity);
|
const headers = await this.getHeaders(identity);
|
||||||
return await this.axios.get(url, { headers });
|
return await this.axios.get(url, { headers } as AxiosRequestConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -872,8 +1033,29 @@ export default class AccountViewView extends Vue {
|
|||||||
this.apiServer = this.apiServerInput;
|
this.apiServer = this.apiServerInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
setApiServerInput(value: string) {
|
async onClickSavePushServer() {
|
||||||
this.apiServerInput = value;
|
await db.open();
|
||||||
|
db.settings.update(MASTER_SETTINGS_KEY, {
|
||||||
|
webPushServer: this.webPushServerInput,
|
||||||
|
});
|
||||||
|
this.webPushServer = this.webPushServerInput;
|
||||||
|
this.$notify(
|
||||||
|
{
|
||||||
|
group: "alert",
|
||||||
|
type: "warning",
|
||||||
|
title: "Reload",
|
||||||
|
text: "Now reload the app to get a new VAPID to use with this push server.",
|
||||||
|
},
|
||||||
|
-1,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
alertWebPushSubscription() {
|
||||||
|
console.log(
|
||||||
|
"Web push subscription:",
|
||||||
|
JSON.parse(JSON.stringify(this.subscription)), // gives more info than plain console logging
|
||||||
|
);
|
||||||
|
alert(JSON.stringify(this.subscription));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
476
src/views/ClaimView.vue
Normal file
476
src/views/ClaimView.vue
Normal file
@@ -0,0 +1,476 @@
|
|||||||
|
<template>
|
||||||
|
<QuickNav />
|
||||||
|
<!-- CONTENT -->
|
||||||
|
<section id="Content" class="p-6 pb-24">
|
||||||
|
<!-- Breadcrumb -->
|
||||||
|
<div id="ViewBreadcrumb" class="mb-8">
|
||||||
|
<h1 class="text-lg text-center font-light relative px-7">
|
||||||
|
<!-- Back -->
|
||||||
|
<button
|
||||||
|
@click="$router.go(-1)"
|
||||||
|
class="text-lg text-center px-2 py-1 absolute -left-2 -top-1"
|
||||||
|
>
|
||||||
|
<fa icon="chevron-left" class="fa-fw"></fa>
|
||||||
|
</button>
|
||||||
|
Verifiable Claim Details
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Details -->
|
||||||
|
<div class="bg-slate-100 rounded-md overflow-hidden px-4 py-3 mb-4">
|
||||||
|
<div>
|
||||||
|
<div class="block flex gap-4 overflow-hidden">
|
||||||
|
<div class="overflow-hidden">
|
||||||
|
<h2 class="text-md font-bold">{{ veriClaim.id }}</h2>
|
||||||
|
<div class="text-sm">
|
||||||
|
<div>
|
||||||
|
{{ veriClaim.claimType }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<fa icon="message" class="fa-fw text-slate-400"></fa>
|
||||||
|
{{ veriClaim.claim?.description }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<fa icon="user" class="fa-fw text-slate-400"></fa>
|
||||||
|
{{ veriClaim.issuer }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<fa icon="calendar" class="fa-fw text-slate-400"></fa>
|
||||||
|
{{ veriClaim.issuedAt?.replace(/T/, " ").replace(/Z/, " UTC") }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h2 class="font-bold uppercase text-xl mt-8 mb-2">Confirmations</h2>
|
||||||
|
|
||||||
|
<span v-if="totalConfirmers() === 0">Nobody has confirmed this.</span>
|
||||||
|
<span v-else-if="totalConfirmers() === 1">
|
||||||
|
One person has confirmed this.
|
||||||
|
</span>
|
||||||
|
<span v-else> {{ totalConfirmers() }} people have confirmed this. </span>
|
||||||
|
|
||||||
|
<div v-if="totalConfirmers() > 0">
|
||||||
|
<div
|
||||||
|
v-if="
|
||||||
|
confirmerIdList.length === 0 && confsVisibleToIdList.length === 0
|
||||||
|
"
|
||||||
|
>
|
||||||
|
Nobody that you know confirmed this claim, nor do they have any
|
||||||
|
confirmers in their network.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
v-if="confirmerIdList.length === 0 && confsVisibleToIdList.length > 0"
|
||||||
|
>
|
||||||
|
<!-- Only show if this person has links to confirmers (below). -->
|
||||||
|
Nobody that you know has issued or confirmed this claim.
|
||||||
|
</div>
|
||||||
|
<div v-if="confirmerIdList.length > 0">
|
||||||
|
The following people have issued or confirmed this claim.
|
||||||
|
<ul>
|
||||||
|
<li
|
||||||
|
v-for="confirmerId in confirmerIdList"
|
||||||
|
:key="confirmerId"
|
||||||
|
class="list-disc"
|
||||||
|
>
|
||||||
|
<div class="flex gap-4">
|
||||||
|
<div class="grow overflow-hidden">
|
||||||
|
<div class="text-sm">
|
||||||
|
{{ confirmerId }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Never need to show the following message.
|
||||||
|
If there is nobody in the confirmerIdList then we'll show the combined "nobody" message.
|
||||||
|
If there is somebody in the confirmerIdList then that's all they need to show.
|
||||||
|
-->
|
||||||
|
<!-- Nobody that you know can see someone who has confirmed this claim. -->
|
||||||
|
|
||||||
|
<div v-if="confsVisibleToIdList.length > 0">
|
||||||
|
The following people can connect you with people who have issued or
|
||||||
|
confirmed this claim.
|
||||||
|
<ul>
|
||||||
|
<li
|
||||||
|
v-for="confsVisibleTo in confsVisibleToIdList"
|
||||||
|
:key="confsVisibleTo"
|
||||||
|
class="list-disc"
|
||||||
|
>
|
||||||
|
<div class="flex gap-4">
|
||||||
|
<div class="grow overflow-hidden">
|
||||||
|
<div class="text-sm">
|
||||||
|
{{ confsVisibleTo }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-4">
|
||||||
|
<div v-if="confirmerIdList.includes(activeDid)">
|
||||||
|
You have confirmed this claim.
|
||||||
|
</div>
|
||||||
|
<div v-else-if="containsHiddenDid(veriClaim.claim)">
|
||||||
|
You cannot confirm this claim because it contains data that is hidden
|
||||||
|
from you.
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<button
|
||||||
|
class="bg-blue-600 text-white mt-4 px-4 py-2 rounded-md mb-4"
|
||||||
|
@click="confirmClaim(veriClaim.id)"
|
||||||
|
>
|
||||||
|
Confirm Claim
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h2 class="font-bold uppercase text-xl mt-8 mb-2">Claim</h2>
|
||||||
|
<pre class="text-sm overflow-x-scroll px-4 py-3 bg-slate-100 rounded-md">
|
||||||
|
{{ util.inspect(veriClaim, false, null) }}
|
||||||
|
</pre>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h2 class="font-bold uppercase text-xl mt-8 mb-2">Full Claim</h2>
|
||||||
|
<p class="mb-4">
|
||||||
|
The full claim includes the claim as it was originally issued, including
|
||||||
|
the signature (ie. the proof of issuance by that person).
|
||||||
|
</p>
|
||||||
|
<div v-if="!fullClaim">
|
||||||
|
<p v-if="fullClaimMessage" class="mb-4">
|
||||||
|
{{ fullClaimMessage }}
|
||||||
|
</p>
|
||||||
|
<button
|
||||||
|
v-else
|
||||||
|
class="block w-full text-center text-md uppercase bg-blue-600 text-white px-1.5 py-2 rounded-md mb-2"
|
||||||
|
@click="showFullClaim(veriClaim.id)"
|
||||||
|
>
|
||||||
|
Load Full Claim Details
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<pre>{{ util.inspect(fullClaim, false, null) }}</pre>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<a
|
||||||
|
:href="apiServer + '/api/claim/' + veriClaim.id"
|
||||||
|
target="_blank"
|
||||||
|
class="block w-full text-center text-md uppercase bg-blue-600 text-white px-1.5 py-2 rounded-md mb-2"
|
||||||
|
>
|
||||||
|
View on the Public Server
|
||||||
|
</a>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { AxiosError, RawAxiosRequestHeaders } from "axios";
|
||||||
|
import * as R from "ramda";
|
||||||
|
import { IIdentifier } from "@veramo/core";
|
||||||
|
import * as util from "util";
|
||||||
|
import { Component, Vue } from "vue-facing-decorator";
|
||||||
|
|
||||||
|
import GiftedDialog from "@/components/GiftedDialog.vue";
|
||||||
|
import OfferDialog from "@/components/OfferDialog.vue";
|
||||||
|
import { accountsDB, db } from "@/db/index";
|
||||||
|
import { Contact } from "@/db/tables/contacts";
|
||||||
|
import { MASTER_SETTINGS_KEY, Settings } from "@/db/tables/settings";
|
||||||
|
import { accessToken } from "@/libs/crypto";
|
||||||
|
import * as serverUtil from "@/libs/endorserServer";
|
||||||
|
import QuickNav from "@/components/QuickNav.vue";
|
||||||
|
import EntityIcon from "@/components/EntityIcon.vue";
|
||||||
|
import { Account } from "@/db/tables/accounts";
|
||||||
|
|
||||||
|
interface Notification {
|
||||||
|
group: string;
|
||||||
|
type: string;
|
||||||
|
title: string;
|
||||||
|
text: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
components: { EntityIcon, GiftedDialog, OfferDialog, QuickNav },
|
||||||
|
})
|
||||||
|
export default class ClaimView extends Vue {
|
||||||
|
$notify!: (notification: Notification, timeout?: number) => void;
|
||||||
|
|
||||||
|
activeDid = "";
|
||||||
|
allMyDids: Array<string> = [];
|
||||||
|
allContacts: Array<Contact> = [];
|
||||||
|
apiServer = "";
|
||||||
|
confirmerIdList = []; // list of DIDs that have confirmed this claim excluding the issuer
|
||||||
|
confsVisibleErrorMessage = "";
|
||||||
|
confsVisibleToIdList = []; // list of DIDs that can see any confirmer
|
||||||
|
fullClaim = null;
|
||||||
|
fullClaimMessage = "";
|
||||||
|
numConfsNotVisible = 0; // number of hidden DIDs in the confirmerIdList, minus the issuer if they aren't visible
|
||||||
|
veriClaim = serverUtil.BLANK_GENERIC_SERVER_RECORD;
|
||||||
|
|
||||||
|
util = util;
|
||||||
|
containsHiddenDid = serverUtil.containsHiddenDid;
|
||||||
|
|
||||||
|
async created() {
|
||||||
|
await db.open();
|
||||||
|
const settings = (await db.settings.get(MASTER_SETTINGS_KEY)) as Settings;
|
||||||
|
this.activeDid = settings?.activeDid || "";
|
||||||
|
this.apiServer = settings?.apiServer || "";
|
||||||
|
this.allContacts = await db.contacts.toArray();
|
||||||
|
|
||||||
|
await accountsDB.open();
|
||||||
|
const accounts = accountsDB.accounts;
|
||||||
|
const accountsArr = await accounts?.toArray();
|
||||||
|
this.allMyDids = accountsArr.map((acc) => acc.did);
|
||||||
|
const account = accountsArr.find((acc) => acc.did === this.activeDid);
|
||||||
|
const identity = JSON.parse(account?.identity || "null");
|
||||||
|
|
||||||
|
const pathParam = window.location.pathname.substring("/claim/".length);
|
||||||
|
let claimId;
|
||||||
|
if (pathParam) {
|
||||||
|
claimId = decodeURIComponent(pathParam);
|
||||||
|
this.loadClaim(claimId, identity);
|
||||||
|
} else {
|
||||||
|
this.$notify(
|
||||||
|
{
|
||||||
|
group: "alert",
|
||||||
|
type: "danger",
|
||||||
|
title: "Error",
|
||||||
|
text: "No claim ID was provided.",
|
||||||
|
},
|
||||||
|
-1,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
totalConfirmers() {
|
||||||
|
return (
|
||||||
|
this.numConfsNotVisible +
|
||||||
|
this.confirmerIdList.length +
|
||||||
|
this.confsVisibleToIdList.length
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async getIdentity(activeDid: string): Promise<IIdentifier> {
|
||||||
|
await accountsDB.open();
|
||||||
|
const account = (await accountsDB.accounts
|
||||||
|
.where("did")
|
||||||
|
.equals(activeDid)
|
||||||
|
.first()) as Account;
|
||||||
|
const identity = JSON.parse(account?.identity || "null");
|
||||||
|
|
||||||
|
if (!identity) {
|
||||||
|
throw new Error(
|
||||||
|
"Attempted to load project records with no identity available.",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return identity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async getHeaders(identity: IIdentifier) {
|
||||||
|
const headers: RawAxiosRequestHeaders = {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
};
|
||||||
|
if (identity) {
|
||||||
|
const token = await accessToken(identity);
|
||||||
|
headers["Authorization"] = "Bearer " + token;
|
||||||
|
}
|
||||||
|
return headers;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Isn't there a better way to make this available to the template?
|
||||||
|
didInfo(
|
||||||
|
did: string,
|
||||||
|
activeDid: string,
|
||||||
|
dids: Array<string>,
|
||||||
|
contacts: Array<Contact>,
|
||||||
|
) {
|
||||||
|
return serverUtil.didInfo(did, activeDid, dids, contacts);
|
||||||
|
}
|
||||||
|
|
||||||
|
async loadClaim(claimId: string, identity: IIdentifier) {
|
||||||
|
const url =
|
||||||
|
this.apiServer + "/api/claim/byHandle/" + encodeURIComponent(claimId);
|
||||||
|
const headers = await this.getHeaders(identity);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const resp = await this.axios.get(url, { headers });
|
||||||
|
if (resp.status === 200) {
|
||||||
|
this.veriClaim = resp.data;
|
||||||
|
} else {
|
||||||
|
// actually, axios typically throws an error so we never get here
|
||||||
|
console.log("Error getting claim:", resp);
|
||||||
|
this.$notify(
|
||||||
|
{
|
||||||
|
group: "alert",
|
||||||
|
type: "danger",
|
||||||
|
title: "Error",
|
||||||
|
text: "There was a problem getting that claim. See logs for more info.",
|
||||||
|
},
|
||||||
|
-1,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} catch (error: unknown) {
|
||||||
|
const serverError = error as AxiosError;
|
||||||
|
console.error("Error retrieving claim:", serverError);
|
||||||
|
this.$notify(
|
||||||
|
{
|
||||||
|
group: "alert",
|
||||||
|
type: "danger",
|
||||||
|
title: "Error",
|
||||||
|
text: "Something went wrong retrieving that claim. See logs for more info.",
|
||||||
|
},
|
||||||
|
-1,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const confirmUrl =
|
||||||
|
this.apiServer +
|
||||||
|
"/api/report/issuersWhoClaimedOrConfirmed?claimId=" +
|
||||||
|
encodeURIComponent(serverUtil.stripEndorserPrefix(claimId));
|
||||||
|
const confirmHeaders = await this.getHeaders(identity);
|
||||||
|
try {
|
||||||
|
const response = await this.axios.get(confirmUrl, {
|
||||||
|
headers: confirmHeaders,
|
||||||
|
});
|
||||||
|
if (response.status === 200) {
|
||||||
|
const resultList1 = response.data.result || [];
|
||||||
|
const resultList2 = R.reject(serverUtil.isHiddenDid, resultList1);
|
||||||
|
const resultList3 = R.reject(
|
||||||
|
(did: string) => did === this.veriClaim.issuer,
|
||||||
|
resultList2,
|
||||||
|
);
|
||||||
|
this.confirmerIdList = resultList3;
|
||||||
|
this.numConfsNotVisible = resultList1.length - resultList2.length;
|
||||||
|
if (resultList3.length === resultList2.length) {
|
||||||
|
// the issuer was not in the "visible" list so they must be hidden
|
||||||
|
// so subtract them from the non-visible confirmers count
|
||||||
|
this.numConfsNotVisible = this.numConfsNotVisible - 1;
|
||||||
|
}
|
||||||
|
this.confsVisibleToIdList =
|
||||||
|
response.data.result.resultVisibleToDids || [];
|
||||||
|
} else {
|
||||||
|
this.confsVisibleErrorMessage =
|
||||||
|
"Had problems retrieving confirmations.";
|
||||||
|
}
|
||||||
|
} catch (error: unknown) {
|
||||||
|
const serverError = error as AxiosError;
|
||||||
|
console.error("Error retrieving confirmations:", serverError);
|
||||||
|
this.confsVisibleErrorMessage =
|
||||||
|
"Had problems retrieving confirmations. See logs for more info.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async showFullClaim(claimId: string) {
|
||||||
|
await accountsDB.open();
|
||||||
|
const accounts = accountsDB.accounts;
|
||||||
|
const accountsArr = await accounts?.toArray();
|
||||||
|
const account = accountsArr.find((acc) => acc.did === this.activeDid);
|
||||||
|
const identity = JSON.parse(account?.identity || "null");
|
||||||
|
|
||||||
|
const url =
|
||||||
|
this.apiServer + "/api/claim/full/" + encodeURIComponent(claimId);
|
||||||
|
const headers = await this.getHeaders(identity);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const resp = await this.axios.get(url, { headers });
|
||||||
|
if (resp.status === 200) {
|
||||||
|
this.fullClaim = resp.data;
|
||||||
|
} else {
|
||||||
|
// actually, axios typically throws an error so we never get here
|
||||||
|
console.log("Error getting full claim:", resp);
|
||||||
|
this.$notify(
|
||||||
|
{
|
||||||
|
group: "alert",
|
||||||
|
type: "danger",
|
||||||
|
title: "Error",
|
||||||
|
text: "There was a problem getting that claim. See logs for more info.",
|
||||||
|
},
|
||||||
|
-1,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} catch (error: unknown) {
|
||||||
|
console.error("Error retrieving full claim:", error);
|
||||||
|
const serverError = error as AxiosError;
|
||||||
|
if (serverError.response?.status === 403) {
|
||||||
|
this.fullClaimMessage =
|
||||||
|
"You are not authorized to view the full contents of this claim." +
|
||||||
|
" To see all the details, ask the issuer to allow you to see their claims." +
|
||||||
|
" If you cannot see the issuer's DID, ask someone in the Confirmations section above." +
|
||||||
|
" If there are no connections, you will have to ask people in your" +
|
||||||
|
" network for their help, some other way; send them to this page and" +
|
||||||
|
" see if they can make a connection for you.";
|
||||||
|
} else {
|
||||||
|
this.$notify(
|
||||||
|
{
|
||||||
|
group: "alert",
|
||||||
|
type: "danger",
|
||||||
|
title: "Error",
|
||||||
|
text: "Something went wrong retrieving that claim. See logs for more info.",
|
||||||
|
},
|
||||||
|
-1,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async confirmClaim() {
|
||||||
|
if (confirm("Do you personally confirm that this is true?")) {
|
||||||
|
// similar logic is found in endorser-mobile
|
||||||
|
const goodClaim = serverUtil.removeSchemaContext(
|
||||||
|
serverUtil.removeVisibleToDids(
|
||||||
|
serverUtil.addLastClaimOrHandleAsIdIfMissing(
|
||||||
|
this.veriClaim.claim,
|
||||||
|
this.veriClaim.id,
|
||||||
|
this.veriClaim.handleId,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
const confirmationClaim: serverUtil.GenericVerifiableCredential & {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
object: any;
|
||||||
|
} = {
|
||||||
|
"@context": "https://schema.org",
|
||||||
|
"@type": "AgreeAction",
|
||||||
|
object: goodClaim,
|
||||||
|
};
|
||||||
|
const result = await serverUtil.createAndSubmitClaim(
|
||||||
|
confirmationClaim,
|
||||||
|
await this.getIdentity(this.activeDid),
|
||||||
|
this.apiServer,
|
||||||
|
this.axios,
|
||||||
|
);
|
||||||
|
if (result.type === "success") {
|
||||||
|
this.$notify(
|
||||||
|
{
|
||||||
|
group: "alert",
|
||||||
|
type: "success",
|
||||||
|
title: "Success",
|
||||||
|
text: "Confirmation submitted.",
|
||||||
|
},
|
||||||
|
5000,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
console.log("Got error submitting the confirmation:", result);
|
||||||
|
this.$notify(
|
||||||
|
{
|
||||||
|
group: "alert",
|
||||||
|
type: "danger",
|
||||||
|
title: "Error",
|
||||||
|
text: "There was a problem submitting the confirmation. See logs for more info.",
|
||||||
|
},
|
||||||
|
-1,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -124,7 +124,7 @@ interface Notification {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Component({ components: { QuickNav } })
|
@Component({ components: { QuickNav } })
|
||||||
export default class ContactsView extends Vue {
|
export default class ContactAmountssView extends Vue {
|
||||||
$notify!: (notification: Notification, timeout?: number) => void;
|
$notify!: (notification: Notification, timeout?: number) => void;
|
||||||
|
|
||||||
activeDid = "";
|
activeDid = "";
|
||||||
|
|||||||
@@ -18,9 +18,19 @@
|
|||||||
<h1 id="ViewHeading" class="text-4xl text-center font-light pt-4">
|
<h1 id="ViewHeading" class="text-4xl text-center font-light pt-4">
|
||||||
Your Contact Info
|
Your Contact Info
|
||||||
</h1>
|
</h1>
|
||||||
|
<p v-if="!givenName" class="text-center mt-2">
|
||||||
|
<span class="text-red">Beware!</span>
|
||||||
|
You aren't sharing your name, so hurry and
|
||||||
|
<router-link
|
||||||
|
:to="{ name: 'new-edit-account' }"
|
||||||
|
class="bg-blue-500 text-white px-1.5 py-1 rounded-md"
|
||||||
|
>
|
||||||
|
go here to set it for them.
|
||||||
|
</router-link>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div @click="onCopyToClipboard()">
|
<div @click="onCopyToClipboard()" v-if="activeDid">
|
||||||
<!--
|
<!--
|
||||||
Play with display options: https://qr-code-styling.com/
|
Play with display options: https://qr-code-styling.com/
|
||||||
See docs: https://www.npmjs.com/package/qr-code-generator-vue3
|
See docs: https://www.npmjs.com/package/qr-code-generator-vue3
|
||||||
@@ -32,6 +42,15 @@
|
|||||||
class="flex justify-center"
|
class="flex justify-center"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="text-center" v-else>
|
||||||
|
You have no identitifiers yet, so
|
||||||
|
<router-link :to="{ name: 'start' }" class="text-blue-500">
|
||||||
|
create your identifier.
|
||||||
|
</router-link>
|
||||||
|
<br />
|
||||||
|
We recommend you do that first; otherwise, these contacts won't see your
|
||||||
|
activity.
|
||||||
|
</div>
|
||||||
|
|
||||||
<h1 class="text-4xl text-center font-light pt-4">Scan Contact Info</h1>
|
<h1 class="text-4xl text-center font-light pt-4">Scan Contact Info</h1>
|
||||||
<qrcode-stream @detect="onScanDetect" @error="onScanError" />
|
<qrcode-stream @detect="onScanDetect" @error="onScanError" />
|
||||||
@@ -78,6 +97,7 @@ export default class ContactQRScanShow extends Vue {
|
|||||||
|
|
||||||
activeDid = "";
|
activeDid = "";
|
||||||
apiServer = "";
|
apiServer = "";
|
||||||
|
givenName = "";
|
||||||
qrValue = "";
|
qrValue = "";
|
||||||
|
|
||||||
public async getIdentity(activeDid: string) {
|
public async getIdentity(activeDid: string) {
|
||||||
@@ -91,7 +111,7 @@ export default class ContactQRScanShow extends Vue {
|
|||||||
|
|
||||||
if (!identity) {
|
if (!identity) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"Attempted to load Give records with no identity available.",
|
"Attempted to show contact info with no identity available.",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return identity;
|
return identity;
|
||||||
@@ -102,21 +122,12 @@ export default class ContactQRScanShow extends Vue {
|
|||||||
const settings = await db.settings.get(MASTER_SETTINGS_KEY);
|
const settings = await db.settings.get(MASTER_SETTINGS_KEY);
|
||||||
this.activeDid = settings?.activeDid || "";
|
this.activeDid = settings?.activeDid || "";
|
||||||
this.apiServer = settings?.apiServer || "";
|
this.apiServer = settings?.apiServer || "";
|
||||||
|
this.givenName = settings?.firstName || "";
|
||||||
|
|
||||||
await accountsDB.open();
|
await accountsDB.open();
|
||||||
const accounts = await accountsDB.accounts.toArray();
|
const accounts = await accountsDB.accounts.toArray();
|
||||||
const account = R.find((acc) => acc.did === this.activeDid, accounts);
|
const account = R.find((acc) => acc.did === this.activeDid, accounts);
|
||||||
if (!account) {
|
if (account) {
|
||||||
this.$notify(
|
|
||||||
{
|
|
||||||
group: "alert",
|
|
||||||
type: "warning",
|
|
||||||
title: "",
|
|
||||||
text: "You have no identity yet.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
const identity = await this.getIdentity(this.activeDid);
|
const identity = await this.getIdentity(this.activeDid);
|
||||||
const publicKeyHex = identity.keys[0].publicKeyHex;
|
const publicKeyHex = identity.keys[0].publicKeyHex;
|
||||||
const publicEncKey = Buffer.from(publicKeyHex, "hex").toString("base64");
|
const publicEncKey = Buffer.from(publicKeyHex, "hex").toString("base64");
|
||||||
|
|||||||
@@ -19,15 +19,16 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- New Contact -->
|
<!-- New Contact -->
|
||||||
<div class="mb-4 flex">
|
<div class="mb-4 flex items-stretch">
|
||||||
<span class="self-center bg-slate-500 text-white px-1.5 py-1 rounded-md">
|
<router-link
|
||||||
<router-link :to="{ name: 'contact-qr' }">
|
:to="{ name: 'contact-qr' }"
|
||||||
<fa icon="qrcode" class="fa-fw" />
|
class="flex items-center bg-slate-500 text-white px-1.5 py-1 mr-1 rounded-md"
|
||||||
</router-link>
|
>
|
||||||
</span>
|
<fa icon="qrcode" class="fa-fw text-2xl" />
|
||||||
|
</router-link>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="DID, Name, Public Key"
|
placeholder="DID, Name, Public Key (base 16 or 64)"
|
||||||
class="block w-full rounded-l border border-r-0 border-slate-400 px-3 py-2"
|
class="block w-full rounded-l border border-r-0 border-slate-400 px-3 py-2"
|
||||||
v-model="contactInput"
|
v-model="contactInput"
|
||||||
/>
|
/>
|
||||||
@@ -110,48 +111,50 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="ContactActions" class="flex gap-1.5 mt-2">
|
<div id="ContactActions" class="flex gap-1.5 mt-2">
|
||||||
<button
|
<div v-if="activeDid">
|
||||||
v-if="contact.seesMe"
|
<button
|
||||||
class="text-sm uppercase bg-slate-500 text-white px-2 py-1.5 rounded-md"
|
v-if="contact.seesMe"
|
||||||
@click="setVisibility(contact, false, true)"
|
class="text-sm uppercase bg-slate-500 text-white px-2 py-1.5 rounded-md"
|
||||||
title="They can see you"
|
@click="setVisibility(contact, false, true)"
|
||||||
>
|
title="They can see you"
|
||||||
<fa icon="eye" class="fa-fw" />
|
>
|
||||||
</button>
|
<fa icon="eye" class="fa-fw" />
|
||||||
<button
|
</button>
|
||||||
v-else
|
<button
|
||||||
class="text-sm uppercase bg-slate-500 text-white px-2 py-1.5 rounded-md"
|
|
||||||
@click="setVisibility(contact, true, true)"
|
|
||||||
title="They cannot see you"
|
|
||||||
>
|
|
||||||
<fa icon="eye-slash" class="fa-fw" />
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button
|
|
||||||
class="text-sm uppercase bg-slate-500 text-white px-2 py-1.5 rounded-md"
|
|
||||||
@click="checkVisibility(contact)"
|
|
||||||
title="Check Visibility"
|
|
||||||
>
|
|
||||||
<fa icon="rotate" class="fa-fw" />
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button
|
|
||||||
@click="register(contact)"
|
|
||||||
class="text-sm uppercase bg-slate-500 text-white ml-6 px-2 py-1.5 rounded-md"
|
|
||||||
>
|
|
||||||
<fa
|
|
||||||
v-if="contact.registered"
|
|
||||||
icon="person-circle-check"
|
|
||||||
class="fa-fw"
|
|
||||||
title="Registered"
|
|
||||||
/>
|
|
||||||
<fa
|
|
||||||
v-else
|
v-else
|
||||||
icon="person-circle-question"
|
class="text-sm uppercase bg-slate-500 text-white px-2 py-1.5 rounded-md"
|
||||||
class="fa-fw"
|
@click="setVisibility(contact, true, true)"
|
||||||
title="Registration Unknown"
|
title="They cannot see you"
|
||||||
/>
|
>
|
||||||
</button>
|
<fa icon="eye-slash" class="fa-fw" />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="text-sm uppercase bg-slate-500 text-white px-2 py-1.5 rounded-md"
|
||||||
|
@click="checkVisibility(contact)"
|
||||||
|
title="Check Visibility"
|
||||||
|
v-if="activeDid"
|
||||||
|
>
|
||||||
|
<fa icon="rotate" class="fa-fw" />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
@click="register(contact)"
|
||||||
|
class="text-sm uppercase bg-slate-500 text-white ml-6 px-2 py-1.5 rounded-md"
|
||||||
|
v-if="activeDid"
|
||||||
|
>
|
||||||
|
<fa
|
||||||
|
v-if="contact.registered"
|
||||||
|
icon="person-circle-check"
|
||||||
|
class="fa-fw"
|
||||||
|
title="Registered"
|
||||||
|
/>
|
||||||
|
<fa
|
||||||
|
v-else
|
||||||
|
icon="person-circle-question"
|
||||||
|
class="fa-fw"
|
||||||
|
title="Registration Unknown"
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
@click="deleteContact(contact)"
|
@click="deleteContact(contact)"
|
||||||
@@ -168,7 +171,7 @@
|
|||||||
<button
|
<button
|
||||||
class="text-sm bg-blue-600 text-white px-2 py-1.5 rounded-l-md"
|
class="text-sm bg-blue-600 text-white px-2 py-1.5 rounded-l-md"
|
||||||
@click="onClickAddGive(activeDid, contact.did)"
|
@click="onClickAddGive(activeDid, contact.did)"
|
||||||
title="givenByMeDescriptions[contact.did]"
|
:title="givenByMeDescriptions[contact.did] || ''"
|
||||||
>
|
>
|
||||||
To:
|
To:
|
||||||
{{
|
{{
|
||||||
@@ -187,7 +190,7 @@
|
|||||||
<button
|
<button
|
||||||
class="text-sm bg-blue-600 text-white px-2 py-1.5 rounded-r-md -ml-1.5 border-l border-blue-400"
|
class="text-sm bg-blue-600 text-white px-2 py-1.5 rounded-r-md -ml-1.5 border-l border-blue-400"
|
||||||
@click="onClickAddGive(contact.did, activeDid)"
|
@click="onClickAddGive(contact.did, activeDid)"
|
||||||
title="givenToMeDescriptions[contact.did]"
|
:title="givenToMeDescriptions[contact.did] || ''"
|
||||||
>
|
>
|
||||||
From:
|
From:
|
||||||
{{
|
{{
|
||||||
@@ -263,6 +266,7 @@ import {
|
|||||||
SimpleSigner,
|
SimpleSigner,
|
||||||
} from "@/libs/crypto";
|
} from "@/libs/crypto";
|
||||||
import {
|
import {
|
||||||
|
CONTACT_URL_PREFIX,
|
||||||
GiveServerRecord,
|
GiveServerRecord,
|
||||||
GiveVerifiableCredential,
|
GiveVerifiableCredential,
|
||||||
RegisterVerifiableCredential,
|
RegisterVerifiableCredential,
|
||||||
@@ -303,6 +307,7 @@ export default class ContactsView extends Vue {
|
|||||||
givenToMeUnconfirmed: Record<string, number> = {};
|
givenToMeUnconfirmed: Record<string, number> = {};
|
||||||
hourDescriptionInput = "";
|
hourDescriptionInput = "";
|
||||||
hourInput = "0";
|
hourInput = "0";
|
||||||
|
isRegistered = false;
|
||||||
showGiveNumbers = false;
|
showGiveNumbers = false;
|
||||||
showGiveTotals = true;
|
showGiveTotals = true;
|
||||||
showGiveConfirmed = true;
|
showGiveConfirmed = true;
|
||||||
@@ -312,6 +317,7 @@ export default class ContactsView 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.activeDid = settings?.activeDid || "";
|
this.activeDid = settings?.activeDid || "";
|
||||||
this.apiServer = settings?.apiServer || "";
|
this.apiServer = settings?.apiServer || "";
|
||||||
|
this.isRegistered = !!settings?.isRegistered;
|
||||||
|
|
||||||
this.showGiveNumbers = !!settings?.showContactGivesInline;
|
this.showGiveNumbers = !!settings?.showContactGivesInline;
|
||||||
if (this.showGiveNumbers) {
|
if (this.showGiveNumbers) {
|
||||||
@@ -330,7 +336,7 @@ export default class ContactsView extends Vue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async getIdentity(activeDid: string) {
|
public async getIdentity(activeDid: string): Promise<IIdentifier> {
|
||||||
await accountsDB.open();
|
await accountsDB.open();
|
||||||
const accounts = await accountsDB.accounts.toArray();
|
const accounts = await accountsDB.accounts.toArray();
|
||||||
const account = R.find((acc) => acc.did === activeDid, accounts) as Account;
|
const account = R.find((acc) => acc.did === activeDid, accounts) as Account;
|
||||||
@@ -361,6 +367,10 @@ export default class ContactsView extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async loadGives() {
|
async loadGives() {
|
||||||
|
if (!this.activeDid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const handleResponse = (
|
const handleResponse = (
|
||||||
resp: { status: number; data: { data: GiveServerRecord[] } },
|
resp: { status: number; data: { data: GiveServerRecord[] } },
|
||||||
descriptions: Record<string, string>,
|
descriptions: Record<string, string>,
|
||||||
@@ -395,11 +405,11 @@ export default class ContactsView extends Vue {
|
|||||||
{
|
{
|
||||||
group: "alert",
|
group: "alert",
|
||||||
type: "danger",
|
type: "danger",
|
||||||
title: "Server Error",
|
title: "Retrieval Error",
|
||||||
text:
|
text:
|
||||||
"Got an error retrieving your " +
|
"Got an error retrieving your " +
|
||||||
(useRecipient ? "given" : "received") +
|
(useRecipient ? "given" : "received") +
|
||||||
" time from the server.",
|
" data from the server.",
|
||||||
},
|
},
|
||||||
-1,
|
-1,
|
||||||
);
|
);
|
||||||
@@ -450,12 +460,13 @@ export default class ContactsView extends Vue {
|
|||||||
this.givenToMeConfirmed = givenToMeConfirmed;
|
this.givenToMeConfirmed = givenToMeConfirmed;
|
||||||
this.givenToMeUnconfirmed = givenToMeUnconfirmed;
|
this.givenToMeUnconfirmed = givenToMeUnconfirmed;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log("Error loading gives", error);
|
||||||
this.$notify(
|
this.$notify(
|
||||||
{
|
{
|
||||||
group: "alert",
|
group: "alert",
|
||||||
type: "danger",
|
type: "danger",
|
||||||
title: "Server Error",
|
title: "Load Error",
|
||||||
text: error as string,
|
text: "Got an error loading your gives.",
|
||||||
},
|
},
|
||||||
-1,
|
-1,
|
||||||
);
|
);
|
||||||
@@ -475,6 +486,12 @@ export default class ContactsView extends Vue {
|
|||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.contactInput.startsWith(CONTACT_URL_PREFIX)) {
|
||||||
|
await this.newContactFromScan(this.contactInput);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let did = this.contactInput;
|
let did = this.contactInput;
|
||||||
let name, publicKeyBase64;
|
let name, publicKeyBase64;
|
||||||
const commaPos1 = this.contactInput.indexOf(",");
|
const commaPos1 = this.contactInput.indexOf(",");
|
||||||
@@ -493,7 +510,7 @@ export default class ContactsView extends Vue {
|
|||||||
publicKeyBase64 = Buffer.from(publicKeyBase64, "hex").toString("base64");
|
publicKeyBase64 = Buffer.from(publicKeyBase64, "hex").toString("base64");
|
||||||
}
|
}
|
||||||
const newContact = { did, name, publicKeyBase64 };
|
const newContact = { did, name, publicKeyBase64 };
|
||||||
return this.addContact(newContact);
|
await this.addContact(newContact);
|
||||||
}
|
}
|
||||||
|
|
||||||
async newContactFromScan(url: string): Promise<void> {
|
async newContactFromScan(url: string): Promise<void> {
|
||||||
@@ -540,31 +557,39 @@ export default class ContactsView extends Vue {
|
|||||||
(a: Contact, b) => (a.name || "").localeCompare(b.name || ""),
|
(a: Contact, b) => (a.name || "").localeCompare(b.name || ""),
|
||||||
allContacts,
|
allContacts,
|
||||||
);
|
);
|
||||||
this.setVisibility(newContact, true, false);
|
let addedMessage;
|
||||||
|
if (this.activeDid) {
|
||||||
|
this.setVisibility(newContact, true, false);
|
||||||
|
addedMessage =
|
||||||
|
newContact.name +
|
||||||
|
" was added, and your activity is visible to them.";
|
||||||
|
} else {
|
||||||
|
addedMessage = newContact.name + " was added.";
|
||||||
|
}
|
||||||
this.$notify(
|
this.$notify(
|
||||||
{
|
{
|
||||||
group: "alert",
|
group: "alert",
|
||||||
type: "success",
|
type: "success",
|
||||||
title: "Contact Added",
|
title: "Contact Added",
|
||||||
text:
|
text: addedMessage,
|
||||||
newContact.name +
|
|
||||||
" was added, and your activity is visible to them.",
|
|
||||||
},
|
},
|
||||||
-1,
|
5000,
|
||||||
);
|
|
||||||
// putting this last so that it shows on the top
|
|
||||||
this.$notify(
|
|
||||||
{
|
|
||||||
group: "alert",
|
|
||||||
type: "info",
|
|
||||||
title: "New User?",
|
|
||||||
text:
|
|
||||||
"If " +
|
|
||||||
newContact.name +
|
|
||||||
" is a new user, be sure to register them.",
|
|
||||||
},
|
|
||||||
-1,
|
|
||||||
);
|
);
|
||||||
|
if (this.isRegistered) {
|
||||||
|
// putting this last so that it shows on the top
|
||||||
|
this.$notify(
|
||||||
|
{
|
||||||
|
group: "alert",
|
||||||
|
type: "info",
|
||||||
|
title: "New User?",
|
||||||
|
text:
|
||||||
|
"If " +
|
||||||
|
newContact.name +
|
||||||
|
" is a new user, be sure to register them.",
|
||||||
|
},
|
||||||
|
-1,
|
||||||
|
);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.error("Error when adding contact to storage:", err);
|
console.error("Error when adding contact to storage:", err);
|
||||||
@@ -685,6 +710,7 @@ export default class ContactsView extends Vue {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.error("Error when registering:", error);
|
||||||
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) {
|
||||||
@@ -701,7 +727,7 @@ export default class ContactsView extends Vue {
|
|||||||
{
|
{
|
||||||
group: "alert",
|
group: "alert",
|
||||||
type: "danger",
|
type: "danger",
|
||||||
title: "Server Error",
|
title: "Registration Error",
|
||||||
text: userMessage,
|
text: userMessage,
|
||||||
},
|
},
|
||||||
-1,
|
-1,
|
||||||
@@ -747,27 +773,28 @@ export default class ContactsView extends Vue {
|
|||||||
} else {
|
} else {
|
||||||
console.error(
|
console.error(
|
||||||
"Got some bad server response when setting visibility: ",
|
"Got some bad server response when setting visibility: ",
|
||||||
|
resp.status,
|
||||||
resp,
|
resp,
|
||||||
);
|
);
|
||||||
const message =
|
const message =
|
||||||
resp.data.error?.message || "Bad server response of " + resp.status;
|
resp.data.error?.message || "Got some error setting visibility.";
|
||||||
this.$notify(
|
this.$notify(
|
||||||
{
|
{
|
||||||
group: "alert",
|
group: "alert",
|
||||||
type: "danger",
|
type: "danger",
|
||||||
title: "Server Error",
|
title: "Error Setting Visibility",
|
||||||
text: message,
|
text: message,
|
||||||
},
|
},
|
||||||
-1,
|
-1,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Got some server error when setting visibility:", err);
|
console.error("Got some error when setting visibility:", err);
|
||||||
this.$notify(
|
this.$notify(
|
||||||
{
|
{
|
||||||
group: "alert",
|
group: "alert",
|
||||||
type: "danger",
|
type: "danger",
|
||||||
title: "Server Error",
|
title: "Error Setting Visibility",
|
||||||
text: "Check connectivity and try again.",
|
text: "Check connectivity and try again.",
|
||||||
},
|
},
|
||||||
-1,
|
-1,
|
||||||
@@ -810,19 +837,19 @@ export default class ContactsView extends Vue {
|
|||||||
{
|
{
|
||||||
group: "alert",
|
group: "alert",
|
||||||
type: "danger",
|
type: "danger",
|
||||||
title: "Server Error",
|
title: "Error Checking Visibility",
|
||||||
text: message,
|
text: message,
|
||||||
},
|
},
|
||||||
-1,
|
-1,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log("Caught error from server request to check visibility:", err);
|
console.log("Caught error from request to check visibility:", err);
|
||||||
this.$notify(
|
this.$notify(
|
||||||
{
|
{
|
||||||
group: "alert",
|
group: "alert",
|
||||||
type: "danger",
|
type: "danger",
|
||||||
title: "Server Error",
|
title: "Error Checking Visibility",
|
||||||
text: "Check connectivity and try again.",
|
text: "Check connectivity and try again.",
|
||||||
},
|
},
|
||||||
-1,
|
-1,
|
||||||
@@ -938,6 +965,7 @@ export default class ContactsView extends Vue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// similar function is in endorserServer.ts
|
||||||
private async createAndSubmitGive(
|
private async createAndSubmitGive(
|
||||||
identity: IIdentifier,
|
identity: IIdentifier,
|
||||||
fromDid: string,
|
fromDid: string,
|
||||||
@@ -1007,6 +1035,7 @@ export default class ContactsView extends Vue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log("Error in createAndSubmitGive: ", error);
|
||||||
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) {
|
||||||
@@ -1023,7 +1052,7 @@ export default class ContactsView extends Vue {
|
|||||||
{
|
{
|
||||||
group: "alert",
|
group: "alert",
|
||||||
type: "danger",
|
type: "danger",
|
||||||
title: "Server Error",
|
title: "Error Sending Give",
|
||||||
text: userMessage,
|
text: userMessage,
|
||||||
},
|
},
|
||||||
-1,
|
-1,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<QuickNav selected="Discover"></QuickNav>
|
<QuickNav selected="Discover"></QuickNav>
|
||||||
|
<TopMessage />
|
||||||
|
|
||||||
<!-- CONTENT -->
|
<!-- CONTENT -->
|
||||||
<section id="Content" class="p-6 pb-24">
|
<section id="Content" class="p-6 pb-24">
|
||||||
@@ -136,6 +137,7 @@ import { didInfo, ProjectData } from "@/libs/endorserServer";
|
|||||||
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 EntityIcon from "@/components/EntityIcon.vue";
|
||||||
|
import TopMessage from "@/components/TopMessage.vue";
|
||||||
|
|
||||||
interface Notification {
|
interface Notification {
|
||||||
group: string;
|
group: string;
|
||||||
@@ -149,6 +151,7 @@ interface Notification {
|
|||||||
QuickNav,
|
QuickNav,
|
||||||
InfiniteScroll,
|
InfiniteScroll,
|
||||||
EntityIcon,
|
EntityIcon,
|
||||||
|
TopMessage,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
export default class DiscoverView extends Vue {
|
export default class DiscoverView extends Vue {
|
||||||
@@ -358,9 +361,7 @@ export default class DiscoverView extends Vue {
|
|||||||
const plans: ProjectData[] = results.data;
|
const plans: ProjectData[] = results.data;
|
||||||
for (const plan of plans) {
|
for (const plan of plans) {
|
||||||
const { name, description, handleId = plan.handleId, rowid } = plan;
|
const { name, description, handleId = plan.handleId, rowid } = plan;
|
||||||
if (beforeId !== plan["rowid"]) {
|
this.projects.push({ name, description, handleId, rowid });
|
||||||
this.projects.push({ name, description, handleId, rowid });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.projects = results.data;
|
this.projects = results.data;
|
||||||
|
|||||||
87
src/views/HelpNotificationsView.vue
Normal file
87
src/views/HelpNotificationsView.vue
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
<template>
|
||||||
|
<QuickNav />
|
||||||
|
|
||||||
|
<!-- CONTENT -->
|
||||||
|
<section id="Content" class="p-6 pb-24">
|
||||||
|
<!-- Breadcrumb -->
|
||||||
|
<div class="mb-8">
|
||||||
|
<!-- Back -->
|
||||||
|
<div class="text-lg text-center font-light relative px-7">
|
||||||
|
<h1
|
||||||
|
class="text-lg text-center px-2 py-1 absolute -left-2 -top-1"
|
||||||
|
@click="$router.back()"
|
||||||
|
>
|
||||||
|
<fa icon="chevron-left" class="fa-fw"></fa>
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Heading -->
|
||||||
|
<h1 id="ViewHeading" class="text-4xl text-center font-light pt-4 mb-8">
|
||||||
|
Notification Help
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<p>Here are things to try to get notifications working.</p>
|
||||||
|
|
||||||
|
<h2 class="text-xl font-semibold">Test</h2>
|
||||||
|
<p>Somehow call the service-worker self.showNotification</p>
|
||||||
|
|
||||||
|
<h2 class="text-xl font-semibold">Check OS-level permissions</h2>
|
||||||
|
<div>
|
||||||
|
Walk-throughs & screenshots, maybe for all combinations of OS &
|
||||||
|
browsers.
|
||||||
|
<div>
|
||||||
|
<h3 class="text-lg font-semibold">Mobile Phone - Apple iOS</h3>
|
||||||
|
<div>
|
||||||
|
Notifications require iOS 16.4 or higher. To check your iOS version,
|
||||||
|
go to Settings > General > About > Software Version.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3 class="text-lg font-semibold">Mobile Phone - Google Android</h3>
|
||||||
|
<div>See the browser section.</div>
|
||||||
|
|
||||||
|
<h3 class="text-lg font-semibold">Desktop - Mac</h3>
|
||||||
|
<div>Requires Mac OS 13.</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h2 class="text-xl font-semibold">Check browser-level permissions</h2>
|
||||||
|
<p>Walk-throughs & screenshots for browser settings</p>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<h3 class="text-lg font-semibold">Mobile Phone - Apple iOS</h3>
|
||||||
|
<div>Make sure your OS (above) supports it.</div>
|
||||||
|
|
||||||
|
<h3 class="text-lg font-semibold">Mobile Phone - Android</h3>
|
||||||
|
<div>Chrome requires version 50.</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h2 class="text-xl font-semibold">Explain full reset to start again</h2>
|
||||||
|
<p>
|
||||||
|
Walk-throughs for clearing everything & subscribing anew to get a
|
||||||
|
message
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2 class="text-xl font-semibold">Auto-detection</h2>
|
||||||
|
<p>Show results of auto-detection whether they're turned on</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
<script lang="ts">
|
||||||
|
import { Component, Vue } from "vue-facing-decorator";
|
||||||
|
import QuickNav from "@/components/QuickNav.vue";
|
||||||
|
|
||||||
|
interface Notification {
|
||||||
|
group: string;
|
||||||
|
type: string;
|
||||||
|
title: string;
|
||||||
|
text: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component({ components: { QuickNav } })
|
||||||
|
export default class HelpNotificationsView extends Vue {
|
||||||
|
$notify!: (notification: Notification, timeout?: number) => void;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -181,6 +181,21 @@
|
|||||||
different page.
|
different page.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<h2 class="text-xl font-semibold">
|
||||||
|
How do I access even more functionality?
|
||||||
|
</h2>
|
||||||
|
<p>
|
||||||
|
There is an "Advanced" section at the bottom of the Account
|
||||||
|
<fa icon="circle-user" /> page.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
There is a even more functionality in a mobile app (and more
|
||||||
|
documentation) at
|
||||||
|
<a href="https://endorser.ch" class="text-blue-500">
|
||||||
|
EndorserSearch.com
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
<h2 class="text-xl font-semibold">What is your privacy policy?</h2>
|
<h2 class="text-xl font-semibold">What is your privacy policy?</h2>
|
||||||
<p>
|
<p>
|
||||||
See
|
See
|
||||||
@@ -199,9 +214,7 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2 class="text-xl font-semibold">What app version is this?</h2>
|
<h2 class="text-xl font-semibold">What app version is this?</h2>
|
||||||
<p>
|
<p>{{ package.version }} ({{ commitHash }})</p>
|
||||||
{{ package.version }}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2 class="text-xl font-semibold">
|
<h2 class="text-xl font-semibold">
|
||||||
For any other questions, including removing your data:
|
For any other questions, including removing your data:
|
||||||
@@ -231,6 +244,7 @@ export default class Help extends Vue {
|
|||||||
$notify!: (notification: Notification, timeout?: number) => void;
|
$notify!: (notification: Notification, timeout?: number) => void;
|
||||||
|
|
||||||
package = Package;
|
package = Package;
|
||||||
|
commitHash = process.env.VUE_APP_GIT_HASH;
|
||||||
|
|
||||||
showOnboardInfo() {
|
showOnboardInfo() {
|
||||||
this.$notify(
|
this.$notify(
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<QuickNav selected="Home"></QuickNav>
|
<QuickNav selected="Home"></QuickNav>
|
||||||
|
<TopMessage />
|
||||||
|
|
||||||
<!-- CONTENT -->
|
<!-- CONTENT -->
|
||||||
<section id="Content" class="p-6 pb-24">
|
<section id="Content" class="p-6 pb-24">
|
||||||
<h1 id="ViewHeading" class="text-4xl text-center font-light pt-4 mb-8">
|
<h1 id="ViewHeading" class="text-4xl text-center font-light pt-4 mb-8">
|
||||||
@@ -8,28 +10,44 @@
|
|||||||
|
|
||||||
<!-- show the actions for recognizing a give -->
|
<!-- show the actions for recognizing a give -->
|
||||||
<div class="mb-8">
|
<div class="mb-8">
|
||||||
<div v-if="!activeDid">
|
<div
|
||||||
To record others' giving,
|
v-if="!activeDid"
|
||||||
<router-link :to="{ name: 'start' }" class="text-blue-500">
|
class="bg-amber-200 rounded-md overflow-hidden text-center px-4 py-3 mb-4"
|
||||||
create your identifier.</router-link
|
>
|
||||||
|
<p class="text-lg mb-3">
|
||||||
|
You need an <b>identifier</b> before you can record anyone's gives.
|
||||||
|
</p>
|
||||||
|
<router-link
|
||||||
|
:to="{ name: 'start' }"
|
||||||
|
class="block text-center text-md font-bold uppercase bg-blue-500 text-white mt-2 px-2 py-3 rounded-md"
|
||||||
|
>
|
||||||
|
Create Your Identifier</router-link
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else-if="!isRegistered">
|
<div
|
||||||
To record others' giving, someone must register your account, so show
|
v-else-if="!isRegistered"
|
||||||
them
|
class="bg-amber-200 rounded-md overflow-hidden text-center px-4 py-3 mb-4"
|
||||||
<router-link :to="{ name: 'contact-qr' }" class="text-blue-500">
|
>
|
||||||
your identity info</router-link
|
Someone must register your account before you can record anyone's gives.
|
||||||
|
To do this:
|
||||||
|
<router-link
|
||||||
|
:to="{ name: 'contact-qr' }"
|
||||||
|
class="block text-center text-md font-bold uppercase bg-blue-500 text-white mt-2 px-2 py-3 rounded-md"
|
||||||
>
|
>
|
||||||
and then
|
1. Show Them Your Identity Info</router-link
|
||||||
<router-link :to="{ name: 'account' }" class="text-blue-500">
|
>
|
||||||
check your limits.</router-link
|
<router-link
|
||||||
|
:to="{ name: 'account' }"
|
||||||
|
class="block text-center text-md font-bold uppercase bg-blue-500 text-white mt-2 px-2 py-3 rounded-md"
|
||||||
|
>
|
||||||
|
2. Check Your Limits</router-link
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<!-- activeDid && isRegistered -->
|
<!-- activeDid && isRegistered -->
|
||||||
<h2 class="text-xl font-bold">Record Something Given</h2>
|
<h2 class="text-xl font-bold mb-4">Record Something Given</h2>
|
||||||
|
|
||||||
<ul class="grid grid-cols-4 gap-x-3 gap-y-5 text-center mb-5">
|
<ul class="grid grid-cols-4 gap-x-3 gap-y-5 text-center mb-5">
|
||||||
<li @click="openDialog()">
|
<li @click="openDialog()">
|
||||||
@@ -87,40 +105,53 @@
|
|||||||
showGivenToUser="true"
|
showGivenToUser="true"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<!-- 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>
|
<h2 class="text-xl font-bold mb-4">Latest Activity</h2>
|
||||||
|
<InfiniteScroll @reached-bottom="loadMoreGives">
|
||||||
|
<ul class="border-t border-slate-300">
|
||||||
|
<li
|
||||||
|
class="border-b border-slate-300 py-2"
|
||||||
|
v-for="record in feedData"
|
||||||
|
:key="record.jwtId"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="border-b border-dashed border-slate-400 text-orange-400 pb-2 mb-2 font-bold uppercase text-sm"
|
||||||
|
v-if="record.jwtId == feedLastViewedClaimId"
|
||||||
|
>
|
||||||
|
You've seen all the following
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex">
|
||||||
|
<fa icon="gift" class="pt-1 pr-2 text-slate-500"></fa>
|
||||||
|
<span class="">{{ this.giveDescription(record) }}</span>
|
||||||
|
<a @click="onClickLoadClaim(record.jwtId)">
|
||||||
|
<fa icon="circle-info" class="pl-2 pt-1 text-slate-500"></fa>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</InfiniteScroll>
|
||||||
<div :class="{ hidden: isHiddenSpinner }">
|
<div :class="{ hidden: isHiddenSpinner }">
|
||||||
<p class="text-slate-500 text-center italic mt-4 mb-4">
|
<p class="text-slate-500 text-center italic mt-4 mb-4">
|
||||||
<fa icon="spinner" class="fa-spin-pulse"></fa> Loading…
|
<fa icon="spinner" class="fa-spin-pulse"></fa> Loading…
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<ul class="border-t border-slate-300">
|
|
||||||
<li
|
|
||||||
class="border-b border-slate-300 py-2"
|
|
||||||
v-for="record in feedData"
|
|
||||||
:key="record.jwtId"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="border-b border-dashed border-slate-400 text-orange-400 pb-2 mb-2 font-bold uppercase text-sm"
|
|
||||||
v-if="record.jwtId == feedLastViewedId"
|
|
||||||
>
|
|
||||||
You've seen all the following before
|
|
||||||
</div>
|
|
||||||
<div class="flex">
|
|
||||||
<fa icon="gift" class="pt-1 pr-2 text-slate-500"></fa>
|
|
||||||
<!-- icon values: "coins" = money; "clock" = time; "gift" = others -->
|
|
||||||
<span class="">{{ this.giveDescription(record) }}</span>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Component, Vue } from "vue-facing-decorator";
|
import { Component, Vue } from "vue-facing-decorator";
|
||||||
|
|
||||||
|
import EntityIcon from "@/components/EntityIcon.vue";
|
||||||
import GiftedDialog from "@/components/GiftedDialog.vue";
|
import GiftedDialog from "@/components/GiftedDialog.vue";
|
||||||
|
import InfiniteScroll from "@/components/InfiniteScroll.vue";
|
||||||
|
import QuickNav from "@/components/QuickNav.vue";
|
||||||
|
import TopMessage from "@/components/TopMessage.vue";
|
||||||
import { db, accountsDB } from "@/db/index";
|
import { db, accountsDB } from "@/db/index";
|
||||||
|
import { Account } from "@/db/tables/accounts";
|
||||||
|
import { Contact } from "@/db/tables/contacts";
|
||||||
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";
|
||||||
import {
|
import {
|
||||||
@@ -128,11 +159,7 @@ import {
|
|||||||
GiverInputInfo,
|
GiverInputInfo,
|
||||||
GiveServerRecord,
|
GiveServerRecord,
|
||||||
} from "@/libs/endorserServer";
|
} from "@/libs/endorserServer";
|
||||||
import { Contact } from "@/db/tables/contacts";
|
|
||||||
import QuickNav from "@/components/QuickNav.vue";
|
|
||||||
import EntityIcon from "@/components/EntityIcon.vue";
|
|
||||||
import { IIdentifier } from "@veramo/core";
|
import { IIdentifier } from "@veramo/core";
|
||||||
import { Account } from "@/db/tables/accounts";
|
|
||||||
|
|
||||||
interface Notification {
|
interface Notification {
|
||||||
group: string;
|
group: string;
|
||||||
@@ -142,7 +169,13 @@ interface Notification {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: { GiftedDialog, QuickNav, EntityIcon },
|
components: {
|
||||||
|
GiftedDialog,
|
||||||
|
QuickNav,
|
||||||
|
EntityIcon,
|
||||||
|
InfiniteScroll,
|
||||||
|
TopMessage,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
export default class HomeView extends Vue {
|
export default class HomeView extends Vue {
|
||||||
$notify!: (notification: Notification, timeout?: number) => void;
|
$notify!: (notification: Notification, timeout?: number) => void;
|
||||||
@@ -151,10 +184,9 @@ export default class HomeView extends Vue {
|
|||||||
allContacts: Array<Contact> = [];
|
allContacts: Array<Contact> = [];
|
||||||
allMyDids: Array<string> = [];
|
allMyDids: Array<string> = [];
|
||||||
apiServer = "";
|
apiServer = "";
|
||||||
feedAllLoaded = false;
|
|
||||||
feedData = [];
|
feedData = [];
|
||||||
feedPreviousOldestId?: string;
|
feedPreviousOldestId?: string;
|
||||||
feedLastViewedId?: string;
|
feedLastViewedClaimId?: string;
|
||||||
isHiddenSpinner = true;
|
isHiddenSpinner = true;
|
||||||
isRegistered = false;
|
isRegistered = false;
|
||||||
numAccounts = 0;
|
numAccounts = 0;
|
||||||
@@ -171,13 +203,7 @@ export default class HomeView extends Vue {
|
|||||||
.equals(activeDid)
|
.equals(activeDid)
|
||||||
.first()) as Account;
|
.first()) as Account;
|
||||||
const identity = JSON.parse(account?.identity || "null");
|
const identity = JSON.parse(account?.identity || "null");
|
||||||
|
return identity; // may be null
|
||||||
if (!identity) {
|
|
||||||
throw new Error(
|
|
||||||
"Attempted to load Give records with no identity available.",
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return identity;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async getHeaders(identity: IIdentifier) {
|
public async getHeaders(identity: IIdentifier) {
|
||||||
@@ -200,9 +226,12 @@ export default class HomeView extends Vue {
|
|||||||
this.apiServer = settings?.apiServer || "";
|
this.apiServer = settings?.apiServer || "";
|
||||||
this.activeDid = settings?.activeDid || "";
|
this.activeDid = settings?.activeDid || "";
|
||||||
this.allContacts = await db.contacts.toArray();
|
this.allContacts = await db.contacts.toArray();
|
||||||
this.feedLastViewedId = settings?.lastViewedClaimId;
|
this.feedLastViewedClaimId = settings?.lastViewedClaimId;
|
||||||
this.isRegistered = !!settings?.isRegistered;
|
this.isRegistered = !!settings?.isRegistered;
|
||||||
|
|
||||||
|
// this returns a Promise but we don't need to wait for it
|
||||||
this.updateAllFeed();
|
this.updateAllFeed();
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
this.$notify(
|
this.$notify(
|
||||||
@@ -245,24 +274,33 @@ export default class HomeView extends Vue {
|
|||||||
return headers;
|
return headers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Data loader used by infinite scroller
|
||||||
|
* @param payload is the flag from the InfiniteScroll indicating if it should load
|
||||||
|
**/
|
||||||
|
public async loadMoreGives(payload: boolean) {
|
||||||
|
if (payload) {
|
||||||
|
this.updateAllFeed();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public async updateAllFeed() {
|
public async updateAllFeed() {
|
||||||
this.isHiddenSpinner = false;
|
this.isHiddenSpinner = false;
|
||||||
await this.retrieveClaims(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) {
|
||||||
this.feedData = this.feedData.concat(results.data);
|
this.feedData = this.feedData.concat(results.data);
|
||||||
this.feedAllLoaded = results.hitLimit;
|
|
||||||
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.
|
||||||
if (
|
if (
|
||||||
this.feedLastViewedId == null ||
|
this.feedLastViewedClaimId == null ||
|
||||||
this.feedLastViewedId < results.data[0].jwtId
|
this.feedLastViewedClaimId < results.data[0].jwtId
|
||||||
) {
|
) {
|
||||||
await db.open();
|
await db.open();
|
||||||
db.settings.update(MASTER_SETTINGS_KEY, {
|
db.settings.update(MASTER_SETTINGS_KEY, {
|
||||||
lastViewedClaimId: results.data[0].jwtId,
|
lastViewedClaimId: results.data[0].jwtId,
|
||||||
});
|
});
|
||||||
// but not for this page because we need to remember what it was before
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -272,17 +310,22 @@ export default class HomeView extends Vue {
|
|||||||
{
|
{
|
||||||
group: "alert",
|
group: "alert",
|
||||||
type: "danger",
|
type: "danger",
|
||||||
title: "Export Error",
|
title: "Feed Error",
|
||||||
text: e.userMessage || "There was an error retrieving feed data.",
|
text: e.userMessage || "There was an error retrieving feed data.",
|
||||||
},
|
},
|
||||||
-1,
|
-1,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.isHiddenSpinner = true;
|
this.isHiddenSpinner = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async retrieveClaims(endorserApiServer: string, beforeId?: string) {
|
/**
|
||||||
|
* Retrieve claims in reverse chronological order
|
||||||
|
*
|
||||||
|
* @param beforeId the earliest ID (of previous searches) to search earlier
|
||||||
|
* @return claims in reverse chronological order
|
||||||
|
*/
|
||||||
|
public async retrieveGives(endorserApiServer: string, beforeId?: string) {
|
||||||
const beforeQuery = beforeId == null ? "" : "&beforeId=" + beforeId;
|
const beforeQuery = beforeId == null ? "" : "&beforeId=" + beforeId;
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
endorserApiServer + "/api/v2/report/gives?" + beforeQuery,
|
endorserApiServer + "/api/v2/report/gives?" + beforeQuery,
|
||||||
@@ -347,6 +390,13 @@ export default class HomeView extends Vue {
|
|||||||
return giverInfo + " gave" + gaveRecipientInfo + ": " + gaveAmount;
|
return giverInfo + " gave" + gaveRecipientInfo + ": " + gaveAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onClickLoadClaim(jwtId: string) {
|
||||||
|
const route = {
|
||||||
|
path: "/claim/" + encodeURIComponent(jwtId),
|
||||||
|
};
|
||||||
|
this.$router.push(route);
|
||||||
|
}
|
||||||
|
|
||||||
displayAmount(code: string, amt: number) {
|
displayAmount(code: string, amt: number) {
|
||||||
return "" + amt + " " + this.currencyShortWordForCode(code, amt === 1);
|
return "" + amt + " " + this.currencyShortWordForCode(code, amt === 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ export default class NewEditAccountView extends Vue {
|
|||||||
});
|
});
|
||||||
localStorage.setItem("firstName", this.givenName as string);
|
localStorage.setItem("firstName", this.givenName as string);
|
||||||
localStorage.setItem("lastName", ""); // deprecated, pre v 0.1.3
|
localStorage.setItem("lastName", ""); // deprecated, pre v 0.1.3
|
||||||
this.$router.push({ name: "account" });
|
this.$router.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
onClickCancel() {
|
onClickCancel() {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
class="text-lg text-center px-2 py-1 absolute -left-2 -top-1"
|
class="text-lg text-center px-2 py-1 absolute -left-2 -top-1"
|
||||||
><fa icon="chevron-left" class="fa-fw"></fa
|
><fa icon="chevron-left" class="fa-fw"></fa
|
||||||
></router-link>
|
></router-link>
|
||||||
[New/Edit] Plan
|
Edit Idea
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -24,22 +24,28 @@
|
|||||||
|
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Project Name"
|
placeholder="Idea Name"
|
||||||
class="block w-full rounded border border-slate-400 mb-4 px-3 py-2"
|
class="block w-full rounded border border-slate-400 mb-4 px-3 py-2"
|
||||||
v-model="projectName"
|
v-model="fullClaim.name"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<textarea
|
<textarea
|
||||||
placeholder="Description"
|
placeholder="Description"
|
||||||
class="block w-full rounded border border-slate-400 mb-4 px-3 py-2"
|
class="block w-full rounded border border-slate-400 mb-4 px-3 py-2"
|
||||||
rows="5"
|
rows="5"
|
||||||
v-model="description"
|
v-model="fullClaim.description"
|
||||||
maxlength="500"
|
maxlength="5000"
|
||||||
></textarea>
|
></textarea>
|
||||||
<div class="text-xs text-slate-500 italic -mt-3 mb-4">
|
<div class="text-xs text-slate-500 italic -mt-3 mb-4">
|
||||||
{{ description.length }}/500 max. characters
|
{{ fullClaim.description?.length }}/5000 max. characters
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<input
|
||||||
|
v-model="fullClaim.url"
|
||||||
|
placeholder="Website"
|
||||||
|
class="block w-full rounded border border-slate-400 mb-4 px-3 py-2"
|
||||||
|
/>
|
||||||
|
|
||||||
<div class="flex items-center mb-4">
|
<div class="flex items-center mb-4">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
@@ -72,7 +78,7 @@
|
|||||||
name="OpenStreetMap"
|
name="OpenStreetMap"
|
||||||
/>
|
/>
|
||||||
<l-marker
|
<l-marker
|
||||||
v-if="latitude || longitude"
|
v-if="latitude && longitude"
|
||||||
:lat-lng="[latitude, longitude]"
|
:lat-lng="[latitude, longitude]"
|
||||||
@click="maybeEraseLatLong()"
|
@click="maybeEraseLatLong()"
|
||||||
/>
|
/>
|
||||||
@@ -136,13 +142,17 @@ export default class NewEditProjectView extends Vue {
|
|||||||
|
|
||||||
activeDid = "";
|
activeDid = "";
|
||||||
apiServer = "";
|
apiServer = "";
|
||||||
description = "";
|
|
||||||
errorMessage = "";
|
errorMessage = "";
|
||||||
|
fullClaim: PlanVerifiableCredential = {
|
||||||
|
"@context": "https://schema.org",
|
||||||
|
"@type": "PlanAction",
|
||||||
|
name: "",
|
||||||
|
description: "",
|
||||||
|
}; // this default is only to avoid errors before plan is loaded
|
||||||
includeLocation = false;
|
includeLocation = false;
|
||||||
latitude = 0;
|
latitude = 0;
|
||||||
longitude = 0;
|
longitude = 0;
|
||||||
numAccounts = 0;
|
numAccounts = 0;
|
||||||
projectName = "";
|
|
||||||
zoom = 2;
|
zoom = 2;
|
||||||
|
|
||||||
async beforeCreate() {
|
async beforeCreate() {
|
||||||
@@ -214,9 +224,12 @@ export default class NewEditProjectView extends Vue {
|
|||||||
try {
|
try {
|
||||||
const resp = await this.axios.get(url, { headers });
|
const resp = await this.axios.get(url, { headers });
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
const claim = resp.data.claim;
|
this.fullClaim = resp.data.claim;
|
||||||
this.projectName = claim.name;
|
if (this.fullClaim?.location) {
|
||||||
this.description = claim.description;
|
this.includeLocation = true;
|
||||||
|
this.latitude = this.fullClaim.location.geo.latitude;
|
||||||
|
this.longitude = this.fullClaim.location.geo.longitude;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Got error retrieving that project", error);
|
console.error("Got error retrieving that project", error);
|
||||||
@@ -225,13 +238,7 @@ export default class NewEditProjectView extends Vue {
|
|||||||
|
|
||||||
private async SaveProject(identity: IIdentifier) {
|
private async SaveProject(identity: IIdentifier) {
|
||||||
// Make a claim
|
// Make a claim
|
||||||
const vcClaim: PlanVerifiableCredential = {
|
const vcClaim: PlanVerifiableCredential = this.fullClaim;
|
||||||
"@context": "https://schema.org",
|
|
||||||
"@type": "PlanAction",
|
|
||||||
name: this.projectName,
|
|
||||||
description: this.description,
|
|
||||||
identifier: this.projectId || undefined,
|
|
||||||
};
|
|
||||||
if (this.projectId) {
|
if (this.projectId) {
|
||||||
vcClaim.identifier = this.projectId;
|
vcClaim.identifier = this.projectId;
|
||||||
}
|
}
|
||||||
@@ -293,6 +300,20 @@ export default class NewEditProjectView extends Vue {
|
|||||||
2000,
|
2000,
|
||||||
this,
|
this,
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
console.log(
|
||||||
|
"Got unexpected 'data' inside response from server",
|
||||||
|
resp,
|
||||||
|
);
|
||||||
|
this.$notify(
|
||||||
|
{
|
||||||
|
group: "alert",
|
||||||
|
type: "danger",
|
||||||
|
title: "Error Saving Idea",
|
||||||
|
text: "Server did not save the idea. Try again.",
|
||||||
|
},
|
||||||
|
-1,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
let userMessage = "There was an error saving the project.";
|
let userMessage = "There was an error saving the project.";
|
||||||
@@ -300,8 +321,8 @@ export default class NewEditProjectView extends Vue {
|
|||||||
error?: { message?: string };
|
error?: { message?: string };
|
||||||
}>;
|
}>;
|
||||||
if (serverError) {
|
if (serverError) {
|
||||||
|
console.log("Got error from server", serverError);
|
||||||
if (Object.prototype.hasOwnProperty.call(serverError, "message")) {
|
if (Object.prototype.hasOwnProperty.call(serverError, "message")) {
|
||||||
console.log(serverError);
|
|
||||||
userMessage = serverError.response?.data?.error?.message || ""; // This is info for the user.
|
userMessage = serverError.response?.data?.error?.message || ""; // This is info for the user.
|
||||||
this.$notify(
|
this.$notify(
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ export default class NewIdentifierView extends Vue {
|
|||||||
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$router.push({ name: "account" });
|
this.$router.push({ name: "home" });
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<QuickNav selected="Projects"></QuickNav>
|
<QuickNav />
|
||||||
|
<TopMessage />
|
||||||
|
|
||||||
<!-- CONTENT -->
|
<!-- CONTENT -->
|
||||||
<section id="Content" class="p-6 pb-24">
|
<section id="Content" class="p-6 pb-24">
|
||||||
<!-- Breadcrumb -->
|
<!-- Breadcrumb -->
|
||||||
@@ -12,7 +14,7 @@
|
|||||||
>
|
>
|
||||||
<fa icon="chevron-left" class="fa-fw"></fa>
|
<fa icon="chevron-left" class="fa-fw"></fa>
|
||||||
</button>
|
</button>
|
||||||
View Plan
|
Idea
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -35,7 +37,7 @@
|
|||||||
<fa icon="user" class="fa-fw text-slate-400"></fa>
|
<fa icon="user" class="fa-fw text-slate-400"></fa>
|
||||||
{{ issuer }}
|
{{ issuer }}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div v-if="timeSince">
|
||||||
<fa icon="calendar" class="fa-fw text-slate-400"></fa>
|
<fa icon="calendar" class="fa-fw text-slate-400"></fa>
|
||||||
{{ timeSince }}
|
{{ timeSince }}
|
||||||
</div>
|
</div>
|
||||||
@@ -45,8 +47,13 @@
|
|||||||
:href="getOpenStreetMapUrl()"
|
:href="getOpenStreetMapUrl()"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
class="underline"
|
class="underline"
|
||||||
>
|
>Map View
|
||||||
Map View
|
</a>
|
||||||
|
</div>
|
||||||
|
<div v-if="url">
|
||||||
|
<fa icon="globe" class="fa-fw text-slate-400"></fa>
|
||||||
|
<a :href="addScheme(url)" target="_blank" class="underline"
|
||||||
|
>{{ domainForWebsite(this.url) }}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -56,8 +63,11 @@
|
|||||||
<div class="text-sm text-slate-500">
|
<div class="text-sm text-slate-500">
|
||||||
<div v-if="!expanded">
|
<div v-if="!expanded">
|
||||||
{{ truncatedDesc }}
|
{{ truncatedDesc }}
|
||||||
<a v-if="description.length >= truncateLength" @click="expandText"
|
<a
|
||||||
>Read More</a
|
v-if="description.length >= truncateLength"
|
||||||
|
@click="expandText"
|
||||||
|
class="uppercase text-xs font-semibold text-slate-700"
|
||||||
|
>... Read More</a
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
@@ -65,7 +75,7 @@
|
|||||||
<a
|
<a
|
||||||
@click="collapseText"
|
@click="collapseText"
|
||||||
class="uppercase text-xs font-semibold text-slate-700"
|
class="uppercase text-xs font-semibold text-slate-700"
|
||||||
>Read Less</a
|
>- Read Less</a
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -80,8 +90,8 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-4">
|
<div v-if="activeDid" class="mb-4">
|
||||||
<div v-if="activeDid" class="text-center">
|
<div class="text-center">
|
||||||
<button
|
<button
|
||||||
@click="openOfferDialog({ name: 'you', did: activeDid })"
|
@click="openOfferDialog({ name: 'you', did: activeDid })"
|
||||||
class="block w-full text-lg font-bold uppercase bg-blue-600 text-white px-2 py-3 rounded-md"
|
class="block w-full text-lg font-bold uppercase bg-blue-600 text-white px-2 py-3 rounded-md"
|
||||||
@@ -91,17 +101,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div v-if="activeDid">
|
||||||
<div v-if="activeDid" class="text-center">
|
<div class="text-center">
|
||||||
<button
|
<button
|
||||||
@click="openGiftDialog({ name: 'you', did: activeDid })"
|
@click="openGiftDialog({ name: 'you', did: activeDid })"
|
||||||
class="block w-full text-lg font-bold uppercase bg-blue-600 text-white px-2 py-3 rounded-md"
|
class="block w-full text-lg font-bold uppercase bg-blue-600 text-white px-2 py-3 rounded-md"
|
||||||
>
|
>
|
||||||
I gave…
|
I gave…
|
||||||
</button>
|
</button>
|
||||||
<p class="mt-2 mb-4 text-center">Or, record a gift from:</p>
|
<p class="mt-2 mb-4 text-center">Or, record a contribution from:</p>
|
||||||
</div>
|
</div>
|
||||||
<p v-if="!activeDid" class="mt-2 mb-4">Record a gift from:</p>
|
|
||||||
|
|
||||||
<ul class="grid grid-cols-4 gap-x-3 gap-y-5 text-center mb-5">
|
<ul class="grid grid-cols-4 gap-x-3 gap-y-5 text-center mb-5">
|
||||||
<li @click="openGiftDialog()">
|
<li @click="openGiftDialog()">
|
||||||
@@ -148,7 +157,7 @@
|
|||||||
<div class="grid items-start grid-cols-1 sm:grid-cols-3 gap-4">
|
<div class="grid items-start grid-cols-1 sm:grid-cols-3 gap-4">
|
||||||
<div class="bg-slate-100 px-4 py-3 rounded-md">
|
<div class="bg-slate-100 px-4 py-3 rounded-md">
|
||||||
<h3 class="text-sm uppercase font-semibold mb-3">
|
<h3 class="text-sm uppercase font-semibold mb-3">
|
||||||
Offered To This Project
|
Offered To This Idea
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<div v-if="offersToThis.length === 0">
|
<div v-if="offersToThis.length === 0">
|
||||||
@@ -166,9 +175,14 @@
|
|||||||
<fa icon="user" class="fa-fw text-slate-400"></fa>
|
<fa icon="user" class="fa-fw text-slate-400"></fa>
|
||||||
{{ didInfo(offer.agentDid, activeDid, allMyDids, allContacts) }}
|
{{ didInfo(offer.agentDid, activeDid, allMyDids, allContacts) }}
|
||||||
</span>
|
</span>
|
||||||
|
<a @click="onClickLoadClaim(offer.jwtId)">
|
||||||
|
<fa icon="circle-info" class="pl-2 pt-1 text-slate-500"></fa>
|
||||||
|
</a>
|
||||||
<span v-if="offer.amount">
|
<span v-if="offer.amount">
|
||||||
<fa icon="coins" class="fa-fw text-slate-400"></fa>
|
<fa
|
||||||
{{ offer.amount }}
|
:icon="iconForUnitCode(offer.unit)"
|
||||||
|
class="fa-fw text-slate-400"
|
||||||
|
/>{{ offer.amount }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="offer.objectDescription" class="text-slate-500">
|
<div v-if="offer.objectDescription" class="text-slate-500">
|
||||||
@@ -180,9 +194,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="bg-slate-100 px-4 py-3 rounded-md">
|
<div class="bg-slate-100 px-4 py-3 rounded-md">
|
||||||
<h3 class="text-sm uppercase font-semibold mb-3">
|
<h3 class="text-sm uppercase font-semibold mb-3">Given To This Idea</h3>
|
||||||
Given To This Project
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
<div v-if="givesToThis.length === 0">(None yet. Record one above.)</div>
|
<div v-if="givesToThis.length === 0">(None yet. Record one above.)</div>
|
||||||
|
|
||||||
@@ -197,9 +209,14 @@
|
|||||||
><fa icon="user" class="fa-fw text-slate-400"></fa>
|
><fa icon="user" class="fa-fw text-slate-400"></fa>
|
||||||
{{ didInfo(give.agentDid, activeDid, allMyDids, allContacts) }}
|
{{ didInfo(give.agentDid, activeDid, allMyDids, allContacts) }}
|
||||||
</span>
|
</span>
|
||||||
<span v-if="give.amount"
|
<a @click="onClickLoadClaim(give.jwtId)">
|
||||||
><fa icon="coins" class="fa-fw text-slate-400"></fa>
|
<fa icon="circle-info" class="pl-2 pt-1 text-slate-500"></fa>
|
||||||
{{ give.amount }}
|
</a>
|
||||||
|
<span v-if="give.amount">
|
||||||
|
<fa
|
||||||
|
:icon="iconForUnitCode(give.unit)"
|
||||||
|
class="fa-fw text-slate-400"
|
||||||
|
/>{{ give.amount }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="give.description" class="text-slate-500">
|
<div v-if="give.description" class="text-slate-500">
|
||||||
@@ -216,30 +233,34 @@
|
|||||||
class="bg-slate-100 px-4 py-3 rounded-md"
|
class="bg-slate-100 px-4 py-3 rounded-md"
|
||||||
>
|
>
|
||||||
<h3 class="text-sm uppercase font-semibold mb-3">
|
<h3 class="text-sm uppercase font-semibold mb-3">
|
||||||
Contributions To This Project
|
Contributions To This Idea
|
||||||
</h3>
|
</h3>
|
||||||
<ul>
|
<!-- centering because long, wrapped project names didn't left align with blank or "text-left" -->
|
||||||
<li v-for="plan in fulfillersToThis" :key="plan.handleId">
|
<div class="text-center">
|
||||||
|
<div v-for="plan in fulfillersToThis" :key="plan.handleId">
|
||||||
<button
|
<button
|
||||||
@click="onClickLoadProject(plan.handleId)"
|
@click="onClickLoadProject(plan.handleId)"
|
||||||
class="text-blue-500"
|
class="text-blue-500"
|
||||||
>
|
>
|
||||||
{{ plan.name }}
|
{{ plan.name }}
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</div>
|
||||||
</ul>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="fulfilledByThis" class="bg-slate-100 px-4 py-3 rounded-md">
|
<div v-if="fulfilledByThis" class="bg-slate-100 px-4 py-3 rounded-md">
|
||||||
<h3 class="text-sm uppercase font-semibold mb-3">
|
<h3 class="text-sm uppercase font-semibold mb-3">
|
||||||
Contributions By This Project
|
Contributions By This Idea
|
||||||
</h3>
|
</h3>
|
||||||
<button
|
<!-- centering because long, wrapped project names didn't left align with blank or "text-left" -->
|
||||||
@click="onClickLoadProject(fulfilledByThis.handleId)"
|
<div class="text-center">
|
||||||
class="text-blue-500"
|
<button
|
||||||
>
|
@click="onClickLoadProject(fulfilledByThis.handleId)"
|
||||||
{{ fulfilledByThis.name }}
|
class="text-blue-500"
|
||||||
</button>
|
>
|
||||||
|
{{ fulfilledByThis.name }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -263,10 +284,12 @@ import { Component, Vue } from "vue-facing-decorator";
|
|||||||
|
|
||||||
import GiftedDialog from "@/components/GiftedDialog.vue";
|
import GiftedDialog from "@/components/GiftedDialog.vue";
|
||||||
import OfferDialog from "@/components/OfferDialog.vue";
|
import OfferDialog from "@/components/OfferDialog.vue";
|
||||||
|
import TopMessage from "@/components/TopMessage.vue";
|
||||||
import { accountsDB, db } from "@/db/index";
|
import { accountsDB, db } from "@/db/index";
|
||||||
import { Contact } from "@/db/tables/contacts";
|
import { Contact } from "@/db/tables/contacts";
|
||||||
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";
|
||||||
|
import { isGlobalUri } from "@/libs/util";
|
||||||
import {
|
import {
|
||||||
didInfo,
|
didInfo,
|
||||||
GiverInputInfo,
|
GiverInputInfo,
|
||||||
@@ -286,7 +309,7 @@ interface Notification {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: { EntityIcon, GiftedDialog, OfferDialog, QuickNav },
|
components: { EntityIcon, GiftedDialog, OfferDialog, QuickNav, TopMessage },
|
||||||
})
|
})
|
||||||
export default class ProjectViewView extends Vue {
|
export default class ProjectViewView extends Vue {
|
||||||
$notify!: (notification: Notification, timeout?: number) => void;
|
$notify!: (notification: Notification, timeout?: number) => void;
|
||||||
@@ -309,6 +332,7 @@ export default class ProjectViewView extends Vue {
|
|||||||
timeSince = "";
|
timeSince = "";
|
||||||
truncatedDesc = "";
|
truncatedDesc = "";
|
||||||
truncateLength = 40;
|
truncateLength = 40;
|
||||||
|
url = "";
|
||||||
|
|
||||||
async created() {
|
async created() {
|
||||||
await db.open();
|
await db.open();
|
||||||
@@ -338,12 +362,6 @@ export default class ProjectViewView extends Vue {
|
|||||||
.equals(activeDid)
|
.equals(activeDid)
|
||||||
.first()) as Account;
|
.first()) as Account;
|
||||||
const identity = JSON.parse(account?.identity || "null");
|
const identity = JSON.parse(account?.identity || "null");
|
||||||
|
|
||||||
if (!identity) {
|
|
||||||
throw new Error(
|
|
||||||
"Attempted to load project records with no identity available.",
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return identity;
|
return identity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -410,19 +428,22 @@ export default class ProjectViewView extends Vue {
|
|||||||
this.truncatedDesc = this.description.slice(0, this.truncateLength);
|
this.truncatedDesc = this.description.slice(0, this.truncateLength);
|
||||||
this.latitude = resp.data.claim?.location?.geo?.latitude || 0;
|
this.latitude = resp.data.claim?.location?.geo?.latitude || 0;
|
||||||
this.longitude = resp.data.claim?.location?.geo?.longitude || 0;
|
this.longitude = resp.data.claim?.location?.geo?.longitude || 0;
|
||||||
} else if (resp.status === 404) {
|
this.url = resp.data.claim?.url || "";
|
||||||
// actually, axios throws an error so we never get here
|
} else {
|
||||||
|
// actually, axios throws an error on 404 so we probably never get here
|
||||||
|
console.log("Error getting project:", resp);
|
||||||
this.$notify(
|
this.$notify(
|
||||||
{
|
{
|
||||||
group: "alert",
|
group: "alert",
|
||||||
type: "danger",
|
type: "danger",
|
||||||
title: "Error",
|
title: "Error",
|
||||||
text: "That project does not exist.",
|
text: "There was a problem getting that project. See logs for more info.",
|
||||||
},
|
},
|
||||||
-1,
|
-1,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
|
console.error("Error retrieving project:", error);
|
||||||
const serverError = error as AxiosError;
|
const serverError = error as AxiosError;
|
||||||
if (serverError.response?.status === 404) {
|
if (serverError.response?.status === 404) {
|
||||||
this.$notify(
|
this.$notify(
|
||||||
@@ -444,7 +465,6 @@ export default class ProjectViewView extends Vue {
|
|||||||
},
|
},
|
||||||
-1,
|
-1,
|
||||||
);
|
);
|
||||||
console.error("Error retrieving project:", serverError.message);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -627,5 +647,59 @@ export default class ProjectViewView extends Vue {
|
|||||||
openOfferDialog() {
|
openOfferDialog() {
|
||||||
(this.$refs.customOfferDialog as OfferDialog).open();
|
(this.$refs.customOfferDialog as OfferDialog).open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onClickLoadClaim(jwtId: string) {
|
||||||
|
const route = {
|
||||||
|
path: "/claim/" + encodeURIComponent(jwtId),
|
||||||
|
};
|
||||||
|
this.$router.push(route);
|
||||||
|
}
|
||||||
|
|
||||||
|
UNIT_CODES: Record<string, Record<string, string>> = {
|
||||||
|
BTC: {
|
||||||
|
name: "Bitcoin",
|
||||||
|
faIcon: "bitcoin-sign",
|
||||||
|
},
|
||||||
|
HUR: {
|
||||||
|
name: "hours",
|
||||||
|
faIcon: "clock",
|
||||||
|
},
|
||||||
|
USD: {
|
||||||
|
name: "US Dollars",
|
||||||
|
faIcon: "dollar",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
iconForUnitCode(unitCode: string) {
|
||||||
|
return this.UNIT_CODES[unitCode]?.faIcon || "question";
|
||||||
|
}
|
||||||
|
|
||||||
|
// return an HTTPS URL if it's not a global URL
|
||||||
|
addScheme(url: string) {
|
||||||
|
if (!isGlobalUri(url)) {
|
||||||
|
return "https://" + url;
|
||||||
|
}
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
|
// return just the domain for display, if possible
|
||||||
|
domainForWebsite(url: string) {
|
||||||
|
try {
|
||||||
|
const hostname = new URL(url).hostname;
|
||||||
|
if (!hostname) {
|
||||||
|
// happens for non-http URLs
|
||||||
|
return url;
|
||||||
|
} else if (url.endsWith(hostname)) {
|
||||||
|
// it's just the domain
|
||||||
|
return hostname;
|
||||||
|
} else {
|
||||||
|
// there's more, but don't bother displaying the whole thing
|
||||||
|
return hostname + "...";
|
||||||
|
}
|
||||||
|
} catch (error: unknown) {
|
||||||
|
// must not be a valid URL
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<QuickNav selected="Projects"></QuickNav>
|
<QuickNav selected="Projects"></QuickNav>
|
||||||
|
<TopMessage />
|
||||||
|
|
||||||
<section id="Content" class="p-6 pb-24">
|
<section id="Content" class="p-6 pb-24">
|
||||||
<!-- Heading -->
|
<!-- Heading -->
|
||||||
<h1 id="ViewHeading" class="text-4xl text-center font-light pt-4 mb-8">
|
<h1 id="ViewHeading" class="text-4xl text-center font-light pt-4 mb-8">
|
||||||
Your Plans
|
Your Ideas
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<!-- Quick Search -->
|
<!-- Quick Search -->
|
||||||
@@ -79,6 +81,7 @@ import { IIdentifier } from "@veramo/core";
|
|||||||
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 EntityIcon from "@/components/EntityIcon.vue";
|
import EntityIcon from "@/components/EntityIcon.vue";
|
||||||
|
import TopMessage from "@/components/TopMessage.vue";
|
||||||
import { ProjectData } from "@/libs/endorserServer";
|
import { ProjectData } from "@/libs/endorserServer";
|
||||||
|
|
||||||
interface Notification {
|
interface Notification {
|
||||||
@@ -89,7 +92,7 @@ interface Notification {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: { InfiniteScroll, QuickNav, EntityIcon },
|
components: { InfiniteScroll, QuickNav, EntityIcon, TopMessage },
|
||||||
})
|
})
|
||||||
export default class ProjectsView extends Vue {
|
export default class ProjectsView extends Vue {
|
||||||
$notify!: (notification: Notification, timeout?: number) => void;
|
$notify!: (notification: Notification, timeout?: number) => void;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ importScripts(
|
|||||||
);
|
);
|
||||||
|
|
||||||
self.addEventListener("install", (event) => {
|
self.addEventListener("install", (event) => {
|
||||||
console.error(event);
|
console.log("Adding event listener for:", event);
|
||||||
importScripts(
|
importScripts(
|
||||||
"safari-notifications.js",
|
"safari-notifications.js",
|
||||||
"nacl.js",
|
"nacl.js",
|
||||||
@@ -23,16 +23,20 @@ self.addEventListener("push", function (event) {
|
|||||||
payload = JSON.parse(event.data.text());
|
payload = JSON.parse(event.data.text());
|
||||||
}
|
}
|
||||||
const message = await self.getNotificationCount();
|
const message = await self.getNotificationCount();
|
||||||
console.error(message);
|
if (message) {
|
||||||
const title = payload ? payload.title : "Custom Title";
|
console.log("Will notify user:", message);
|
||||||
const options = {
|
const title = payload ? payload.title : "Custom Title";
|
||||||
body: message,
|
const options = {
|
||||||
icon: payload ? payload.icon : "icon.png",
|
body: message,
|
||||||
badge: payload ? payload.badge : "badge.png",
|
icon: payload ? payload.icon : "icon.png",
|
||||||
};
|
badge: payload ? payload.badge : "badge.png",
|
||||||
await self.registration.showNotification(title, options);
|
};
|
||||||
|
await self.registration.showNotification(title, options);
|
||||||
|
} else {
|
||||||
|
console.log("No notification message, so will not tell the user.");
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error in processing the push event:", error);
|
console.error("Error processing the push event:", error);
|
||||||
}
|
}
|
||||||
})(),
|
})(),
|
||||||
);
|
);
|
||||||
@@ -51,7 +55,7 @@ self.addEventListener("activate", (event) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
self.addEventListener("fetch", (event) => {
|
self.addEventListener("fetch", (event) => {
|
||||||
console.log(event.request);
|
console.log("Got fetch event", event.request);
|
||||||
});
|
});
|
||||||
|
|
||||||
self.addEventListener("error", (event) => {
|
self.addEventListener("error", (event) => {
|
||||||
|
|||||||
@@ -395,12 +395,12 @@ async function setMostRecentNotified(id) {
|
|||||||
data["lastNotifiedClaimId"] = id;
|
data["lastNotifiedClaimId"] = id;
|
||||||
await updateRecord(store, data);
|
await updateRecord(store, data);
|
||||||
} else {
|
} else {
|
||||||
console.error("Record not found");
|
console.error("IndexedDB settings record not found.");
|
||||||
}
|
}
|
||||||
|
|
||||||
transaction.oncomplete = () => db.close();
|
transaction.oncomplete = () => db.close();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Database error: " + error.message);
|
console.error("IndexedDB error:", error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -466,6 +466,7 @@ async function getNotificationCount() {
|
|||||||
if ("secret" in self) {
|
if ("secret" in self) {
|
||||||
secret = self.secret;
|
secret = self.secret;
|
||||||
const secretUint8Array = self.decodeBase64(secret);
|
const secretUint8Array = self.decodeBase64(secret);
|
||||||
|
// 1 is our master settings ID; see MASTER_SETTINGS_KEY
|
||||||
const settings = await getSettingById(1);
|
const settings = await getSettingById(1);
|
||||||
let lastNotifiedClaimId = null;
|
let lastNotifiedClaimId = null;
|
||||||
if ("lastNotifiedClaimId" in settings) {
|
if ("lastNotifiedClaimId" in settings) {
|
||||||
@@ -496,7 +497,7 @@ async function getNotificationCount() {
|
|||||||
headers["Authorization"] = "Bearer " + (await accessToken(identifier));
|
headers["Authorization"] = "Bearer " + (await accessToken(identifier));
|
||||||
|
|
||||||
let response = await fetch(
|
let response = await fetch(
|
||||||
"https://test-api.endorser.ch/api/v2/report/claims",
|
settings["apiServer"] + "/api/v2/report/claims",
|
||||||
{
|
{
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers: headers,
|
headers: headers,
|
||||||
@@ -513,15 +514,17 @@ async function getNotificationCount() {
|
|||||||
}
|
}
|
||||||
newClaims++;
|
newClaims++;
|
||||||
}
|
}
|
||||||
if (newClaims === 0) {
|
if (newClaims > 0) {
|
||||||
result = "You have no new claims today.";
|
result = `There are ${newClaims} new activities on TimeSafari`;
|
||||||
} else {
|
|
||||||
result = `${newClaims} have been shared with you`;
|
|
||||||
}
|
}
|
||||||
const most_recent_notified = claims[0]["id"];
|
const most_recent_notified = claims[0]["id"];
|
||||||
await setMostRecentNotified(most_recent_notified);
|
await setMostRecentNotified(most_recent_notified);
|
||||||
} else {
|
} else {
|
||||||
console.error(response.status);
|
console.error(
|
||||||
|
"The service worker got a bad response status when fetching claims:",
|
||||||
|
response.status,
|
||||||
|
response,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
const { defineConfig } = require("@vue/cli-service");
|
const { defineConfig } = require("@vue/cli-service");
|
||||||
|
const { gitDescribeSync } = require("git-describe");
|
||||||
|
|
||||||
|
process.env.VUE_APP_GIT_HASH = gitDescribeSync().hash;
|
||||||
|
|
||||||
module.exports = defineConfig({
|
module.exports = defineConfig({
|
||||||
transpileDependencies: true,
|
transpileDependencies: true,
|
||||||
configureWebpack: {
|
configureWebpack: {
|
||||||
|
|||||||
29
web-push.md
29
web-push.md
@@ -390,3 +390,32 @@ While notifications are turned on, the user can tap on the App Notifications tog
|
|||||||
|
|
||||||
- "Turn off Notifications" to fully turn them off (which means the user will need to go through the dialogs agains to turn them back on).
|
- "Turn off Notifications" to fully turn them off (which means the user will need to go through the dialogs agains to turn them back on).
|
||||||
- "Leave it On" to make no changes and dismiss the dialog.
|
- "Leave it On" to make no changes and dismiss the dialog.
|
||||||
|
|
||||||
|
# NOTIFICATION STATES
|
||||||
|
|
||||||
|
* Unpermissioned. Push server cannot send notifications to the user because it does not have permission.
|
||||||
|
This may be the same as when the user gave permission in the past but has since revoked it at the OS or browser
|
||||||
|
level, outside the app. (User can change to Permissioned when the user gives permission.)
|
||||||
|
* Permissioned. (User can change to Unpermissioned via the OS or browser settings.)
|
||||||
|
* Active. (User can change to Muted when the user mutes notifications.)
|
||||||
|
* Muted. (User can change to Active when the user toggles it.)
|
||||||
|
(Turning mute off automatically after some amount of time is not planned in version 1.)
|
||||||
|
|
||||||
|
|
||||||
|
# TROUBLESHOOTING
|
||||||
|
|
||||||
|
## Desktop
|
||||||
|
|
||||||
|
#### Firefox
|
||||||
|
|
||||||
|
Go to `about:debugging` and click on `Inspect` for the service worker.
|
||||||
|
|
||||||
|
#### Chrome
|
||||||
|
|
||||||
|
Go to `chrome://inspect/#service-workers` and click on `Inspect` for the service worker.
|
||||||
|
|
||||||
|
## Mobile
|
||||||
|
|
||||||
|
#### Android
|
||||||
|
|
||||||
|
#### iOS
|
||||||
|
|||||||
Reference in New Issue
Block a user