-
Notifications
You must be signed in to change notification settings - Fork 12
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
Implement new App Launcher Not Running Page/Functionality #384
Conversation
…ew not running page to app.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -23,7 +23,7 @@ async def handle_apps(request: Request): | |||
if not theme: | |||
theme = themes.DEFAULT_THEME | |||
return templates.TemplateResponse( | |||
"japps_home.html", | |||
"japps_custom.html", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, this page template is only used by pages which require a custom route through the japps service. This change was just to reduce confusion with naming between this template and the real base template (japps_page)
# If server_name is 'lab' then it is the default user | ||
if server_name == "lab" or server_name == "vscode": | ||
server_name = "" | ||
|
||
if server_name is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was updated to allow calling this endpoint from the default server (JupyterLab or VSCode). Just passing an empty server_name string today results in the endpoint returning all apps, which is not what we want here.
.card-dialog-body-wrapper { | ||
padding: 0 24px 20px !important; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix spacing issue in modal dialogs, which are currently being overridden by JupyterLab styling
@@ -125,6 +125,7 @@ export const ContextMenu = ({ | |||
}} | |||
onClick={(e) => { | |||
if (!item.disabled && item.onClick) { | |||
e.stopPropagation(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This prevents the onclick event from bubbling up when the context menu should actually be handling the event
useEffect(() => { | ||
if (currentUser) { | ||
const currentId = window.location.pathname | ||
.replace(/\/$/, '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trim any extra slashes from the end to ensure we get a proper split on strings
@@ -93,6 +97,7 @@ export const getApps = ( | |||
...server, | |||
id: app.name, | |||
name: app.display_name, | |||
url: server.url?.replace('/user/', '/hub/user/'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes 404 error when clicking on stopped app
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me, tests passing and coverage good. No errors.
I am seeing this on a local nebari deployment, any ideas? @jbouder |
Aside from this message, is the app loading as expected? |
Yep, everything else seems to be running fine. |
Cool. I think there is an overly specific check thats adding that message. I'll get an update pushed shortly. |
It looks like the modal appears even when I just got off to clicking on the context menu, seems weird IMO, is that expected behaviour? Screen.Recording.2024-07-16.at.9.43.49.am.mov |
We would need to handle the case when a shared app is stopped and the person with whom the app is shared, tried to access the app and then start it, in that case "starting the app" will fail. At the moment backend returns 500, but after this is merged #397 it will return 404. We're not allowing the shared user to start the app and in future we may, in that case it will return either 200 or 403. So to summarise we need to handle the following cases:
The later two cases are not handled at the moment. I am happy to get this PR in and handle those in a follow up PR as this is a huge improvement anyway. |
Good catch. Since we're adding a click event to the card, I need to make sure the events on the card and the context menu do not conflict. I fixed that in one place, but missed this one. Will get that fixed. |
I think we can handle this separately as it may take a little more work. Can you create an issue with the specifics? |
Fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me. Verified the click context, works as expected.
Reference Issues or PRs
N/A
What does this implement/fix?
Put a
x
in the boxes that applyTesting
Screenshots
Any other comments?
Note: native browser-based session storage is being used to track redirect and open ux. This will be replaced with global state when app is running as full SPA