Implement refreshResourceTree message and hide refresh button above resource tree for Fabric native (#2102)

This commit is contained in:
Laurent Nguyen 2025-04-15 17:48:44 +02:00 committed by GitHub
parent 2cff0fc3ff
commit afdbefe36c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 23 additions and 10 deletions

View File

@ -81,6 +81,13 @@ export type FabricMessageV3 =
error: string | undefined;
data: { accessToken: string };
};
}
| {
type: "refreshResourceTree";
message: {
id: string;
error: string | undefined;
};
};
export enum CosmosDbArtifactType {

View File

@ -340,16 +340,18 @@ export const SidebarContainer: React.FC<SidebarProps> = ({ explorer }) => {
<>
<div className={styles.floatingControlsContainer}>
<div className={styles.floatingControls}>
<button
type="button"
data-test="Sidebar/RefreshButton"
className={styles.floatingControlButton}
disabled={loading}
title="Refresh"
onClick={onRefreshClick}
>
<ArrowSync12Regular />
</button>
{!isFabricNative() && (
<button
type="button"
data-test="Sidebar/RefreshButton"
className={styles.floatingControlButton}
disabled={loading}
title="Refresh"
onClick={onRefreshClick}
>
<ArrowSync12Regular />
</button>
)}
<button
type="button"
className={styles.floatingControlButton}

View File

@ -215,6 +215,10 @@ async function configureFabric(): Promise<Explorer> {
}
break;
}
case "refreshResourceTree": {
explorer.onRefreshResourcesClick();
break;
}
default:
console.error(`Unknown Fabric message type: ${JSON.stringify(data)}`);
break;