From 7b4aafc65de383dff65fbfcfddc2eafba29bff3f Mon Sep 17 00:00:00 2001 From: Mykola Morhun Date: Thu, 12 Jan 2017 09:30:19 +0200 Subject: [PATCH] CODENVY-1403: Disable rsync agents on UI (#3676) Disable rsync agents on UI --- .../environments/list-agents/list-agents.controller.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dashboard/src/app/workspaces/workspace-details/environments/list-agents/list-agents.controller.ts b/dashboard/src/app/workspaces/workspace-details/environments/list-agents/list-agents.controller.ts index e14b50cfe5..2f737cf64f 100644 --- a/dashboard/src/app/workspaces/workspace-details/environments/list-agents/list-agents.controller.ts +++ b/dashboard/src/app/workspaces/workspace-details/environments/list-agents/list-agents.controller.ts @@ -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 = ['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 {