HOTFIX: 3009 - Unlock report button
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
4849355c9b
commit
35e3c8ce65
|
@ -22,7 +22,7 @@
|
|||
<vn-card>
|
||||
<section class="vn-pa-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"
|
||||
ng-click="$ctrl.showReport()"
|
||||
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) {
|
||||
const target = $event.target;
|
||||
const draggable = target.closest(this.draggableElement);
|
||||
|
|
|
@ -14,6 +14,17 @@ describe('Travel Component vnTravelExtraCommunity', () => {
|
|||
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()', () => {
|
||||
it('should find the draggable element', () => {
|
||||
const draggable = document.createElement('a');
|
||||
|
|
Loading…
Reference in New Issue