Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add isFullScreen capability #5

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add isFullScreen capability
  • Loading branch information
opauloh committed Mar 29, 2022
commit e863d13ea898818abe78006dc3aa78bae3a50dec
Original file line number Diff line number Diff line change
@@ -191,9 +191,10 @@ export const useSessionView = ({
? sessionView.getSessionView({
sessionEntityId: sessionViewId,
loadAlertDetails: openDetailsPanel,
isFullScreen: fullScreen,
})
: null;
}, [openDetailsPanel, sessionView, sessionViewId]);
}, [openDetailsPanel, sessionView, sessionViewId, fullScreen]);

const navigation = useMemo(() => {
return (
Original file line number Diff line number Diff line change
@@ -38,6 +38,7 @@ export const SessionView = ({
height,
jumpToEvent,
loadAlertDetails,
isFullScreen = false,
}: SessionViewDeps) => {
const [isDetailOpen, setIsDetailOpen] = useState(false);
const [selectedProcess, setSelectedProcess] = useState<Process | null>(null);
@@ -50,7 +51,7 @@ export const SessionView = ({
const [fetchAlertStatus, setFetchAlertStatus] = useState<string[]>([]);
const [updatedAlertsStatus, setUpdatedAlertsStatus] = useState<AlertStatusEventEntityIdMap>({});

const styles = useStyles({ height });
const styles = useStyles({ height, isFullScreen });

const onProcessSelected = useCallback((process: Process | null) => {
setSelectedProcess(process);
Original file line number Diff line number Diff line change
@@ -12,21 +12,22 @@ import { euiLightVars as theme } from '@kbn/ui-theme';

interface StylesDeps {
height: string | undefined;
isFullScreen?: boolean;
}

export const useStyles = ({ height = '500px' }: StylesDeps) => {
export const useStyles = ({ height = '500px', isFullScreen }: StylesDeps) => {
const { euiTheme } = useEuiTheme();

const cached = useMemo(() => {
const { border } = euiTheme;

const processTree: CSSObject = {
height: `${height}`,
height: `${isFullScreen ? 'calc(100vh - 118px)' : height}`,
position: 'relative',
};

const detailPanel: CSSObject = {
height: `${height}px`,
height: `${isFullScreen ? 'calc(100vh - 118px)' : height}`,
borderRightWidth: '0px',
};

@@ -67,7 +68,7 @@ export const useStyles = ({ height = '500px' }: StylesDeps) => {
sessionViewerComponent,
toolBar,
};
}, [height, euiTheme]);
}, [height, isFullScreen, euiTheme]);

return cached;
};
1 change: 1 addition & 0 deletions x-pack/plugins/session_view/public/types.ts
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ export interface SessionViewDeps {
// the root node of the process tree to render. e.g process.entry.entity_id or process.session_leader.entity_id
sessionEntityId: string;
height?: string;
isFullScreen?: boolean;
// if provided, the session view will jump to and select the provided event if it belongs to the session leader
// session view will fetch a page worth of events starting from jumpToEvent as well as a page backwards.
jumpToEvent?: ProcessEvent;