mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-30 06:11:38 +00:00
Fixed DirectoryPickerPanel and NotificationConsoleComponent
This commit is contained in:
@@ -27,7 +27,7 @@ export interface NotificationConsoleComponentProps {
|
||||
}
|
||||
|
||||
interface NotificationConsoleComponentState {
|
||||
headerStatus: string;
|
||||
headerStatus: string | undefined;
|
||||
selectedFilter: string;
|
||||
allConsoleData: ConsoleData[];
|
||||
}
|
||||
@@ -44,7 +44,7 @@ export class NotificationConsoleComponent extends React.Component<
|
||||
{ key: "Error", text: "Error" },
|
||||
];
|
||||
private headerTimeoutId?: number;
|
||||
private prevHeaderStatus: string;
|
||||
private prevHeaderStatus: string | undefined;
|
||||
private consoleHeaderElement?: HTMLElement;
|
||||
|
||||
constructor(props: NotificationConsoleComponentProps) {
|
||||
@@ -99,7 +99,7 @@ export class NotificationConsoleComponent extends React.Component<
|
||||
<div
|
||||
className="notificationConsoleHeader"
|
||||
id="notificationConsoleHeader"
|
||||
ref={this.setElememntRef}
|
||||
ref={this.setElememntRef as React.LegacyRef<HTMLDivElement>}
|
||||
onClick={() => this.expandCollapseConsole()}
|
||||
onKeyDown={(event: React.KeyboardEvent<HTMLDivElement>) => this.onExpandCollapseKeyPress(event)}
|
||||
tabIndex={0}
|
||||
@@ -150,7 +150,7 @@ export class NotificationConsoleComponent extends React.Component<
|
||||
role="combobox"
|
||||
selectedKey={this.state.selectedFilter}
|
||||
options={NotificationConsoleComponent.FilterOptions}
|
||||
onChange={this.onFilterSelected.bind(this)}
|
||||
onChange={() => this.onFilterSelected.bind(this)}
|
||||
aria-labelledby="consoleFilterLabel"
|
||||
aria-label={this.state.selectedFilter}
|
||||
/>
|
||||
@@ -210,12 +210,12 @@ export class NotificationConsoleComponent extends React.Component<
|
||||
));
|
||||
}
|
||||
|
||||
private onFilterSelected = (event: React.ChangeEvent<HTMLSelectElement>, option: IDropdownOption): void => {
|
||||
private onFilterSelected = (option: IDropdownOption): void => {
|
||||
this.setState({ selectedFilter: String(option.key) });
|
||||
};
|
||||
|
||||
private getFilteredConsoleData(): ConsoleData[] {
|
||||
let filterType: ConsoleDataType;
|
||||
let filterType: ConsoleDataType | undefined;
|
||||
|
||||
switch (this.state.selectedFilter) {
|
||||
case "In Progress":
|
||||
@@ -308,7 +308,8 @@ const PrPreview = (props: { pr: string }) => {
|
||||
export const NotificationConsole: React.FC = () => {
|
||||
const setIsExpanded = useNotificationConsole((state) => state.setIsExpanded);
|
||||
const isExpanded = useNotificationConsole((state) => state.isExpanded);
|
||||
const consoleData = useNotificationConsole((state) => state.consoleData);
|
||||
//eslint-disable-next-line
|
||||
const consoleData = useNotificationConsole((state) => state.consoleData!);
|
||||
const inProgressConsoleDataIdToBeDeleted = useNotificationConsole(
|
||||
(state) => state.inProgressConsoleDataIdToBeDeleted
|
||||
);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Panel, PanelType, ChoiceGroup } from "@fluentui/react";
|
||||
import { ChoiceGroup, Panel, PanelType } from "@fluentui/react";
|
||||
import * as React from "react";
|
||||
import { useDirectories } from "../../../hooks/useDirectories";
|
||||
|
||||
@@ -7,7 +7,7 @@ interface Props {
|
||||
dismissPanel: () => void;
|
||||
tenantId: string;
|
||||
armToken: string;
|
||||
switchTenant: (tenantId: string) => void;
|
||||
switchTenant: (tenantId: string | undefined) => void;
|
||||
}
|
||||
|
||||
export const DirectoryPickerPanel: React.FunctionComponent<Props> = ({
|
||||
@@ -29,8 +29,8 @@ export const DirectoryPickerPanel: React.FunctionComponent<Props> = ({
|
||||
<ChoiceGroup
|
||||
options={directories.map((dir) => ({ key: dir.tenantId, text: `${dir.displayName} (${dir.tenantId})` }))}
|
||||
selectedKey={tenantId}
|
||||
onChange={(event, option) => {
|
||||
switchTenant(option.key);
|
||||
onChange={(_event, option) => {
|
||||
switchTenant(option?.key);
|
||||
dismissPanel();
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -134,7 +134,9 @@
|
||||
"./src/quickstart.ts",
|
||||
"./src/setupTests.ts",
|
||||
"./src/userContext.test.ts",
|
||||
"src/Common/EntityValue.tsx"
|
||||
"src/Common/EntityValue.tsx",
|
||||
"./src/Platform/Hosted/Components/DirectoryPickerPanel.tsx",
|
||||
"./src/Explorer/Menus/NotificationConsole/NotificationConsoleComponent.tsx"
|
||||
],
|
||||
"include": [
|
||||
"src/CellOutputViewer/transforms/**/*",
|
||||
|
||||
Reference in New Issue
Block a user