💡 Address PR comments

This commit is contained in:
ajnart
2023-04-03 15:57:11 +09:00
parent 2063adc6c0
commit f1e39ba911

View File

@@ -7,18 +7,16 @@ export const getFrontendConfig = (name: string): ConfigType => {
const config = getConfig(name); const config = getConfig(name);
Consola.info(`Requested frontend content of configuration '${name}'`); Consola.info(`Requested frontend content of configuration '${name}'`);
// Find out if config as apps with integrations that have a property with no value or undefined
// If so, remove print an error using consola
// If not, return the config // If not, return the config
const appsWithIntegrationsWithUndefinedProperties = config.apps.filter( const someAppsWithoutProps = config.apps.filter(
(app) => (app) =>
app.integration?.properties.some( app.integration?.properties.some(
(property) => property.value === null || property.value === undefined (property) => property.value === null || property.value === undefined
) ?? false ) ?? false
); );
if (appsWithIntegrationsWithUndefinedProperties.length > 0) { if (someAppsWithoutProps.length > 0) {
Consola.warn( Consola.warn(
`The following apps have integrations with errored properties: [${appsWithIntegrationsWithUndefinedProperties `There are apps that have missing configuration options: [${someAppsWithoutProps
.map((app) => app.name) .map((app) => app.name)
.join(', ')}] please input the correct secrets once again for the concerned app(s), save them, exit edit mode and reload the page.` .join(', ')}] please input the correct secrets once again for the concerned app(s), save them, exit edit mode and reload the page.`
); );