-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(data-warehouse): split managed and self managed tables in setti…
…ngs page (#23034) split managed and self-managed
- Loading branch information
Showing
10 changed files
with
148 additions
and
13 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
58 changes: 58 additions & 0 deletions
58
frontend/src/scenes/data-warehouse/settings/DataWarehouseSelfManagedSourcesTable.tsx
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,58 @@ | ||
import { LemonButton, LemonDialog, LemonTable } from '@posthog/lemon-ui' | ||
import { useActions, useValues } from 'kea' | ||
|
||
import { DatabaseSchemaDataWarehouseTable } from '~/queries/schema' | ||
|
||
import { dataWarehouseSettingsLogic } from './dataWarehouseSettingsLogic' | ||
|
||
export function DataWarehouseSelfManagedSourcesTable(): JSX.Element { | ||
const { selfManagedTables } = useValues(dataWarehouseSettingsLogic) | ||
const { deleteSelfManagedTable } = useActions(dataWarehouseSettingsLogic) | ||
|
||
return ( | ||
<LemonTable | ||
dataSource={selfManagedTables} | ||
columns={[ | ||
{ | ||
title: 'Name', | ||
dataIndex: 'name', | ||
key: 'name', | ||
}, | ||
{ | ||
key: 'actions', | ||
render: (_, item: DatabaseSchemaDataWarehouseTable) => { | ||
return ( | ||
<div className="flex flex-row justify-end"> | ||
<LemonButton | ||
status="danger" | ||
data-attr={`delete-data-warehouse-${item.name}`} | ||
key={`delete-data-warehouse-${item.name}`} | ||
onClick={() => { | ||
LemonDialog.open({ | ||
title: 'Delete table?', | ||
description: | ||
'Table deletion cannot be undone. All views and joins related to this table will be deleted.', | ||
|
||
primaryButton: { | ||
children: 'Delete', | ||
status: 'danger', | ||
onClick: () => { | ||
deleteSelfManagedTable(item.id) | ||
}, | ||
}, | ||
secondaryButton: { | ||
children: 'Cancel', | ||
}, | ||
}) | ||
}} | ||
> | ||
Delete | ||
</LemonButton> | ||
</div> | ||
) | ||
}, | ||
}, | ||
]} | ||
/> | ||
) | ||
} |
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
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