Skip to content

Commit

Permalink
Added text for empty table and cascade delete for slack bot deletion (#…
Browse files Browse the repository at this point in the history
…3390)

* fixed fk issue for slack bot deletion

* Added text for empty table and cascade delete for slack bot deletion
  • Loading branch information
hagen-danswer authored Dec 12, 2024
1 parent 9cacb37 commit 748b79b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions backend/danswer/db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1521,6 +1521,7 @@ class SlackBot(Base):
slack_channel_configs: Mapped[list[SlackChannelConfig]] = relationship(
"SlackChannelConfig",
back_populates="slack_bot",
cascade="all, delete-orphan",
)


Expand Down
10 changes: 10 additions & 0 deletions web/src/app/admin/bots/SlackBotTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ export function SlackBotTable({ slackBots }: { slackBots: SlackBot[] }) {
</ClickableTableRow>
);
})}
{slackBots.length === 0 && (
<TableRow>
<TableCell
colSpan={4}
className="text-center text-muted-foreground"
>
Please add a New Slack Bot to begin chatting with Danswer!
</TableCell>
</TableRow>
)}
</TableBody>
</Table>
{slackBots.length > NUM_IN_PAGE && (
Expand Down

0 comments on commit 748b79b

Please sign in to comment.