Implement refreshResourceTree message and hide refresh button above resource tree for Fabric native

This commit is contained in:
Laurent Nguyen 2025-04-11 08:52:13 +02:00
parent a3bfc89318
commit de3e7ff904
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

@ -315,6 +315,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"
@ -325,6 +326,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;