ICON_COLLAPSE_REMOVE: 'remove',
ICON_KEYBOARD_ARROW_RIGHT: 'keyboard_arrow_right',
EXPAND_LEVEL_THREE: '3',
+ COLLECTION_CHECK_ARRAY: ['sentData', 'receivedData', 'path', 'collection', 'method', 'status', 'name'],
+ EV_REFRESH_LIST_INDEX: 'EV_REFRESH_LIST_INDEX',
+ YANGMAN_DISABLE_ADDING_LIST_ELEMENT: 'YANGMAN_DISABLE_ADDING_LIST_ELEMENT',
+ YANGMAN_MODULE_D_INIT: 'YANGMAN_MODULE_D_INIT',
+ YANGMAN_GET_API_TREE_DATA: 'YANGMAN_GET_API_TREE_DATA',
+ YANGMAN_SET_API_TREE_DATA: 'YANGMAN_SET_API_TREE_DATA',
+ YANGMAN_SET_LOADING_BOX: 'YANGMAN_SET_LOADING_BOX',
+ YANGMAN_SHOW_TOAST: 'YANGMAN_SHOW_TOAST',
+ YANGMAN_SET_MODULE_LIST_TITLE: 'YANGMAN_SET_MODULE_LIST_TITLE',
+ YANGMAN_SET_CODEMIRROR_DATA: 'YANGMAN_SET_CODEMIRROR_DATA_',
+ YANGMAN_GET_CODEMIRROR_DATA: 'YANGMAN_GET_CODEMIRROR_DATA_',
+ SET_SEL_OPERATIONS: 'SET_SEL_OPERATIONS',
+ YANGMAN_HEADER_INIT: 'YANGMAN_HEADER_INIT',
+ YANGMAN_FILL_NODE_FROM_REQ: 'YANGMAN_FILL_NODE_FROM_REQ',
+ YANGMAN_EXECUTE_WITH_DATA: 'YANGMAN_EXECUTE_WITH_DATA',
+ YANGMAN_DESELECT_REQUESTS: 'YANGMAN_DESELECT_REQUESTS',
+ YANGMAN_REFRESH_COLLECTIONS: 'YANGMAN_REFRESH_COLLECTIONS',
+ YANGMAN_REFRESH_HISTORY: 'YANGMAN_REFRESH_HISTORY',
+ YANGMAN_SAVE_EXECUTED_REQUEST: 'YANGMAN_SAVE_EXECUTED_REQUEST',
+ YANGMAN_SELECT_THE_NEWEST_REQUEST: 'YANGMAN_SELECT_THE_NEWEST_REQUEST',
+ YANGMAN_SAVE_REQUEST_TO_COLLECTION: 'YANGMAN_SAVE_REQUEST_TO_COLLECTION',
+ YANGMAN_REFRESH_AND_EXPAND_COLLECTIONS: 'YANGMAN_REFRESH_AND_EXPAND_COLLECTIONS',
+ YANGMAN_SET_ERROR_DATA: 'YANGMAN_SET_ERROR_DATA',
+ YANGMAN_SET_ERROR_MESSAGE: 'YANGMAN_SET_ERROR_MESSAGE',
+ YANGMAN_EXECUTING_REQUEST_PROGRESS_START: 'YANGMAN_EXECUTING_REQUEST_PROGRESS_START',
+ YANGMAN_EXECUTING_REQUEST_PROGRESS_STOP: 'YANGMAN_EXECUTING_REQUEST_PROGRESS_STOP',
+ YANGMAN_GET_CODEMIRROR_DATA_RECEIVED: 'YANGMAN_GET_CODEMIRROR_DATA_RECEIVED',
+ YANGMAN_GET_CODEMIRROR_DATA_SENT: 'YANGMAN_GET_CODEMIRROR_DATA_SENT',
+ YANGMAN_SET_CODEMIRROR_DATA_RECEIVED: 'YANGMAN_SET_CODEMIRROR_DATA_RECEIVED',
+ YANGMAN_SET_CODEMIRROR_DATA_SENT: 'YANGMAN_SET_CODEMIRROR_DATA_SENT',
+ YANGMAN_ERROR_EMPTY_IDENTIFIERS: 'YANGMAN_ERROR_EMPTY_IDENTIFIERS',
+ YANGMAN_NO_MOUNT_POINT: 'YANGMAN_NO_MOUNT_POINT',
+ YANGMAN_CUST_MOUNT_POINTS: 'YANGMAN_CUST_MOUNT_POINTS',
+ YANGMAN_CANCEL_MP: 'YANGMAN_CANCEL_MP',
+ YANGMAN_MOUNT_POINT: 'YANGMAN_MOUNT_POINT',
+ SET_SCOPE_TREE_ROWS: 'SET_SCOPE_TREE_ROWS',
+ TREE_ROWS: 'tree_rows',
};
});
yangList.toggleExpanded = toggleExpanded;
// WATCHERS
- $scope.$on('EV_REFRESH_LIST_INDEX', function () {
+ $scope.$on(constants.EV_REFRESH_LIST_INDEX, function () {
yangList.currentDisplayIndex = 1;
});
- $scope.$on('YANGMAN_DISABLE_ADDING_LIST_ELEMENT', function() {
+ $scope.$on(constants.YANGMAN_DISABLE_ADDING_LIST_ELEMENT, function() {
yangList.init();
});
angular.module('app.yangman').controller('ModuleDetailCtrl', ModuleDetailCtrl);
- ModuleDetailCtrl.$inject = ['$scope', '$rootScope', '$timeout', 'YangmanService'];
+ ModuleDetailCtrl.$inject = ['$scope', '$rootScope', '$timeout', 'YangmanService', 'constants'];
- function ModuleDetailCtrl($scope, $rootScope, $timeout, YangmanService) {
+ function ModuleDetailCtrl($scope, $rootScope, $timeout, YangmanService, constants) {
var moduleDetail = this;
moduleDetail.treeApis = [];
moduleDetail.setDataDetailStore = setDataDetailStore;
// WATCHERS
- $scope.$on('YANGMAN_MODULE_D_INIT', function (){
+ $scope.$on(constants.YANGMAN_MODULE_D_INIT, function (){
init();
});
angular.module('app.yangman').controller('ModulesListCtrl', ModulesListCtrl);
ModulesListCtrl.$inject = ['$scope', '$rootScope', '$mdToast', 'YangUtilsService', 'PluginsHandlerService',
- '$filter', '$timeout'];
+ '$filter', '$timeout', 'constants'];
- function ModulesListCtrl($scope, $rootScope, $mdToast, YangUtilsService, PluginsHandlerService, $filter, $timeout) {
+ function ModulesListCtrl($scope, $rootScope, $mdToast, YangUtilsService, PluginsHandlerService, $filter, $timeout, constants) {
var modulesList = this;
modulesList.treeApis = [];
modulesList.setModule = setModule;
// watchers
- $scope.$on('YANGMAN_GET_API_TREE_DATA', function (event, args) {
+ $scope.$on(constants.YANGMAN_GET_API_TREE_DATA, function (event, args) {
(args.cbk || angular.noop)(modulesList.treeApis);
});
// set tree apis data
- $scope.$on('YANGMAN_SET_API_TREE_DATA', function (event, args) {
+ $scope.$on(constants.YANGMAN_SET_API_TREE_DATA, function (event, args) {
modulesList.treeApis = args.params;
modulesList.showLoadingBox = false;
showToastInfoBox('YANGMAN_LOADED_MODULES');
});
// show hide loading box
- $scope.$on('YANGMAN_SET_LOADING_BOX', function (event, args){
+ $scope.$on(constants.YANGMAN_SET_LOADING_BOX, function (event, args){
modulesList.showLoadingBox = args.params;
(args.cbk || angular.noop)();
});
// show info box with custom title
- $scope.$on('YANGMAN_SHOW_TOAST', function (event, args) {
+ $scope.$on(constants.YANGMAN_SHOW_TOAST, function (event, args) {
showToastInfoBox(args.params);
});
- $scope.$on('YANGMAN_SET_MODULE_LIST_TITLE', function (event, args) {
+ $scope.$on(constants.YANGMAN_SET_MODULE_LIST_TITLE, function (event, args) {
modulesList.moduleListTitle = args.params;
});
requestData.type = type;
initEditorOptions();
- $scope.$on('YANGMAN_SET_CODEMIRROR_DATA_' + type, function (event, args){
+ $scope.$on(constants.YANGMAN_SET_CODEMIRROR_DATA + type, function (event, args){
requestData.data = args.params.data;
});
- $scope.$on('YANGMAN_GET_CODEMIRROR_DATA_' + type, function (event, args){
+ $scope.$on(constants.YANGMAN_GET_CODEMIRROR_DATA + type, function (event, args){
args.params.reqData = requestData.data;
});
}
/**
* Set selected operations based on data store
*/
- $scope.$on('SET_SEL_OPERATIONS', function (event, operations, setUrl) {
+ $scope.$on(constants.SET_SEL_OPERATIONS, function (event, operations, setUrl) {
setAllowedMethods(operations);
if ( setUrl ) {
/**
* Watching for changes in shown detail data type (radio button)
*/
- $scope.$on('YANGMAN_HEADER_INIT', function (event, args) {
+ $scope.$on(constants.YANGMAN_HEADER_INIT, function (event, args) {
init();
setRequestUrl(args.params.path);
setRequestMethod(args.params.method);
(args.cbk || angular.noop)();
});
- $scope.$on('YANGMAN_FILL_NODE_FROM_REQ', function (event, args) {
+ $scope.$on(constants.YANGMAN_FILL_NODE_FROM_REQ, function (event, args) {
setNodeDataFromRequestData(args.params.requestUrl, args.params.leftpanel);
(args.cbk || angular.noop)();
});
- $scope.$on('YANGMAN_EXECUTE_WITH_DATA', function (event, args) {
+ $scope.$on(constants.YANGMAN_EXECUTE_WITH_DATA, function (event, args) {
executeOperation(args.params.data ? angular.fromJson(args.params.data) : {}, args.cbk);
});
var sentData = { reqData: null },
allData = { sent: null, received: null };
- $scope.rootBroadcast('YANGMAN_GET_CODEMIRROR_DATA_RECEIVED', params);
- $scope.rootBroadcast('YANGMAN_GET_CODEMIRROR_DATA_SENT', sentData);
+ $scope.rootBroadcast(constants.YANGMAN_GET_CODEMIRROR_DATA_RECEIVED, params);
+ $scope.rootBroadcast(constants.YANGMAN_GET_CODEMIRROR_DATA_SENT, sentData);
allData.sent = sentData.reqData ? angular.fromJson(sentData.reqData) : {};
allData.received = params.reqData ? angular.fromJson(params.reqData) : {};
dataType = requestHeader.selectedOperation === constants.OPERATION_GET ? constants.REQUEST_DATA_TYPE_RECEIVED : 'SENT';
}
- $scope.rootBroadcast('YANGMAN_GET_CODEMIRROR_DATA_' + dataType, params);
+ $scope.rootBroadcast(constants.YANGMAN_GET_CODEMIRROR_DATA + dataType, params);
return params.reqData ? angular.fromJson(params.reqData) : {};
},
};
*/
function sendRequestData(data, type){
$scope.rootBroadcast(
- 'YANGMAN_SET_CODEMIRROR_DATA_' + type,
+ constants.YANGMAN_SET_CODEMIRROR_DATA + type,
{ data: data instanceof Object ? JSON.stringify(data, null, 4) : data }
);
}
function sendErrorData(response) {
- $scope.rootBroadcast('YANGMAN_SET_ERROR_DATA', response);
+ $scope.rootBroadcast(constants.YANGMAN_SET_ERROR_DATA, response);
}
/**
}
function setApiByUrl(url, cbk, fill){
- $scope.rootBroadcast('YANGMAN_GET_API_TREE_DATA', null, function (treeApis) {
+ $scope.rootBroadcast(constants.YANGMAN_GET_API_TREE_DATA, null, function (treeApis) {
var apisIndexes =
PathUtilsService.searchNodeByPath(url, treeApis, null, true, true);
null, null, requestHeader.requestUrl, requestHeader.selectedOperation, '', '', ''
);
- $scope.rootBroadcast('YANGMAN_GET_CODEMIRROR_DATA_SENT', sentData);
- $scope.rootBroadcast('YANGMAN_GET_CODEMIRROR_DATA_RECEIVED', receivedData);
+ $scope.rootBroadcast(constants.YANGMAN_GET_CODEMIRROR_DATA_SENT, sentData);
+ $scope.rootBroadcast(constants.YANGMAN_GET_CODEMIRROR_DATA_RECEIVED, receivedData);
RequestService.fillRequestByMethod(
historyReq, sentData, receivedData, requestHeader.selectedOperation, $scope.node,
requestHeader.selectedShownDataType
);
- $scope.rootBroadcast('YANGMAN_SAVE_REQUEST_TO_COLLECTION', { event: event, reqObj: historyReq });
+ $scope.rootBroadcast(constants.YANGMAN_SAVE_REQUEST_TO_COLLECTION, { event: event, reqObj: historyReq });
}
function showRequestProgress(){
- $scope.rootBroadcast('YANGMAN_EXECUTING_REQUEST_PROGRESS_START');
+ $scope.rootBroadcast(constants.YANGMAN_EXECUTING_REQUEST_PROGRESS_START);
}
function finishRequestProgress(message){
- $scope.rootBroadcast('YANGMAN_EXECUTING_REQUEST_PROGRESS_STOP');
+ $scope.rootBroadcast(constants.YANGMAN_EXECUTING_REQUEST_PROGRESS_STOP);
}
/**
showRequestProgress();
setRequestUrl(requestHeader.selectedShownDataType === constants.DISPLAY_TYPE_REQ_DATA ? requestHeader.requestUrl : null);
- $scope.rootBroadcast('YANGMAN_SET_ERROR_MESSAGE', '');
+ $scope.rootBroadcast(constants.YANGMAN_SET_ERROR_MESSAGE, '');
if ( requestHeader.selectedShownDataType !== constants.DISPLAY_TYPE_FORM ){
setApiByUrl(requestHeader.requestUrl, null, true);
requestHeader.executedOperation = requestHeader.selectedOperation;
} else {
$scope.rootBroadcast(
- 'YANGMAN_SET_ERROR_MESSAGE',
- $filter('translate')('YANGMAN_ERROR_EMPTY_IDENTIFIERS')
+ constants.YANGMAN_SET_ERROR_MESSAGE,
+ $filter('translate')(constants.YANGMAN_ERROR_EMPTY_IDENTIFIERS)
);
}
);
$scope.node.expanded = true;
- $scope.rootBroadcast('YANGMAN_DISABLE_ADDING_LIST_ELEMENT');
+ $scope.rootBroadcast(constants.YANGMAN_DISABLE_ADDING_LIST_ELEMENT);
preparedReceivedData = YangmanService.checkRpcReceivedData(preparedReceivedData, $scope.node);
sendRequestData(preparedReceivedData, constants.REQUEST_DATA_TYPE_RECEIVED);
}
reqInfo.time
);
- $scope.rootBroadcast('YANGMAN_SAVE_EXECUTED_REQUEST', historyReq, function (){
- $scope.rootBroadcast('YANGMAN_SELECT_THE_NEWEST_REQUEST');
+ $scope.rootBroadcast(constants.YANGMAN_SAVE_EXECUTED_REQUEST, historyReq, function (){
+ $scope.rootBroadcast(constants.YANGMAN_SELECT_THE_NEWEST_REQUEST);
});
(executeCbk || angular.noop)(historyReq);
reqInfo.statusText,
reqInfo.time
);
- $scope.rootBroadcast('YANGMAN_SAVE_EXECUTED_REQUEST', historyReq, function (){
- $scope.rootBroadcast('YANGMAN_SELECT_THE_NEWEST_REQUEST');
+ $scope.rootBroadcast(constants.YANGMAN_SAVE_EXECUTED_REQUEST, historyReq, function (){
+ $scope.rootBroadcast(constants.YANGMAN_SELECT_THE_NEWEST_REQUEST);
});
if (response.data) {
if ( requestHeader.selectedShownDataType === constants.DISPLAY_TYPE_REQ_DATA ) {
// get json data
var params = { reqData: null };
- $scope.rootBroadcast('YANGMAN_GET_CODEMIRROR_DATA_SENT', params);
+ $scope.rootBroadcast(constants.YANGMAN_GET_CODEMIRROR_DATA_SENT, params);
executeOperation(params.reqData ? angular.fromJson(params.reqData) : {}, cbk);
} else {
executeOperation({}, cbk);
'MAIN_SCOPE'
);
- $scope.rootBroadcast('YANGMAN_GET_API_TREE_DATA', null, function (treeApis) {
+ $scope.rootBroadcast(constants.YANGMAN_GET_API_TREE_DATA, null, function (treeApis) {
DataBackupService.storeFromScope(
['treeApis'],
{ treeApis: treeApis },
$scope.setGlobalParams(mountPointApis, augmentations);
$scope.setDataStore(null);
requestHeader.statusObj = reqObj;
- $scope.rootBroadcast('YANGMAN_SET_API_TREE_DATA', mountPointTreeApis);
+ $scope.rootBroadcast(constants.YANGMAN_SET_API_TREE_DATA, mountPointTreeApis);
}
/**
$mdDialog.show(confirm).then(function (){
vm.collectionList.clear();
vm.collectionList.saveToStorage();
- $scope.rootBroadcast('YANGMAN_REFRESH_COLLECTIONS');
+ $scope.rootBroadcast(constants.YANGMAN_REFRESH_COLLECTIONS);
YangmanDesignService.enableMdMenuItem(event);
}, function () {
YangmanDesignService.enableMdMenuItem(event);
* @param $fileContent
*/
function readCollectionFromFile($fileContent) {
- var data = $fileContent,
- checkArray = ['sentData', 'receivedData', 'path', 'collection', 'method', 'status', 'name'];
+ var data = $fileContent;
- if (data && YangmanService.validateFile(data, checkArray)){
+ if (data && YangmanService.validateFile(data, constants.COLLECTION_CHECK_ARRAY)){
try {
vm.collectionList.loadListFromFile(data);
vm.collectionList.saveToStorage();
- $scope.rootBroadcast('YANGMAN_REFRESH_COLLECTIONS');
+ $scope.rootBroadcast(constants.YANGMAN_REFRESH_COLLECTIONS);
clearFileInputValue();
}
catch (e) {
}
$scope.rootBroadcast(
- 'YANGMAN_SET_CODEMIRROR_DATA_RECEIVED', { data: reqObj.setDataForView(reqObj.receivedData) }
+ constants.YANGMAN_SET_CODEMIRROR_DATA_RECEIVED, { data: reqObj.setDataForView(reqObj.receivedData) }
);
$scope.rootBroadcast(
- 'YANGMAN_SET_CODEMIRROR_DATA_SENT', { data: reqObj.setDataForView(reqObj.sentData) }
+ constants.YANGMAN_SET_CODEMIRROR_DATA_SENT, { data: reqObj.setDataForView(reqObj.sentData) }
);
- $scope.rootBroadcast('YANGMAN_SET_ERROR_DATA',
+ $scope.rootBroadcast(constants.YANGMAN_SET_ERROR_DATA,
reqObj.receivedData && reqObj.receivedData.hasOwnProperty('errors') ? reqObj.receivedData : {});
- $scope.rootBroadcast('YANGMAN_FILL_NODE_FROM_REQ', { requestUrl: reqObj.path, requestData: data },
+ $scope.rootBroadcast(constants.YANGMAN_FILL_NODE_FROM_REQ, { requestUrl: reqObj.path, requestData: data },
function (){
$scope.setRightPanelSection(constants.DISPLAY_TYPE_FORM);
- $scope.rootBroadcast('YANGMAN_HEADER_INIT', {
+ $scope.rootBroadcast(constants.YANGMAN_HEADER_INIT, {
path: reqObj.path,
method: reqObj.method,
statusObj: {
*/
function executeRequest(reqObj) {
showData(reqObj);
- $scope.rootBroadcast('YANGMAN_EXECUTE_WITH_DATA',{ data: reqObj.sentData });
+ $scope.rootBroadcast(constants.YANGMAN_EXECUTE_WITH_DATA,{ data: reqObj.sentData });
}
/**
};
$scope.rootBroadcast(
- 'YANGMAN_SET_ERROR_DATA',
+ constants.YANGMAN_SET_ERROR_DATA,
reqObj.receivedData && reqObj.receivedData.hasOwnProperty('errors') ? reqObj.receivedData : {}
);
}
$scope.setRightPanelSection(constants.DISPLAY_TYPE_REQ_DATA);
$scope.setJsonView(true, reqObj.method !== constants.OPERATION_GET);
- $scope.rootBroadcast('YANGMAN_HEADER_INIT', headerObj);
- $scope.rootBroadcast('YANGMAN_FILL_NODE_FROM_REQ', { requestUrl: reqObj.path });
+ $scope.rootBroadcast(constants.YANGMAN_HEADER_INIT, headerObj);
+ $scope.rootBroadcast(constants.YANGMAN_FILL_NODE_FROM_REQ, { requestUrl: reqObj.path });
$scope.rootBroadcast(
- 'YANGMAN_SET_CODEMIRROR_DATA_RECEIVED',
+ constants.YANGMAN_SET_CODEMIRROR_DATA_RECEIVED,
{ data: reqObj.setDataForView(reqObj.receivedData) }
);
$scope.rootBroadcast(
- 'YANGMAN_SET_CODEMIRROR_DATA_SENT',
+ constants.YANGMAN_SET_CODEMIRROR_DATA_SENT,
{ data: reqObj.setDataForView(reqObj.sentData) }
);
}
// if request was selected, deselect requests in all other instances of RequestsListCtrl
- $scope.$on('YANGMAN_DESELECT_REQUESTS', function (event, params) {
+ $scope.$on(constants.YANGMAN_DESELECT_REQUESTS, function (event, params) {
if (params.params.broadcastingCtrl !== vm) {
deselectAllRequests();
}
});
- $scope.$on('YANGMAN_REFRESH_COLLECTIONS', function (event, params){
+ $scope.$on(constants.YANGMAN_REFRESH_COLLECTIONS, function (event, params){
loadCollectionsList();
(params.cbk || angular.noop)();
});
vm.mainList = vm.requestList;
loadHistoryList();
- $scope.$on('YANGMAN_REFRESH_HISTORY', loadHistoryList);
+ $scope.$on(constants.YANGMAN_REFRESH_HISTORY, loadHistoryList);
// saving from request header after execution
- $scope.$on('YANGMAN_SAVE_EXECUTED_REQUEST', saveBcstedHistoryRequest);
+ $scope.$on(constants.YANGMAN_SAVE_EXECUTED_REQUEST, saveBcstedHistoryRequest);
// select newest request
- $scope.$on('YANGMAN_SELECT_THE_NEWEST_REQUEST', selectNewestRequest);
+ $scope.$on(constants.YANGMAN_SELECT_THE_NEWEST_REQUEST, selectNewestRequest);
}
else {
vm.mainList = vm.collectionList;
// saving from request header
- $scope.$on('YANGMAN_SAVE_REQUEST_TO_COLLECTION', saveRequestFromExt);
+ $scope.$on(constants.YANGMAN_SAVE_REQUEST_TO_COLLECTION, saveRequestFromExt);
// saving collections expanded status on refresh
- $scope.$on('YANGMAN_REFRESH_AND_EXPAND_COLLECTIONS', function(){
+ $scope.$on(constants.YANGMAN_REFRESH_AND_EXPAND_COLLECTIONS, function(){
var expandedColNames = vm.collectionList.getExpandedCollectionNames();
- $scope.rootBroadcast('YANGMAN_REFRESH_COLLECTIONS', {}, function (){
+ $scope.rootBroadcast(constants.YANGMAN_REFRESH_COLLECTIONS, {}, function (){
vm.collectionList.expandCollectionByNames(expandedColNames);
});
});
* @param requestObj
*/
function selectRequest(event, requestObj){
- $scope.rootBroadcast('YANGMAN_DESELECT_REQUESTS', { broadcastingCtrl: vm });
+ $scope.rootBroadcast(constants.YANGMAN_DESELECT_REQUESTS, { broadcastingCtrl: vm });
vm.mainList.toggleReqSelection(!event.ctrlKey, requestObj);
if (!event.ctrlKey){
vm.showData(requestObj, true);
* Refresh and expand collections
*/
function refreshCollectionsWithExpansion(){
- $scope.rootBroadcast('YANGMAN_REFRESH_AND_EXPAND_COLLECTIONS');
+ $scope.rootBroadcast(constants.YANGMAN_REFRESH_AND_EXPAND_COLLECTIONS);
}
}
yangForm.getNodeName = getNodeName;
// watchers
- $scope.$on('YANGMAN_SET_ERROR_DATA', setRcvdErrorData);
+ $scope.$on(constants.YANGMAN_SET_ERROR_DATA, setRcvdErrorData);
- $scope.$on('YANGMAN_SET_ERROR_MESSAGE', setErrorMessage);
+ $scope.$on(constants.YANGMAN_SET_ERROR_MESSAGE, setErrorMessage);
/**
* Method for set error message in form
* Initialization
*/
function init(){
- $scope.$on('YANGMAN_EXECUTING_REQUEST_PROGRESS_START', startExecutingRequestProgress);
- $scope.$on('YANGMAN_EXECUTING_REQUEST_PROGRESS_STOP', stopExecutingRequestProgress);
+ $scope.$on(constants.YANGMAN_EXECUTING_REQUEST_PROGRESS_START, startExecutingRequestProgress);
+ $scope.$on(constants.YANGMAN_EXECUTING_REQUEST_PROGRESS_STOP, stopExecutingRequestProgress);
YangmanDesignService.hideMainMenu();
YangmanDesignService.setDraggableLeftPanel();
* Genereal method for clearing code mirror - sent and received data too
*/
function clearCM(){
- $scope.rootBroadcast('YANGMAN_SET_CODEMIRROR_DATA_RECEIVED', { data: JSON.stringify({}) });
- $scope.rootBroadcast('YANGMAN_SET_CODEMIRROR_DATA_SENT', { data: JSON.stringify({}) });
+ $scope.rootBroadcast(constants.YANGMAN_SET_CODEMIRROR_DATA_RECEIVED, { data: JSON.stringify({}) });
+ $scope.rootBroadcast(constants.YANGMAN_SET_CODEMIRROR_DATA_SENT, { data: JSON.stringify({}) });
}
if ( $scope.node ) {
$scope.node.clear();
- $scope.$broadcast('YANGMAN_DISABLE_ADDING_LIST_ELEMENT');
+ $scope.$broadcast(constants.YANGMAN_DISABLE_ADDING_LIST_ELEMENT);
}
}
if ( expand ) {
$scope.node = null;
setLeftPanel(leftPanel);
- $scope.$broadcast('YANGMAN_MODULE_D_INIT');
+ $scope.$broadcast(constants.YANGMAN_MODULE_D_INIT);
} else {
if ( $scope.node ) {
PathUtilsService.clearPath($scope.selectedSubApi.pathArray);
}
- $scope.$broadcast('SET_SEL_OPERATIONS', subApi ? $scope.selectedSubApi.operations : [], setUrl);
+ $scope.$broadcast(constants.SET_SEL_OPERATIONS, subApi ? $scope.selectedSubApi.operations : [], setUrl);
}
/**
};
- scope.$watch('tree_rows', function () {
+ scope.$watch(constants.TREE_ROWS, function () {
scope.treeRows = scope.tree_rows;
- scope.$emit('SET_SCOPE_TREE_ROWS', scope.treeRows);
+ scope.$emit(constants.SET_SCOPE_TREE_ROWS, scope.treeRows);
});
scope.tree_rows = [];
angular.module('app.yangman').service('PluginsUnsetterService',
['PathUtilsService', 'DataBackupService', PluginsUnsetterService]);
- function PluginsUnsetterService(PathUtilsService, DataBackupService){
+ PluginsUnsetterService.$inject = ['constants'];
+
+ function PluginsUnsetterService(PathUtilsService, DataBackupService, constants){
var service = {
'YANGMAN_CUST_MOUNT_POINTS': unsetMountPoint,
unset: unset,
);
DataBackupService.getToScope(['treeApis'], modulesListObj, 'MODULES_LIST');
- scope.$broadcast('YANGMAN_SET_API_TREE_DATA', { params: modulesListObj.treeApis });
- scope.$broadcast('YANGMAN_SET_MODULE_LIST_TITLE', { params: '' });
+ scope.$broadcast(constants.YANGMAN_SET_API_TREE_DATA, { params: modulesListObj.treeApis });
+ scope.$broadcast(constants.YANGMAN_SET_MODULE_LIST_TITLE, { params: '' });
if ( scope.selectedDatastore ){
- scope.$broadcast('YANGMAN_MODULE_D_INIT');
+ scope.$broadcast(constants.YANGMAN_MODULE_D_INIT);
}
}
scope = args.scope,
path = scope.selectedSubApi.buildApiRequestString();
- scope.rootBroadcast('YANGMAN_SET_LOADING_BOX', true, function () {
+ scope.rootBroadcast(constants.YANGMAN_SET_LOADING_BOX, true, function () {
scope.setLeftPanel(0);
$timeout(function () {
MountPointsConnectorService.discoverMountPoints(path, getNodesMPData, createMPStructure);
controller.initMountPoint(mountPointTreeApis, mountPointApis, mpAugments, reqObj);
scope.rootBroadcast(
- 'YANGMAN_SET_MODULE_LIST_TITLE',
- pathItems[pathItems.length - 1] + ' [ ' + $filter('translate')('YANGMAN_MOUNT_POINT') + ' ]'
+ constants.YANGMAN_SET_MODULE_LIST_TITLE,
+ pathItems[pathItems.length - 1] + ' [ ' + $filter('translate')(constants.YANGMAN_MOUNT_POINT) + ' ]'
);
controller.selectedPluginsButtons.push(
- MountPointsConnectorService.createCustomButton('YANGMAN_CANCEL_MP', function (){
- return controller.selectedPlugin.label === 'YANGMAN_CUST_MOUNT_POINTS';
+ MountPointsConnectorService.createCustomButton(constants.YANGMAN_CANCEL_MP, function (){
+ return controller.selectedPlugin.label === constants.YANGMAN_CUST_MOUNT_POINTS;
},
function (){
controller.unsetPluginFunctionality();
} else {
$timeout(function (){
controller.selectedPlugin = null;
- scope.rootBroadcast('YANGMAN_SET_LOADING_BOX', false);
- scope.rootBroadcast('YANGMAN_SHOW_TOAST', 'YANGMAN_NO_MOUNT_POINT');
+ scope.rootBroadcast(constants.YANGMAN_SET_LOADING_BOX, false);
+ scope.rootBroadcast(constants.YANGMAN_SHOW_TOAST, constants.YANGMAN_NO_MOUNT_POINT);
}, 100);
}
}