corrected some eslint errors and small refactor
This commit is contained in:
parent
ed64c3b50a
commit
29149b1b58
|
@ -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;
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
vn-descriptor{
|
||||
vn-descriptor {
|
||||
font-family: raleway-bold;
|
||||
}
|
|
@ -11,6 +11,6 @@ vn-item-client a:hover {
|
|||
background-color: #424242;
|
||||
}
|
||||
|
||||
.vn-item-client-name{
|
||||
.vn-item-client-name {
|
||||
font-family: raleway-bold;
|
||||
}
|
||||
|
|
|
@ -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});
|
||||
}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
.notes-date{
|
||||
.notes-date {
|
||||
font-family: raleway-bold;
|
||||
}
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -29,6 +29,7 @@ export default class Controller {
|
|||
this.repeatPassword = '';
|
||||
this.$.$apply();
|
||||
}
|
||||
|
||||
onPassChange(response) {
|
||||
if (response == 'ACCEPT' && this.canChangePassword)
|
||||
try {
|
||||
|
|
|
@ -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]);
|
||||
|
@ -222,6 +225,7 @@ class Autocomplete extends Component {
|
|||
this.getItems();
|
||||
}
|
||||
}
|
||||
|
||||
getItems() {
|
||||
if (this.url === undefined) {
|
||||
this.items = copyObject(this.data);
|
||||
|
@ -273,6 +277,7 @@ class Autocomplete extends Component {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
$onInit() {
|
||||
this.findMore = this.url && this.maxRow;
|
||||
this.mouseFocus = false;
|
||||
|
@ -321,7 +326,6 @@ class Autocomplete extends Component {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
Autocomplete.$inject = ['$element', '$scope', '$http', '$timeout', '$filter'];
|
||||
|
||||
module.component('vnAutocomplete', {
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
{
|
||||
"initial:before": {
|
||||
"loopback#favicon": {}
|
||||
"loopback#favicon": {
|
||||
"params": "$!../favicon.ico"
|
||||
}
|
||||
},
|
||||
"initial": {
|
||||
"compression": {},
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<!doctype html>
|
||||
<html ng-app="salix">
|
||||
<head>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Salix</title>
|
||||
<script src="/acl"></script>
|
||||
</head>
|
||||
<body>
|
||||
</head>
|
||||
<body>
|
||||
<vn-app></vn-app>
|
||||
<script type="text/javascript"
|
||||
src="/static/routes.js">
|
||||
|
@ -19,6 +19,6 @@
|
|||
<script type="text/javascript"
|
||||
src="/static/bundle.salix.js">
|
||||
</script>
|
||||
</body>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
Loading…
Reference in New Issue