mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-19 17:01:13 +00:00
Add teaching bubbles after creating sample DB (#1270)
* Add teaching bubbles after creating sample DB * Add teaching bubble while creating sample container * Remove test code * Update tests and always show teaching bubbles in add collection panel when launched from quick start * Fix snapshot
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { CollectionTabKind } from "Contracts/ViewModels";
|
||||
import { useTeachingBubble } from "hooks/useTeachingBubble";
|
||||
import ko from "knockout";
|
||||
import React, { MutableRefObject, useEffect, useRef, useState } from "react";
|
||||
import loadingIcon from "../../../images/circular_loader_black_16x16.gif";
|
||||
@@ -113,6 +115,14 @@ function TabPane({ tab, active }: { tab: Tab; active: boolean }) {
|
||||
};
|
||||
|
||||
useEffect((): (() => void) | void => {
|
||||
if (
|
||||
tab.tabKind === CollectionTabKind.Documents &&
|
||||
tab.collection?.databaseId === "SampleDB" &&
|
||||
tab.collection?.id() === "SampleContainer"
|
||||
) {
|
||||
useTeachingBubble.getState().setIsDocumentsTabOpened(true);
|
||||
}
|
||||
|
||||
const { current: element } = ref;
|
||||
if (element) {
|
||||
ko.applyBindings(tab, element);
|
||||
|
||||
Reference in New Issue
Block a user