mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-5845] remove Alfresco Compatibility usage (#8822)
* upgrade to latest js-api * upgrade to latest js-api * upgrade to latest js-api * upgrade to latest js-api * upgrade to latest js-api * upgrade to latest js-api * fix security concerns for execSync * security fix * fixes as per code reviews * code fixes for attach file widget dialog * code fixes * code fixes * disable ACS storage check * add the jira to the commented out block * remove useless logger call * code fixes * code fixes * code fixes * code and typing fixes * fix lint * disable the code * try other fixes, add missing headers * dump error to console * replace test file with in-memory stream * code fixes * simplify checks * disable upload * remove useless test and ng-mocks dependency
This commit is contained in:
@@ -20,37 +20,35 @@
|
||||
import { PluginInterface } from './plugin-model';
|
||||
import { logger } from '../logger';
|
||||
import { ProcessServiceHealth } from './process-services-health';
|
||||
import { AlfrescoApi } from '@alfresco/js-api';
|
||||
|
||||
export class ProcessServiceCheckPlugin {
|
||||
processServiceHealth: ProcessServiceHealth;
|
||||
|
||||
constructor(
|
||||
private plugInInfo: PluginInterface,
|
||||
private alfrescoJsApi: any
|
||||
) {
|
||||
this.processServiceHealth = new ProcessServiceHealth(
|
||||
this.plugInInfo,
|
||||
this.alfrescoJsApi
|
||||
);
|
||||
constructor(private plugInInfo: PluginInterface, private alfrescoJsApi: AlfrescoApi) {
|
||||
this.processServiceHealth = new ProcessServiceHealth(this.plugInInfo, this.alfrescoJsApi);
|
||||
}
|
||||
|
||||
async checkProcessServicesPlugin() {
|
||||
async checkProcessServicesPlugin(): Promise<void> {
|
||||
let pluginStatus;
|
||||
try {
|
||||
const isPluginEnabled = await this.processServiceHealth.isPluginEnabledFromAppConfiguration();
|
||||
const isBackendActive = await this.processServiceHealth.checkBackendHealth();
|
||||
|
||||
if (isPluginEnabled && isBackendActive) {
|
||||
logger.info(
|
||||
`The plugin ${
|
||||
this.plugInInfo.name
|
||||
} has been correctly configured`
|
||||
);
|
||||
logger.info(`The plugin ${this.plugInInfo.name} has been correctly configured`);
|
||||
pluginStatus = [{ PluginName: this.plugInInfo.name, Status: `${'Active'}`, BE: 'UP', FE: 'Enabled' }];
|
||||
console.table(pluginStatus);
|
||||
} else {
|
||||
this.logConfigurationError();
|
||||
pluginStatus = [{ PluginName: this.plugInInfo.name, Status: 'Inactive', BE: isBackendActive ? 'UP' : 'DOWN', FE: isPluginEnabled ? 'Enabled' : 'Disabled' }];
|
||||
pluginStatus = [
|
||||
{
|
||||
PluginName: this.plugInInfo.name,
|
||||
Status: 'Inactive',
|
||||
BE: isBackendActive ? 'UP' : 'DOWN',
|
||||
FE: isPluginEnabled ? 'Enabled' : 'Disabled'
|
||||
}
|
||||
];
|
||||
console.table(pluginStatus);
|
||||
process.exit(1);
|
||||
}
|
||||
@@ -62,12 +60,7 @@ export class ProcessServiceCheckPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
private logConfigurationError(error?: any) {
|
||||
logger.error(
|
||||
`The plugin ${
|
||||
this.plugInInfo.name
|
||||
} has not been correctly configured`,
|
||||
error
|
||||
);
|
||||
private logConfigurationError(error?: any): void {
|
||||
logger.error(`The plugin ${this.plugInInfo.name} has not been correctly configured`, error);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user