diff --git a/components/centraldashboard/public/assets/i18n/languages.json b/components/centraldashboard/public/assets/i18n/languages.json index 65d93eae115..9b7067be419 100644 --- a/components/centraldashboard/public/assets/i18n/languages.json +++ b/components/centraldashboard/public/assets/i18n/languages.json @@ -78,6 +78,7 @@ "registrationPage.linkPrivacy": "Privacy", "registrationPage.errValidation": "Name can only start and end with alpha-num characters, dashes are only permitted between start and end. (minlength >= 1)", "registrationPage.errDuplicate": "Namespace \"{namespace}\" already exists", + "registrationPage.errCreateNotebook": "An error occured while creating the default notebook", "registrationPage.errTest": "Test Error!", "namespaceNeeded.text1": "Please select a", "namespaceNeeded.text2": "namespace", @@ -188,6 +189,7 @@ "registrationPage.linkDocumentation": "Documentation", "registrationPage.linkPrivacy": "Confidentialité", "registrationPage.errValidation": "Le nom doit commencer et terminer par des caractères alphanumériques, les tirets ne sont autorisés qu'à l'intérieur. (longueur minimale >= 1)", + "registrationPage.errCreateNotebook": "Erreur lors de la création du bloc-note par défaut.", "registrationPage.errDuplicate": "L'espace de noms \"{namespace}\" existe déjà", "registrationPage.errTest": "Test Error!", "namespaceNeeded.text1": "Veuillez choisir un ", diff --git a/components/centraldashboard/public/components/landing-page.js b/components/centraldashboard/public/components/landing-page.js index 39a345b8875..85ce936438d 100644 --- a/components/centraldashboard/public/components/landing-page.js +++ b/components/centraldashboard/public/components/landing-page.js @@ -121,6 +121,21 @@ export class LandingPage extends mixinBehaviors([AppLocalizeBehavior], utilities */ const success = await this.pollProfile(66, 300); if (success) this._successSetup(); + + // Create the default notebook + const APICreateDefault = this.$.CreateDefaultNotebook; + + await APICreateDefault.generateRequest().completes.catch((e) => e); + await this.sleep(1); // So the errors and callbacks can schedule + if (this.error && this.error.response) { + if (this.error.response.error) { + this.set('error', {response: { + error: 'registrationPage.errCreateNotebook', + namespace: this.namespaceName, + }}); + } + return this.waitForRedirect = false; + } this.waitForRedirect = false; } diff --git a/components/centraldashboard/public/components/landing-page.pug b/components/centraldashboard/public/components/landing-page.pug index f15ca5da7f7..73ae6839cb2 100644 --- a/components/centraldashboard/public/components/landing-page.pug +++ b/components/centraldashboard/public/components/landing-page.pug @@ -1,5 +1,7 @@ iron-ajax#MakeNamespace(method='POST', url='/api/workgroup/create', handle-as='json', last-error='{{error}}', last-response='{{resp}}', content-type='application/json', loading='{{submittingWorkgroup}}') +iron-ajax#GetMyNamespace(url='/api/workgroup/exists', handle-as='json') +iron-ajax#CreateDefaultNotebook(method='POST', url='/jupyter/api/namespaces/[[namespaceName]]/createdefault', headers='{"Content-Type": "application/json"}') paper-card#MainCard figure#Logo !{logo} neon-animatable.Main-Content