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
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( slack_channel_configs: Mapped[list[SlackChannelConfig]] = relationship(
"SlackChannelConfig", "SlackChannelConfig",
back_populates="slack_bot", back_populates="slack_bot",
cascade="all, delete-orphan",
) )

View File

@@ -96,6 +96,16 @@ export function SlackBotTable({ slackBots }: { slackBots: SlackBot[] }) {
</ClickableTableRow> </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> </TableBody>
</Table> </Table>
{slackBots.length > NUM_IN_PAGE && ( {slackBots.length > NUM_IN_PAGE && (