Added text for empty table and cascade delete for slack bot deletion (#3390)

* fixed fk issue for slack bot deletion

* Added text for empty table and cascade delete for slack bot deletion
This commit is contained in:
hagen-danswer 2024-12-11 17:00:32 -08:00 committed by GitHub
parent 9cacb373ef
commit 748b79b0ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 0 deletions

View File

@ -1521,6 +1521,7 @@ class SlackBot(Base):
slack_channel_configs: Mapped[list[SlackChannelConfig]] = relationship(
"SlackChannelConfig",
back_populates="slack_bot",
cascade="all, delete-orphan",
)

View File

@ -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 && (