Skip to content
This repository was archived by the owner on Jan 19, 2025. It is now read-only.
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
10 changes: 3 additions & 7 deletions client/src/Components/SelectionView/DocumentationText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,17 @@ export default function DocumentationText({inputText = ""}: DocumentationTextPro
const cssClasses = classNames(
"read-more-button",
{
"pl-2rem": !hasMultipleLines,
"pl-1rem": !hasMultipleLines,
}
);

const iconCssClasses = classNames({
"pl-1rem": hasMultipleLines,
});

return (
<div className="docu-paragraph" onClick={() => {
setReadMore(!readMore);
}}>
{hasMultipleLines && <div className={iconCssClasses}>
{hasMultipleLines &&
<VisibilityIndicator hasChildren={hasMultipleLines} showChildren={readMore}/>
</div>}
}


<ReactMarkdown className={cssClasses} rehypePlugins={[rehypeKatex]} remarkPlugins={[remarkGfm, remarkMath]}>
Expand Down
2 changes: 1 addition & 1 deletion client/src/Components/SelectionView/FunctionView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function FunctionView(props: FunctionViewProps): JSX.Element {
isTitle={false}
/>
)) :
<span className={"text-muted, pl-2rem"}>There are no parameters.</span>
<span className={"text-muted pl-1rem"}>There are no parameters.</span>
}
</>
}
Expand Down
4 changes: 2 additions & 2 deletions client/src/Components/SelectionView/ModuleView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function ModuleView(props: ModuleViewProps): JSX.Element {
))}
</ul>
: <span className="text-muted"
style={{paddingLeft: '2rem'}}>There are no imports.</span>
style={{paddingLeft: '1rem'}}>There are no imports.</span>
}
<h2>Imported from</h2>
{!isEmptyList(declaration.fromImports) ?
Expand All @@ -41,7 +41,7 @@ export default function ModuleView(props: ModuleViewProps): JSX.Element {
))}
</ul>
: <span className="text-muted"
style={{paddingLeft: '2rem'}}>There are no modules that import this module.</span>}
style={{paddingLeft: '1rem'}}>There are no modules that import this module.</span>}
</>
}
</>
Expand Down
9 changes: 2 additions & 7 deletions client/src/Components/SelectionView/ParameterNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import AnnotationStore from "../../model/annotation/AnnotationStore";
import PythonParameter from "../../model/python/PythonParameter";
import {Nullable, Setter} from "../../util/types";
import RenameDialog from "../Dialog/RenameDialog";
import DocumentationText from "./DocumentationText";
import "./SelectionView.css";
import RenameAnnotationView from "./RenameAnnotationView";
import classNames from "classnames";
Expand Down Expand Up @@ -34,7 +33,7 @@ export default function ParameterNode(props: ParameterNodeProps): JSX.Element {
});

return (
<div className="parameter-list">
<div>
<div className="parameter-header">
{props.isTitle ? <h1 className="parameter-name">{props.pythonParameter.name}</h1> : <h4 className="parameter-name">{props.pythonParameter.name}</h4>}
<div className={dropdownClassnames}>
Expand Down Expand Up @@ -64,13 +63,9 @@ export default function ParameterNode(props: ParameterNodeProps): JSX.Element {
setNewName={setNewName}
/>}

{
props.pythonParameter.description &&
<DocumentationText inputText={props.pythonParameter?.description}/>
}
{
!props.pythonParameter.description &&
<p className="pl-2rem text-muted">There is no documentation for this parameter.</p>
<p className="pl-1rem text-muted">There is no documentation for this parameter.</p>
}
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion client/src/Components/SelectionView/ParameterView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function ParameterView(props: ParameterViewProps): JSX.Element {
{declaration.hasDefault &&
<TitleValueViewPair title="Default value" value={declaration.defaultValue}/>}
{declaration.type &&
<><h2>Type</h2><span className="pl-2rem">{declaration.type}</span></>
<><h2>Type</h2><span className="pl-1rem">{declaration.type}</span></>
}
</>}
</>
Expand Down
4 changes: 2 additions & 2 deletions client/src/Components/SelectionView/RenameAnnotationView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const RenameAnnotationView: React.FC<RenameAnnotationViewProps> = (props) => {
const deleteRenameAnnotation = () => props.setNewName(null);

if (props.newName !== null) {
return (<div>
<h5>Annotations</h5>
return (<div className={"annotation-list"}>
<h4>Annotations</h4>
<Row>
<Col className="align-items-center" xs="auto">
<code>{`@rename: ${props.newName}`}</code>
Expand Down
4 changes: 2 additions & 2 deletions client/src/Components/SelectionView/SectionListViewItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ export default function SectionListViewItem(props: ClassViewItemProps): JSX.Elem
{
!isEmptyList(props.inputElements) ?
props.inputElements.map((listElement, index) => (
<div className="pl-2rem" key={index}>{listElement}</div>
<div className="pl-1rem" key={index}>{listElement}</div>
)) :
<span className="text-muted"
style={{paddingLeft: '2rem'}}>There are no {props.title.toLowerCase()}.</span>
style={{paddingLeft: '1rem'}}>There are no {props.title.toLowerCase()}.</span>
}
</>
);
Expand Down
12 changes: 9 additions & 3 deletions client/src/Components/SelectionView/SelectionView.css
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,18 @@
}

h2 {
padding-bottom: 15px;
padding-top: 15px;
padding-top: 30px;
padding-bottom: 10px;
}

h1 {
font-weight: bold;
padding-bottom: 15px;
}

.module-list {
list-style: none;
padding-left: 2rem;
padding-left: 1rem;
}

.module-list li:not(:first-child) {
Expand All @@ -79,4 +80,9 @@ h1 {
margin-bottom: 10px;
padding-bottom: 20px;
align-self: flex-end;
}

.annotation-list {
padding-bottom: 20px;
padding-left: 1rem;
}