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; error: string | undefined;
data: { accessToken: string }; data: { accessToken: string };
}; };
}
| {
type: "refreshResourceTree";
message: {
id: string;
error: string | undefined;
};
}; };
export enum CosmosDbArtifactType { export enum CosmosDbArtifactType {

View File

@ -340,6 +340,7 @@ export const SidebarContainer: React.FC<SidebarProps> = ({ explorer }) => {
<> <>
<div className={styles.floatingControlsContainer}> <div className={styles.floatingControlsContainer}>
<div className={styles.floatingControls}> <div className={styles.floatingControls}>
{!isFabricNative() && (
<button <button
type="button" type="button"
data-test="Sidebar/RefreshButton" data-test="Sidebar/RefreshButton"
@ -350,6 +351,7 @@ export const SidebarContainer: React.FC<SidebarProps> = ({ explorer }) => {
> >
<ArrowSync12Regular /> <ArrowSync12Regular />
</button> </button>
)}
<button <button
type="button" type="button"
className={styles.floatingControlButton} className={styles.floatingControlButton}

View File

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