diff --git a/src/renderer/components/+catalog/catalog-add-button.tsx b/src/renderer/components/+catalog/catalog-add-button.tsx index 37b16dab6b..8f3cc20412 100644 --- a/src/renderer/components/+catalog/catalog-add-button.tsx +++ b/src/renderer/components/+catalog/catalog-add-button.tsx @@ -100,7 +100,10 @@ export class CatalogAddButton extends React.Component { key={index} icon={} tooltipTitle={menuItem.title} - onClick={() => menuItem.onClick()} + onClick={(evt) => { + evt.stopPropagation(); + menuItem.onClick(); + }} TooltipClasses={{ popper: "catalogSpeedDialPopper" }} diff --git a/src/renderer/components/layout/setting-layout.tsx b/src/renderer/components/layout/setting-layout.tsx index 53e54e07ac..45f665df1c 100644 --- a/src/renderer/components/layout/setting-layout.tsx +++ b/src/renderer/components/layout/setting-layout.tsx @@ -36,6 +36,14 @@ export interface SettingLayoutProps extends React.DOMAttributes { back?: (evt: React.MouseEvent | KeyboardEvent) => void; } +function scrollToAnchor() { + const { hash } = window.location; + + if (hash) { + document.querySelector(`${hash}`).scrollIntoView(); + } +} + const defaultProps: Partial = { provideBackButtonNavigation: true, contentGaps: true, @@ -59,6 +67,8 @@ export class SettingLayout extends React.Component { async componentDidMount() { window.addEventListener("keydown", this.onEscapeKey); + + scrollToAnchor(); } componentWillUnmount() { @@ -79,7 +89,7 @@ export class SettingLayout extends React.Component { render() { const { contentClass, provideBackButtonNavigation, - contentGaps, navigation, children, ...elemProps + contentGaps, navigation, children, back, ...elemProps } = this.props; const className = cssNames("SettingLayout", { showNavigation: navigation }, this.props.className); diff --git a/src/renderer/initializers/catalog-category-registry.tsx b/src/renderer/initializers/catalog-category-registry.tsx index 5404bd81a4..56eefc3c07 100644 --- a/src/renderer/initializers/catalog-category-registry.tsx +++ b/src/renderer/initializers/catalog-category-registry.tsx @@ -19,14 +19,17 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +import React from "react"; import { kubernetesClusterCategory } from "../../common/catalog-entities"; -import { addClusterURL } from "../../common/routes"; +import { addClusterURL, kubernetesURL } from "../../common/routes"; import { multiSet } from "../utils"; import { UserStore } from "../../common/user-store"; import { getAllEntries } from "../components/+preferences/kubeconfig-syncs"; import { runInAction } from "mobx"; import { isWindows } from "../../common/vars"; import { PathPicker } from "../components/path-picker/path-picker"; +import { Notifications } from "../components/notifications"; +import { Link } from "react-router-dom"; async function addSyncEntries(filePaths: string[]) { const entries = await getAllEntries(filePaths); @@ -34,6 +37,14 @@ async function addSyncEntries(filePaths: string[]) { runInAction(() => { multiSet(UserStore.getInstance().syncKubeconfigEntries, entries); }); + + Notifications.ok( +
+

Selected items has been added to Kubeconfig Sync.


+

Check the Preferences{" "} + to see full list.

+
+ ); } export function initCatalogCategoryRegistryEntries() {