Skip to content

Commit

Permalink
Fixed bugs
Browse files Browse the repository at this point in the history
Signed-off-by: saimedhi <[email protected]>
  • Loading branch information
saimedhi committed Oct 29, 2024
1 parent f3d665c commit 5c5a492
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 13 deletions.
5 changes: 4 additions & 1 deletion public/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,13 @@ export const FlowFrameworkDashboardsApp = (props: Props) => {
const location = useLocation();
const queryParams = getDataSourceFromURL(location);
const dataSourceId = queryParams.dataSourceId;
const isWorkflowDetailPage = location.pathname.includes(
APP_PATH.WORKFLOW_DETAIL.split(':')[0]
);
const sidebar = (
<EuiPageSideBar
style={{ minWidth: 190 }}
hidden={hideInAppSideNavBar}
hidden={isWorkflowDetailPage || hideInAppSideNavBar}
paddingSize="l"
>
<EuiSideNav
Expand Down
5 changes: 5 additions & 0 deletions public/global-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@
height: 100%;
width: 100%;
}

.panel-with-radius {
border-radius: 4px;
overflow: hidden;
}
6 changes: 5 additions & 1 deletion public/pages/workflow_detail/resizable_workspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ export function ResizableWorkspace(props: ResizableWorkspaceProps) {
initialSize={60}
minSize="25%"
paddingSize="s"
className="stretch-absolute panel-with-radius"
>
<WorkflowInputs
workflow={props.workflow}
Expand All @@ -182,14 +183,15 @@ export function ResizableWorkspace(props: ResizableWorkspaceProps) {
marginRight: isPreviewPanelOpen ? '-32px' : '0px',
marginBottom: isToolsPanelOpen ? '0px' : '24px',
}}
className="stretch-absolute panel-with-radius"
mode="collapsible"
initialSize={60}
minSize="25%"
paddingSize="s"
onToggleCollapsedInternal={() => onTogglePreviewChange()}
>
<EuiResizableContainer
className="workspace-panel"
className="workspace-panel stretch-absolute"
direction="vertical"
style={{
marginLeft: '-8px',
Expand Down Expand Up @@ -221,6 +223,7 @@ export function ResizableWorkspace(props: ResizableWorkspaceProps) {
minSize="25%"
paddingSize="s"
style={{ marginBottom: '-8px' }}
className="stretch-absolute"
>
<EuiFlexGroup
direction="column"
Expand All @@ -237,6 +240,7 @@ export function ResizableWorkspace(props: ResizableWorkspaceProps) {
</EuiResizablePanel>
<EuiResizableButton />
<EuiResizablePanel
className="stretch-absolute panel-with-radius"
id={TOOLS_PANEL_ID}
mode="collapsible"
initialSize={50}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,11 @@ export function WorkflowInputs(props: WorkflowInputsProps) {
}

return (
<EuiPanel paddingSize="m" grow={true} className="workspace-panel">
<EuiPanel
paddingSize="m"
grow={true}
className="workspace-panel stretch-relative"
>
{props.uiConfig === undefined ? (
<EuiLoadingSpinner size="xl" />
) : (
Expand Down Expand Up @@ -812,7 +816,7 @@ export function WorkflowInputs(props: WorkflowInputsProps) {
<EuiFlexItem>
<EuiHorizontalRule margin="m" />
</EuiFlexItem>
<EuiFlexItem>
<EuiFlexItem style={{ marginBottom: '18px' }}>
<EuiFlexGroup direction="row" justifyContent="flexEnd">
{onIngest && !ingestEnabled ? (
<EuiFlexItem grow={false}>
Expand Down
18 changes: 9 additions & 9 deletions public/render_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,20 @@ export const renderApp = (
params.element
);

const EXPECTED_BASE_PATH = `/app/${PLUGIN_ID}#`;
const handleLinkClick = (event: MouseEvent) => {
const anchorTag = (event.target as HTMLElement).closest(
'a'
) as HTMLAnchorElement | null;

const unlistenParentHistory = params.history.listen(() => {
if (
hideInAppSideNavBar &&
window.location.pathname.endsWith(`/app/${PLUGIN_ID}`)
) {
window.location.href = EXPECTED_BASE_PATH;
if (anchorTag && anchorTag.href.endsWith(`/app/${PLUGIN_ID}`)) {
window.location.href = anchorTag.href + '#';
window.dispatchEvent(new HashChangeEvent('hashchange'));
}
});
};
document.addEventListener('click', handleLinkClick);

return () => {
ReactDOM.unmountComponentAtNode(params.element);
unlistenParentHistory();
document.removeEventListener('click', handleLinkClick);
};
};

0 comments on commit 5c5a492

Please sign in to comment.