Browse Source

add flag for logging a contribution as a trade

kb/add-usage-guide
Trent Larson 9 months ago
parent
commit
8a7ce0fe65
  1. 2
      README.md
  2. 2
      package.json
  3. 25
      project.task.yaml
  4. 16
      src/components/GiftedDialog.vue
  5. 15
      src/libs/endorserServer.ts
  6. 4
      src/views/HomeView.vue
  7. 6
      src/views/ProjectViewView.vue

2
README.md

@ -38,6 +38,8 @@ If you are deploying in a subdirectory, add it to `publicPath` in vue.config.js,
... to copy the contents of the `sw_scripts` folder to the `dist` folder - except additional_scripts.js.
* Get on the server and back up the time-safari folder.
* `rsync -azvu -e "ssh -i ~/.ssh/..." dist ubuntutest@test.timesafari.app:time-safari`
* Revert src/constants/app.ts and package.json (if that was prod), edit package.json to increment version & add "-beta", `npm install`, and commit. Also record what version is on production.

2
package.json

@ -1,6 +1,6 @@
{
"name": "TimeSafari_Test",
"version": "0.2.2",
"version": "0.2.3-beta",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",

25
project.task.yaml

@ -1,19 +1,30 @@
tasks:
- record donations vs gives
- in mobile - change give & fulfills to array of objects?
- migrate all existing records to gifts (after clients send DonateAction)
- update docs
- show VC details... somehow:
- add VC confirmation - BVC may have an org page
- 01 show my VCs - most interesting, or via search
- 04 allow user to download chains of VCs, mine + ones I can see about me from others
- add VC confirmation
- on gives feed - link to project
- show feed of offers, new projects, etc -- maybe limited to my search area
- revenue
- copy button for seed
- .5 If notifications are not enabled, add message to front page with link/button to enable
- record donations vs gives
- make server endpoint for full English description of limits
- make identicons for contacts into more-memorable faces (and maybe change project identicons, too)
- create a help-desk document & add screenshots
- 01 server - show all claim details when issued by the issuer
- .1 update "offer" units to have same functionality as "give" units
- on home page, prompt for install check in addition to "supports notifications" check (since they won't get notified if Chrome is closed)
- 01 on Mac (& Windows?) desktop, add a help blurb so that they can find it again (since it doesn't show in Application list)
- bug - got error adding on Firefox user #0 as contact for themselves
- bug (that is hard to reproduce) - 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
@ -21,12 +32,10 @@ tasks:
- bug (that is hard to reproduce) - on the second 'give' recorded on prod it showed me as the agent
- 01 send visibility signal as a VC and store it
- 04 remove 'rowid' references (that are sqlite-specific); may involve server
- 04 look at other examples for better UI friend.tech
- 01 make the prod build copy the sw_scripts
- .5 Add start date to project
- 04 look at other examples for better UI, eg friend.tech
- .5 Add inactive flag / end date, start date to project
- .3 check that Android shows "back" buttons on screens without bottom tray
- .1 Make give description text box into something that expands as they type?
- .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
@ -34,11 +43,11 @@ tasks:
- 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)
- .1 remove 2 second setTimeout in NewEditProjectView.vue
- 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
- 04 fix lack of initial notification in Firefox (on MacOS, maybe others)
- .5 fix masked icon (because some of the top-right of the binoculars is cut off)
- contacts v+ :
- 01 Import all the non-sensitive data (ie. contacts & settings).

16
src/components/GiftedDialog.vue

@ -36,9 +36,15 @@
<fa icon="chevron-right" />
</div>
</div>
<div v-if="showGivenToUser" class="mt-2 text-right">
<input type="checkbox" class="mr-2" v-model="givenToUser" />
<label class="text-sm">Given to you</label>
<div class="mt-2 text-right">
<span v-if="showGivenToUser" class="mt-2 mr-16">
<input type="checkbox" class="mr-2" v-model="givenToUser" />
<label class="text-sm">Given to you</label>
</span>
<span class="mt-2">
<input type="checkbox" class="mr-2" v-model="isTrade" />
<label class="text-sm">Trade (not a gift)</label>
</span>
</div>
<p class="text-center mb-2 mt-6 italic">
Sign & Send to publish to the world
@ -88,6 +94,7 @@ export default class GiftedDialog extends Vue {
giver?: GiverInputInfo; // undefined means no identified giver agent
description = "";
givenToUser = false;
isTrade = false;
unitCode = "HUR";
visible = false;
@ -264,6 +271,7 @@ export default class GiftedDialog extends Vue {
amountInput,
unitCode,
this.projectId,
this.isTrade,
);
if (
@ -287,7 +295,7 @@ export default class GiftedDialog extends Vue {
group: "alert",
type: "success",
title: "Success",
text: "That gift was recorded.",
text: `That ${this.isTrade ? "trade" : "gift"} was recorded.`,
},
7000,
);

15
src/libs/endorserServer.ts

@ -88,7 +88,7 @@ export interface GiveVerifiableCredential {
"@type": "GiveAction";
agent?: { identifier: string };
description?: string;
fulfills?: { "@type": string; identifier?: string; lastClaimId?: string };
fulfills?: { "@type": string; identifier?: string; lastClaimId?: string }[];
identifier?: string;
object?: { amountOfThisGood: number; unitCode: string };
recipient?: { identifier: string };
@ -312,6 +312,7 @@ export async function createAndSubmitGive(
hours?: number,
unitCode?: string,
fulfillsProjectHandleId?: string,
isTrade: boolean = false,
): Promise<CreateAndSubmitClaimResult> {
const vcClaim: GiveVerifiableCredential = {
"@context": "https://schema.org",
@ -322,10 +323,16 @@ export async function createAndSubmitGive(
object: hours
? { amountOfThisGood: hours, unitCode: unitCode || "HUR" }
: undefined,
fulfills: fulfillsProjectHandleId
? { "@type": "PlanAction", identifier: fulfillsProjectHandleId }
: undefined,
fulfills: [{ "@type": isTrade ? "TradeAction" : "DonateAction" }],
};
if (fulfillsProjectHandleId) {
vcClaim.fulfills = vcClaim.fulfills || []; // weird that it won't typecheck without this
vcClaim.fulfills.push({
"@type": "PlanAction",
identifier: fulfillsProjectHandleId,
});
}
console.log("createAndSubmitGive vcClaim", vcClaim);
return createAndSubmitClaim(
vcClaim as GenericServerRecord,
identity,

4
src/views/HomeView.vue

@ -385,7 +385,9 @@ export default class HomeView extends Vue {
public async retrieveGives(endorserApiServer: string, beforeId?: string) {
const beforeQuery = beforeId == null ? "" : "&beforeId=" + beforeId;
const response = await fetch(
endorserApiServer + "/api/v2/report/gives?" + beforeQuery,
endorserApiServer +
"/api/v2/report/gives?giftNotTrade=true&" +
beforeQuery,
{
method: "GET",
headers: await this.buildHeaders(),

6
src/views/ProjectViewView.vue

@ -162,7 +162,7 @@
</h3>
<div v-if="offersToThis.length === 0">
(None yet. Record one above.)
(None yet. Wanna offer something if others join you?)
</div>
<ul v-else class="text-sm border-t border-slate-300">
@ -197,7 +197,9 @@
<div class="bg-slate-100 px-4 py-3 rounded-md">
<h3 class="text-sm uppercase font-semibold mb-3">Given To This Idea</h3>
<div v-if="givesToThis.length === 0">(None yet. Record one above.)</div>
<div v-if="givesToThis.length === 0">
(None yet. You can be the first.)
</div>
<ul v-else class="text-sm border-t border-slate-300">
<li

Loading…
Cancel
Save