-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: activate public brain subscription (#1241)
* feat: add public brain details modal * feat(brain): add subscription route * feat: activate subscription button * feat: add last_update column to brain table * feat: display last update on public brain details page * feat: change RBAC rule for public brains * feat: maintain brain last_update time
- Loading branch information
1 parent
6166b17
commit 2c9a0c1
Showing
29 changed files
with
329 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from uuid import UUID | ||
|
||
from models.settings import get_supabase_db | ||
|
||
|
||
def update_brain_last_update_time(brain_id: UUID): | ||
supabase_db = get_supabase_db() | ||
supabase_db.update_brain_last_update_time(brain_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
.../app/brains-management/[brainId]/components/BrainManagementTabs/utils/isUserBrainOwner.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { UUID } from "crypto"; | ||
|
||
import { MinimalBrainForUser } from "@/lib/context/BrainProvider/types"; | ||
|
||
type IsUserBrainOwnerProps = { | ||
userAccessibleBrains: MinimalBrainForUser[]; | ||
brainId?: UUID; | ||
}; | ||
export const isUserBrainOwner = ({ | ||
brainId, | ||
userAccessibleBrains, | ||
}: IsUserBrainOwnerProps): boolean => { | ||
const brain = userAccessibleBrains.find(({ id }) => id === brainId); | ||
if (brain === undefined) { | ||
return false; | ||
} | ||
|
||
return brain.role === "Owner"; | ||
}; |
Oops, something went wrong.