diff --git a/src/libs/endorserServer.ts b/src/libs/endorserServer.ts index f1f362d9b..f10bd3fc4 100644 --- a/src/libs/endorserServer.ts +++ b/src/libs/endorserServer.ts @@ -593,17 +593,21 @@ export async function setPlanInCache( /** * - * @returns { data: Array, hitLimit: boolean } + * @returns { data: Array, hitLimit: boolean true if maximum was hit and there may be more } */ export async function getNewOffersToUser( axios: Axios, apiServer: string, activeDid: string, - lastAckedOfferToUserJwtId?: string, + afterOfferJwtId?: string, + beforeOfferJwtId?: string, ) { let url = `${apiServer}/api/v2/report/offers?recipientDid=${activeDid}`; - if (lastAckedOfferToUserJwtId) { - url += "&afterId=" + lastAckedOfferToUserJwtId; + if (afterOfferJwtId) { + url += "&afterId=" + afterOfferJwtId; + } + if (beforeOfferJwtId) { + url += "&beforeId=" + beforeOfferJwtId; } const headers = await getHeaders(activeDid); const response = await axios.get(url, { headers }); @@ -611,17 +615,22 @@ export async function getNewOffersToUser( } /** * - * @returns { data: Array, hitLimit: boolean } + * @returns { data: Array, hitLimit: boolean true if maximum was hit and there may be more } */ export async function getNewOffersToUserProjects( axios: Axios, apiServer: string, activeDid: string, - lastAckedOfferToUserProjectsJwtId?: string, + afterOfferJwtId?: string, + beforeOfferJwtId?: string, ) { let url = `${apiServer}/api/v2/report/offersToPlansOwnedByMe`; - if (lastAckedOfferToUserProjectsJwtId) { - url += "?afterId=" + lastAckedOfferToUserProjectsJwtId; + if (afterOfferJwtId) { + url += "?afterId=" + afterOfferJwtId; + } + if (beforeOfferJwtId) { + url += afterOfferJwtId ? "&" : "?"; + url += "beforeId=" + beforeOfferJwtId; } const headers = await getHeaders(activeDid); const response = await axios.get(url, { headers }); diff --git a/src/router/index.ts b/src/router/index.ts index 9b81a1421..f56db4767 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -184,6 +184,16 @@ const routes: Array = [ name: "quick-action-bvc-end", component: () => import("../views/QuickActionBvcEndView.vue"), }, + { + path: "/recent-offers-to-user", + name: "recent-offers-to-user", + component: () => import("../views/RecentOffersToUserView.vue"), + }, + { + path: "/recent-offers-to-user-projects", + name: "recent-offers-to-user-projects", + component: () => import("../views/RecentOffersToUserProjectsView.vue"), + }, { path: "/scan-contact", name: "scan-contact", diff --git a/src/views/DIDView.vue b/src/views/DIDView.vue index aac59133c..f53d5cd42 100644 --- a/src/views/DIDView.vue +++ b/src/views/DIDView.vue @@ -41,8 +41,8 @@ class="ml-2 mr-2 mt-4" > Details - - + +
 
       
@@ -212,7 +211,9 @@ > {{ numNewOffersToUser }}{{ newOffersToUserHitLimit ? "+" : "" }} -

new offer{{ numNewOffersToUser === 1 ? "" : "s" }} to you

+

+ new offer{{ numNewOffersToUser === 1 ? "" : "s" }} to you +

-

+

new offer{{ numNewOffersToUserProjects === 1 ? "" : "s" }} to your projects

diff --git a/src/views/NewActivityView.vue b/src/views/NewActivityView.vue index 26d089a2d..c0b74fd5c 100644 --- a/src/views/NewActivityView.vue +++ b/src/views/NewActivityView.vue @@ -16,21 +16,26 @@
-
- {{ newOffersToUser.length - }}{{ newOffersToUserHitLimit ? "+" : "" }} - New Offer{{ newOffersToUser.length === 1 ? "" : "s" }} To You - +
+
+ {{ newOffersToUser.length + }}{{ newOffersToUserHitLimit ? "+" : "" }} + New Offer{{ newOffersToUser.length === 1 ? "" : "s" }} To You + +
+ + See all +
@@ -43,7 +48,7 @@ {{ didInfo(offer.offeredByDid, activeDid, allMyDids, allContacts) }} - offers + offered {{ offer.objectDescription }} -
- {{ newOffersToUserProjects.length - }}{{ newOffersToUserProjectsHitLimit ? "+" : "" }} - New Offer{{ newOffersToUserProjects.length === 1 ? "" : "s" }} To Your - Projects - +
+
+ {{ newOffersToUserProjects.length + }}{{ newOffersToUserProjectsHitLimit ? "+" : "" }} + New Offer{{ newOffersToUserProjects.length === 1 ? "" : "s" }} To + Your Projects + +
+ + See all +
@@ -100,7 +110,7 @@ {{ didInfo(offer.offeredByDid, activeDid, allMyDids, allContacts) }} - offers + offered {{ offer.objectDescription }} + + +
+ +
+

+ + + Offers to Your Projects +

+
+ + +
    +
  • +
    + You've already seen all the following +
    + + {{ + didInfo(offer.offeredByDid, activeDid, allMyDids, allContacts) + }} + offered + {{ + offer.objectDescription + }}{{ offer.objectDescription && offer.amount ? ", and " : "" }} + {{ + displayAmount(offer.unit, offer.amount) + }} + to + {{ offer.planName }} + + + +
  • +
+
+
+ + + diff --git a/src/views/RecentOffersToUserView.vue b/src/views/RecentOffersToUserView.vue new file mode 100644 index 000000000..74faaf66b --- /dev/null +++ b/src/views/RecentOffersToUserView.vue @@ -0,0 +1,146 @@ + + +