1
0
mirror of https://github.com/sasjs/server.git synced 2026-04-09 23:23:13 +00:00

fix(appstream): app logo + improvements

This commit is contained in:
Saad Jutt
2022-03-22 03:55:51 +05:00
parent 98a00ec7ac
commit df6003df94
10 changed files with 70 additions and 22 deletions

View File

@@ -22,9 +22,15 @@ export const loadAppStreamConfig = async () => {
process.appStreamConfig = {}
for (const [streamServiceName, entry] of Object.entries(appStreamConfig)) {
const { appLoc, streamWebFolder } = entry
const { appLoc, streamWebFolder, streamLogo } = entry
publishAppStream(appLoc, streamWebFolder, streamServiceName, false)
publishAppStream(
appLoc,
streamWebFolder,
streamServiceName,
streamLogo,
false
)
}
console.log('App Stream Config loaded!')
@@ -34,14 +40,14 @@ export const addEntryToAppStreamConfig = (
streamServiceName: string,
appLoc: string,
streamWebFolder: string,
logo?: string,
streamLogo?: string,
addEntryToFile: boolean = true
) => {
if (streamServiceName && appLoc && streamWebFolder) {
process.appStreamConfig[streamServiceName] = {
appLoc,
streamWebFolder,
logo
streamLogo
}
if (addEntryToFile) saveAppStreamConfig()
}
@@ -68,7 +74,7 @@ const saveAppStreamConfig = async () => {
const isValidAppStreamConfig = (config: any) => {
if (config) {
return !Object.entries(config).some(([streamServiceName, entry]) => {
const { appLoc, streamWebFolder, logo } = entry as any
const { appLoc, streamWebFolder, streamLogo } = entry as any
return (
typeof streamServiceName !== 'string' ||

View File

@@ -73,6 +73,7 @@ export const deployValidation = (data: any): Joi.ValidationResult =>
appLoc: Joi.string().pattern(/^\//).required().min(2),
streamServiceName: Joi.string(),
streamWebFolder: Joi.string(),
streamLogo: Joi.string(),
fileTree: Joi.any().required()
}).validate(data)