CODENVY-1403: Disable rsync agents on UI (#3676)

Disable rsync agents on UI
6.19.x
Mykola Morhun 2017-01-12 09:30:19 +02:00 committed by GitHub
parent f684f4fc7d
commit 7b4aafc65d
1 changed files with 8 additions and 1 deletions

View File

@ -18,6 +18,12 @@ import {CheAPI} from '../../../../../components/api/che-api.factory';
* @description This class is handling the controller for list of agents
* @author Ilya Buziuk
*/
/** List of the agents which shouldn't be switched by user */
const DISABLED_AGENTS: Array<string> = ['org.eclipse.che.ws-agent',
'com.codenvy.rsync_in_machine',
'com.codenvy.external_rsync'];
export class ListAgentsController {
cheAgent: CheAgent;
@ -62,12 +68,13 @@ export class ListAgentsController {
}
/**
* Disables agents which shouldn't be switched by user.
* Switching of the "ws-agent" must happen only via "Dev" slider.
* "ws-agent" should be listed, but always disabled regardless of the state
* @param agentId {string}
*/
needToDisable(agentId: string): boolean {
return (agentId === 'org.eclipse.che.ws-agent');
return DISABLED_AGENTS.indexOf(agentId) !== -1;
}
isEnabled(agentId: string, agents: string[]): boolean {