From 2ae4c5c87e397399de16797802a6b6896884f8a7 Mon Sep 17 00:00:00 2001 From: uday biswas Date: Tue, 3 Sep 2024 15:15:12 +0530 Subject: [PATCH 1/4] readme error resolved --- .../app/projects/project/project.component.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Analysim.Web/ClientApp/src/app/projects/project/project.component.ts b/src/Analysim.Web/ClientApp/src/app/projects/project/project.component.ts index b968cb4..e6d199c 100644 --- a/src/Analysim.Web/ClientApp/src/app/projects/project/project.component.ts +++ b/src/Analysim.Web/ClientApp/src/app/projects/project/project.component.ts @@ -103,13 +103,13 @@ export class ProjectComponent implements OnInit { this.latestVersion = this.versions[0]; // Default to the latest version } // console.log("the loatest version : ", this.latestVersion); + this.projectService.getNotebookFile(result.notebooks.filter((notebook) => notebook.name.toLowerCase() === "readme")[0], this.latestVersion).subscribe( + notebookJson => { + this.notebookContent = this.sanitizer.bypassSecurityTrustHtml(this.renderNotebook(notebookJson)); + // console.log("the notebook content is : ", this.notebookContent); + }); }); // console.log("readme file is : ", result.notebooks.filter((notebook) => notebook.name.toLowerCase() === "readme")[0]); - this.projectService.getNotebookFile(result.notebooks.filter((notebook) => notebook.name.toLowerCase() === "readme")[0], this.latestVersion).subscribe( - notebookJson => { - this.notebookContent = this.sanitizer.bypassSecurityTrustHtml(this.renderNotebook(notebookJson)); - // console.log("the notebook content is : ", this.notebookContent); - }); } ) @@ -182,20 +182,20 @@ export class ProjectComponent implements OnInit { for (const cell of notebookJson.cells) { htmlContent += '
'; if (cell.cell_type === 'markdown') { - htmlContent += marked(cell.source.join('')); + htmlContent += marked(cell.source); } else if (cell.cell_type === 'code') { - htmlContent += '
' + hljs.highlight(cell.source.join(''), {language: 'python'}).value + '
'; + htmlContent += '
' + hljs.highlight(cell.source, {language: 'python'}).value + '
'; if (cell.outputs) { for (const output of cell.outputs) { if (output.data && output.data['text/html']) { - htmlContent += output.data['text/html'].join(''); + htmlContent += output.data['text/html']; } else if (output.data && output.data['image/png']) { htmlContent += ``; } else if (output.data && output.data['text/plain']) { - htmlContent += '
' + output.data['text/plain'].join('') + '
'; + htmlContent += '
' + output.data['text/plain'] + '
'; } else if (output.text) { - htmlContent += '
' + output.text.join('') + '
'; + htmlContent += '
' + output.text + '
'; } } } From 7f1ff484a9168d6a2875fedf7079d4e50e05b112 Mon Sep 17 00:00:00 2001 From: uday biswas Date: Wed, 4 Sep 2024 15:50:16 +0530 Subject: [PATCH 2/4] versioning update error resolved --- .../projects/project/project.component.scss | 1 + .../app/projects/project/project.component.ts | 24 ++++++++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/Analysim.Web/ClientApp/src/app/projects/project/project.component.scss b/src/Analysim.Web/ClientApp/src/app/projects/project/project.component.scss index df315b5..03ee2de 100644 --- a/src/Analysim.Web/ClientApp/src/app/projects/project/project.component.scss +++ b/src/Analysim.Web/ClientApp/src/app/projects/project/project.component.scss @@ -53,6 +53,7 @@ .notebook-readme-full{ margin-bottom: 4px; + overflow-x: scroll; } .notebook-cell pre code div { diff --git a/src/Analysim.Web/ClientApp/src/app/projects/project/project.component.ts b/src/Analysim.Web/ClientApp/src/app/projects/project/project.component.ts index e6d199c..729af28 100644 --- a/src/Analysim.Web/ClientApp/src/app/projects/project/project.component.ts +++ b/src/Analysim.Web/ClientApp/src/app/projects/project/project.component.ts @@ -95,18 +95,20 @@ export class ProjectComponent implements OnInit { if (this.currentUser != null && this.project.projectUsers.find(x => x.userID == this.currentUser.id) != undefined) { this.projectUser = this.project.projectUsers.find(x => x.userID == this.currentUser.id) } + // console.log("Result : ", result); this.readmeNotebook = result.notebooks.filter((notebook) => notebook.name.toLowerCase() === "readme")[0]; + // console.log("readme : " ,this.readmeNotebook); this.projectService.getNotebookVersions(result.notebooks.filter((notebook) => notebook.name.toLowerCase() === "readme")[0]).subscribe(versions => { this.versions = versions; - //console.log("Versions: ", this.versions); + // console.log("Versions: ", this.versions); if (this.versions.length > 0) { this.latestVersion = this.versions[0]; // Default to the latest version } // console.log("the loatest version : ", this.latestVersion); this.projectService.getNotebookFile(result.notebooks.filter((notebook) => notebook.name.toLowerCase() === "readme")[0], this.latestVersion).subscribe( notebookJson => { + // console.log("the notebook content is : ", notebookJson); this.notebookContent = this.sanitizer.bypassSecurityTrustHtml(this.renderNotebook(notebookJson)); - // console.log("the notebook content is : ", this.notebookContent); }); }); // console.log("readme file is : ", result.notebooks.filter((notebook) => notebook.name.toLowerCase() === "readme")[0]); @@ -177,25 +179,31 @@ export class ProjectComponent implements OnInit { } renderNotebook(notebookJson: any): string { - // Simple rendering of the notebook. Customize as needed. + // console.log("notebook rendering content :" , notebookJson); let htmlContent = `
`; for (const cell of notebookJson.cells) { htmlContent += '
'; if (cell.cell_type === 'markdown') { - htmlContent += marked(cell.source); + const markdownContent = Array.isArray(cell.source) ? cell.source.join('') : cell.source; + htmlContent += marked(markdownContent); } else if (cell.cell_type === 'code') { - htmlContent += '
' + hljs.highlight(cell.source, {language: 'python'}).value + '
'; + // console.log("error: ", hljs.highlight(cell.source, {language: 'python'})); + const codeContent = Array.isArray(cell.source) ? cell.source.join('') : cell.source; + htmlContent += '
' + hljs.highlight(codeContent, { language: 'python' }).value + '
'; if (cell.outputs) { for (const output of cell.outputs) { if (output.data && output.data['text/html']) { - htmlContent += output.data['text/html']; + const htmlOutput = Array.isArray(output.data['text/html']) ? output.data['text/html'].join('') : output.data['text/html']; + htmlContent += htmlOutput; } else if (output.data && output.data['image/png']) { htmlContent += ``; } else if (output.data && output.data['text/plain']) { - htmlContent += '
' + output.data['text/plain'] + '
'; + const plainTextOutput = Array.isArray(output.data['text/plain']) ? output.data['text/plain'].join('') : output.data['text/plain']; + htmlContent += '
' + plainTextOutput + '
'; } else if (output.text) { - htmlContent += '
' + output.text + '
'; + const outputText = Array.isArray(output.text) ? output.text.join('') : output.text; + htmlContent += '
' + outputText + '
'; } } } From e5a2a2f8c3be38aa320488bd8f3dae11f730bc91 Mon Sep 17 00:00:00 2001 From: uday biswas Date: Fri, 13 Sep 2024 09:39:07 +0530 Subject: [PATCH 3/4] readme refresh done --- .../src/app/projects/project/project.component.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Analysim.Web/ClientApp/src/app/projects/project/project.component.ts b/src/Analysim.Web/ClientApp/src/app/projects/project/project.component.ts index 729af28..2b6a865 100644 --- a/src/Analysim.Web/ClientApp/src/app/projects/project/project.component.ts +++ b/src/Analysim.Web/ClientApp/src/app/projects/project/project.component.ts @@ -176,6 +176,19 @@ export class ProjectComponent implements OnInit { closeDisplayNotebookModal() { this.displayNotebookModalRef.hide(); this.router.navigate([this.router.url.split('/').slice(0,5).join('/')]) + this.projectService.getNotebookVersions(this.readmeNotebook).subscribe(versions => { + this.versions = versions; + // console.log("Versions: ", this.versions); + if (this.versions.length > 0) { + this.latestVersion = this.versions[0]; // Default to the latest version + } + // console.log("the loatest version : ", this.latestVersion); + this.projectService.getNotebookFile(this.readmeNotebook, this.latestVersion).subscribe( + notebookJson => { + // console.log("the notebook content is : ", notebookJson); + this.notebookContent = this.sanitizer.bypassSecurityTrustHtml(this.renderNotebook(notebookJson)); + }); + }); } renderNotebook(notebookJson: any): string { From 7b03727e786f7d7b5ca58e8e99cf43d0d56213f5 Mon Sep 17 00:00:00 2001 From: Cengiz Gunay Date: Wed, 20 Nov 2024 17:57:43 -0500 Subject: [PATCH 4/4] npm upgrade --- src/Analysim.Web/ClientApp/package-lock.json | 75 +++++++------------- 1 file changed, 25 insertions(+), 50 deletions(-) diff --git a/src/Analysim.Web/ClientApp/package-lock.json b/src/Analysim.Web/ClientApp/package-lock.json index e82d36b..361c055 100644 --- a/src/Analysim.Web/ClientApp/package-lock.json +++ b/src/Analysim.Web/ClientApp/package-lock.json @@ -15757,15 +15757,13 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/@csstools/postcss-unset-value/-/postcss-unset-value-1.0.1.tgz", "integrity": "sha512-f1G1WGDXEU/RN1TWAxBPQgQudtLnLQPyiWdtypkPC+mVYNKFKH/HYXSxH4MVNqwF8M0eDsoiU7HumJHCg/L/jg==", - "dev": true, - "requires": {} + "dev": true }, "@csstools/selector-specificity": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-2.0.1.tgz", "integrity": "sha512-aG20vknL4/YjQF9BSV7ts4EWm/yrjagAN7OWBNmlbEOUiu0llj4OGrFoOKK3g2vey4/p2omKCoHrWtPxSwV3HA==", - "dev": true, - "requires": {} + "dev": true }, "@discoveryjs/json-ext": { "version": "0.5.7", @@ -15934,8 +15932,7 @@ "version": "14.0.3", "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-14.0.3.tgz", "integrity": "sha512-PwvgCeY7mbijazovpA0ggeo81A3yzwOb8AfVD3yfGT15Z2qnEVyL+05Tj6ttRTngceF3gsERamFcB6lRKdcjdw==", - "dev": true, - "requires": {} + "dev": true }, "@nodelib/fs.scandir": { "version": "2.1.5", @@ -16837,8 +16834,7 @@ "version": "1.8.0", "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", - "dev": true, - "requires": {} + "dev": true }, "acorn-walk": { "version": "7.2.0", @@ -17238,8 +17234,7 @@ "bootstrap": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.6.2.tgz", - "integrity": "sha512-51Bbp/Uxr9aTuy6ca/8FbFloBUJZLHwnhTcnjIeRn2suQWsWzcuJhGjKDB5eppVte/8oCdOL3VuwxvZDUggwGQ==", - "requires": {} + "integrity": "sha512-51Bbp/Uxr9aTuy6ca/8FbFloBUJZLHwnhTcnjIeRn2suQWsWzcuJhGjKDB5eppVte/8oCdOL3VuwxvZDUggwGQ==" }, "bootstrap-icons": { "version": "1.11.3", @@ -17926,8 +17921,7 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/css-prefers-color-scheme/-/css-prefers-color-scheme-6.0.3.tgz", "integrity": "sha512-4BqMbZksRkJQx2zAjrokiGMd07RqOa2IxIrrN10lyBe9xhn9DEvjUK79J6jkeiv9D9hQFXKb6g1jwU62jziJZA==", - "dev": true, - "requires": {} + "dev": true }, "css-select": { "version": "4.3.0", @@ -19688,8 +19682,7 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==", - "dev": true, - "requires": {} + "dev": true }, "ieee754": { "version": "1.2.1", @@ -20494,8 +20487,7 @@ "ws": { "version": "7.5.9", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", - "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", - "requires": {} + "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==" } } }, @@ -20719,8 +20711,7 @@ "version": "1.7.0", "resolved": "https://registry.npmjs.org/karma-jasmine-html-reporter/-/karma-jasmine-html-reporter-1.7.0.tgz", "integrity": "sha512-pzum1TL7j90DTE86eFt48/s12hqwQuiD+e5aXx2Dc9wDEn2LfGq6RoAxEZZjFiN0RDSCOnosEKRZWxbQ+iMpQQ==", - "dev": true, - "requires": {} + "dev": true }, "karma-source-map-support": { "version": "1.4.0", @@ -21117,8 +21108,7 @@ "marked-highlight": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/marked-highlight/-/marked-highlight-2.1.3.tgz", - "integrity": "sha512-t35JWm2u8HanOJ+gSJBAYQ0Jgr3vy+gl7ORAXN8bSEQFHl5FYXH0A7YXVMrfhmKaSuBSy6LidXECn3U9Qv/dHA==", - "requires": {} + "integrity": "sha512-t35JWm2u8HanOJ+gSJBAYQ0Jgr3vy+gl7ORAXN8bSEQFHl5FYXH0A7YXVMrfhmKaSuBSy6LidXECn3U9Qv/dHA==" }, "media-typer": { "version": "0.3.0", @@ -22280,15 +22270,13 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/postcss-font-variant/-/postcss-font-variant-5.0.0.tgz", "integrity": "sha512-1fmkBaCALD72CK2a9i468mA/+tr9/1cBxRRMXOUaZqO43oWPR5imcyPjXwuv7PXbCid4ndlP5zWhidQVVa3hmA==", - "dev": true, - "requires": {} + "dev": true }, "postcss-gap-properties": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/postcss-gap-properties/-/postcss-gap-properties-3.0.3.tgz", "integrity": "sha512-rPPZRLPmEKgLk/KlXMqRaNkYTUpE7YC+bOIQFN5xcu1Vp11Y4faIXv6/Jpft6FMnl6YRxZqDZG0qQOW80stzxQ==", - "dev": true, - "requires": {} + "dev": true }, "postcss-image-set-function": { "version": "4.0.6", @@ -22314,8 +22302,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/postcss-initial/-/postcss-initial-4.0.1.tgz", "integrity": "sha512-0ueD7rPqX8Pn1xJIjay0AZeIuDoF+V+VvMt/uOnn+4ezUKhZM/NokDeP6DwMNyIoYByuN/94IQnt5FEkaN59xQ==", - "dev": true, - "requires": {} + "dev": true }, "postcss-lab-function": { "version": "4.2.0", @@ -22342,22 +22329,19 @@ "version": "5.0.4", "resolved": "https://registry.npmjs.org/postcss-logical/-/postcss-logical-5.0.4.tgz", "integrity": "sha512-RHXxplCeLh9VjinvMrZONq7im4wjWGlRJAqmAVLXyZaXwfDWP73/oq4NdIp+OZwhQUMj0zjqDfM5Fj7qby+B4g==", - "dev": true, - "requires": {} + "dev": true }, "postcss-media-minmax": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/postcss-media-minmax/-/postcss-media-minmax-5.0.0.tgz", "integrity": "sha512-yDUvFf9QdFZTuCUg0g0uNSHVlJ5X1lSzDZjPSFaiCWvjgsvu8vEVxtahPrLMinIDEEGnx6cBe6iqdx5YWz08wQ==", - "dev": true, - "requires": {} + "dev": true }, "postcss-modules-extract-imports": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.1.0.tgz", "integrity": "sha512-k3kNe0aNFQDAZGbin48pL2VNidTF0w4/eASDsxlyspobzU3wZQLOGj7L9gfRe0Jo9/4uud09DsjFNH7winGv8Q==", - "dev": true, - "requires": {} + "dev": true }, "postcss-modules-local-by-default": { "version": "4.0.5", @@ -22408,15 +22392,13 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/postcss-overflow-shorthand/-/postcss-overflow-shorthand-3.0.3.tgz", "integrity": "sha512-CxZwoWup9KXzQeeIxtgOciQ00tDtnylYIlJBBODqkgS/PU2jISuWOL/mYLHmZb9ZhZiCaNKsCRiLp22dZUtNsg==", - "dev": true, - "requires": {} + "dev": true }, "postcss-page-break": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/postcss-page-break/-/postcss-page-break-3.0.4.tgz", "integrity": "sha512-1JGu8oCjVXLa9q9rFTo4MbeeA5FMe00/9C7lN4va606Rdb+HkxXtXsmEDrIraQ11fGz/WvKWa8gMuCKkrXpTsQ==", - "dev": true, - "requires": {} + "dev": true }, "postcss-place": { "version": "7.0.4", @@ -22493,8 +22475,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/postcss-replace-overflow-wrap/-/postcss-replace-overflow-wrap-4.0.0.tgz", "integrity": "sha512-KmF7SBPphT4gPPcKZc7aDkweHiKEEO8cla/GjcBK+ckKxiZslIu3C4GCRW3DNfL0o7yW7kMQu9xlZ1kXRXLXtw==", - "dev": true, - "requires": {} + "dev": true }, "postcss-selector-not": { "version": "5.0.0", @@ -23055,8 +23036,7 @@ "version": "3.5.2", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true, - "requires": {} + "dev": true }, "json-schema-traverse": { "version": "0.4.1", @@ -23608,8 +23588,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-4.0.0.tgz", "integrity": "sha512-1V4WqhhZZgjVAVJyt7TdDPZoPBPNHbekX4fWnCJL1yQukhCeZhJySUL+gL9y6sNdN95uEOS83Y55SqHcP7MzLA==", - "dev": true, - "requires": {} + "dev": true }, "stylus": { "version": "0.57.0", @@ -23769,8 +23748,7 @@ "version": "3.5.2", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true, - "requires": {} + "dev": true }, "json-schema-traverse": { "version": "0.4.1", @@ -24190,8 +24168,7 @@ "version": "3.5.2", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true, - "requires": {} + "dev": true }, "json-schema-traverse": { "version": "0.4.1", @@ -24291,8 +24268,7 @@ "version": "8.8.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.0.tgz", "integrity": "sha512-JDAgSYQ1ksuwqfChJusw1LSJ8BizJ2e/vVu5Lxjq3YvNJNlROv1ui4i+c/kUUrPheBvQl4c5UbERhTwKa6QBJQ==", - "dev": true, - "requires": {} + "dev": true } } }, @@ -24433,8 +24409,7 @@ "version": "8.2.3", "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz", "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==", - "dev": true, - "requires": {} + "dev": true }, "xml-name-validator": { "version": "3.0.0",