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

🐛Fix path to open components script #94

Merged
merged 5 commits into from
Feb 11, 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
6 changes: 3 additions & 3 deletions src/tray_library/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export default function Sidebar(props: SidebarProps) {
<TrayWidget>
<div>
<div className="search-input">
<input type="text" name="" value={searchTerm} placeholder="SEARCH" className="search-input__text-input" style={{ width: "80%" }} onChange={handleOnChange} />
<input type="text" name="" value={searchTerm} placeholder="SEARCH" className="search-input__text-input" style={{ width: "75%" }} onChange={handleOnChange} />
<a onClick={handleSearchOnClick} className="search-input__button"><i className="fa fa-search "></i></a>
<a onClick={handleRefreshOnClick} className="search-input__button"><i className="fa fa-refresh "></i></a>
</div>
Expand Down Expand Up @@ -214,7 +214,7 @@ export default function Sidebar(props: SidebarProps) {
name={componentVal.task}
color={componentVal.color}
app={props.lab}
path={componentVal.path} />
path={componentVal.file_path} />
</div>
);
}
Expand All @@ -240,7 +240,7 @@ export default function Sidebar(props: SidebarProps) {
name={val.task}
color={val.color}
app={props.lab}
path={val.path} />
path={val.file_path} />
</div>
);
})
Expand Down
6 changes: 2 additions & 4 deletions src/tray_library/TrayItemWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ export class TrayItemWidget extends React.Component<TrayItemWidgetProps> {
if (event.ctrlKey || event.metaKey) {
const { commands } = this.props.app;
commands.execute('docmanager:open', {
path: this.props.path,
factory: 'Editor',
path: this.props.path
});
}
this.forceUpdate();
Expand All @@ -52,8 +51,7 @@ export class TrayItemWidget extends React.Component<TrayItemWidgetProps> {
if (this.props.path != "") {
const { commands } = this.props.app;
commands.execute('docmanager:open', {
path: this.props.path,
factory: 'Editor',
path: this.props.path
});
}
this.forceUpdate();
Expand Down
3 changes: 3 additions & 0 deletions xircuits/handlers/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import tornado
from jupyter_server.base.handlers import APIHandler
import platform

from .config import get_config

Expand Down Expand Up @@ -148,6 +149,8 @@ def extract_component(self, node: ast.ClassDef, file_path, python_path):
"class": name,
"package_name": ("xai_components." if python_path is None else "") + file_path.as_posix().replace("/", ".")[:-3],
"python_path": str(python_path) if python_path is not None else None,
"abs_file_path": os.path.join(str(python_path), str(file_path)) if python_path is not None else None,
"file_path": "xai_components/" + (file_path.as_posix()[:-3] + ".py" if platform.system() == "Windows" else str(file_path)),
"task": name,
"header": GROUP_ADVANCED,
"category": category,
Expand Down