fix: viya deploy updating index html based on URL

This commit is contained in:
Mihajlo Medjedovic 2025-06-06 10:57:41 +02:00
parent 9a2addc18e
commit 86134f478a

View File

@ -345,14 +345,17 @@ export class AutomaticComponent implements OnInit {
* This is needed to ensure that the DC will use the same compute context `makedata` service used to run against.
*/
public async updateIndexHtmlComputeContext() {
const filenamePath = location.search.split('/').pop()
const filename = filenamePath?.includes('.') ? filenamePath : 'DataController.html'
const indexHtmlContent = await this.sasService.getFileContent(
`${this.appLoc}/services`,
'DataController.html'
filename
)
if (!indexHtmlContent) {
this.loggerService.error(
`Failed to get DataController.html at ${this.appLoc}/services`
`Failed to get ${filename} at ${this.appLoc}/services`
)
return
}
@ -376,7 +379,7 @@ export class AutomaticComponent implements OnInit {
await this.sasService
.updateFileContent(
`${this.appLoc}/services`,
'DataController.html',
filename,
updatedContent
)
.catch((err: any) => {