Skip to content

Commit

Permalink
remove duplicate tab states
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonelizabeth committed Oct 5, 2020
1 parent a8b1b9e commit 0a43a3c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const i18nTexts = {
defaultMessage: 'Documents:',
}
),
addDocumentsButtonLabel: i18n.translate(
editDocumentsButtonLabel: i18n.translate(
'xpack.ingestPipelines.pipelineEditor.testPipeline.documentsDropdown.editDocumentsButtonLabel',
{
defaultMessage: 'Edit documents',
Expand Down Expand Up @@ -124,7 +124,7 @@ export const DocumentsDropdown: FunctionComponent<Props> = ({
}}
data-test-subj="editDocumentsButton"
>
{i18nTexts.addDocumentsButtonLabel}
{i18nTexts.editDocumentsButtonLabel}
</EuiButton>
</EuiPopoverFooter>
</EuiPopover>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export const TestPipelineActions: FunctionComponent = () => {
{openTestPipelineFlyout && (
<TestPipelineFlyout
activeTab={activeFlyoutTab}
setActiveTab={setActiveFlyoutTab}
processors={{
processors: processors.state.processors,
onFailure: processors.state.onFailure,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { TestPipelineFlyoutTab } from './test_pipeline_tabs';

export interface Props {
activeTab: TestPipelineFlyoutTab;
setActiveTab: (tab: TestPipelineFlyoutTab) => void;
onClose: () => void;
processors: DeserializeResult;
}
Expand All @@ -31,6 +32,7 @@ export interface TestPipelineConfig {
export const TestPipelineFlyout: React.FunctionComponent<Props> = ({
onClose,
activeTab,
setActiveTab,
processors,
}) => {
const { services } = useKibana();
Expand All @@ -52,8 +54,6 @@ export const TestPipelineFlyout: React.FunctionComponent<Props> = ({
},
});

const [selectedTab, setSelectedTab] = useState<TestPipelineFlyoutTab>(activeTab);

const [isRunningTest, setIsRunningTest] = useState<boolean>(false);
const [testingError, setTestingError] = useState<any>(null);
const [testOutput, setTestOutput] = useState<any>(undefined);
Expand Down Expand Up @@ -151,7 +151,7 @@ export const TestPipelineFlyout: React.FunctionComponent<Props> = ({
});

if (isSuccessful) {
setSelectedTab('output');
setActiveTab('output');
}
};

Expand Down Expand Up @@ -180,8 +180,8 @@ export const TestPipelineFlyout: React.FunctionComponent<Props> = ({
testOutput={testOutput}
form={form}
validateAndTestPipeline={validateAndTestPipeline}
selectedTab={selectedTab}
setSelectedTab={setSelectedTab}
selectedTab={activeTab}
setSelectedTab={setActiveTab}
testingError={testingError}
onClose={onClose}
/>
Expand Down

0 comments on commit 0a43a3c

Please sign in to comment.