Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into dev
gitea/salix/dev This commit has test failures Details

This commit is contained in:
Juan Ferrer 2019-04-03 13:40:35 +02:00
commit eab2a29cb5
8 changed files with 59 additions and 89 deletions

View File

@ -1315,3 +1315,8 @@ INSERT INTO `postgresql`.`calendar_employee` (`business_id`, `calendar_state_id`
(107, 2, DATE_ADD(CURDATE(), INTERVAL -10 DAY)),
(107, 1, DATE_ADD(CURDATE(), INTERVAL -12 DAY)),
(107, 2, DATE_ADD(CURDATE(), INTERVAL -20 DAY));
INSERT INTO `vn`.`smsConfig` (`id`, `uri`, `user`, `password`, `title`)
VALUES
('1', 'https://websms.xtratelecom.es/api_php/server.wsdl', 'VERDINATURA', '182wbOKu', 'Verdnatura');

View File

@ -10,8 +10,8 @@
</vn-auto>
<vn-one>
<strong>
<span translate>{{$ctrl.defaultDate | dateTime: 'MMMM'}}</span>
<span>{{$ctrl.defaultDate | dateTime: 'yyyy'}}</span>
<span translate>{{$ctrl.defaultDate | date: 'MMMM'}}</span>
<span>{{$ctrl.defaultDate | date: 'yyyy'}}</span>
</strong>
</vn-one>
<vn-auto>
@ -23,69 +23,41 @@
</vn-icon>
</vn-auto>
</vn-horizontal>
<vn-horizontal>
<!-- <vn-auto>
<vn-vertical class="body">
<section class="day">
<span></span>
</section>
<section class="day">
<span>1</span>
</section>
<section class="day">
<span>2</span>
</section>
<section class="day">
<span>3</span>
</section>
<section class="day">
<span>4</span>
</section>
<section class="day">
<span>5</span>
</section>
<section class="day">
<span>6</span>
</section>
</vn-vertical>
</vn-auto>
<vn-one> -->
<vn-vertical class="body">
<vn-horizontal class="weekdays">
<section class="day" ng-click="$ctrl.selectAll(1)">
<span>L</span>
</section>
<section class="day" ng-click="$ctrl.selectAll(2)">
<span>M</span>
</section>
<section class="day" ng-click="$ctrl.selectAll(3)">
<span>X</span>
</section>
<section class="day" ng-click="$ctrl.selectAll(4)">
<span>J</span>
</section>
<section class="day" ng-click="$ctrl.selectAll(5)">
<span>V</span>
</section>
<section class="day" ng-click="$ctrl.selectAll(6)">
<span>S</span>
</section>
<section class="day" ng-click="$ctrl.selectAll(0)">
<span>D</span>
</section>
</vn-horizontal>
<vn-horizontal class="days">
<section ng-repeat="day in $ctrl.days" class="day {{day.event.className || day.className}}"
ng-click="$ctrl.select($index)"
ng-style="{'color': day.event.style.color}">
<span ng-if="day.event" vn-tooltip="{{day.event.title}}"
ng-style="{'background-color': day.event.style.background}">
{{::day.dated | date: 'd'}}
</span>
<span ng-if="!day.event">{{::day.dated | date: 'd'}}</span>
</section>
</vn-horizontal>
</vn-vertical>
</vn-one>
</vn-horizontal>
<vn-vertical class="body">
<vn-horizontal class="weekdays">
<section class="day" ng-click="$ctrl.selectAll(1)">
<span>L</span>
</section>
<section class="day" ng-click="$ctrl.selectAll(2)">
<span>M</span>
</section>
<section class="day" ng-click="$ctrl.selectAll(3)">
<span>X</span>
</section>
<section class="day" ng-click="$ctrl.selectAll(4)">
<span>J</span>
</section>
<section class="day" ng-click="$ctrl.selectAll(5)">
<span>V</span>
</section>
<section class="day" ng-click="$ctrl.selectAll(6)">
<span>S</span>
</section>
<section class="day" ng-click="$ctrl.selectAll(0)">
<span>D</span>
</section>
</vn-horizontal>
<vn-horizontal class="days">
<section ng-repeat="day in $ctrl.days" class="day {{day.event.className || day.className}}"
ng-click="$ctrl.select($index)"
ng-style="{'color': day.event.style.color}">
<span ng-if="day.event" vn-tooltip="{{day.event.title}}"
ng-style="{'background-color': day.event.style.background}">
{{::day.dated | date: 'd'}}
</span>
<span ng-if="!day.event">{{::day.dated | date: 'd'}}</span>
</section>
</vn-horizontal>
</vn-vertical>
</div>

View File

@ -1,4 +1,4 @@
fdescribe('Component vnCalendar', () => {
describe('Component vnCalendar', () => {
let controller;
let $element;
@ -14,12 +14,12 @@ fdescribe('Component vnCalendar', () => {
$element.remove();
});
describe('events() setter', () => {
describe('data() setter', () => {
it(`should set an array of events and convert string dates to string object, then call repaint() method`, () => {
spyOn(controller, 'repaint');
let currentDate = new Date().toString();
controller.events = [
controller.data = [
{dated: currentDate, title: 'Event 1'},
{dated: currentDate, title: 'Event 2'},
];
@ -30,8 +30,7 @@ fdescribe('Component vnCalendar', () => {
});
describe('addEvent()', () => {
it(`should add an event to an array of events, then call repaint() method`, () => {
spyOn(controller, 'repaint');
it(`should add an event to an array of events`, () => {
controller.events = [];
controller.addEvent({
dated: new Date(),
@ -43,13 +42,13 @@ fdescribe('Component vnCalendar', () => {
expect(firstEvent.title).toEqual('My event');
expect(firstEvent.isRemovable).toBeDefined();
expect(firstEvent.isRemovable).toBeTruthy();
expect(controller.repaint).toHaveBeenCalledWith();
});
it(`should not repeat an event for the same date, should not call repaint() method`, () => {
spyOn(controller, 'repaint');
it(`should not repeat an event for the same date`, () => {
const curDate = new Date();
controller._events = [{
curDate.setHours(0, 0, 0, 0);
controller.events = [{
dated: curDate,
title: 'My event 1',
className: 'color'
@ -64,13 +63,11 @@ fdescribe('Component vnCalendar', () => {
expect(controller.events.length).toEqual(1);
expect(firstEvent.title).toEqual('My event 1');
expect(controller.repaint).not.toHaveBeenCalledWith();
});
});
describe('removeEvent()', () => {
it(`should remove an event from an array of events, then call repaint() method`, () => {
spyOn(controller, 'repaint');
it(`should remove an event from an array of events`, () => {
const curDate = new Date();
controller._events = [{
dated: curDate,
@ -80,7 +77,6 @@ fdescribe('Component vnCalendar', () => {
controller.removeEvent(curDate);
expect(controller.events.length).toEqual(0);
expect(controller.repaint).toHaveBeenCalledWith();
});
});

Binary file not shown.

Binary file not shown.

View File

@ -76,5 +76,6 @@
"You cannot remove this department": "No puedes eliminar este departamento",
"The extension must be unique": "La extensión debe ser unica",
"The secret can't be blank": "La contraseña no puede estar en blanco",
"EXTENSION_INVALID_FORMAT": "La extensión es invalida"
"EXTENSION_INVALID_FORMAT": "La extensión es invalida",
"We weren't able to send this SMS": "No hemos podido enviar el SMS"
}

View File

@ -57,7 +57,7 @@
"params": {
"item-tags": "$ctrl.itemTags"
},
"acl": ["buyer"]
"acl": ["buyer", "accessory"]
}, {
"url" : "/tax",
"state": "item.card.tax",

View File

@ -31,7 +31,6 @@
data="tags"
on-change="$ctrl.getSourceTable(tag)"
show-field="name"
vn-acl="buyer"
vn-focus>
</vn-autocomplete>
<vn-textfield
@ -40,8 +39,7 @@
vn-three
label="Value"
model="itemTag.value"
rule="itemTag.value"
vn-acl="buyer">
rule="itemTag.value">
</vn-textfield>
<vn-autocomplete
ng-show="tag.selection.isFree === false"
@ -51,8 +49,7 @@
label="Value"
field="itemTag.value"
show-field="{{$ctrl.sourceTables[itemTag.id].field}}"
value-field="{{$ctrl.sourceTables[itemTag.id].field}}"
vn-acl="buyer">
value-field="{{$ctrl.sourceTables[itemTag.id].field}}">
</vn-autocomplete>
<vn-textfield
vn-tab-index="-1"
@ -60,8 +57,7 @@
type="number"
label="Relevancy"
model="itemTag.priority"
rule="itemTag.priority"
vn-acl="buyer">
rule="itemTag.priority">
</vn-textfield>
<vn-none>
<vn-icon-button