From 454fbc9b6d267d5db90ed348215600dacc0d725a Mon Sep 17 00:00:00 2001 From: Isaiah Hamilton Date: Tue, 22 Mar 2022 17:46:54 -0400 Subject: [PATCH 1/4] chore: update community numbers --- www/data/Community.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/data/Community.tsx b/www/data/Community.tsx index 3f00a98ab82..6988a132170 100644 --- a/www/data/Community.tsx +++ b/www/data/Community.tsx @@ -31,7 +31,7 @@ const data: CommunityItem[] = [ }, { title: 'GitHub', - stat: '28,000+', + stat: '30,000+', statLabel: 'GitHub stars', img: 'github.png', invertImgDarkMode: true, @@ -43,7 +43,7 @@ const data: CommunityItem[] = [ }, { title: 'Twitter', - stat: '25,000+', + stat: '26,000+', statLabel: 'Followers', img: 'twitter.png', detail: () => ( @@ -54,7 +54,7 @@ const data: CommunityItem[] = [ }, { title: 'Discord', - stat: '5,000+', + stat: '6,000+', statLabel: 'SuperTroopers', img: 'discord.png', detail: () => ( From 6e1c756e971d307dbeb6fc76056d2a4264fbdec4 Mon Sep 17 00:00:00 2001 From: Tobias Speicher Date: Thu, 24 Mar 2022 00:04:31 +0100 Subject: [PATCH 2/4] refactor: replace deprecated String.prototype.substr() .substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated Signed-off-by: Tobias Speicher --- examples/react-todo-list/src/components/Home.js | 2 +- .../interfaces/Database/Functions/CreateFunction.tsx | 5 +++-- studio/pages/project/[ref]/api/index.tsx | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/react-todo-list/src/components/Home.js b/examples/react-todo-list/src/components/Home.js index 3c9f53103c2..ad432108d01 100644 --- a/examples/react-todo-list/src/components/Home.js +++ b/examples/react-todo-list/src/components/Home.js @@ -15,7 +15,7 @@ const Home = ({ user }) => { * Read more on https://supabase.com/docs/reference/javascript/reset-password-email#notes */ let url = window.location.hash; - let query = url.substr(1); + let query = url.slice(1); let result = {}; query.split("&").forEach((part) => { diff --git a/studio/components/interfaces/Database/Functions/CreateFunction.tsx b/studio/components/interfaces/Database/Functions/CreateFunction.tsx index 07443b9bf8a..dafd57350fe 100644 --- a/studio/components/interfaces/Database/Functions/CreateFunction.tsx +++ b/studio/components/interfaces/Database/Functions/CreateFunction.tsx @@ -101,8 +101,9 @@ function convertArgumentTypes(value: string) { if (isEmpty(value) || !items || items?.length == 0) return { value: [] } const temp = items.map((x) => { const str = x.trim() - const name = str.substr(0, str.indexOf(' ')) - const type = str.substr(str.indexOf(' ') + 1) + const space = str.indexOf(' ') + const name = str.slice(0, space !== 1 ? space : 0) + const type = str.slice(space + 1) return { name, type } }) return { value: temp } diff --git a/studio/pages/project/[ref]/api/index.tsx b/studio/pages/project/[ref]/api/index.tsx index 725c2ec4d05..6ae2714af8c 100644 --- a/studio/pages/project/[ref]/api/index.tsx +++ b/studio/pages/project/[ref]/api/index.tsx @@ -34,7 +34,7 @@ const PageConfig = () => { let rpcs: any = {} Object.entries(paths || []).forEach(([name, val]) => { - let trimmed = name.substr(1) + let trimmed = name.slice(1) let id = trimmed.replace(functionPath, '') let displayName = id.replace(/_/g, ' ') let camelCase = snakeToCamel(id) From 045ed5dd6b6edc9d461f046c502b3ae4a8331fc7 Mon Sep 17 00:00:00 2001 From: Isaiah Hamilton Date: Wed, 23 Mar 2022 21:03:26 -0400 Subject: [PATCH 3/4] fix: reset password example --- web/spec/supabase.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/spec/supabase.yml b/web/spec/supabase.yml index 0c6150b4227..3fceab23358 100644 --- a/web/spec/supabase.yml +++ b/web/spec/supabase.yml @@ -865,7 +865,7 @@ pages: isSpotlight: true js: | ```js - const { data, error } = supabase.auth.api + const { data, error } = await supabase.auth.api .resetPasswordForEmail('user@email.com') ``` From 9d50214262a10b8493c457ebcafecea8043f586a Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Fri, 25 Mar 2022 01:02:01 +0800 Subject: [PATCH 4/4] Fix billing prices to use the price based on default_price_id --- .../Billing/AddOns/ComputeSizeSelection.tsx | 46 +++++++++++-------- .../Billing/ProUpgrade/ProUpgrade.utils.ts | 8 +++- 2 files changed, 34 insertions(+), 20 deletions(-) diff --git a/studio/components/interfaces/Billing/AddOns/ComputeSizeSelection.tsx b/studio/components/interfaces/Billing/AddOns/ComputeSizeSelection.tsx index f6c89d7eea4..0e3bc5cd8a5 100644 --- a/studio/components/interfaces/Billing/AddOns/ComputeSizeSelection.tsx +++ b/studio/components/interfaces/Billing/AddOns/ComputeSizeSelection.tsx @@ -17,25 +17,33 @@ const ComputeSizeSelection: FC = ({ computeSizes, selectedComputeSize, on

- {computeSizes.map((option: any) => ( - ) diff --git a/studio/components/interfaces/Billing/ProUpgrade/ProUpgrade.utils.ts b/studio/components/interfaces/Billing/ProUpgrade/ProUpgrade.utils.ts index 14f231a98b8..fb74ad37968 100644 --- a/studio/components/interfaces/Billing/ProUpgrade/ProUpgrade.utils.ts +++ b/studio/components/interfaces/Billing/ProUpgrade/ProUpgrade.utils.ts @@ -4,11 +4,17 @@ export const formSubscriptionUpdatePayload = ( selectedPaymentMethod: string, region: string ) => { + const defaultPriceId = selectedTier.metadata?.default_price_id + const price = + defaultPriceId !== undefined + ? selectedTier.prices.find((price: any) => price.id === defaultPriceId).id + : selectedTier.prices[0].id + const addons = region === 'af-south-1' || !selectedComputeSize.id ? [] : [selectedComputeSize.prices[0].id] const proration_date = Math.floor(Date.now() / 1000) return { - tier: selectedTier.prices[0].id, + tier: price, addons, proration_date, payment_method: selectedPaymentMethod,