mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 09:20:16 +00:00
resolve master branch conflict
This commit is contained in:
@@ -1,8 +1,3 @@
|
||||
import * as React from "react";
|
||||
import { Dialog as FluentDialog, DialogType, DialogFooter, IDialogProps } from "office-ui-fabric-react/lib/Dialog";
|
||||
import { IButtonProps, PrimaryButton, DefaultButton } from "office-ui-fabric-react/lib/Button";
|
||||
import { ITextFieldProps, TextField } from "office-ui-fabric-react/lib/TextField";
|
||||
import { Link } from "office-ui-fabric-react/lib/Link";
|
||||
import {
|
||||
ChoiceGroup,
|
||||
FontIcon,
|
||||
@@ -10,6 +5,11 @@ import {
|
||||
IProgressIndicatorProps,
|
||||
ProgressIndicator,
|
||||
} from "office-ui-fabric-react";
|
||||
import { DefaultButton, IButtonProps, PrimaryButton } from "office-ui-fabric-react/lib/Button";
|
||||
import { Dialog as FluentDialog, DialogFooter, DialogType, IDialogProps } from "office-ui-fabric-react/lib/Dialog";
|
||||
import { Link } from "office-ui-fabric-react/lib/Link";
|
||||
import { ITextFieldProps, TextField } from "office-ui-fabric-react/lib/TextField";
|
||||
import React, { FunctionComponent } from "react";
|
||||
|
||||
export interface TextFieldProps extends ITextFieldProps {
|
||||
label: string;
|
||||
@@ -50,61 +50,69 @@ const DIALOG_TITLE_FONT_SIZE = "17px";
|
||||
const DIALOG_TITLE_FONT_WEIGHT = 400;
|
||||
const DIALOG_SUBTEXT_FONT_SIZE = "15px";
|
||||
|
||||
export class Dialog extends React.Component<DialogProps> {
|
||||
constructor(props: DialogProps) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
public render(): JSX.Element {
|
||||
const dialogProps: IDialogProps = {
|
||||
hidden: !this.props.visible,
|
||||
dialogContentProps: {
|
||||
type: this.props.type || DialogType.normal,
|
||||
title: this.props.title,
|
||||
subText: this.props.subText,
|
||||
styles: {
|
||||
title: { fontSize: DIALOG_TITLE_FONT_SIZE, fontWeight: DIALOG_TITLE_FONT_WEIGHT },
|
||||
subText: { fontSize: DIALOG_SUBTEXT_FONT_SIZE },
|
||||
},
|
||||
showCloseButton: this.props.showCloseButton || false,
|
||||
onDismiss: this.props.onDismiss,
|
||||
export const Dialog: FunctionComponent<DialogProps> = ({
|
||||
title,
|
||||
subText,
|
||||
isModal,
|
||||
visible,
|
||||
choiceGroupProps,
|
||||
textFieldProps,
|
||||
linkProps,
|
||||
progressIndicatorProps,
|
||||
primaryButtonText,
|
||||
secondaryButtonText,
|
||||
onPrimaryButtonClick,
|
||||
onSecondaryButtonClick,
|
||||
primaryButtonDisabled,
|
||||
type,
|
||||
showCloseButton,
|
||||
onDismiss,
|
||||
}: DialogProps) => {
|
||||
const dialogProps: IDialogProps = {
|
||||
hidden: !visible,
|
||||
dialogContentProps: {
|
||||
type: type || DialogType.normal,
|
||||
title,
|
||||
subText,
|
||||
styles: {
|
||||
title: { fontSize: DIALOG_TITLE_FONT_SIZE, fontWeight: DIALOG_TITLE_FONT_WEIGHT },
|
||||
subText: { fontSize: DIALOG_SUBTEXT_FONT_SIZE },
|
||||
},
|
||||
modalProps: { isBlocking: this.props.isModal, isDarkOverlay: false },
|
||||
minWidth: DIALOG_MIN_WIDTH,
|
||||
maxWidth: DIALOG_MAX_WIDTH,
|
||||
};
|
||||
const choiceGroupProps: IChoiceGroupProps = this.props.choiceGroupProps;
|
||||
const textFieldProps: ITextFieldProps = this.props.textFieldProps;
|
||||
const linkProps: LinkProps = this.props.linkProps;
|
||||
const progressIndicatorProps: IProgressIndicatorProps = this.props.progressIndicatorProps;
|
||||
const primaryButtonProps: IButtonProps = {
|
||||
text: this.props.primaryButtonText,
|
||||
disabled: this.props.primaryButtonDisabled || false,
|
||||
onClick: this.props.onPrimaryButtonClick,
|
||||
};
|
||||
const secondaryButtonProps: IButtonProps =
|
||||
this.props.secondaryButtonText && this.props.onSecondaryButtonClick
|
||||
? {
|
||||
text: this.props.secondaryButtonText,
|
||||
onClick: this.props.onSecondaryButtonClick,
|
||||
}
|
||||
: undefined;
|
||||
showCloseButton: showCloseButton || false,
|
||||
onDismiss,
|
||||
},
|
||||
modalProps: { isBlocking: isModal, isDarkOverlay: false },
|
||||
minWidth: DIALOG_MIN_WIDTH,
|
||||
maxWidth: DIALOG_MAX_WIDTH,
|
||||
};
|
||||
|
||||
return (
|
||||
<FluentDialog {...dialogProps}>
|
||||
{choiceGroupProps && <ChoiceGroup {...choiceGroupProps} />}
|
||||
{textFieldProps && <TextField {...textFieldProps} />}
|
||||
{linkProps && (
|
||||
<Link href={linkProps.linkUrl} target="_blank">
|
||||
{linkProps.linkText} <FontIcon iconName="NavigateExternalInline" />
|
||||
</Link>
|
||||
)}
|
||||
{progressIndicatorProps && <ProgressIndicator {...progressIndicatorProps} />}
|
||||
<DialogFooter>
|
||||
<PrimaryButton {...primaryButtonProps} />
|
||||
{secondaryButtonProps && <DefaultButton {...secondaryButtonProps} />}
|
||||
</DialogFooter>
|
||||
</FluentDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
const primaryButtonProps: IButtonProps = {
|
||||
text: primaryButtonText,
|
||||
disabled: primaryButtonDisabled || false,
|
||||
onClick: onPrimaryButtonClick,
|
||||
};
|
||||
const secondaryButtonProps: IButtonProps =
|
||||
secondaryButtonText && onSecondaryButtonClick
|
||||
? {
|
||||
text: secondaryButtonText,
|
||||
onClick: onSecondaryButtonClick,
|
||||
}
|
||||
: undefined;
|
||||
|
||||
return (
|
||||
<FluentDialog {...dialogProps}>
|
||||
{choiceGroupProps && <ChoiceGroup {...choiceGroupProps} />}
|
||||
{textFieldProps && <TextField {...textFieldProps} />}
|
||||
{linkProps && (
|
||||
<Link href={linkProps.linkUrl} target="_blank">
|
||||
{linkProps.linkText} <FontIcon iconName="NavigateExternalInline" />
|
||||
</Link>
|
||||
)}
|
||||
{progressIndicatorProps && <ProgressIndicator {...progressIndicatorProps} />}
|
||||
<DialogFooter>
|
||||
<PrimaryButton {...primaryButtonProps} />
|
||||
{secondaryButtonProps && <DefaultButton {...secondaryButtonProps} />}
|
||||
</DialogFooter>
|
||||
</FluentDialog>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -350,11 +350,11 @@ exports[`test render renders with filters 1`] = `
|
||||
}
|
||||
>
|
||||
<div
|
||||
className="ms-ScrollablePane root-72"
|
||||
className="ms-ScrollablePane root-40"
|
||||
data-is-scrollable="true"
|
||||
>
|
||||
<div
|
||||
className="stickyAbove-74"
|
||||
className="stickyAbove-42"
|
||||
style={
|
||||
Object {
|
||||
"height": 0,
|
||||
@@ -365,7 +365,7 @@ exports[`test render renders with filters 1`] = `
|
||||
}
|
||||
/>
|
||||
<div
|
||||
className="ms-ScrollablePane--contentContainer contentContainer-73"
|
||||
className="ms-ScrollablePane--contentContainer contentContainer-41"
|
||||
data-is-scrollable={true}
|
||||
>
|
||||
<Sticky
|
||||
@@ -691,18 +691,18 @@ exports[`test render renders with filters 1`] = `
|
||||
validateOnLoad={true}
|
||||
>
|
||||
<div
|
||||
className="ms-TextField directoryListFilterTextBox root-78"
|
||||
className="ms-TextField directoryListFilterTextBox root-46"
|
||||
>
|
||||
<div
|
||||
className="ms-TextField-wrapper"
|
||||
>
|
||||
<div
|
||||
className="ms-TextField-fieldGroup fieldGroup-79"
|
||||
className="ms-TextField-fieldGroup fieldGroup-47"
|
||||
>
|
||||
<input
|
||||
aria-invalid={false}
|
||||
aria-label="Directory filter text box"
|
||||
className="ms-TextField-field field-80"
|
||||
className="ms-TextField-field field-48"
|
||||
id="TextField0"
|
||||
onBlur={[Function]}
|
||||
onChange={[Function]}
|
||||
@@ -1900,7 +1900,7 @@ exports[`test render renders with filters 1`] = `
|
||||
>
|
||||
<button
|
||||
aria-disabled={true}
|
||||
className="ms-Button ms-Button--default is-disabled directoryListButton root-89"
|
||||
className="ms-Button ms-Button--default is-disabled directoryListButton root-57"
|
||||
data-is-focusable={false}
|
||||
disabled={true}
|
||||
onClick={[Function]}
|
||||
@@ -1912,7 +1912,7 @@ exports[`test render renders with filters 1`] = `
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
className="ms-Button-flexContainer flexContainer-90"
|
||||
className="ms-Button-flexContainer flexContainer-58"
|
||||
data-automationid="splitbuttonprimary"
|
||||
>
|
||||
<div
|
||||
@@ -1943,7 +1943,7 @@ exports[`test render renders with filters 1`] = `
|
||||
</List>
|
||||
</div>
|
||||
<div
|
||||
className="stickyBelow-75"
|
||||
className="stickyBelow-43"
|
||||
style={
|
||||
Object {
|
||||
"bottom": "0px",
|
||||
@@ -1954,7 +1954,7 @@ exports[`test render renders with filters 1`] = `
|
||||
}
|
||||
>
|
||||
<div
|
||||
className="stickyBelowItems-76"
|
||||
className="stickyBelowItems-44"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -321,7 +321,7 @@ export class SubSettingsComponent extends React.Component<SubSettingsComponentPr
|
||||
public getPartitionKeyVisible = (): boolean => {
|
||||
if (
|
||||
userContext.apiType === "Cassandra" ||
|
||||
this.props.container.isPreferredApiTable() ||
|
||||
userContext.apiType === "Tables" ||
|
||||
!this.props.collection.partitionKeyProperty ||
|
||||
(this.props.container.isPreferredApiMongoDB() && this.props.collection.partitionKey.systemKey)
|
||||
) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
import { mount, ReactWrapper } from "enzyme";
|
||||
import React from "react";
|
||||
import { ThroughputInput } from ".";
|
||||
import { ThroughputInput } from "./ThroughputInput";
|
||||
const props = {
|
||||
isDatabase: false,
|
||||
showFreeTierExceedThroughputTooltip: true,
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
} from "office-ui-fabric-react";
|
||||
import React, { FunctionComponent, useState } from "react";
|
||||
import * as Constants from "../../../Common/Constants";
|
||||
import { Tooltip } from "../../../Common/Tooltip";
|
||||
import { Tooltip } from "../../../Common/Tooltip/Tooltip";
|
||||
import * as SharedConstants from "../../../Shared/Constants";
|
||||
import { userContext } from "../../../UserContext";
|
||||
import * as AutoPilotUtils from "../../../Utils/AutoPilotUtils";
|
||||
@@ -15,7 +15,7 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
|
||||
horizontal={true}
|
||||
>
|
||||
<div
|
||||
className="ms-Stack css-72"
|
||||
className="ms-Stack css-40"
|
||||
>
|
||||
<span
|
||||
className="mandatoryStar"
|
||||
@@ -33,7 +33,7 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
|
||||
variant="small"
|
||||
>
|
||||
<span
|
||||
className="css-73"
|
||||
className="css-41"
|
||||
style={
|
||||
Object {
|
||||
"lineHeight": "20px",
|
||||
@@ -1377,7 +1377,7 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
|
||||
>
|
||||
<button
|
||||
aria-label="Info"
|
||||
className="ms-Button ms-Button--icon root-74"
|
||||
className="ms-Button ms-Button--icon root-42"
|
||||
data-is-focusable={true}
|
||||
id="iconButton1"
|
||||
onClick={[Function]}
|
||||
@@ -1389,16 +1389,16 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
className="ms-Button-flexContainer flexContainer-75"
|
||||
className="ms-Button-flexContainer flexContainer-43"
|
||||
data-automationid="splitbuttonprimary"
|
||||
>
|
||||
<Component
|
||||
className="ms-Button-icon icon-77"
|
||||
className="ms-Button-icon icon-45"
|
||||
iconName="Info"
|
||||
>
|
||||
<i
|
||||
aria-hidden={true}
|
||||
className="ms-Icon root-37 css-82 ms-Button-icon icon-77"
|
||||
className="ms-Icon root-37 css-50 ms-Button-icon icon-45"
|
||||
data-icon-name="Info"
|
||||
role="presentation"
|
||||
style={
|
||||
@@ -1425,7 +1425,7 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
|
||||
</Stack>
|
||||
<Stack>
|
||||
<div
|
||||
className="ms-Stack css-83"
|
||||
className="ms-Stack css-51"
|
||||
>
|
||||
<StyledChoiceGroupBase
|
||||
aria-label="mode"
|
||||
@@ -1741,7 +1741,7 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
|
||||
className=""
|
||||
>
|
||||
<div
|
||||
className="ms-ChoiceFieldGroup root-84"
|
||||
className="ms-ChoiceFieldGroup root-52"
|
||||
role="radiogroup"
|
||||
>
|
||||
<div
|
||||
@@ -2051,14 +2051,14 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
|
||||
}
|
||||
>
|
||||
<div
|
||||
className="ms-ChoiceField root-85"
|
||||
className="ms-ChoiceField root-53"
|
||||
>
|
||||
<div
|
||||
className="ms-ChoiceField-wrapper"
|
||||
>
|
||||
<input
|
||||
checked={true}
|
||||
className="ms-ChoiceField-input input-86"
|
||||
className="ms-ChoiceField-input input-54"
|
||||
id="ChoiceGroup6-true"
|
||||
name="ChoiceGroup6"
|
||||
onBlur={[Function]}
|
||||
@@ -2067,7 +2067,7 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
|
||||
type="radio"
|
||||
/>
|
||||
<label
|
||||
className="ms-ChoiceField-field is-checked field-87"
|
||||
className="ms-ChoiceField-field is-checked field-55"
|
||||
htmlFor="ChoiceGroup6-true"
|
||||
>
|
||||
<span
|
||||
@@ -2385,14 +2385,14 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
|
||||
}
|
||||
>
|
||||
<div
|
||||
className="ms-ChoiceField root-85"
|
||||
className="ms-ChoiceField root-53"
|
||||
>
|
||||
<div
|
||||
className="ms-ChoiceField-wrapper"
|
||||
>
|
||||
<input
|
||||
checked={false}
|
||||
className="ms-ChoiceField-input input-86"
|
||||
className="ms-ChoiceField-input input-54"
|
||||
id="ChoiceGroup6-false"
|
||||
name="ChoiceGroup6"
|
||||
onBlur={[Function]}
|
||||
@@ -2401,7 +2401,7 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
|
||||
type="radio"
|
||||
/>
|
||||
<label
|
||||
className="ms-ChoiceField-field field-92"
|
||||
className="ms-ChoiceField-field field-60"
|
||||
htmlFor="ChoiceGroup6-false"
|
||||
>
|
||||
<span
|
||||
@@ -2426,7 +2426,7 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
|
||||
className="throughputInputSpacing"
|
||||
>
|
||||
<div
|
||||
className="ms-Stack throughputInputSpacing css-83"
|
||||
className="ms-Stack throughputInputSpacing css-51"
|
||||
>
|
||||
<Text
|
||||
data-testid="ruDescription"
|
||||
@@ -2434,7 +2434,7 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
|
||||
variant="small"
|
||||
>
|
||||
<span
|
||||
className="css-73"
|
||||
className="css-41"
|
||||
data-testid="ruDescription"
|
||||
>
|
||||
Provision maximum RU/s required by this resource. Estimate your required RU/s with
|
||||
@@ -2723,7 +2723,7 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
|
||||
}
|
||||
>
|
||||
<a
|
||||
className="ms-Link root-95"
|
||||
className="ms-Link root-63"
|
||||
data-testid="ruDescription"
|
||||
href="https://cosmos.azure.com/capacitycalculator/"
|
||||
onClick={[Function]}
|
||||
@@ -2741,7 +2741,7 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
|
||||
key=".0:$.1"
|
||||
>
|
||||
<div
|
||||
className="ms-Stack css-72"
|
||||
className="ms-Stack css-40"
|
||||
>
|
||||
<Text
|
||||
data-testid="maxRUDescription"
|
||||
@@ -2754,7 +2754,7 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
|
||||
variant="small"
|
||||
>
|
||||
<span
|
||||
className="css-73"
|
||||
className="css-41"
|
||||
data-testid="maxRUDescription"
|
||||
style={
|
||||
Object {
|
||||
@@ -4101,7 +4101,7 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
|
||||
>
|
||||
<button
|
||||
aria-label="Info"
|
||||
className="ms-Button ms-Button--icon root-74"
|
||||
className="ms-Button ms-Button--icon root-42"
|
||||
data-is-focusable={true}
|
||||
id="iconButton9"
|
||||
onClick={[Function]}
|
||||
@@ -4113,16 +4113,16 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
className="ms-Button-flexContainer flexContainer-75"
|
||||
className="ms-Button-flexContainer flexContainer-43"
|
||||
data-automationid="splitbuttonprimary"
|
||||
>
|
||||
<Component
|
||||
className="ms-Button-icon icon-77"
|
||||
className="ms-Button-icon icon-45"
|
||||
iconName="Info"
|
||||
>
|
||||
<i
|
||||
aria-hidden={true}
|
||||
className="ms-Icon root-37 css-82 ms-Button-icon icon-77"
|
||||
className="ms-Icon root-37 css-50 ms-Button-icon icon-45"
|
||||
data-icon-name="Info"
|
||||
role="presentation"
|
||||
style={
|
||||
@@ -4456,17 +4456,17 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
|
||||
value="4000"
|
||||
>
|
||||
<div
|
||||
className="ms-TextField is-required root-97"
|
||||
className="ms-TextField is-required root-65"
|
||||
>
|
||||
<div
|
||||
className="ms-TextField-wrapper"
|
||||
>
|
||||
<div
|
||||
className="ms-TextField-fieldGroup fieldGroup-98"
|
||||
className="ms-TextField-fieldGroup fieldGroup-66"
|
||||
>
|
||||
<input
|
||||
aria-invalid={false}
|
||||
className="ms-TextField-field field-99"
|
||||
className="ms-TextField-field field-67"
|
||||
id="TextField14"
|
||||
min={4000}
|
||||
onBlur={[Function]}
|
||||
@@ -4488,7 +4488,7 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
|
||||
variant="small"
|
||||
>
|
||||
<span
|
||||
className="css-73"
|
||||
className="css-41"
|
||||
>
|
||||
Your
|
||||
container
|
||||
Reference in New Issue
Block a user