Commit 5b109547 authored by D’jalmar Gutierrez Titirico's avatar D’jalmar Gutierrez Titirico 🚲
Browse files

se repararon los combobox de los modales, que mostraban opciones invalidas,...

se repararon los combobox de los modales, que mostraban opciones invalidas, asi tambien al usar los tags se tenia un bug con angular 1.5.*, por lo cual se procedio a bajar la version a la 1.4.10
parent 550d9cb1
......@@ -2,7 +2,7 @@
"name": "modulo-personal",
"version": "0.0.0",
"dependencies": {
"angular": "~1.5.3",
"angular": "~1.4.10",
"json3": "~3.3.1",
"es5-shim": "~3.0.1",
"bootstrap-sass-official": "~3.1.1",
......@@ -14,8 +14,8 @@
"font-awesome": ">=4.1.0",
"lodash": "~2.4.1",
"angular-ui-router": "~0.2.18",
"angular-validation-match": "~1.5.2",
"angular-animate": "^1.5.3",
"angular-validation-match": "~1.4.0",
"angular-animate": "^1.4.9",
"ng-tags-input": "^3.0.0"
},
"devDependencies": {
......
......@@ -9,8 +9,8 @@
this.datoPostulante = {fk_postulante: this.postulante._id}
this.service = datoPostulanteService;
tipoDatoService.getTiposDato().then(tiposDato=> {
this.tiposDato = tiposDato;
this.tipoDatoSeleccionado = {};
this.tiposDato = {rows: tiposDato.rows.filter(dato=>this.postulante.Datos.findIndex(x=>x.propiedad == dato.propiedad) == -1)};
// this.tipoDatoSeleccionado = {};
})
}
......
......@@ -7,11 +7,13 @@
this.enviado = false;
this.modal = $uibModalInstance;
this.datoPostulante = Object.assign({}, parametro.tipoDato.DatoPostulante)
this.postulante = parametro.postulante;
this.tipoDato = parametro.tipoDato;
this.service = datoPostulanteService;
tipoDatoService.getTiposDato().then(tiposDato=> {
this.tiposDato = tiposDato;
this.tipoDatoSeleccionado = tiposDato.rows.find(x=>x.propiedad === this.datoPostulante.propiedad);
this.tiposDato = {rows: tiposDato.rows.filter(dato=>this.postulante.Datos.findIndex(x=>x.propiedad == dato.propiedad) == -1)};
this.tiposDato.rows.push(this.tipoDatoSeleccionado);
})
}
......
......@@ -13,7 +13,7 @@
postulanteService.getPostulantes({ordenarPor: 'nombres'})
.then(postulantes=> {
this.postulantes = postulantes;
this.postulanteSeleccionado = {};
//this.postulanteSeleccionado = {};
});
}
......
......@@ -10,8 +10,8 @@
this.postulacion = {fk_postulante: this.postulante._id};
this.service = postulacionService;
cargoService.getCargos().then(cargos => {
this.cargos = cargos;
this.cargoSeleccionado = {};
this.cargos = {rows: cargos.rows.filter(cargo => this.postulante.Postulaciones.findIndex(x=>x._id == cargo._id) == -1)};
//this.cargoSeleccionado = {};
})
}
......
......@@ -2,16 +2,18 @@
(()=> {
class PostulacionesEditarModalController {
constructor($uibModalInstance, cargo, cargoService, postulacionService) {
constructor($uibModalInstance, parametro, cargoService, postulacionService) {
this.errores = {};
this.enviado = false;
this.modal = $uibModalInstance;
this.postulacion = Object.assign({}, cargo.Postulacion);
this.cargo = cargo;
this.postulacion = Object.assign({}, parametro.cargo.Postulacion);
this.cargo = parametro.cargo;
this.postulante = parametro.postulante;
this.service = postulacionService;
cargoService.getCargos().then(cargos => {
this.cargos = cargos;
this.cargoSeleccionado = cargos.rows.find(x=>x._id === this.postulacion.fk_cargo);
this.cargos = {rows: cargos.rows.filter(cargo=>this.postulante.Postulaciones.findIndex(x=>x._id == cargo._id) == -1)};
this.cargos.rows.push(this.cargoSeleccionado);
})
}
......
......@@ -32,7 +32,8 @@
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary-outline" type="submit" ng-disabled="!(form.cargos.$dirty ||form.presentacion.$dirty)">
<button class="btn btn-primary-outline" type="submit"
ng-disabled="!(form.cargos.$dirty ||form.presentacion.$dirty)">
Guardar
</button>
<button class="btn btn-default" type="button" ng-click="vm.modal.dismiss()">Cancelar</button>
......
......@@ -15,7 +15,7 @@
this.postulacionService = postulacionService;
this.comentarioService = comentarioService;
this.id = $stateParams.postulanteId;
this.tags = [];
this.tags = {count:0};
this.service.getPostulante(this.id, {
incluye: [
{entidad: 'Tags'},
......@@ -27,6 +27,10 @@
this.postulante = postulante;
console.log(postulante);
});
this.tagService.getTags()
.then(tags=> {
this.tags = tags;
});
}
//region datos del postulante
......@@ -88,7 +92,7 @@
controller: 'PostulacionesEditarModalCtrl',
controllerAs: 'vm',
resolve: {
cargo: cargo
parametro: {postulante: this.postulante, cargo: cargo}
}
})
}
......@@ -118,14 +122,15 @@
//region tags
autoCompletarTags(query) {
console.log(this.tags)
if (this.tags.length == 0) {
this.tagService.getTags()
.then(tags=> {
this.tags = tags;
return this.tags.rows.filter(x=>x.nombre.includes(query));
})
}
else return this.tags.rows.filter(x=>x.nombre.includes(query));
// if (this.tags.count == 0) {
// this.tagService.getTags()
// .then(tags=> {
// this.tags = tags;
// return this.tags.rows.filter(x=>x.nombre.includes(query));
// });
// }
// else
return this.tags.rows.filter(x=>x.nombre.includes(query));
}
adicionarTag(tag) {
......
......@@ -102,7 +102,7 @@
<tags-input class="primary" ng-model="vm.postulante.Tags" name="tags" placeholder="Adicionar Tags"
display-property="nombre"
min-length="2" on-tag-adding="vm.adicionarTag($tag)" on-tag-removed="vm.quitarTag($tag)">
<auto-complete source="vm.autoCompletarTags($query)" min-length="2"></auto-complete>
<auto-complete source="vm.autoCompletarTags($query)" min-length="2" display-property="nombre"></auto-complete>
</tags-input>
</blockquote>
</div>
......
......@@ -57,7 +57,7 @@
<script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script>
<script src="bower_components/lodash/dist/lodash.compat.js"></script>
<script src="bower_components/angular-ui-router/release/angular-ui-router.js"></script>
<script src="bower_components/angular-validation-match/dist/angular-validation-match.min.js"></script>
<script src="bower_components/angular-validation-match/dist/angular-input-match.min.js"></script>
<script src="bower_components/angular-animate/angular-animate.js"></script>
<script src="bower_components/ng-tags-input/ng-tags-input.min.js"></script>
<!-- endbower -->
......
......@@ -26,7 +26,7 @@ module.exports = function(config) {
'client/bower_components/angular-bootstrap/ui-bootstrap-tpls.js',
'client/bower_components/lodash/dist/lodash.compat.js',
'client/bower_components/angular-ui-router/release/angular-ui-router.js',
'client/bower_components/angular-validation-match/dist/angular-validation-match.min.js',
'client/bower_components/angular-validation-match/dist/angular-input-match.min.js',
'client/bower_components/angular-animate/angular-animate.js',
'client/bower_components/ng-tags-input/ng-tags-input.min.js',
'client/bower_components/angular-mocks/angular-mocks.js',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment