style: lint

This commit is contained in:
Mihajlo Medjedovic
2025-06-04 17:36:13 +02:00
parent 72239558af
commit a0a529ad38
2 changed files with 38 additions and 24 deletions

View File

@@ -192,9 +192,11 @@ export class AutomaticComponent implements OnInit {
}
public getComputeContextName(id: string): string | undefined {
return this.computeContexts.find(
(context: ComputeContextItem) => context.id === id
)?.name || undefined
return (
this.computeContexts.find(
(context: ComputeContextItem) => context.id === id
)?.name || undefined
)
}
/**
@@ -272,7 +274,9 @@ export class AutomaticComponent implements OnInit {
let selectedComputeContextName = this.sasJsConfig.contextName
if (this.selectedComputeContext.length && this.computeContexts.length) {
const computeContextName = this.getComputeContextName(this.selectedComputeContext)
const computeContextName = this.getComputeContextName(
this.selectedComputeContext
)
if (computeContextName) {
selectedComputeContextName = computeContextName
@@ -291,14 +295,9 @@ export class AutomaticComponent implements OnInit {
}
this.sasJs
.request(
`services/admin/makedata`,
data,
overrideConfig,
() => {
this.sasService.shouldLogin.next(true)
}
)
.request(`services/admin/makedata`, data, overrideConfig, () => {
this.sasService.shouldLogin.next(true)
})
.then((res: any) => {
this.autodeployDone = true
@@ -346,17 +345,26 @@ 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 indexHtmlContent = await this.sasService.getFileContent(`${this.appLoc}/services`, 'DataController.html')
const indexHtmlContent = await this.sasService.getFileContent(
`${this.appLoc}/services`,
'DataController.html'
)
if (!indexHtmlContent) {
this.loggerService.error(`Failed to get DataController.html at ${this.appLoc}/services`)
this.loggerService.error(
`Failed to get DataController.html at ${this.appLoc}/services`
)
return
}
const computeContextName = this.getComputeContextName(this.selectedComputeContext)
const computeContextName = this.getComputeContextName(
this.selectedComputeContext
)
if (!computeContextName) {
this.loggerService.error(`Compute context name not found for ID: ${this.selectedComputeContext} | List: ${JSON.stringify(this.computeContexts)}`)
this.loggerService.error(
`Compute context name not found for ID: ${this.selectedComputeContext} | List: ${JSON.stringify(this.computeContexts)}`
)
return
}
@@ -365,13 +373,15 @@ export class AutomaticComponent implements OnInit {
`contextname="${computeContextName}"`
)
await this.sasService.updateFileContent(
`${this.appLoc}/services`,
'DataController.html',
updatedContent
).catch((err: any) => {
this.loggerService.error(`Failed to update DataController.html: ${err}`)
})
await this.sasService
.updateFileContent(
`${this.appLoc}/services`,
'DataController.html',
updatedContent
)
.catch((err: any) => {
this.loggerService.error(`Failed to update DataController.html: ${err}`)
})
}
public downloadFile(

View File

@@ -663,7 +663,11 @@ export class SasService {
return this.sasjsAdapter.getFileContent(folderPath, fileName)
}
public updateFileContent(folderPath: string, fileName: string, content: string) {
public updateFileContent(
folderPath: string,
fileName: string,
content: string
) {
return this.sasjsAdapter.updateFileContent(folderPath, fileName, content)
}
}