Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
wg102 committed Feb 14, 2024
1 parent 28445d2 commit 6bcc9bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ export class NotebookDefaultCard

// Functions to render the HTML template ifs correctly
_isNotebookUndefined(t) {
return t.notebook === undefined;
return t && t.notebook === undefined;
}

_isNotebookEmpty(t) {
return t.notebook.name == '';
return t == 'null';
}

_isNotebookReady(t) {
Expand All @@ -53,6 +53,9 @@ export class NotebookDefaultCard
_isCreateDisabled() {
return this.loading;
}
_getNamespace() {
return this.namespace;
}


_connectNotebook() {
Expand All @@ -79,6 +82,7 @@ export class NotebookDefaultCard
// Create the default notebook
const APICreateDefault = this.$.CreateDefaultNotebook;
await APICreateDefault.generateRequest().completes.catch((e) => e);
this.loading = false;
}

/**
Expand All @@ -89,7 +93,7 @@ export class NotebookDefaultCard
*/
_isolateErrorFromIronRequest(e) {
const bd = e.detail.request.response||{};
return bd.error || e.detail.error || e.detail;
return bd.error || bd.log || e.detail.error || e.detail;
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
iron-ajax#CreateDefaultNotebook(method='POST', url='/jupyter/api/namespaces/[[namespace]]/createdefault',
on-response='handleNotebookCreate', on-error='handleNotebookCreateError', handle-as='json', content-type='application/json')
iron-ajax#GetDefaultNotebook(auto, method='GET', url='/jupyter/api/namespaces/[[namespace]]/defaultnotebook',
iron-ajax#GetDefaultNotebook(auto, params="[[_getNamespace()]]" method='GET', url='/jupyter/api/namespaces/[[namespace]]/defaultnotebook',
last-response='{{defaultNotebook}}', on-error='handleNotebookFetchError', handle-as='json', content-type='application/json')
paper-card#DefaultNotebookCard(heading="{{localize('notebookDefaultCard.txtDefaultNotebook')}}")
div.data-content
Expand Down

0 comments on commit 6bcc9bd

Please sign in to comment.