'app/yangman/services/requests.services',
'app/yangman/services/parameters.services',
'app/yangman/services/plugins-unsetter.services',
+ 'app/yangman/services/history-settings.services',
'app/yangman/directives/ui-codemirror.directive',
'app/yangman/directives/read_file.directive',
], function () {
angular.module('app.yangman').controller('YangmanCtrl', YangmanCtrl);
YangmanCtrl.$inject = [
- '$mdDialog', '$scope', '$rootScope', 'YangmanDesignService', 'RequestBuilderService',
- 'EventDispatcherService', 'constants', 'ParametersService', 'PathUtilsService', 'PluginsUnsetterService', '$timeout',
+ '$scope', '$rootScope', 'HistorySettingsService', 'YangmanDesignService', 'RequestBuilderService',
+ 'EventDispatcherService', 'constants', 'ParametersService', 'PathUtilsService', 'PluginsUnsetterService',
+ '$timeout',
];
function YangmanCtrl(
- $mdDialog, $scope, $rootScope, YangmanDesignService, RequestBuilderService,
- EventDispatcherService, constants, ParametersService, PathUtilsService, PluginsUnsetterService, $timeout
+ $scope, $rootScope, HistorySettingsService, YangmanDesignService, RequestBuilderService, EventDispatcherService,
+ constants, ParametersService, PathUtilsService, PluginsUnsetterService, $timeout
) {
var main = this;
$scope.requestDataToShow = '';
$scope.parametersList = ParametersService.createEmptyParametersList('yangman_parameters');
$scope.shownCMHint = false;
+ $scope.historySettings = HistorySettingsService.createHistorySettings().loadFromStorage();
main.selectedMainTab = 0;
main.leftPanelTab = 0;
main.executingRequestProgress = false;
main.constants = constants;
- // methods
main.init = init;
main.initModuleDetailHeight = initModuleDetailHeight;
main.switchedTab = switchedTab;
// scope global methods
$scope.buildRootRequest = buildRootRequest;
- $scope.broadcastFromRoot = broadcastFromRoot;
$scope.checkAddingListElement = checkAddingListElement;
$scope.clearCM = clearCM;
$scope.rootBroadcast = rootBroadcast;
$scope.switchSection = switchSection;
$scope.setParametersList = setParametersList;
$scope.unsetPlugin = unsetPlugin;
- $scope.setCMHintShown = setCMHintShown;
init();
- function setCMHintShown(shown) {
- $scope.shownCMHint = shown;
- }
+ /**
+ * Start showing progressbar in request header view
+ */
function startExecutingRequestProgress() {
main.executingRequestProgress = true;
}
+
+ /**
+ * Stop showing progressbar in request header view
+ */
function stopExecutingRequestProgress() {
main.executingRequestProgress = false;
}
/**
- * Set parametersList
+ * Set parametersList to $scope to be available for all controllers directly
* @param parametersList
*/
function setParametersList(parametersList) {
}
- /**
- * Broadcast from this main controller to all children ctrls
- * @param eventName
- * @param val
- */
- function broadcastFromRoot(eventName, val) {
- $scope.$broadcast(eventName, val);
- }
/**
* Initialization
*/
}
/**
- * Method for fill key into request path
+ * Method for fill key into request path, used by yangutils via event dispatching
* @param inputs
*/
function fillPathIdentifiersByKey(inputs) {
}
}
- // TODO :: description
+
+ /**
+ * Method for bulk filling path identifiers, used by yangutils via event dispatching
+ * @param inputs
+ */
function fillPathIdentifiersByListData(inputs) {
var node = inputs[0];
}
}
- // TODO :: description
+
+ /**
+ * Check if the main tab containing tree with modules is displayed
+ * @returns {boolean}
+ */
function modulesTreeDisplayed() {
return main.selectedMainTab === 0;
}
}
/**
- * Genereal method for clearing code mirror - sent and received data too
+ * Genereal method for clearing code mirror - both sent and received data, needs to be in $scope to be available
+ * everywhere
*/
function clearCM(){
$scope.rootBroadcast(constants.YANGMAN_SET_CODEMIRROR_DATA_RECEIVED, { data: JSON.stringify({}) });
}
- // SETTERS
-
/**
* Switcher for module detail and module list
* @param value
}
/**
- * Set dataStore to global param && open module detail in left panel
+ * Set dataStore to global param, open module detail in left panel
* @param dataStore
* @param expand
+ * @param leftPanel
*/
function setDataStore(dataStore, expand, leftPanel){
$scope.selectedDatastore = dataStore;
setLeftPanel(leftPanel);
$scope.$broadcast(constants.YANGMAN_MODULE_D_INIT);
} else {
-
if ( $scope.node ) {
$scope.node.clear();
}
* Set api and sub api to global param
* @param api
* @param subApi
+ * @param setUrl
+ * @param clearPathArray
*/
function setApi(api, subApi, setUrl, clearPathArray){
$scope.selectedApi = api;