From 9ace33d7830a9def42d741c23b46090afe0c5510 Mon Sep 17 00:00:00 2001 From: Saad Jutt Date: Thu, 24 Mar 2022 00:54:59 +0500 Subject: [PATCH 1/4] fix(deploy): user can deploy to same appName with different/same appLoc --- api/public/test.html | 50 +++++++++++++++++++++++++++++++ api/src/routes/appStream/index.ts | 11 ------- 2 files changed, 50 insertions(+), 11 deletions(-) create mode 100644 api/public/test.html diff --git a/api/public/test.html b/api/public/test.html new file mode 100644 index 0000000..d162581 --- /dev/null +++ b/api/public/test.html @@ -0,0 +1,50 @@ + + + + + + +

App Stream

+
+ + + clickme + + App Name here + App Name here + App Name here + App Name here + App Name here + App Name here + App Name here + App Name here + App Name here + App Name here + App Name here + App Name here + App Name here + App Name here + App Name here + App Name here + App Name here + App Name here +
+ + diff --git a/api/src/routes/appStream/index.ts b/api/src/routes/appStream/index.ts index 793efbd..ea379e7 100644 --- a/api/src/routes/appStream/index.ts +++ b/api/src/routes/appStream/index.ts @@ -40,17 +40,6 @@ export const publishAppStream = async ( if (!streamServiceName) { streamServiceName = `AppStreamName${appCount + 1}` - } else { - const alreadyDeployed = process.appStreamConfig[streamServiceName] - if (alreadyDeployed) { - if (alreadyDeployed.appLoc === appLoc) { - // redeploying to same streamServiceName - } else { - // trying to deploy to another existing streamServiceName - // assign new streamServiceName - streamServiceName = `${streamServiceName}-${appCount + 1}` - } - } } router.use(`/${streamServiceName}`, express.static(pathToDeployment)) From 5655311b9663225823c192b39a03f39d17dda730 Mon Sep 17 00:00:00 2001 From: Saad Jutt Date: Thu, 24 Mar 2022 01:07:06 +0500 Subject: [PATCH 2/4] fix: fallback logo on AppStream --- api/src/routes/appStream/appStreamHtml.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api/src/routes/appStream/appStreamHtml.ts b/api/src/routes/appStream/appStreamHtml.ts index 3edf09f..0f48b10 100644 --- a/api/src/routes/appStream/appStreamHtml.ts +++ b/api/src/routes/appStream/appStreamHtml.ts @@ -14,12 +14,12 @@ const style = `` @@ -31,7 +31,10 @@ const singleAppStreamHtml = ( logo?: string ) => ` - + ${streamServiceName} ` From 954b2e3e2e023e03a50e85d6812435e95eed1038 Mon Sep 17 00:00:00 2001 From: Saad Jutt Date: Thu, 24 Mar 2022 01:12:04 +0500 Subject: [PATCH 3/4] chore: removed test file --- api/public/test.html | 50 -------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 api/public/test.html diff --git a/api/public/test.html b/api/public/test.html deleted file mode 100644 index d162581..0000000 --- a/api/public/test.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - -

App Stream

- - - From 0c0301433c98b7c10d6eca2a4fec7164e8b13dbe Mon Sep 17 00:00:00 2001 From: Saad Jutt Date: Thu, 24 Mar 2022 04:22:30 +0500 Subject: [PATCH 4/4] test: fixed --- api/src/utils/appStreamConfig.ts | 2 ++ api/src/utils/copySASjsCore.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/api/src/utils/appStreamConfig.ts b/api/src/utils/appStreamConfig.ts index 39c02af..867964d 100644 --- a/api/src/utils/appStreamConfig.ts +++ b/api/src/utils/appStreamConfig.ts @@ -5,6 +5,8 @@ import { AppStreamConfig } from '../types' import { getTmpAppStreamConfigPath } from './file' export const loadAppStreamConfig = async () => { + if (process.env.NODE_ENV === 'test') return + const appStreamConfigPath = getTmpAppStreamConfigPath() const content = (await fileExists(appStreamConfigPath)) diff --git a/api/src/utils/copySASjsCore.ts b/api/src/utils/copySASjsCore.ts index 3bce118..0352dd0 100644 --- a/api/src/utils/copySASjsCore.ts +++ b/api/src/utils/copySASjsCore.ts @@ -10,6 +10,8 @@ import { import { getTmpMacrosPath, sasJSCoreMacros, sasJSCoreMacrosInfo } from '.' export const copySASjsCore = async () => { + if (process.env.NODE_ENV === 'test') return + console.log('Copying Macros from container to drive(tmp).') const macrosDrivePath = getTmpMacrosPath()