Merge pull request #8231 from supabase/master

Prod deploy to Studio
This commit is contained in:
Joshen Lim authored and GitHub committed 2022-08-12 14:07:27 +08:00
commit 98d424a44e
44 files changed
+92 -45

No files matched your search

@@ -2,8 +2,8 @@
title: 'Slack Consolidate: a slackbot built with Python and Supabase'
description: A slackbot to consolidate messages from different channels using Supabase, Slack SDK and Python
author: rodrigo_mansueli
image: slackbot-consilidate/slackbot-thumb.jpg
thumb: slackbot-consilidate/slackbot-thumb.jpg
image: slackbot-consolidate/slackbot-thumb.jpg
thumb: slackbot-consolidate/slackbot-thumb.jpg
tags:
- slack
- python
@@ -35,19 +35,19 @@ Now, it is time to create the bot in Slack and get the API Keys (after granting
[https://api.slack.com/apps](https://api.slack.com/apps)
![Green arrow pointing to the ‘Create New App’ button.](/images/blog/slackbot-consilidate/00_create_new_app.png)
![Green arrow pointing to the ‘Create New App’ button.](/images/blog/slackbot-consolidate/00_create_new_app.png)
Green arrow pointing to the ‘Create New App’ button.
Then, select to create an app from a manifest (this will already set the required permissions) for the app:
![Green arrow pointing to the option ‘From an app manifest’ inside the “Create an app” menu.](/images/blog/slackbot-consilidate/01_create_an_slack_app.png)
![Green arrow pointing to the option ‘From an app manifest’ inside the “Create an app” menu.](/images/blog/slackbot-consolidate/01_create_an_slack_app.png)
Green arrow pointing to the option ‘From an app manifest’ inside the “Create an app” menu.
Select the Slack workspace to deploy:
![The picture shows a dropdown UI with Supabase selected as the workspace.](/images/blog/slackbot-consilidate/02_pick_workspace.png)
![The picture shows a dropdown UI with Supabase selected as the workspace.](/images/blog/slackbot-consolidate/02_pick_workspace.png)
The picture shows a dropdown UI with Supabase selected as the workspace.
@@ -88,13 +88,13 @@ token_rotation_enabled: false
Enter the manifest above when asked:
![The picture shows the place where you have to paste the manifest file included in the repo.](/images/blog/slackbot-consilidate/03_enter_manifest.png)
![The picture shows the place where you have to paste the manifest file included in the repo.](/images/blog/slackbot-consolidate/03_enter_manifest.png)
The picture shows the place where you have to paste the manifest file included in the repo.
Then, confirm to create the bot:
![You can see a summary screen to confirm the creation of the bot and the scopes assigned.](/images/blog/slackbot-consilidate/04_confirm_window.png)
![You can see a summary screen to confirm the creation of the bot and the scopes assigned.](/images/blog/slackbot-consolidate/04_confirm_window.png)
You can see a summary screen to confirm the creation of the bot and the scopes assigned.
@@ -102,7 +102,7 @@ You can see a summary screen to confirm the creation of the bot and the scopes a
Install the app on the workspace:
![The picture shows the button to Install the App to the Slack Workspace.](/images/blog/slackbot-consilidate/05_install_workspace.png)
![The picture shows the button to Install the App to the Slack Workspace.](/images/blog/slackbot-consolidate/05_install_workspace.png)
The picture shows the button to Install the App to the Slack Workspace.
@@ -112,7 +112,7 @@ The command to invite the bot is below:
`/invite @SlackConsolidate`
![The picture shows the command /invite @Slackbot in the channel #team-support.](/images/blog/slackbot-consilidate/06_invite_bot_to_channel.png)
![The picture shows the command /invite @Slackbot in the channel #team-support.](/images/blog/slackbot-consolidate/06_invite_bot_to_channel.png)
The picture shows the command /invite @Slackbot in the channel #team-support.
@@ -151,7 +151,7 @@ CREATE TABLE slack_watcher (
You may want to call [conversations.list](https://api.slack.com/methods/conversations.list) to dump all the channels and channel IDs into a CSV file, then use it to populate the table `slack_channels`. You can also manually get the data, but copying the links to messages in the channels:
![After right-clicking a message in Slack, you can see the option to select the link.](/images/blog/slackbot-consilidate/07_copy_msg_link.png)
![After right-clicking a message in Slack, you can see the option to select the link.](/images/blog/slackbot-consolidate/07_copy_msg_link.png)
After right-clicking a message in Slack, you can see the option to select the link.
@@ -175,13 +175,13 @@ The name of the channel is not needed. But it is recommended to set, it so you c
Using Supabase UI (easier):
![The green arrow points to insert row button inside Supabase.](/images/blog/slackbot-consilidate/08_insert_row.png)
![The green arrow points to insert row button inside Supabase.](/images/blog/slackbot-consolidate/08_insert_row.png)
The green arrow points to insert row button inside Supabase.
Then, enter the information as needed:
![The picture shows the UI in Supabase to insert a new row to the database table.](/images/blog/slackbot-consilidate/09_insert_row_b.png)
![The picture shows the UI in Supabase to insert a new row to the database table.](/images/blog/slackbot-consolidate/09_insert_row_b.png)
The picture shows the UI in Supabase to insert a new row to the database table.
@@ -217,7 +217,7 @@ You need to get the supabase URL and API keys from here:
[https://app.supabase.com/project/\_/settings/api](https://app.supabase.com/project/_/settings/api)
![The picture illustrates where to get the URL and the service key to setup the environment variables.](/images/blog/slackbot-consilidate/10_copy_supabase_apis.png)
![The picture illustrates where to get the URL and the service key to setup the environment variables.](/images/blog/slackbot-consolidate/10_copy_supabase_apis.png)
The picture illustrates where to get the URL and the service key to setup the environment variables.
@@ -225,7 +225,7 @@ Slack environment variables:
Then, copy the bot and person API Tokens for the bot:
![The picture has arrows pointing to the tokens that will be used as environment variables from Slack.](/images/blog/slackbot-consilidate/11_copy_slack_apis.png)
![The picture has arrows pointing to the tokens that will be used as environment variables from Slack.](/images/blog/slackbot-consolidate/11_copy_slack_apis.png)
The picture has arrows pointing to the tokens that will be used as environment variables from Slack.
@@ -405,7 +405,7 @@ if __name__ == '__main__':
Of course, we aren't doing proper Python example if we don't make a test notebook available:
[![Open in Colab](/images/blog/2022-august/colab-badge.svg)](https://colab.research.google.com/github/mansueli/SlackConsolidate/blob/main/SlackConsolidate_bot.ipynb)
[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/mansueli/SlackConsolidate/blob/main/SlackConsolidate_bot.ipynb)
## Conclusion
@@ -49,7 +49,7 @@ There's a $1500 GitHub sponsorship and [gold Supabase caps](https://store.supaba
- The Hackathon begins at 8:00am PT Friday 12th August 2022
- Work on your project any time for the next 10 days
- Submission deadline (11:59pm PT Sunday 21st August 2021)
- Submission deadline (11:59pm PT Sunday 21st August 2022)
### Prizes
File renamed without changes.

Before

Width:  |  Height:  |  Size: 313 KiB

After

Width:  |  Height:  |  Size: 313 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 256 KiB

After

Width:  |  Height:  |  Size: 256 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 209 KiB

After

Width:  |  Height:  |  Size: 209 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 290 KiB

After

Width:  |  Height:  |  Size: 290 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 279 KiB

After

Width:  |  Height:  |  Size: 279 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 376 KiB

After

Width:  |  Height:  |  Size: 376 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 190 KiB

After

Width:  |  Height:  |  Size: 190 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 287 KiB

After

Width:  |  Height:  |  Size: 287 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 408 KiB

After

Width:  |  Height:  |  Size: 408 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 282 KiB

After

Width:  |  Height:  |  Size: 282 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 271 KiB

After

Width:  |  Height:  |  Size: 271 KiB

@@ -29,6 +29,11 @@ const AddPaymentMethodForm: FC<Props> = ({ returnUrl, onCancel }) => {
setIsSaving(true)
if (document !== undefined) {
// [Joshen] This is to ensure that any 3DS popup from Stripe remains clickable
document.body.classList.add('!pointer-events-auto')
}
const { error } = await stripe.confirmSetup({
elements,
confirmParams: { return_url: returnUrl },
@@ -41,6 +46,10 @@ const AddPaymentMethodForm: FC<Props> = ({ returnUrl, onCancel }) => {
message: error?.message ?? ' Failed to save card details',
})
}
if (document !== undefined) {
document.body.classList.remove('!pointer-events-auto')
}
}
return (
@@ -11,7 +11,7 @@ const RolesHelperModal: FC<Props> = ({}) => {
<IconHelpCircle
size={16}
strokeWidth={1.5}
className="cursor-pointer"
className="cursor-pointer hover:text-scale-1200 transition"
onClick={() => setShowModal(!showModal)}
/>
<Modal
@@ -3,7 +3,7 @@ import { useRouter } from 'next/router'
import { Button } from '@supabase/ui'
import * as Tooltip from '@radix-ui/react-tooltip'
import { useStore, checkPermissions } from 'hooks'
import { useStore, checkPermissions, useFlag } from 'hooks'
import { API_URL } from 'lib/constants'
import { delete_ } from 'lib/common/fetch'
import TextConfirmModal from 'components/ui/Modals/TextConfirmModal'
@@ -16,13 +16,17 @@ interface Props {
const DeleteProjectButton: FC<Props> = ({ type = 'danger' }) => {
const router = useRouter()
const { app, ui } = useStore()
const enablePermissions = useFlag('enablePermissions')
const project = ui.selectedProject
const isOwner = ui.selectedOrganization?.is_owner
const [isOpen, setIsOpen] = useState(false)
const [loading, setLoading] = useState(false)
const canDeleteProject = checkPermissions(PermissionAction.UPDATE, 'projects')
const canDeleteProject = enablePermissions
? checkPermissions(PermissionAction.UPDATE, 'projects')
: isOwner
const toggle = () => {
if (loading) return
@@ -52,11 +56,9 @@ const DeleteProjectButton: FC<Props> = ({ type = 'danger' }) => {
<>
<Tooltip.Root delayDuration={0}>
<Tooltip.Trigger>
<div className="flex items-center">
<Button onClick={toggle} type={type} disabled={!canDeleteProject}>
Delete project
</Button>
</div>
<Button onClick={toggle} type={type} disabled={!canDeleteProject}>
Delete project
</Button>
</Tooltip.Trigger>
{!canDeleteProject && (
<Tooltip.Content side="bottom">
@@ -23,7 +23,7 @@ const DeleteProjectPanel: FC<Props> = ({}) => {
withIcon
title="Deleting this project will also remove your database."
>
<div className="flex flex-col">
<div>
<p className="mb-4 block">
Make sure you have made a backup if you want to keep your data.
</p>
@@ -2,7 +2,7 @@ import { FC } from 'react'
import { Form, Input } from '@supabase/ui'
import { PermissionAction } from '@supabase/shared-types/out/constants'
import { useStore, checkPermissions } from 'hooks'
import { useStore, checkPermissions, useFlag } from 'hooks'
import { API_URL } from 'lib/constants'
import { post } from 'lib/common/fetch'
import {
@@ -20,9 +20,14 @@ const General: FC<Props> = ({}) => {
const { app, ui } = useStore()
const project = ui.selectedProject
const enablePermissions = useFlag('enablePermissions')
const isOwner = ui.selectedOrganization?.is_owner
const formId = 'project-general-settings'
const initialValues = { name: project?.name ?? '', ref: project?.ref ?? '' }
const canUpdateProject = checkPermissions(PermissionAction.UPDATE, 'projects')
const canUpdateProject = enablePermissions
? checkPermissions(PermissionAction.UPDATE, 'projects')
: isOwner
const onSubmit = async (values: any, { setSubmitting, resetForm }: any) => {
const response = await post(`${API_URL}/projects/${project?.ref}/update`, { name: values.name })
@@ -5,7 +5,7 @@ import * as Tooltip from '@radix-ui/react-tooltip'
import { Button, IconPause } from '@supabase/ui'
import { PermissionAction } from '@supabase/shared-types/out/constants'
import { checkPermissions, useStore } from 'hooks'
import { checkPermissions, useStore, useFlag } from 'hooks'
import { post } from 'lib/common/fetch'
import { API_URL, PROJECT_STATUS } from 'lib/constants'
import ConfirmModal from 'components/ui/Dialogs/ConfirmDialog'
@@ -21,13 +21,15 @@ const PauseProjectButton: FC<Props> = observer(({ projectRef, projectId }) => {
const [loading, setLoading] = useState(false)
const [isModalOpen, setIsModalOpen] = useState(false)
const enablePermissions = useFlag('enablePermissions')
const isOwner = ui.selectedOrganization?.is_owner
const openModal = () => setIsModalOpen(true)
const closeModal = () => setIsModalOpen(false)
const canPauseProject = checkPermissions(
PermissionAction.INFRA_EXECUTE,
'queue_jobs.projects.pause'
)
const canPauseProject = enablePermissions
? checkPermissions(PermissionAction.INFRA_EXECUTE, 'queue_jobs.projects.pause')
: isOwner
const requestPauseProject = async () => {
if (!canPauseProject) {
@@ -4,7 +4,7 @@ import { Alert, Button, IconPauseCircle } from '@supabase/ui'
import { PermissionAction } from '@supabase/shared-types/out/constants'
import { Project } from 'types'
import { checkPermissions, useStore, useSubscriptionStats } from 'hooks'
import { checkPermissions, useStore, useSubscriptionStats, useFlag } from 'hooks'
import { post } from 'lib/common/fetch'
import { API_URL, PROJECT_STATUS, DEFAULT_FREE_PROJECTS_LIMIT } from 'lib/constants'
import { DeleteProjectButton } from 'components/interfaces/Settings/General'
@@ -20,13 +20,15 @@ const ProjectPausedState: FC<Props> = ({ project }) => {
const { total_active_free_projects: totalActiveFreeProjects } = subscriptionStats
const freeProjectsLimit = ui.profile?.free_project_limit ?? DEFAULT_FREE_PROJECTS_LIMIT
const enablePermissions = useFlag('enablePermissions')
const isOwner = ui.selectedOrganization?.is_owner
const [showConfirmRestore, setShowConfirmRestore] = useState(false)
const hasExceedActiveFreeProjectsLimit = totalActiveFreeProjects >= freeProjectsLimit
const canResumeProject = checkPermissions(
PermissionAction.INFRA_EXECUTE,
'queue_jobs.projects.initialize_or_resume'
)
const canResumeProject = enablePermissions
? checkPermissions(PermissionAction.INFRA_EXECUTE, 'queue_jobs.projects.initialize_or_resume')
: isOwner
const onSelectRestore = () => {
if (!canResumeProject) {
+1 -1
View File
@@ -118,7 +118,7 @@
}
.table-container thead th {
@apply text-scale-900 font-normal text-sm;
@apply text-scale-1100 font-normal text-sm;
@apply bg-table-header-light dark:bg-table-header-dark;
@apply border-t border-b border-table-border-light dark:border-table-border-dark;
}
+1
View File
@@ -2,6 +2,7 @@
id: api
title: APIs
description: Auto-generating and Realtime APIs.
sidebar_label: Overview
---
import Tabs from '@theme/Tabs';
+1
View File
@@ -2,6 +2,7 @@
id: auth
title: Auth
description: Use Supabase to Authenticate and Authorize your users.
sidebar_label: Overview
---
import Link from '@docusaurus/Link'
+1
View File
@@ -2,6 +2,7 @@
id: database
title: Database
description: Use Supabase to manage your data.
sidebar_label: Overview
---
Every Supabase project comes with a full [Postgres](https://www.postgresql.org/) database, a free and open source
@@ -1,6 +1,6 @@
---
id: connecting-to-postgres
title: 'Connecting'
title: 'Database Connections'
description: There are various ways to connect to your Postgres database.
---
+3 -2
View File
@@ -1,7 +1,8 @@
---
id: docker
title: With Docker
description: How to use configure and deploy Supabase.
title: Self-hosting with Docker
description: How to configure and deploy Supabase.
sidebar_label: Docker
---
Docker is the easiest way to get started with self-hosted Supabase.
+1
View File
@@ -2,6 +2,7 @@
id: storage
title: Storage
description: Use Supabase to store and serve files.
sidebar_label: Overview
---
import Tabs from '@theme/Tabs'
+1
View File
@@ -2,6 +2,7 @@
id: with-angular
title: "Quickstart: Angular"
description: Learn how to use Supabase in your Angular App.
sidebar_label: Angular
---
import Tabs from '@theme/Tabs';
+1
View File
@@ -2,6 +2,7 @@
id: with-expo
title: 'Quickstart: Expo'
description: Learn how to use Supabase in your React Native App.
sidebar_label: Expo
---
import Tabs from '@theme/Tabs'
+1
View File
@@ -2,6 +2,7 @@
id: with-flutter
title: 'Quickstart: Flutter'
description: Learn how to use Supabase in your Flutter App.
sidebar_label: Flutter
---
import Tabs from '@theme/Tabs'
+1
View File
@@ -2,6 +2,7 @@
id: with-ionic-angular
title: "Quickstart: Ionic Angular"
description: Learn how to use Supabase in your Ionic Angular App.
sidebar_label: Ionic Angular
---
import Tabs from '@theme/Tabs';
+1
View File
@@ -2,6 +2,7 @@
id: with-ionic-react
title: "Quickstart: Ionic React"
description: Learn how to use Supabase in your Ionic React App.
sidebar_label: Ionic React
---
import Tabs from '@theme/Tabs';
+1
View File
@@ -2,6 +2,7 @@
id: with-ionic-vue
title: "Quickstart: Ionic Vue"
description: Learn how to use Supabase in your Ionic Vue App.
sidebar_label: Ionic Vue
---
import Tabs from '@theme/Tabs';
+1
View File
@@ -2,6 +2,7 @@
id: with-nextjs
title: "Quickstart: Next.js"
description: Learn how to use Supabase in your Next App.
sidebar_label: "Next.js"
---
import Tabs from '@theme/Tabs';
+1
View File
@@ -2,6 +2,7 @@
id: with-nuxt-3
title: 'Quickstart: Nuxt 3'
description: Learn how to use Supabase in your Nuxt 3 App.
sidebar_label: Nuxt 3
---
# Quickstart: Nuxt
+1
View File
@@ -2,6 +2,7 @@
id: with-react
title: 'Quickstart: React'
description: Learn how to use Supabase in your React App.
sidebar_label: React
---
import Tabs from '@theme/Tabs'
+1
View File
@@ -2,6 +2,7 @@
id: with-redwoodjs
title: 'Quickstart: RedwoodJS'
description: Learn how to use Supabase in your RedwoodJS App.
sidebar_label: RedwoodJS
---
import Tabs from '@theme/Tabs'
+1
View File
@@ -2,6 +2,7 @@
id: with-solidjs
title: 'Quickstart: SolidJS'
description: Learn how to use Supabase in your SolidJS App.
sidebar_label: SolidJS
---
import Tabs from '@theme/Tabs'
+3 -2
View File
@@ -2,6 +2,7 @@
id: with-svelte
title: "Quickstart: Svelte"
description: Learn how to use Supabase in your Svelte App.
sidebar_label: Svelte
---
import Tabs from '@theme/Tabs';
@@ -405,8 +406,8 @@ Now that we have all the components in place, let's update `App.svelte`:
user.set(supabase.auth.user())
supabase.auth.onAuthStateChange((_, session) => {
user.set(session.user)
supabase.auth.onAuthStateChange((state, session) => {
user.set(state === 'SIGNED_IN' && session.user)
})
</script>
+1
View File
@@ -2,6 +2,7 @@
id: with-sveltekit
title: "Quickstart: SvelteKit"
description: Learn how to use Supabase in your SvelteKit App.
sidebar_label: SvelteKit
---
import Tabs from '@theme/Tabs';
+1
View File
@@ -2,6 +2,7 @@
id: with-vue-3
title: "Quickstart: Vue 3"
description: Learn how to use Supabase in your Vue 3 App.
sidebar_label: "Vue 3"
---
import Tabs from '@theme/Tabs';
+10 -2
View File
@@ -1266,7 +1266,7 @@ pages:
```
- name: Listening to row level changes
description: You can listen to individual rows using the format `{table}:{col}=eq.{val}` - where `{col}` is the column name, and `{val}` is the value which you want to match.
notes: |
notes: |
- ``eq`` filter works with all database types as under the hood, it's casting both the filter value and the database value to the correct type and then comparing them.
js: |
```js
@@ -1695,7 +1695,15 @@ pages:
.eq('name', 'United States')
.order('name', {foreignTable: 'cities'})
```
- name: Ordering multiple columns
js: |
```js
const { data, error } = await supabase
.from('cities')
.select('name', 'country_id')
.order('country_id', { ascending: false })
.order('name', { ascending: false })
```
range():
$ref: '@supabase/postgrest-js."lib/PostgrestFilterBuilder".PostgrestFilterBuilder.range'
examples: