From 6aab1ff49dc2f053bb88a5d8455e50232e194567 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sat, 24 Feb 2024 10:26:12 -0700 Subject: [PATCH 01/11] consolidate interface and remove copies of code --- src/App.vue | 11 ++--------- src/components/GiftedDialog.vue | 11 +++-------- src/components/GiftedPrompts.vue | 11 ++--------- src/components/OfferDialog.vue | 11 +++-------- src/components/TopMessage.vue | 12 +++--------- src/views/AccountViewView.vue | 15 ++++++--------- src/views/ClaimView.vue | 10 ++-------- src/views/ContactAmountsView.vue | 20 +++++++------------- src/views/ContactGiftingView.vue | 19 +++++++------------ src/views/ContactQRScanShowView.vue | 10 ++-------- src/views/DiscoverView.vue | 20 +++++++------------- src/views/HelpNotificationsView.vue | 10 ++-------- src/views/HelpView.vue | 10 ++-------- src/views/HomeView.vue | 12 +++--------- src/views/IdentitySwitcherView.vue | 12 +++--------- src/views/ImportAccountView.vue | 17 ++++++----------- src/views/NewEditProjectView.vue | 10 ++-------- src/views/ProjectViewView.vue | 18 ++++++------------ src/views/ProjectsView.vue | 10 ++-------- src/views/SearchAreaView.vue | 12 +++--------- src/views/SeedBackupView.vue | 15 +++++---------- src/views/StatisticsView.vue | 11 +++-------- 22 files changed, 81 insertions(+), 206 deletions(-) diff --git a/src/App.vue b/src/App.vue index 2d8935fa..0fee98a8 100644 --- a/src/App.vue +++ b/src/App.vue @@ -288,21 +288,14 @@ interface VapidResponse { }; } -import { DEFAULT_PUSH_SERVER } from "@/constants/app"; +import { DEFAULT_PUSH_SERVER, NotificationIface } from "@/constants/app"; import { db } from "@/db/index"; import { MASTER_SETTINGS_KEY } from "@/db/tables/settings"; import { sendTestThroughPushServer } from "@/libs/util"; -interface Notification { - group: string; - type: string; - title: string; - text: string; -} - @Component export default class App extends Vue { - $notify!: (notification: Notification, timeout?: number) => void; + $notify!: (notification: NotificationIface, timeout?: number) => void; b64 = ""; serviceWorkerReady = false; diff --git a/src/components/GiftedDialog.vue b/src/components/GiftedDialog.vue index 3edb081c..5353f9e4 100644 --- a/src/components/GiftedDialog.vue +++ b/src/components/GiftedDialog.vue @@ -67,6 +67,8 @@ diff --git a/src/views/QuickActionBvcEndView.vue b/src/views/QuickActionBvcEndView.vue new file mode 100644 index 00000000..c86fb585 --- /dev/null +++ b/src/views/QuickActionBvcEndView.vue @@ -0,0 +1,228 @@ + + + diff --git a/src/views/QuickActionBvcView.vue b/src/views/QuickActionBvcView.vue new file mode 100644 index 00000000..48aa8599 --- /dev/null +++ b/src/views/QuickActionBvcView.vue @@ -0,0 +1,52 @@ + + + From 2058205150bc2ed284cb24167158b09c3babea76 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sun, 25 Feb 2024 18:38:54 -0700 Subject: [PATCH 03/11] for BVC shortcut: send attend & give actions, and list actions to confirm --- src/App.vue | 4 +- src/components/GiftedDialog.vue | 19 +--- src/components/OfferDialog.vue | 27 +----- src/libs/endorserServer.ts | 39 +++++--- src/libs/util.ts | 30 +++++- src/views/AccountViewView.vue | 2 +- src/views/ContactAmountsView.vue | 2 +- src/views/ContactGiftingView.vue | 2 +- src/views/ContactQRScanShowView.vue | 3 +- src/views/ContactsView.vue | 18 ++-- src/views/DiscoverView.vue | 8 +- src/views/HomeView.vue | 8 +- src/views/QuickActionBvcBeginView.vue | 131 +++++++++++++++++++++++--- src/views/QuickActionBvcEndView.vue | 71 +++++++++----- src/views/QuickActionBvcView.vue | 2 +- 15 files changed, 247 insertions(+), 119 deletions(-) diff --git a/src/App.vue b/src/App.vue index 0fee98a8..484d0153 100644 --- a/src/App.vue +++ b/src/App.vue @@ -582,7 +582,7 @@ export default class App extends Vue { } }) .catch((error) => { - console.log("Push provider server communication failed:", error); + console.error("Push provider server communication failed:", error); return false; }); @@ -597,7 +597,7 @@ export default class App extends Vue { return response.ok; }) .catch((error) => { - console.log("Push server communication failed:", error); + console.error("Push server communication failed:", error); return false; }); diff --git a/src/components/GiftedDialog.vue b/src/components/GiftedDialog.vue index 5353f9e4..4d5da377 100644 --- a/src/components/GiftedDialog.vue +++ b/src/components/GiftedDialog.vue @@ -77,7 +77,6 @@ import { import * as libsUtil from "@/libs/util"; import { accountsDB, db } from "@/db/index"; import { MASTER_SETTINGS_KEY, Settings } from "@/db/tables/settings"; -import { Account } from "@/db/tables/accounts"; import { Contact } from "@/db/tables/contacts"; @Component @@ -206,22 +205,6 @@ export default class GiftedDialog extends Vue { }); } - public async getIdentity(activeDid: string) { - 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 Give records for DID ${activeDid} but no identifier was found", - ); - } - return identity; - } - /** * * @param giverDid may be null @@ -262,7 +245,7 @@ export default class GiftedDialog extends Vue { } try { - const identity = await this.getIdentity(this.activeDid); + const identity = await libsUtil.getIdentity(this.activeDid); const result = await createAndSubmitGive( this.axios, this.apiServer, diff --git a/src/components/OfferDialog.vue b/src/components/OfferDialog.vue index c0f2b69b..6cce99dd 100644 --- a/src/components/OfferDialog.vue +++ b/src/components/OfferDialog.vue @@ -72,9 +72,8 @@ import { Vue, Component, Prop } from "vue-facing-decorator"; import { NotificationIface } from "@/constants/app"; import { createAndSubmitOffer } from "@/libs/endorserServer"; import * as libsUtil from "@/libs/util"; -import { accountsDB, db } from "@/db/index"; +import { db } from "@/db/index"; import { MASTER_SETTINGS_KEY, Settings } from "@/db/tables/settings"; -import { Account } from "@/db/tables/accounts"; @Component export default class OfferDialog extends Vue { @@ -102,7 +101,7 @@ export default class OfferDialog extends Vue { this.activeDid = settings?.activeDid || ""; // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (err: any) { - console.log("Error retrieving settings from database:", err); + console.error("Error retrieving settings from database:", err); this.$notify( { group: "alert", @@ -173,22 +172,6 @@ export default class OfferDialog extends Vue { }); } - public async getIdentity(activeDid: string) { - 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 Offer records for DID ${activeDid} but no identifier was found`, - ); - } - return identity; - } - /** * * @param description may be an empty string @@ -228,7 +211,7 @@ export default class OfferDialog extends Vue { } try { - const identity = await this.getIdentity(this.activeDid); + const identity = await libsUtil.getIdentity(this.activeDid); const result = await createAndSubmitOffer( this.axios, this.apiServer, @@ -245,7 +228,7 @@ export default class OfferDialog extends Vue { this.isOfferCreationError(result.response) ) { const errorMessage = this.getOfferCreationErrorMessage(result); - console.log("Error with offer creation result:", result); + console.error("Error with offer creation result:", result); this.$notify( { group: "alert", @@ -268,7 +251,7 @@ export default class OfferDialog extends Vue { } // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (error: any) { - console.log("Error with offer recordation caught:", error); + console.error("Error with offer recordation caught:", error); const message = error.userMessage || error.response?.data?.error?.message || diff --git a/src/libs/endorserServer.ts b/src/libs/endorserServer.ts index be4865de..2d64b8ab 100644 --- a/src/libs/endorserServer.ts +++ b/src/libs/endorserServer.ts @@ -229,16 +229,16 @@ export interface ErrorResponse { }; } -export interface ErrorResult { - type: "error"; - error: InternalError; -} - export interface InternalError { error: string; // for system logging userMessage?: string; // for user display } +export interface ErrorResult extends ResultWithType { + type: "error"; + error: InternalError; +} + export type CreateAndSubmitClaimResult = SuccessResult | ErrorResult; // This is used to check for hidden info. @@ -758,12 +758,23 @@ export const claimSpecialDescription = ( } }; -// from https://stackoverflow.com/a/175787/845494 -// -export function isNumeric(str: string): boolean { - return !isNaN(+str); -} - -export function numberOrZero(str: string): number { - return isNumeric(str) ? +str : 0; -} +export const BVC_MEETUPS_PROJECT_CLAIM_ID = + //"https://endorser.ch/entity/01GXYPFF7FA03NXKPYY142PY4H"; + "https://endorser.ch/entity/01HNTZYJJXTGT0EZS3VEJGX7AK"; + +export const bvcMeetingJoinClaim = (did: string, startTime: string) => { + return { + "@context": SCHEMA_ORG_CONTEXT, + "@type": "JoinAction", + agent: { + identifier: did, + }, + event: { + organizer: { + name: "Bountiful Voluntaryist Community", + }, + name: "Saturday Morning Meeting", + startTime: startTime, + }, + }; +}; diff --git a/src/libs/util.ts b/src/libs/util.ts index 822cdaab..99c51ec1 100644 --- a/src/libs/util.ts +++ b/src/libs/util.ts @@ -1,14 +1,16 @@ // many of these are also found in endorser-mobile utility.ts import axios, { AxiosResponse } from "axios"; +import { IIdentifier } from "@veramo/core"; +import { useClipboard } from "@vueuse/core"; import { DEFAULT_PUSH_SERVER } from "@/constants/app"; import { accountsDB, db } from "@/db/index"; +import { Account } from "@/db/tables/accounts"; import { MASTER_SETTINGS_KEY } from "@/db/tables/settings"; import { deriveAddress, generateSeed, newIdentifier } from "@/libs/crypto"; import { GenericServerRecord, containsHiddenDid } from "@/libs/endorserServer"; import * as serverUtil from "@/libs/endorserServer"; -import { useClipboard } from "@vueuse/core"; // eslint-disable-next-line @typescript-eslint/no-var-requires const Buffer = require("buffer/").Buffer; @@ -55,6 +57,16 @@ export function iconForUnitCode(unitCode: string) { return UNIT_CODES[unitCode]?.faIcon || "question"; } +// from https://stackoverflow.com/a/175787/845494 +// +export function isNumeric(str: string): boolean { + return !isNaN(+str); +} + +export function numberOrZero(str: string): number { + return isNumeric(str) ? +str : 0; +} + export const isGlobalUri = (uri: string) => { return uri && uri.match(new RegExp(/^[A-Za-z][A-Za-z0-9+.-]+:/)); }; @@ -180,6 +192,22 @@ export function findAllVisibleToDids( * **/ +export const getIdentity = async (activeDid: string): Promise => { + 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 Offer records for DID ${activeDid} but no identifier was found`, + ); + } + return identity; +}; + /** * Generates a new identity, saves it to the database, and sets it as the active identity. * @return {Promise} with the DID of the new identity diff --git a/src/views/AccountViewView.vue b/src/views/AccountViewView.vue index 7b72d53c..343871b6 100644 --- a/src/views/AccountViewView.vue +++ b/src/views/AccountViewView.vue @@ -446,7 +446,7 @@ > Show Shortcut on Home PageShow BVC Shortcut on Home Page
diff --git a/src/views/ContactAmountsView.vue b/src/views/ContactAmountsView.vue index 2902174e..a6fc0ff9 100644 --- a/src/views/ContactAmountsView.vue +++ b/src/views/ContactAmountsView.vue @@ -179,7 +179,7 @@ export default class ContactAmountssView extends Vue { } // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (err: any) { - console.log("Error retrieving settings or gives.", err); + console.error("Error retrieving settings or gives.", err); this.$notify( { group: "alert", diff --git a/src/views/ContactGiftingView.vue b/src/views/ContactGiftingView.vue index d0144f70..ac59292f 100644 --- a/src/views/ContactGiftingView.vue +++ b/src/views/ContactGiftingView.vue @@ -119,7 +119,7 @@ export default class ContactGiftingView extends Vue { // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (err: any) { - console.log("Error retrieving settings & contacts:", err); + console.error("Error retrieving settings & contacts:", err); this.$notify( { group: "alert", diff --git a/src/views/ContactQRScanShowView.vue b/src/views/ContactQRScanShowView.vue index f5cc1860..2744121f 100644 --- a/src/views/ContactQRScanShowView.vue +++ b/src/views/ContactQRScanShowView.vue @@ -180,7 +180,6 @@ export default class ContactQRScanShow extends Vue { // eslint-disable-next-line @typescript-eslint/no-explicit-any onScanDetect(content: any) { if (content[0]?.rawValue) { - //console.log("onDetect", content[0].rawValue); localStorage.setItem("contactEndorserUrl", content[0].rawValue); this.$router.push({ name: "contacts" }); } else { @@ -198,7 +197,7 @@ export default class ContactQRScanShow extends Vue { // eslint-disable-next-line @typescript-eslint/no-explicit-any onScanError(error: any) { - console.log("Scan was invalid:", error); + console.error("Scan was invalid:", error); this.$notify( { group: "alert", diff --git a/src/views/ContactsView.vue b/src/views/ContactsView.vue index 3f353990..494e5379 100644 --- a/src/views/ContactsView.vue +++ b/src/views/ContactsView.vue @@ -284,6 +284,7 @@ diff --git a/src/views/QuickActionBvcEndView.vue b/src/views/QuickActionBvcEndView.vue index c86fb585..ca20e855 100644 --- a/src/views/QuickActionBvcEndView.vue +++ b/src/views/QuickActionBvcEndView.vue @@ -15,19 +15,26 @@
-

+

End of BVC Saturday Meeting

-

Confirm

-
- There are no claims today yet for you to confirm. - - (There are {{ claimCountWithHidden }} hidden claims.) +

Confirm

+
+ +
+
+ There are no claims yet today for you to confirm. + + {{ + claimCountWithHidden === 1 + ? "(There is 1 claim with hidden details.)" + : `(There are ${claimCountWithHidden} claims with hidden details.)` + }}
-
    +
    • - + {{ claimSpecialDescription( @@ -59,10 +78,10 @@
-

Anything else?

-
+

Anything else?

+
- Someone gave + Someone else gave
-
+
+
+ +
@@ -123,7 +152,9 @@ export default class QuickActionBvcBeginView extends Vue { apiServer = ""; claimCountWithHidden = 0; claimsToConfirm: GenericServerRecord[] = []; - description = ""; + claimsToConfirmSelected: string[] = []; + description = "breakfast"; + loadingConfirms = true; someoneGave = false; async created() { @@ -135,6 +166,7 @@ export default class QuickActionBvcBeginView extends Vue { } async mounted() { + this.loadingConfirms = true; let currentOrPreviousSat = DateTime.now().setZone("America/Denver"); if (currentOrPreviousSat.weekday < 6) { // it's not Saturday or Sunday, @@ -165,15 +197,7 @@ export default class QuickActionBvcBeginView extends Vue { const headers = { Authorization: "Bearer " + (await accessToken(identity)), }; - console.log("todayOrPreviousStartDate", todayOrPreviousStartDate); try { - console.log( - this.apiServer + - "/api/claim/?" + - "issuedAt_greaterThanOrEqualTo=" + - encodeURIComponent(todayOrPreviousStartDate) + - "&excludeConfirmations=true", - ); const response = await fetch( this.apiServer + "/api/claim/?" + @@ -187,7 +211,7 @@ export default class QuickActionBvcBeginView extends Vue { console.log("Bad response", response); throw new Error("Bad response when retrieving claims."); } - response.json().then((data) => { + await response.json().then((data) => { const dataByOthers = R.reject( (claim: GenericServerRecord) => claim.issuer === this.activeDid, data, @@ -212,6 +236,7 @@ export default class QuickActionBvcBeginView extends Vue { -1, ); } + this.loadingConfirms = false; } onClickLoadClaim(jwtId: string) { diff --git a/src/views/QuickActionBvcView.vue b/src/views/QuickActionBvcView.vue index 48aa8599..67c5f653 100644 --- a/src/views/QuickActionBvcView.vue +++ b/src/views/QuickActionBvcView.vue @@ -15,7 +15,7 @@
-

+

Bountiful Voluntaryist Community Actions

From 0b24d7bbd82d4dd8907de648a792f93dee87d26e Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sun, 25 Feb 2024 18:55:58 -0700 Subject: [PATCH 04/11] for BVC: fix the attendee & show appropriate success message --- src/views/QuickActionBvcBeginView.vue | 104 +++++++++++++++----------- 1 file changed, 59 insertions(+), 45 deletions(-) diff --git a/src/views/QuickActionBvcBeginView.vue b/src/views/QuickActionBvcBeginView.vue index b5c58db8..7cc0d998 100644 --- a/src/views/QuickActionBvcBeginView.vue +++ b/src/views/QuickActionBvcBeginView.vue @@ -91,8 +91,6 @@ import { MASTER_SETTINGS_KEY, Settings } from "@/db/tables/settings"; export default class QuickActionBvcBeginView extends Vue { $notify!: (notification: NotificationIface, timeout?: number) => void; - activeDid = ""; - apiServer = ""; attended = true; gaveTime = true; hoursStr = "1"; @@ -127,60 +125,76 @@ export default class QuickActionBvcBeginView extends Vue { const hoursNum = libsUtil.numberOrZero(this.hoursStr); const identity = await libsUtil.getIdentity(activeDid); - const result = await createAndSubmitGive( - axios, - apiServer, - identity, - activeDid, - undefined, - undefined, - hoursNum, - "HUR", - BVC_MEETUPS_PROJECT_CLAIM_ID, - ); - if (result.type === "error") { - console.error("Error sending give:", result); - this.$notify( - { - group: "alert", - type: "danger", - title: "Error", - text: - result?.error?.userMessage || - "There was an error sending the give.", - }, - -1, + let timeSuccess = false; + if (this.gaveTime && hoursNum > 0) { + const timeResult = await createAndSubmitGive( + axios, + apiServer, + identity, + activeDid, + undefined, + undefined, + hoursNum, + "HUR", + BVC_MEETUPS_PROJECT_CLAIM_ID, ); + if (timeResult.type === "success") { + timeSuccess = true; + } else { + console.error("Error sending give:", timeResult); + this.$notify( + { + group: "alert", + type: "danger", + title: "Error", + text: + timeResult?.error?.userMessage || + "There was an error sending the time.", + }, + -1, + ); + } } - const result2 = await createAndSubmitClaim( - bvcMeetingJoinClaim(this.activeDid, this.todayOrPreviousStartDate), - identity, - apiServer, - axios, - ); - if (result2.type === "error") { - console.error("Error sending give:", result2); - this.$notify( - { - group: "alert", - type: "danger", - title: "Error", - text: - result2?.error?.userMessage || - "There was an error sending the attendance.", - }, - -1, + let attendedSuccess = false; + if (this.attended) { + const attendResult = await createAndSubmitClaim( + bvcMeetingJoinClaim(activeDid, this.todayOrPreviousStartDate), + identity, + apiServer, + axios, ); + if (attendResult.type === "success") { + attendedSuccess = true; + } else { + console.error("Error sending give:", attendResult); + this.$notify( + { + group: "alert", + type: "danger", + title: "Error", + text: + attendResult?.error?.userMessage || + "There was an error sending the attendance.", + }, + -1, + ); + } } - if (result.type === "success" || result2.type === "success") { + if (timeSuccess || attendedSuccess) { + const actions = + timeSuccess && attendedSuccess + ? "attendance and time have been" + : timeSuccess + ? "time has been" + : "attendance has been"; this.$notify( { group: "alert", type: "success", title: "Success", - text: "Your actions have been recorded.", + text: `Your ${actions} recorded.`, }, -1, ); From 2c28913d974bc4085f8a8167f9d3394bd5f42b59 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Mon, 26 Feb 2024 19:27:34 -0700 Subject: [PATCH 05/11] for BVC: finish submission of confirmations & final give --- src/libs/endorserServer.ts | 39 +++++++-- src/views/ClaimView.vue | 5 +- src/views/ProjectViewView.vue | 5 +- src/views/QuickActionBvcBeginView.vue | 4 +- src/views/QuickActionBvcEndView.vue | 119 +++++++++++++++++++++++++- 5 files changed, 152 insertions(+), 20 deletions(-) diff --git a/src/libs/endorserServer.ts b/src/libs/endorserServer.ts index 2d64b8ab..48856114 100644 --- a/src/libs/endorserServer.ts +++ b/src/libs/endorserServer.ts @@ -22,7 +22,7 @@ export interface AgreeVerifiableCredential { "@type": string; // "any" because arbitrary objects can be subject of agreement // eslint-disable-next-line @typescript-eslint/no-explicit-any - object: Record; + object: Record; } export interface GiverInputInfo { @@ -46,6 +46,7 @@ export interface ClaimResult { export interface GenericVerifiableCredential { "@context": string; "@type": string; + [key: string]: any; // eslint-disable-line @typescript-eslint/no-explicit-any } export interface GenericServerRecord extends GenericVerifiableCredential { @@ -54,7 +55,7 @@ export interface GenericServerRecord extends GenericVerifiableCredential { issuedAt: string; issuer: string; // eslint-disable-next-line @typescript-eslint/no-explicit-any - claim: Record; + claim: Record; claimType?: string; } export const BLANK_GENERIC_SERVER_RECORD: GenericServerRecord = { @@ -330,7 +331,7 @@ export function addLastClaimOrHandleAsIdIfMissing( } // return clone of object without any nested *VisibleToDids keys -// similar logic is found in endorser-mobile +// similar code is also contained in endorser-mobile // eslint-disable-next-line @typescript-eslint/no-explicit-any export function removeVisibleToDids(input: any): any { if (input instanceof Object) { @@ -340,7 +341,6 @@ export function removeVisibleToDids(input: any): any { const result: Record = {}; 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])); } } @@ -349,7 +349,6 @@ export function removeVisibleToDids(input: any): any { // it's an array return R.map(removeVisibleToDids, input); } - return false; } else { return input; } @@ -518,6 +517,28 @@ export async function createAndSubmitOffer( ); } +// similar logic is found in endorser-mobile +export const createAndSubmitConfirmation = async ( + identifier: IIdentifier, + claim: GenericVerifiableCredential, + lastClaimId: string, // used to set the lastClaimId + handleId: string | undefined, + apiServer: string, + axios: Axios, +) => { + const goodClaim = removeSchemaContext( + removeVisibleToDids( + addLastClaimOrHandleAsIdIfMissing(claim, lastClaimId, handleId), + ), + ); + const confirmationClaim: GenericVerifiableCredential = { + "@context": "https://schema.org", + "@type": "AgreeAction", + object: goodClaim, + }; + return createAndSubmitClaim(confirmationClaim, identifier, apiServer, axios); +}; + export async function createAndSubmitClaim( vcClaim: GenericVerifiableCredential, identity: IIdentifier, @@ -583,7 +604,7 @@ export async function createAndSubmitClaim( } // eslint-disable-next-line @typescript-eslint/no-explicit-any -export const isAccept = (claim: Record) => { +export const isAccept = (claim: Record) => { return ( claim && claim["@context"] === SCHEMA_ORG_CONTEXT && @@ -592,7 +613,7 @@ export const isAccept = (claim: Record) => { }; // eslint-disable-next-line @typescript-eslint/no-explicit-any -export const isOffer = (claim: Record) => { +export const isOffer = (claim: Record) => { return ( claim && claim["@context"] === SCHEMA_ORG_CONTEXT && @@ -622,7 +643,7 @@ export const capitalizeAndInsertSpacesBeforeCaps = (text: string) => { similar code is also contained in endorser-mobile **/ // eslint-disable-next-line @typescript-eslint/no-explicit-any -const claimSummary = (claim: Record) => { +const claimSummary = (claim: Record) => { if (!claim) { // to differentiate from "something" above return "something"; @@ -630,7 +651,7 @@ const claimSummary = (claim: Record) => { if (claim.claim) { // probably a Verified Credential // eslint-disable-next-line @typescript-eslint/no-explicit-any - claim = claim.claim as Record; + claim = claim.claim as Record; } if (Array.isArray(claim)) { if (claim.length === 1) { diff --git a/src/views/ClaimView.vue b/src/views/ClaimView.vue index f0a1b176..df55346c 100644 --- a/src/views/ClaimView.vue +++ b/src/views/ClaimView.vue @@ -730,10 +730,7 @@ export default class ClaimView extends Vue { ), ), ); - const confirmationClaim: serverUtil.GenericVerifiableCredential & { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - object: any; - } = { + const confirmationClaim: serverUtil.GenericVerifiableCredential = { "@context": "https://schema.org", "@type": "AgreeAction", object: goodClaim, diff --git a/src/views/ProjectViewView.vue b/src/views/ProjectViewView.vue index 317e0710..10dc4722 100644 --- a/src/views/ProjectViewView.vue +++ b/src/views/ProjectViewView.vue @@ -800,10 +800,7 @@ export default class ProjectViewView extends Vue { ), ), ); - const confirmationClaim: serverUtil.GenericVerifiableCredential & { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - object: any; - } = { + const confirmationClaim: serverUtil.GenericVerifiableCredential = { "@context": "https://schema.org", "@type": "AgreeAction", object: goodClaim, diff --git a/src/views/QuickActionBvcBeginView.vue b/src/views/QuickActionBvcBeginView.vue index 7cc0d998..1aaf51c5 100644 --- a/src/views/QuickActionBvcBeginView.vue +++ b/src/views/QuickActionBvcBeginView.vue @@ -125,6 +125,7 @@ export default class QuickActionBvcBeginView extends Vue { const hoursNum = libsUtil.numberOrZero(this.hoursStr); const identity = await libsUtil.getIdentity(activeDid); + // first send the claim for time given let timeSuccess = false; if (this.gaveTime && hoursNum > 0) { const timeResult = await createAndSubmitGive( @@ -156,6 +157,7 @@ export default class QuickActionBvcBeginView extends Vue { } } + // now send the claim for attendance let attendedSuccess = false; if (this.attended) { const attendResult = await createAndSubmitClaim( @@ -208,7 +210,7 @@ export default class QuickActionBvcBeginView extends Vue { group: "alert", type: "danger", title: "Error", - text: error.userMessage || "There was an error sending those claims.", + text: error.userMessage || "There was an error sending claims.", }, -1, ); diff --git a/src/views/QuickActionBvcEndView.vue b/src/views/QuickActionBvcEndView.vue index ca20e855..b7db1446 100644 --- a/src/views/QuickActionBvcEndView.vue +++ b/src/views/QuickActionBvcEndView.vue @@ -117,6 +117,7 @@ From a93b556e0c5bf07eb2a0381a381e0faf148fa601 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Mon, 26 Feb 2024 19:43:23 -0700 Subject: [PATCH 06/11] doc: refactor tasks --- project.task.yaml | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/project.task.yaml b/project.task.yaml index a63e09b7..324ccf6a 100644 --- a/project.task.yaml +++ b/project.task.yaml @@ -2,43 +2,40 @@ tasks : - .2 fix give dialog from "more contacts" off home page to allow giving to this user -- 01 in the feed, group by project or contact or topic or time/$ (via BC) -- .2 anchor hash into BTC - -- .1 when gave to a project, say "gave to project" - .2 fix bottom of project selection map, where the icons are hidden but a tap goes to the icon's page -- 01 separate not-on-platform vs totally anonymous; terminology "unidentified"? +- .5 stop from seeing an error on the first page when browser doesn't support service workers (which I've seen on iPhone; visible in Firefox private window) +- .2 don't show a warning on a totally new project when the authorized agent is set +- .2 anchor hash into BTC +- .2 list the "show more" contacts alphabetically -- 01 page for BVC +- 32 image on give : + - Show a camera to take a picture + - Scale the image to a reasonable size + - Upload to a public readable place + - check the rate limits + - use CID (hash?) + - put the image URL in the claim + - Rates - images erased? + - image not associated with JWT ULID since that's assigned later - 24 compelling UI for credential presentations - discover who in my network has activity on a project + - 24 compelling UI for statistics (eg. World?) -- .5 stop from seeing an error on the first page when browser doesn't support service workers (which I've seen on iPhone; visible in Firefox private window) +- 01 in the feed, group by project or contact or topic or time/$ (via BC) +- 01 separate not-on-platform vs totally anonymous; terminology "unidentified"? - .2 add links between projects -- 32 image on give : - - Show a camera to take a picture - - Scale the image to a reasonable size - - Upload to a public readable place - - check the rate limits - - use CID (hash?) - - put the image URL in the claim - - Rates - images erased? - - image not associated with JWT ULID since that's assigned later - - 24 make the contact browsing on the front page something that invites more action -- .2 list the "show more" contacts alphabetically - .5 change server plan & project endpoints to use jwtId as identifier rather than rowid - 16 edit offers & gives, or revoke allowing re-creation - .1 When available in the server, give message for 'nonAmountGiven' on offers on ProjectsView page. - .1 Add help instructions for "Encryption key has changed" error. (It is a problem if localStorage is cleared, but the contacts & settings remain and they have to restore their seeds.) -- .5 add more detail on TimeSafari.org - .1 show better error when user with no ID goes to the "My Project" page -- 08 add button to front page to prompt for ideas for gratitude : - - show previous on "Your" screen - - checkboxes - randomize vs show in order, show non-person-oriented messages, show only contacts, show only projects +- 01 in front page prompt for ideas for gratitude : + - randomize (not show in order) + - checkboxes - show non-person-oriented messages, show only contacts, show only projects - 08 allow user to add a time when they want their daily notification From 1258cf02a10e1d2eab0642131ac955b2c0bfd07e Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Fri, 1 Mar 2024 14:06:01 -0700 Subject: [PATCH 07/11] bump to v 0.2.15 --- CHANGELOG.md | 13 +++++++++++-- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94ec7a56..d4d01661 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,9 +10,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - ? -## [0.2.14] - 2024.02.14 +## [0.2.15] - 2024.03.01 +### Added +- Shortcut page for Bountiful Voluntaryist Community +### Changed +- More readable, targeted summaries in home-page feed items +### Changed in DB +- Nothing + + +## [0.2.14] - 2024.02.14 - 5f9edea1167dbfb64e16648764eed8c09b24eaeb ### Changed -- Combine all service worker scripts into a single file +- Combine all service worker scripts into a single file. ### Changed in DB - Nothing diff --git a/package-lock.json b/package-lock.json index fba20670..d777e434 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "TimeSafari_Test", - "version": "0.2.15-beta", + "version": "0.2.15", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "TimeSafari_Test", - "version": "0.2.15-beta", + "version": "0.2.15", "dependencies": { "@dicebear/collection": "^5.3.5", "@dicebear/core": "^5.3.5", diff --git a/package.json b/package.json index ee91c068..7e6f8cf9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "TimeSafari_Test", - "version": "0.2.15-beta", + "version": "0.2.15", "private": true, "scripts": { "serve": "vue-cli-service serve", From dbccbf7e4a5fed40946157d3d5d1ba12f804c7be Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Fri, 1 Mar 2024 14:40:51 -0700 Subject: [PATCH 08/11] fix: show on the confirmation page when there are hidden claims --- CHANGELOG.md | 2 +- README.md | 2 +- package-lock.json | 4 ++-- package.json | 2 +- src/views/QuickActionBvcEndView.vue | 20 +++++++++++++------- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4d01661..534cae56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - ? -## [0.2.15] - 2024.03.01 +## [0.2.16] - 2024.03.01 ### Added - Shortcut page for Bountiful Voluntaryist Community ### Changed diff --git a/README.md b/README.md index fa0569d4..65468496 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ npm run lint * `npx prettier --write ./sw_scripts/` -* Update the project.task.yaml & CHANGELOG.md & the version in package.json, run `npm install`, and commit. +* Update the project.task.yaml & CHANGELOG.md & the version in package.json, run `npm install`, and commit. Then record the new hash in the changelog. * [Tag wth the new version.](https://gitea.anomalistdesign.com/trent_larson/crowd-funder-for-time-pwa/releases) diff --git a/package-lock.json b/package-lock.json index d777e434..dc27e56d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "TimeSafari_Test", - "version": "0.2.15", + "version": "0.2.16", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "TimeSafari_Test", - "version": "0.2.15", + "version": "0.2.16", "dependencies": { "@dicebear/collection": "^5.3.5", "@dicebear/core": "^5.3.5", diff --git a/package.json b/package.json index 7e6f8cf9..ea5f2782 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "TimeSafari_Test", - "version": "0.2.15", + "version": "0.2.16", "private": true, "scripts": { "serve": "vue-cli-service serve", diff --git a/src/views/QuickActionBvcEndView.vue b/src/views/QuickActionBvcEndView.vue index b7db1446..af2b5268 100644 --- a/src/views/QuickActionBvcEndView.vue +++ b/src/views/QuickActionBvcEndView.vue @@ -26,13 +26,6 @@
There are no claims yet today for you to confirm. - - {{ - claimCountWithHidden === 1 - ? "(There is 1 claim with hidden details.)" - : `(There are ${claimCountWithHidden} claims with hidden details.)` - }} -
+
+ + {{ + claimCountWithHidden === 1 + ? "There is 1 other claim with hidden details," + : `There are ${claimCountWithHidden} other claims with hidden details,` + }} + so if you expected but do not see details from someone then ask them to + check that their activity is visible to you on their Contacts + + page. + +

Anything else?

From 3612ea42240c5e1b7d7eff29a39ff18f1b869b36 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Fri, 1 Mar 2024 15:54:50 -0700 Subject: [PATCH 09/11] bump to v 0.2.17; add "personalized" message and better confirmation-result messages --- CHANGELOG.md | 2 +- README.md | 13 +++++++------ package-lock.json | 4 ++-- package.json | 2 +- project.task.yaml | 1 + src/views/QuickActionBvcBeginView.vue | 12 ++++++------ src/views/QuickActionBvcEndView.vue | 15 +++++++++------ 7 files changed, 27 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 534cae56..85ca1e2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - ? -## [0.2.16] - 2024.03.01 +## [0.2.17] - 2024.03.01 ### Added - Shortcut page for Bountiful Voluntaryist Community ### Changed diff --git a/README.md b/README.md index 65468496..be28ce06 100644 --- a/README.md +++ b/README.md @@ -32,11 +32,7 @@ npm run lint * `npx prettier --write ./sw_scripts/` -* Update the project.task.yaml & CHANGELOG.md & the version in package.json, run `npm install`, and commit. Then record the new hash in the changelog. - -* [Tag wth the new version.](https://gitea.anomalistdesign.com/trent_larson/crowd-funder-for-time-pwa/releases) - -... though maybe you do that after testing and release, since that isn't used in the build (and you often increment a lot during testing). +* Update the project.task.yaml & CHANGELOG.md & the version in package.json, run `npm install`. * If production: change src/constants/app.ts DEFAULT_*_SERVER to be "PROD" and package.json to remove "_Test". Also record what version is on production. @@ -46,7 +42,12 @@ npm run lint * `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. Tag if you didn't before. Also record what version is on production. +* Revert src/constants/app.ts and package.json (if that was prod). + +* Commit changes. Record the new hash in the changelog. Edit package.json to increment version & add "-beta", `npm install`, and commit. Tag if you didn't before. Also record what version is on production. + +* [Tag wth the new version.](https://gitea.anomalistdesign.com/trent_larson/crowd-funder-for-time-pwa/releases) + diff --git a/package-lock.json b/package-lock.json index dc27e56d..f1336925 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "TimeSafari_Test", - "version": "0.2.16", + "version": "0.2.17", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "TimeSafari_Test", - "version": "0.2.16", + "version": "0.2.17", "dependencies": { "@dicebear/collection": "^5.3.5", "@dicebear/core": "^5.3.5", diff --git a/package.json b/package.json index ea5f2782..12fda6fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "TimeSafari_Test", - "version": "0.2.16", + "version": "0.2.17", "private": true, "scripts": { "serve": "vue-cli-service serve", diff --git a/project.task.yaml b/project.task.yaml index 324ccf6a..970760db 100644 --- a/project.task.yaml +++ b/project.task.yaml @@ -73,6 +73,7 @@ tasks : - create a help-desk document & add screenshots - .1 update "offer" units to have same functionality as "give" units +- .5 add a link to any 'give' records that fulfill an offer on ClaimView - 01 on home page, prompt for install check in addition to "supports notifications" check (since they won't get notified if Chrome is closed) - 01 on Mac (& Windows?) desktop, add a help blurb so that they can find it again (since it doesn't show in Application list) - bug (that is hard to reproduce) - got error adding on Firefox user #0 as contact for themselves diff --git a/src/views/QuickActionBvcBeginView.vue b/src/views/QuickActionBvcBeginView.vue index 1aaf51c5..69b9b879 100644 --- a/src/views/QuickActionBvcBeginView.vue +++ b/src/views/QuickActionBvcBeginView.vue @@ -142,7 +142,7 @@ export default class QuickActionBvcBeginView extends Vue { if (timeResult.type === "success") { timeSuccess = true; } else { - console.error("Error sending give:", timeResult); + console.error("Error sending time:", timeResult); this.$notify( { group: "alert", @@ -169,7 +169,7 @@ export default class QuickActionBvcBeginView extends Vue { if (attendResult.type === "success") { attendedSuccess = true; } else { - console.error("Error sending give:", attendResult); + console.error("Error sending attendance:", attendResult); this.$notify( { group: "alert", @@ -187,16 +187,16 @@ export default class QuickActionBvcBeginView extends Vue { if (timeSuccess || attendedSuccess) { const actions = timeSuccess && attendedSuccess - ? "attendance and time have been" + ? "Your attendance and time have been recorded." : timeSuccess - ? "time has been" - : "attendance has been"; + ? "Your time has been recorded." + : "Your attendance has been recorded."; this.$notify( { group: "alert", type: "success", title: "Success", - text: `Your ${actions} recorded.`, + text: actions, }, -1, ); diff --git a/src/views/QuickActionBvcEndView.vue b/src/views/QuickActionBvcEndView.vue index af2b5268..f158fbb0 100644 --- a/src/views/QuickActionBvcEndView.vue +++ b/src/views/QuickActionBvcEndView.vue @@ -95,6 +95,8 @@ size="20" class="border border-slate-400 h-6 px-2" /> +
+ (Everyone likes personalized messages! 😁) ... @@ -326,7 +328,7 @@ export default class QuickActionBvcBeginView extends Vue { title: "Error", text: (giveResult as ErrorResult)?.error?.userMessage || - "There was an error sending the give.", + "There was an error sending that give.", }, -1, ); @@ -338,19 +340,20 @@ export default class QuickActionBvcBeginView extends Vue { confirmsSucceeded.length === 1 ? "confirmation" : "confirmations"; const actions = confirmsSucceeded.length > 0 && giveSucceeded - ? `${confirms} and give have been` + ? `Your ${confirms} and that give have been recorded.` : giveSucceeded - ? "give has been" - : confirms + + ? "That give has been recorded." + : "Your " + + confirms + " " + (confirmsSucceeded.length === 1 ? "has" : "have") + - " been"; + " been recorded."; this.$notify( { group: "alert", type: "success", title: "Success", - text: `Your ${actions} recorded.`, + text: actions, }, -1, ); From 750700e75e2ab16339bba0311524157def0aeedf Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Fri, 1 Mar 2024 15:59:38 -0700 Subject: [PATCH 10/11] bump version and add '-beta' --- CHANGELOG.md | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85ca1e2e..96e74adb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - ? -## [0.2.17] - 2024.03.01 +## [0.2.17] - 2024.03.01- 3612ea42240c5e1b7d7eff29a39ff18f1b869b36 ### Added - Shortcut page for Bountiful Voluntaryist Community ### Changed diff --git a/package-lock.json b/package-lock.json index f1336925..11bee500 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "TimeSafari_Test", - "version": "0.2.17", + "version": "0.2.18-beta", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "TimeSafari_Test", - "version": "0.2.17", + "version": "0.2.18-beta", "dependencies": { "@dicebear/collection": "^5.3.5", "@dicebear/core": "^5.3.5", diff --git a/package.json b/package.json index 12fda6fe..58446809 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "TimeSafari_Test", - "version": "0.2.17", + "version": "0.2.18-beta", "private": true, "scripts": { "serve": "vue-cli-service serve", From ca9044770009914f96b455ecb49898ee598e2ebc Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sat, 2 Mar 2024 16:15:03 -0700 Subject: [PATCH 11/11] fix different "environment" variables for prod & dev --- .env.development | 4 ++++ .env.production | 3 +++ CHANGELOG.md | 9 ++++++--- README.md | 8 ++++---- package.json | 1 + src/constants/app.ts | 4 +++- src/libs/endorserServer.ts | 4 ++-- 7 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 .env.development create mode 100644 .env.production diff --git a/.env.development b/.env.development new file mode 100644 index 00000000..9e5c0060 --- /dev/null +++ b/.env.development @@ -0,0 +1,4 @@ +# Only the variables that start with VUE_APP_ are seen in the application process.env in Vue. + +# this won't resolve as a URL on production; it's a URN only found in the test system +VUE_APP_BVC_MEETUPS_PROJECT_CLAIM_ID=https://endorser.ch/entity/01HNTZYJJXTGT0EZS3VEJGX7AK diff --git a/.env.production b/.env.production new file mode 100644 index 00000000..d3438007 --- /dev/null +++ b/.env.production @@ -0,0 +1,3 @@ +# Only the variables that start with VUE_APP_ are seen in the application process.env in Vue. +VUE_APP_BVC_MEETUPS_PROJECT_CLAIM_ID=https://endorser.ch/entity/01GXYPFF7FA03NXKPYY142PY4H +VUE_APP_DEFAULT_ENDORSER_API_SERVER=https://api.endorser.ch diff --git a/CHANGELOG.md b/CHANGELOG.md index 96e74adb..bab2bbc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,11 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] -### Changed in DB -- ? +### Fixed +- Environment variable for BVC meetings project +### Changed in DB or environment +- Test that a new browser session will get the right default API +- Test that a new browser session will send the right BVC meetings project -## [0.2.17] - 2024.03.01- 3612ea42240c5e1b7d7eff29a39ff18f1b869b36 +## [0.2.17] - 2024.03.01 - 3612ea42240c5e1b7d7eff29a39ff18f1b869b36 ### Added - Shortcut page for Bountiful Voluntaryist Community ### Changed diff --git a/README.md b/README.md index be28ce06..04286a07 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,9 @@ npm run lint * Update the project.task.yaml & CHANGELOG.md & the version in package.json, run `npm install`. -* If production: change src/constants/app.ts DEFAULT_*_SERVER to be "PROD" and package.json to remove "_Test". Also record what version is on production. +* If production: change package.json to remove "_Test". Also record what version is on production. -* `npm run build` +* `npm run build-dev` for test servers or `npm run build` for production. * Get on the server and back up the time-safari folder. @@ -44,9 +44,9 @@ npm run lint * Revert src/constants/app.ts and package.json (if that was prod). -* Commit changes. Record the new hash in the changelog. Edit package.json to increment version & add "-beta", `npm install`, and commit. Tag if you didn't before. Also record what version is on production. +* Commit changes. Record the new hash in the changelog. Edit package.json to increment version & add "-beta", `npm install`, and commit. Also record what version is on production. -* [Tag wth the new version.](https://gitea.anomalistdesign.com/trent_larson/crowd-funder-for-time-pwa/releases) +* [Tag with the new version.](https://gitea.anomalistdesign.com/trent_larson/crowd-funder-for-time-pwa/releases) diff --git a/package.json b/package.json index 58446809..07cae38b 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", + "build-dev": "vue-cli-service build --mode development", "lint": "vue-cli-service lint" }, "dependencies": { diff --git a/src/constants/app.ts b/src/constants/app.ts index 4e94d01f..92961076 100644 --- a/src/constants/app.ts +++ b/src/constants/app.ts @@ -15,7 +15,9 @@ export enum AppString { NO_CONTACT_NAME = "(no name)", } -export const DEFAULT_ENDORSER_API_SERVER = AppString.TEST_ENDORSER_API_SERVER; +export const DEFAULT_ENDORSER_API_SERVER = + process.env.VUE_APP_DEFAULT_ENDORSER_API_SERVER || + AppString.TEST_ENDORSER_API_SERVER; export const DEFAULT_PUSH_SERVER = window.location.protocol + "//" + window.location.host; diff --git a/src/libs/endorserServer.ts b/src/libs/endorserServer.ts index 48856114..ad508c09 100644 --- a/src/libs/endorserServer.ts +++ b/src/libs/endorserServer.ts @@ -780,8 +780,8 @@ export const claimSpecialDescription = ( }; export const BVC_MEETUPS_PROJECT_CLAIM_ID = - //"https://endorser.ch/entity/01GXYPFF7FA03NXKPYY142PY4H"; - "https://endorser.ch/entity/01HNTZYJJXTGT0EZS3VEJGX7AK"; + process.env.VUE_APP_BVC_MEETUPS_PROJECT_CLAIM_ID || + "https://endorser.ch/entity/01HNTZYJJXTGT0EZS3VEJGX7AK"; // this won't resolve as a URL on production; it's a URN only found in the test system export const bvcMeetingJoinClaim = (did: string, startTime: string) => { return {