Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
commit
ae091a3b11
|
@ -22,7 +22,7 @@
|
||||||
<vn-card>
|
<vn-card>
|
||||||
<section class="vn-pa-md">
|
<section class="vn-pa-md">
|
||||||
<vn-tool-bar class="vn-mb-md">
|
<vn-tool-bar class="vn-mb-md">
|
||||||
<vn-button disabled="!model.userParams.landedFrom || !model.userParams.landedTo"
|
<vn-button disabled="!$ctrl.hasDateRange"
|
||||||
icon="picture_as_pdf"
|
icon="picture_as_pdf"
|
||||||
ng-click="$ctrl.showReport()"
|
ng-click="$ctrl.showReport()"
|
||||||
vn-tooltip="Open as PDF">
|
vn-tooltip="Open as PDF">
|
||||||
|
|
|
@ -32,6 +32,14 @@ class Controller extends Section {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get hasDateRange() {
|
||||||
|
const userParams = this.$.model.userParams;
|
||||||
|
const hasLanded = userParams.landedFrom || userParams.landedTo;
|
||||||
|
const hasShipped = userParams.shippedFrom || userParams.shippedTo;
|
||||||
|
|
||||||
|
return hasLanded || hasShipped;
|
||||||
|
}
|
||||||
|
|
||||||
findDraggable($event) {
|
findDraggable($event) {
|
||||||
const target = $event.target;
|
const target = $event.target;
|
||||||
const draggable = target.closest(this.draggableElement);
|
const draggable = target.closest(this.draggableElement);
|
||||||
|
|
|
@ -14,6 +14,17 @@ describe('Travel Component vnTravelExtraCommunity', () => {
|
||||||
controller.$.model.refresh = jest.fn();
|
controller.$.model.refresh = jest.fn();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
describe('hasDateRange()', () => {
|
||||||
|
it('should return truthy when shippedFrom or landedTo are set as userParams', () => {
|
||||||
|
const now = new Date();
|
||||||
|
controller.$.model.userParams = {shippedFrom: now, landedTo: now};
|
||||||
|
|
||||||
|
const result = controller.hasDateRange;
|
||||||
|
|
||||||
|
expect(result).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('findDraggable()', () => {
|
describe('findDraggable()', () => {
|
||||||
it('should find the draggable element', () => {
|
it('should find the draggable element', () => {
|
||||||
const draggable = document.createElement('a');
|
const draggable = document.createElement('a');
|
||||||
|
|
Loading…
Reference in New Issue