Skip to content

Commit

Permalink
removeFooterRef
Browse files Browse the repository at this point in the history
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
  • Loading branch information
abbyhu2000 committed Jul 16, 2024
1 parent c51ed7c commit 0078f65
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 17 deletions.
3 changes: 0 additions & 3 deletions src/plugins/data/public/ui/query_editor/query_editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ export default class QueryEditorUI extends Component<Props, State> {
!(
this.headerRef.current &&
this.bannerRef.current &&
this.footerRef.current &&
this.props.queryLanguage &&
this.extensionMap &&
Object.keys(this.extensionMap).length > 0
Expand All @@ -175,7 +174,6 @@ export default class QueryEditorUI extends Component<Props, State> {
configMap={this.extensionMap}
componentContainer={this.headerRef.current}
bannerContainer={this.bannerRef.current}
footerContainer={this.footerRef.current}
indexPatterns={this.props.indexPatterns}
dataSource={this.props.dataSource}
/>
Expand Down Expand Up @@ -447,7 +445,6 @@ export default class QueryEditorUI extends Component<Props, State> {
)}

<div
ref={this.footerRef}
className={
this.state.isCollapsed && useQueryEditor
? footerClassName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ interface QueryEditorExtensionProps {
dependencies: QueryEditorExtensionDependencies;
componentContainer: Element;
bannerContainer: Element;
footerContainer: Element;
}

export interface QueryEditorExtensionDependencies {
Expand Down Expand Up @@ -110,7 +109,6 @@ export const QueryEditorExtension: React.FC<QueryEditorExtensionProps> = (props)
console.log('props.config', props.config);

Check failure on line 109 in src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extension.tsx

View workflow job for this annotation

GitHub Actions / Build and Verify on Linux (ciGroup1)

Unexpected console statement
console.log('banner', props.bannerContainer, banner);
console.log('component', props.componentContainer, component);
console.log('footer', props.footerContainer, component);
if (!isEnabled) return null;

return (
Expand All @@ -121,9 +119,6 @@ export const QueryEditorExtension: React.FC<QueryEditorExtensionProps> = (props)
<QueryEditorExtensionPortal container={props.componentContainer}>
{component}
</QueryEditorExtensionPortal>
<QueryEditorExtensionPortal container={props.footerContainer}>
{footer}
</QueryEditorExtensionPortal>
</>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,10 @@ interface QueryEditorExtensionsProps extends QueryEditorExtensionDependencies {
configMap?: Record<string, QueryEditorExtensionConfig>;
componentContainer: Element;
bannerContainer: Element;
footerContainer: Element;
}

const QueryEditorExtensions: React.FC<QueryEditorExtensionsProps> = React.memo((props) => {
const {
configMap,
componentContainer,
bannerContainer,
footerContainer,
...dependencies
} = props;
const { configMap, componentContainer, bannerContainer, ...dependencies } = props;

const sortedConfigs = useMemo(() => {
if (!configMap || Object.keys(configMap).length === 0) return [];
Expand All @@ -40,7 +33,6 @@ const QueryEditorExtensions: React.FC<QueryEditorExtensionsProps> = React.memo((
dependencies={dependencies}
componentContainer={componentContainer}
bannerContainer={bannerContainer}
footerContainer={footerContainer}
/>
))}
</>
Expand Down

0 comments on commit 0078f65

Please sign in to comment.