Merge branch 'dev' of https://git.verdnatura.es/salix into dev

This commit is contained in:
Daniel Herrero 2017-11-14 08:56:28 +01:00
commit 83965b20ee
13 changed files with 57 additions and 40 deletions

View File

@ -16,6 +16,7 @@ vn-login > div {
margin: auto;
height: inherit;
}
.box {
box-sizing: border-box;
position: absolute;
@ -27,15 +28,18 @@ vn-login > div {
box-shadow: 0 0 1em 0 rgba(1,1,1,.6);
border-radius: .5em;
}
img {
width: 100%;
padding-bottom: 1em;
}
.footer {
margin-top: 1em;
text-align: center;
position: relative;
}
.spinner-wrapper {
position: absolute;
width: 0;

View File

@ -6,11 +6,13 @@ export default class Controller {
this.$http = $http;
this.$state = $state;
}
$onChanges() {
if (this.client) {
this.getObservation(this.client.id);
}
}
getObservation(clientId) {
let json = JSON.stringify({where: {clientFk: this.client.id}, order: 'created DESC'});
this.$http.get(`/client/api/clientObservations?filter=${json}`).then(
@ -19,6 +21,7 @@ export default class Controller {
}
);
}
newObservation() {
this.$state.go("clientCard.notes.create", {id: this.client.id});
}

View File

@ -6,15 +6,18 @@ export default class Controller {
// onSubmit() is defined by @vnSearchbar
this.onSubmit = () => {};
}
onSearch() {
this.setStorageValue();
this.onSubmit(this.filter);
}
$onChanges() {
var value = JSON.parse(this.$window.sessionStorage.getItem('filter'));
if (value !== undefined)
this.filter = value;
}
setStorageValue() {
this.$window.sessionStorage.setItem('filter', JSON.stringify(this.filter));
}

View File

@ -17,7 +17,7 @@ describe('Client', () => {
}));
describe('onSearch()', () => {
it(`should call setStorageValue() and onSubmit()`, () => {
it('should call setStorageValue() and onSubmit()', () => {
spyOn(controller, 'setStorageValue');
spyOn(controller, 'onSubmit');
controller.setStorageValue();
@ -29,7 +29,7 @@ describe('Client', () => {
});
describe('$onChanges()', () => {
it(`should set filter properties using the search values`, () => {
it('should set filter properties using the search values', () => {
expect(controller.filter).not.toBeDefined();
spyOn(JSON, 'parse').and.returnValue({data: 'data'});
controller.$onChanges();

View File

@ -29,6 +29,7 @@ export default class Controller {
this.repeatPassword = '';
this.$.$apply();
}
onPassChange(response) {
if (response == 'ACCEPT' && this.canChangePassword)
try {

View File

@ -32,6 +32,7 @@ class Autocomplete extends Component {
get showDropDown() {
return this._showDropDown;
}
set showDropDown(value) {
if (value && this.url && !this._preLoad) {
this._preLoad = true;
@ -77,6 +78,7 @@ class Autocomplete extends Component {
get field() {
return this.multiple ? this._multiField : this._field;
}
set field(value) {
if (!angular.equals(value, this.field)) {
this.finding = true;
@ -103,7 +105,7 @@ class Autocomplete extends Component {
if (value && value.hasOwnProperty(this.valueField)) {
this._field = value[this.valueField];
if (this.multiple) {
this._multiField = [value[this.valueField]]
this._multiField = [value[this.valueField]];
}
if (value.hasOwnProperty(this.showField)) {
this.displayValue = value[this.showField];
@ -164,6 +166,7 @@ class Autocomplete extends Component {
json => this.onItemRequest(null)
);
}
onItemRequest(data) {
if (data && data.length > 0)
this.showItem(data[0]);
@ -229,6 +232,7 @@ class Autocomplete extends Component {
this.getItems();
}
}
getItems() {
if (this.url === undefined) {
this.items = copyObject(this.data);
@ -280,6 +284,7 @@ class Autocomplete extends Component {
}
}
}
$onInit() {
this.findMore = this.url && this.maxRow;
this.mouseFocus = false;
@ -328,7 +333,6 @@ class Autocomplete extends Component {
}
}
Autocomplete.$inject = ['$element', '$scope', '$http', '$timeout', '$filter'];
module.component('vnAutocomplete', {

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

View File

@ -1,6 +1,8 @@
{
"initial:before": {
"loopback#favicon": {}
"loopback#favicon": {
"params": "$!../favicon.ico"
}
},
"initial": {
"compression": {},