122 lines
3.4 KiB
JavaScript
122 lines
3.4 KiB
JavaScript
//require.js config
|
|
require.config({
|
|
"paths": {
|
|
//libraries
|
|
"jquery": "lib/jquery.min",
|
|
"underscore": "lib/underscore-min",
|
|
"backbone": "lib/backbone-min",
|
|
"bootstrap": "lib/bootstrap.min",
|
|
"dataTables": "lib/jquery.dataTables.min",
|
|
"DT_bootstrap": "lib/DT_bootstrap",
|
|
"jquery.validate": "lib/jquery.validate.min",
|
|
"select2": "lib/select2.min",
|
|
"text": "lib/text",
|
|
"api": "lib/api.min",
|
|
"transition": "lib/transition.min",
|
|
"dropdown": "lib/dropdown.min",
|
|
"messagebox" : "lib/messagebox.min",
|
|
|
|
|
|
//configuration file
|
|
"config": "conf/config",
|
|
|
|
//utils
|
|
"utils": "util/utils",
|
|
"storage_utils": "util/storage_utils",
|
|
"regex": "util/regex",
|
|
"form_validation_conf": "util/form_validation_conf",
|
|
"datatables_conf": "util/datatables_conf",
|
|
"ajax_conf": "util/ajax_conf",
|
|
"tag_conf": "util/tag_conf",
|
|
"constants": "util/constants",
|
|
"error_messages": "util/error_messages",
|
|
"branches_for_preflight": "util/branches_for_preflight"
|
|
},
|
|
|
|
//manage dependencies & exports
|
|
"shim": {
|
|
"jquery": {
|
|
"exports": "$",
|
|
},
|
|
"underscore": {
|
|
"exports": "_",
|
|
},
|
|
"backbone": {
|
|
"deps": ["underscore", "jquery"],
|
|
"exports": "Backbone",
|
|
},
|
|
"bootstrap": ["jquery"],
|
|
"jquery.validate": ["jquery"],
|
|
"dataTables": ["jquery"],
|
|
"DT_bootstrap": ["jquery", "bootstrap", "dataTables"],
|
|
"select2": ["jquery"],
|
|
"api" : ["jquery"],
|
|
"dropdown": ["jquery", "transition", "api"],
|
|
"messagebox": ["jquery"]
|
|
},
|
|
});
|
|
|
|
define([
|
|
"config",
|
|
|
|
"utils",
|
|
"storage_utils",
|
|
"constants",
|
|
"error_messages",
|
|
|
|
"model/submit_assistant",
|
|
"model/changelist",
|
|
|
|
"collection/files",
|
|
|
|
"view/submit_assistant",
|
|
|
|
"jquery",
|
|
],
|
|
function(config,
|
|
utils, storage_utils, constants, error_messages,
|
|
SubmitAssistantModel, ChangelistModel,
|
|
FilesCollection,
|
|
SubmitAssistantView){
|
|
|
|
$(document).ready(function(){
|
|
storage_utils.setDebug(true);
|
|
|
|
//type of SA is passed as a parameter in the url
|
|
var type_SA = utils.getParameterByName(constants.type_parameter);
|
|
|
|
if(! type_SA){
|
|
alert(error_messages.undefined_type);
|
|
|
|
storage_utils.closeSA();
|
|
}
|
|
else{
|
|
//create models
|
|
var submitAssistantModel = new SubmitAssistantModel({
|
|
type_SA: type_SA,
|
|
API_version: storage_utils.getVersion(),
|
|
is_locked: config.validation_process,
|
|
administration_group: config.administration_group,
|
|
});
|
|
|
|
var changelistModel = new ChangelistModel({
|
|
type_SA: type_SA,
|
|
});
|
|
changelistModel.fetch();
|
|
|
|
submitAssistantModel.checkValidationProcess(changelistModel);
|
|
|
|
var filesCollection = new FilesCollection([], {
|
|
clNum: changelistModel.get("Change"),
|
|
workspace: changelistModel.get("Client"),
|
|
});
|
|
filesCollection.fetch();
|
|
|
|
new SubmitAssistantView({
|
|
model: submitAssistantModel,
|
|
changelistModel: changelistModel,
|
|
filesCollection: filesCollection,
|
|
});
|
|
}
|
|
});
|
|
});
|