Skip to content

Commit

Permalink
[front] Add sync badge on websites (#7546)
Browse files Browse the repository at this point in the history
  • Loading branch information
tdraier committed Sep 19, 2024
1 parent 8fd092b commit 8610669
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion front/components/vaults/VaultResourcesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@ type VaultResourcesListProps = {

const getTableColumns = ({
isManaged,
isWebsite,
isSystemVault,
}: {
isManaged: boolean;
isWebsite: boolean;
isSystemVault: boolean;
}) => {
const nameColumn: ColumnDef<RowData, string> = {
Expand Down Expand Up @@ -233,7 +235,7 @@ const getTableColumns = ({
actionColumn,
];
}
return isManaged
return isManaged || isWebsite
? [nameColumn, usedByColumn, managedByColumn, lastSyncedColumn]
: [nameColumn, usedByColumn, managedByColumn];
};
Expand Down Expand Up @@ -268,6 +270,7 @@ export const VaultResourcesList = ({

const isSystemVault = systemVault.sId === vault.sId;
const isManagedCategory = category === "managed";
const isWebsite = category === "website";
const isWebsiteOrFolder = isWebsiteOrFolderCategory(category);

const [isLoadingByProvider, setIsLoadingByProvider] = useState<
Expand Down Expand Up @@ -481,6 +484,7 @@ export const VaultResourcesList = ({
data={rows}
columns={getTableColumns({
isManaged: isManagedCategory,
isWebsite: isWebsite,
isSystemVault,
})}
filter={dataSourceSearch}
Expand Down
2 changes: 1 addition & 1 deletion front/lib/data_sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function isFolder(

export function isWebsite(
ds: DataSource
): ds is DataSource & { connectorProvider: "webcrawler" } {
): ds is DataSource & WithConnector & { connectorProvider: "webcrawler" } {
return ds.connectorProvider === "webcrawler";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import { augmentDataSourceWithConnectorDetails } from "@app/lib/api/data_sources";
import { withSessionAuthenticationForWorkspace } from "@app/lib/api/wrappers";
import type { Authenticator } from "@app/lib/auth";
import { isManaged } from "@app/lib/data_sources";
import { isManaged, isWebsite } from "@app/lib/data_sources";
import { DataSourceResource } from "@app/lib/resources/data_source_resource";
import { DataSourceViewResource } from "@app/lib/resources/data_source_view_resource";
import { VaultResource } from "@app/lib/resources/vault_resource";
Expand Down Expand Up @@ -112,7 +112,7 @@ async function handler(
dataSourceViews.map(async (dataSourceView) => {
const dataSource = dataSourceView.dataSource;

if (!isManaged(dataSource)) {
if (!isManaged(dataSource) && !isWebsite(dataSource)) {
return {
...dataSourceView,
dataSource: {
Expand Down

0 comments on commit 8610669

Please sign in to comment.