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

View File

@ -1,4 +1,4 @@
fdescribe('Component vnCalendar', () => { describe('Component vnCalendar', () => {
let controller; let controller;
let $element; let $element;
@ -14,12 +14,12 @@ fdescribe('Component vnCalendar', () => {
$element.remove(); $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`, () => { it(`should set an array of events and convert string dates to string object, then call repaint() method`, () => {
spyOn(controller, 'repaint'); spyOn(controller, 'repaint');
let currentDate = new Date().toString(); let currentDate = new Date().toString();
controller.events = [ controller.data = [
{dated: currentDate, title: 'Event 1'}, {dated: currentDate, title: 'Event 1'},
{dated: currentDate, title: 'Event 2'}, {dated: currentDate, title: 'Event 2'},
]; ];
@ -30,8 +30,7 @@ fdescribe('Component vnCalendar', () => {
}); });
describe('addEvent()', () => { describe('addEvent()', () => {
it(`should add an event to an array of events, then call repaint() method`, () => { it(`should add an event to an array of events`, () => {
spyOn(controller, 'repaint');
controller.events = []; controller.events = [];
controller.addEvent({ controller.addEvent({
dated: new Date(), dated: new Date(),
@ -43,13 +42,13 @@ fdescribe('Component vnCalendar', () => {
expect(firstEvent.title).toEqual('My event'); expect(firstEvent.title).toEqual('My event');
expect(firstEvent.isRemovable).toBeDefined(); expect(firstEvent.isRemovable).toBeDefined();
expect(firstEvent.isRemovable).toBeTruthy(); expect(firstEvent.isRemovable).toBeTruthy();
expect(controller.repaint).toHaveBeenCalledWith();
}); });
it(`should not repeat an event for the same date, should not call repaint() method`, () => { it(`should not repeat an event for the same date`, () => {
spyOn(controller, 'repaint');
const curDate = new Date(); const curDate = new Date();
controller._events = [{ curDate.setHours(0, 0, 0, 0);
controller.events = [{
dated: curDate, dated: curDate,
title: 'My event 1', title: 'My event 1',
className: 'color' className: 'color'
@ -64,13 +63,11 @@ fdescribe('Component vnCalendar', () => {
expect(controller.events.length).toEqual(1); expect(controller.events.length).toEqual(1);
expect(firstEvent.title).toEqual('My event 1'); expect(firstEvent.title).toEqual('My event 1');
expect(controller.repaint).not.toHaveBeenCalledWith();
}); });
}); });
describe('removeEvent()', () => { describe('removeEvent()', () => {
it(`should remove an event from an array of events, then call repaint() method`, () => { it(`should remove an event from an array of events`, () => {
spyOn(controller, 'repaint');
const curDate = new Date(); const curDate = new Date();
controller._events = [{ controller._events = [{
dated: curDate, dated: curDate,
@ -80,7 +77,6 @@ fdescribe('Component vnCalendar', () => {
controller.removeEvent(curDate); controller.removeEvent(curDate);
expect(controller.events.length).toEqual(0); 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", "You cannot remove this department": "No puedes eliminar este departamento",
"The extension must be unique": "La extensión debe ser unica", "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", "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": { "params": {
"item-tags": "$ctrl.itemTags" "item-tags": "$ctrl.itemTags"
}, },
"acl": ["buyer"] "acl": ["buyer", "accessory"]
}, { }, {
"url" : "/tax", "url" : "/tax",
"state": "item.card.tax", "state": "item.card.tax",

View File

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