diff --git a/extensions/notebook/package.json b/extensions/notebook/package.json index 7d3d5b79a4..0994bd7694 100644 --- a/extensions/notebook/package.json +++ b/extensions/notebook/package.json @@ -664,6 +664,7 @@ "fast-glob": "^3.1.0", "fs-extra": "^5.0.0", "glob": "^7.1.1", + "js-yaml": "^3.12.1", "node-fetch": "^2.6.1", "request": "^2.88.0", "tar": "^6.0.1", diff --git a/extensions/notebook/src/book/bookVersionHandler.ts b/extensions/notebook/src/book/bookVersionHandler.ts index 3548351731..bf292a252d 100644 --- a/extensions/notebook/src/book/bookVersionHandler.ts +++ b/extensions/notebook/src/book/bookVersionHandler.ts @@ -89,7 +89,7 @@ export function convertTo(version: string, section: JupyterBookSection): Jupyter temp.external = section.external; temp.sections = []; for (let s of section.sections) { - const child = this.convertTo(version, s); + const child = convertTo(version, s); temp.sections.push(child); } return temp; @@ -120,7 +120,7 @@ export function convertTo(version: string, section: JupyterBookSection): Jupyter temp.url = section.url; temp.sections = []; for (let s of section.sections) { - const child = this.convertTo(version, s); + const child = convertTo(version, s); temp.sections.push(child); } return temp; diff --git a/extensions/notebook/src/test/book/bookTocManager.test.ts b/extensions/notebook/src/test/book/bookTocManager.test.ts index b038435458..21e69ea2b4 100644 --- a/extensions/notebook/src/test/book/bookTocManager.test.ts +++ b/extensions/notebook/src/test/book/bookTocManager.test.ts @@ -459,7 +459,7 @@ describe('BookTocManagerTests', function () { }); - it.skip('Add section to book', async () => { // TODO: chgagnon Fix from vscode merge + it('Add section to book', async () => { bookTocManager = new BookTocManager(sourceBookModel, targetBookModel); await bookTocManager.updateBook(sectionA, targetBook, undefined); const listFiles = await fs.promises.readdir(path.join(run.targetBook.bookContentFolderPath, 'sectionA')); @@ -468,7 +468,7 @@ describe('BookTocManagerTests', function () { should(JSON.stringify(listFiles)).be.equal(JSON.stringify(['notebook1.ipynb', 'notebook2.ipynb', 'readme.md']), 'The files of the section should be moved to the target book folder'); }); - it.skip('Add section to section', async () => { // TODO: chgagnon Fix from vscode merge + it('Add section to section', async () => { bookTocManager = new BookTocManager(sourceBookModel, targetBookModel); await bookTocManager.updateBook(sectionB, sectionC, { 'title': 'Notebook 6', diff --git a/extensions/notebook/yarn.lock b/extensions/notebook/yarn.lock index 6061df60c9..6b7d15dcc1 100644 --- a/extensions/notebook/yarn.lock +++ b/extensions/notebook/yarn.lock @@ -500,6 +500,13 @@ applicationinsights@1.7.4: diagnostic-channel "0.2.0" diagnostic-channel-publishers "^0.3.3" +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + asn1@~0.2.3: version "0.2.4" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" @@ -803,6 +810,11 @@ esprima@^2.7.0: resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" integrity sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE= +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" @@ -1124,6 +1136,14 @@ js-tokens@^4.0.0: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== +js-yaml@^3.12.1: + version "3.14.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" + integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" @@ -1633,6 +1653,11 @@ source-map@^0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + sshpk@^1.7.0: version "1.16.1" resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877"