From 7ee588fab39fdd0862fa917ff12013993a34fc44 Mon Sep 17 00:00:00 2001 From: Brad Adams Date: Sun, 13 Aug 2023 14:59:31 +0200 Subject: [PATCH 1/2] fix: review list average sentiment + Only show average sentiment when there are review analyses --- src/components/ProductReviewList.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/ProductReviewList.tsx b/src/components/ProductReviewList.tsx index 902ef1c..d6c7303 100644 --- a/src/components/ProductReviewList.tsx +++ b/src/components/ProductReviewList.tsx @@ -46,10 +46,14 @@ export const ProductReviewList = ({ const averageSentiment = useMemo( () => - Math.floor( - reviewAnalyses.reduce((acc, analysis) => acc + analysis.data.score, 0) / - reviewAnalyses.length - ), + reviewAnalyses?.length + ? Math.floor( + reviewAnalyses.reduce( + (acc, analysis) => acc + analysis.data.score, + 0 + ) / reviewAnalyses.length + ) + : undefined, [reviewAnalyses] ); From 9e5acda2642e66346cd277cc11d4e2197b358529 Mon Sep 17 00:00:00 2001 From: Maksym Dmukhovskyy Date: Sun, 13 Aug 2023 19:41:39 +0400 Subject: [PATCH 2/2] Update names --- .github/workflows/validate-workflow.yml | 2 +- README.md | 2 +- package-lock.json | 6 +++--- package.json | 6 +++--- src/app/layout.tsx | 4 +++- src/constants.ts | 2 +- src/lib/appExtensions.ts | 4 ++-- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/validate-workflow.yml b/.github/workflows/validate-workflow.yml index 36cdce9..5058c86 100644 --- a/.github/workflows/validate-workflow.yml +++ b/.github/workflows/validate-workflow.yml @@ -1,4 +1,4 @@ -name: ildecimo BigAI - Product Review App CI +name: ildecimo Review Pulse - App CI on: push: diff --git a/README.md b/README.md index 7ec9500..50080ae 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -# ildecimo BigAI - BigCommerce x Google Hackathon \ No newline at end of file +# ildecimo Review Pulse - BigCommerce x Google Hackathon \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index b1711d1..0bb94d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "bc-ai-ildecimo-app", + "name": "reviewpulse", "version": "0.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "bc-ai-ildecimo-app", + "name": "reviewpulse", "version": "0.0.1", "dependencies": { "@bigcommerce/big-design": "^0.36.2", @@ -9267,4 +9267,4 @@ } } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 142fca1..8ebf766 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { - "name": "bc-ai-ildecimo-app", + "name": "reviewpulse", "version": "0.0.1", - "author": "BigCommerce", - "description": "BigCommerce Single-click App for enabling AI capabilities in CP", + "author": "ildecimo", + "description": "BigCommerce Single-click App for Reviews with Google Vertex AI", "scripts": { "build": "next build", "dev": "next dev", diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 4a5a7a0..9c6c400 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -10,7 +10,9 @@ const sourceSans = Source_Sans_3({ weight: ['300', '400', '600', '700', '800'], }); -export const metadata: Metadata = { title: 'Review Pulse - ildecimo BigAI' }; +export const metadata: Metadata = { + title: 'Review Pulse - ildecimo BigCommerce Google Vertex AI App', +}; export default function RootLayout({ children, diff --git a/src/constants.ts b/src/constants.ts index b31b1d9..dae2de7 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -22,4 +22,4 @@ export const STYLE_OPTIONS = [ export const BIGCOMMERCE_LOGIN_URL = 'https://login.bigcommerce.com'; export const BIGCOMMERCE_API_URL = 'https://api.bigcommerce.com'; -export const AUTH_COOKIE_NAME = 'bc-ai-app-auth-token'; \ No newline at end of file +export const AUTH_COOKIE_NAME = 'bc-ai-review-pulse'; \ No newline at end of file diff --git a/src/lib/appExtensions.ts b/src/lib/appExtensions.ts index 1312cb0..abff370 100644 --- a/src/lib/appExtensions.ts +++ b/src/lib/appExtensions.ts @@ -167,10 +167,10 @@ const createReviewsAppExtensionMutation = () => ({ model: 'PRODUCTS', url: '/product/${id}', label: { - defaultValue: 'Product Review AI', + defaultValue: 'ildecimo Review Pulse', locales: [ { - value: 'Product Review AI', + value: 'ildecimo Review Pulse', localeCode: 'en-US', }, ],