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

feat: add cheatsheet based on renku-python json file #2112

Merged
merged 1 commit into from
Nov 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
23 changes: 1 addition & 22 deletions client/src/notebooks/Notebooks.present.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import {
import _ from "lodash";

import { NotebooksHelper } from "./index";
import SessionCheatSheet from "./SessionCheatSheet";
import {
CheckNotebookIcon, StartNotebookServer, mergeEnumOptions, ServerOptionBoolean, ServerOptionEnum,
ServerOptionRange
Expand Down Expand Up @@ -147,26 +146,6 @@ function SessionLogs(props) {
);
}

function SessionCommands(props) {
const { tab, notebook } = props;

if (tab !== SESSION_TABS.commands)
return null;

const annotations = NotebooksHelper.cleanAnnotations(notebook.data.annotations, "renku.io");
const branch = annotations["branch"];

// ? Having a minHeight prevent losing the vertical scroll position.
// TODO: Revisit after #1219
return (
<Fragment>
<div className="p-2 p-lg-3" style={{ minHeight: 800 }}>
<SessionCheatSheet branch={branch}/>
</div>
</Fragment>
);
}

function SessionJupyter(props) {
const { notebook, height = "800px", ready } = props;
const history = useHistory();
Expand Down Expand Up @@ -776,5 +755,5 @@ NotebookServerRowAction.displayName = "NotebookServerRowAction";
export {
CheckNotebookIcon, Notebooks, NotebooksDisabled, ServerOptionBoolean, ServerOptionEnum, ServerOptionRange,
StartNotebookServer, mergeEnumOptions, SessionJupyter, NotebookServerRowFull, NotebookServerRow,
SessionCommands, SESSION_TABS, SessionLogs
SESSION_TABS, SessionLogs
};
195 changes: 0 additions & 195 deletions client/src/notebooks/SessionCheatSheet.js

This file was deleted.

4 changes: 2 additions & 2 deletions client/src/notebooks/components/ResourcesSessionModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import "./SessionModal.css";
import { Notebook, SessionHandlers } from "./Session";
import { Modal, ModalBody, ModalHeader, Nav, NavItem, NavLink, TabContent, TabPane } from "../../utils/ts-wrappers";
import { SESSION_TABS, SessionLogs } from "../Notebooks.present";
import SessionCheatSheet from "../SessionCheatSheet";
import { Docs } from "../../utils/constants/Docs";
import SessionCheatSheetGenerated from "./SessionCheatSheet";

/**
* renku-ui
Expand Down Expand Up @@ -105,7 +105,7 @@ const Resources = ({ handlers, notebook, defaultBranch, activeTab }: ResourcesPr
<TabContent activeTab={activeTab}>
<TabPane key={SESSION_TABS.commands} tabId={SESSION_TABS.commands}>
<div className="session-cheat-sheet bg-white border-radius-8">
<SessionCheatSheet branch={defaultBranch} />
<SessionCheatSheetGenerated />
</div>
</TabPane>
<TabPane key={SESSION_TABS.docs} tabId={SESSION_TABS.docs}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,21 @@ div.commands {
min-width: 300px;
padding: 10px;
}
div.commands .break {
flex-basis: 100%;
width: 0;
}

.commands h1 {
border-bottom: 2px solid rgba(0, 0, 0, 0.2);
}

.commands div.commands-row div {
.command {
flex-grow: 1;
padding: 0 20px 5px 0;
}

.commands div.commands-row div:not(.command) {
flex-basis: 0;
flex-grow: 1;
padding: 0 20px 5px 0;
Expand Down
Loading