6 Commits

Author SHA1 Message Date
4c3c9ac88c chore(release): 6.16.1 [skip ci]
## [6.16.1](https://git.datacontroller.io/dc/dc/compare/v6.16.0...v6.16.1) (2025-06-06)

### Bug Fixes

* viya deploy updating index html based on URL ([86134f4](86134f478a))
* viya streamed app deploy page flow fix ([89ab296](89ab296151))
2025-06-06 10:35:30 +00:00
7e1c610a4d Merge pull request 'Viya deploy, updating the compute context in index.html file, found based on URL' (#168) from viya-deploy into main
All checks were successful
Release / Build-production-and-ng-test (push) Successful in 3m54s
Release / Build-and-test-development (push) Successful in 8m30s
Release / release (push) Successful in 8m19s
Reviewed-on: #168
2025-06-06 10:19:20 +00:00
8139f495ce style: lint
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 4m4s
Build / Build-and-test-development (pull_request) Successful in 8m33s
2025-06-06 12:06:10 +02:00
89ab296151 fix: viya streamed app deploy page flow fix 2025-06-06 12:05:52 +02:00
a0dc92c403 style: lint
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 4m15s
Build / Build-and-test-development (pull_request) Successful in 8m34s
2025-06-06 10:58:01 +02:00
86134f478a fix: viya deploy updating index html based on URL 2025-06-06 10:57:41 +02:00
4 changed files with 45 additions and 12 deletions

View File

@ -1,3 +1,11 @@
## [6.16.1](https://git.datacontroller.io/dc/dc/compare/v6.16.0...v6.16.1) (2025-06-06)
### Bug Fixes
* viya deploy updating index html based on URL ([86134f4](https://git.datacontroller.io/dc/dc/commit/86134f478ae0b9426e01bfcc9ca4ee597ca733f7))
* viya streamed app deploy page flow fix ([89ab296](https://git.datacontroller.io/dc/dc/commit/89ab2961513b245eeea48d1867c6496d3261761e))
# [6.16.0](https://git.datacontroller.io/dc/dc/compare/v6.15.2...v6.16.0) (2025-06-05)

View File

@ -8,6 +8,7 @@ import {
} from '@angular/core'
import SASjs, { SASjsConfig } from '@sasjs/adapter'
import { DcAdapterSettings } from 'src/app/models/DcAdapterSettings'
import { HelperService } from 'src/app/services'
import { DeployService } from 'src/app/services/deploy.service'
import { EventService } from 'src/app/services/event.service'
import { LoggerService } from 'src/app/services/logger.service'
@ -82,7 +83,8 @@ export class AutomaticComponent implements OnInit {
private deployService: DeployService,
private sasService: SasService,
private sasViyaService: SasViyaService,
private loggerService: LoggerService
private loggerService: LoggerService,
private helperService: HelperService
) {}
ngOnInit(): void {
@ -325,7 +327,8 @@ export class AutomaticComponent implements OnInit {
})
}
this.updateIndexHtmlComputeContext()
if (this.helperService.isStreamingViya())
this.updateIndexHtmlComputeContext()
})
.catch((err: any) => {
this.eventService.showAbortModal('makedata', JSON.stringify(err))
@ -341,18 +344,29 @@ export class AutomaticComponent implements OnInit {
}
/**
* Only when on Viya, this method will update the `contextname` in the `DataController.html` on the SAS drive
* Only when on Viya streamed app, this method will update the `contextname` in the `index.html` on the SAS drive
* 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 : undefined
if (!filename) {
this.eventService.showAbortModal(
null,
'We could not figure out the file name of `index.html` based on the url.'
)
return
}
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
}
@ -374,11 +388,7 @@ export class AutomaticComponent implements OnInit {
)
await this.sasService
.updateFileContent(
`${this.appLoc}/services`,
'DataController.html',
updatedContent
)
.updateFileContent(`${this.appLoc}/services`, filename, updatedContent)
.catch((err: any) => {
this.loggerService.error(`Failed to update DataController.html: ${err}`)
})

View File

@ -1,6 +1,7 @@
import { Injectable } from '@angular/core'
import cloneDeep from 'lodash-es/cloneDeep'
import * as CryptoMD5 from 'crypto-js/md5'
import { SasService } from './sas.service'
const librariesToShow = 50
@ -12,7 +13,7 @@ export class HelperService {
public loadMoreCount: number = librariesToShow
public isMicrosoft: boolean = false
constructor() {
constructor(private sasService: SasService) {
this.isMicrosoft = this.isIEorEDGE()
console.log('Is IE or Edge?', this.isMicrosoft)
}
@ -314,6 +315,20 @@ export class HelperService {
}
}
public isStreamingViya(): boolean {
const serverType = this.sasService.getServerType()
if (serverType !== 'SASVIYA') return false
if (
location.search.includes('?_file=') &&
location.pathname.includes('/SASJobExecution')
)
return true
return false
}
// Required type is NodeJS.Timeout
// But NodeJS is not available in browser so we have to go with any
private debounceTimeout: any

View File

@ -1,6 +1,6 @@
{
"name": "dcfrontend",
"version": "6.16.0",
"version": "6.16.1",
"description": "Data Controller",
"devDependencies": {
"@saithodev/semantic-release-gitea": "^2.1.0",