Merge branch 'dev' into 3275-worker_calendar
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2021-11-30 11:40:54 +00:00
commit d760eba446
10 changed files with 47 additions and 15 deletions

View File

@ -27,7 +27,7 @@ export async function getBrowser() {
args,
defaultViewport: null,
headless: headless,
slowMo: 5, // slow down by ms
slowMo: 1, // slow down by ms
// ignoreDefaultArgs: ['--disable-extensions'],
// executablePath: '/usr/bin/google-chrome-stable',
// executablePath: '/usr/bin/firefox-developer-edition',

View File

@ -129,13 +129,13 @@
.icon-columndelete:before {
content: "\e91d";
}
.icon-complementos:before {
.icon-accessory:before {
content: "\e91e";
}
.icon-components:before {
content: "\e91f";
}
.icon-confeccion:before {
.icon-handmade:before {
content: "\e920";
}
.icon-consignatarios:before {
@ -180,7 +180,7 @@
.icon-fixedPrice:before {
content: "\e92e";
}
.icon-flor:before {
.icon-flower:before {
content: "\e92f";
}
.icon-frozen:before {
@ -207,7 +207,7 @@
.icon-history:before {
content: "\e937";
}
.icon-Inactivo:before {
.icon-disabled:before {
content: "\e938";
}
.icon-info:before {
@ -285,7 +285,7 @@
.icon-photo:before {
content: "\e951";
}
.icon-planta:before {
.icon-plant:before {
content: "\e952";
}
.icon-stowaway:before {
@ -300,13 +300,13 @@
.icon-regentry:before {
content: "\e956";
}
.icon-reserva:before {
.icon-reserve:before {
content: "\e957";
}
.icon-revision:before {
content: "\e958";
}
.icon-riesgo:before {
.icon-risk:before {
content: "\e959";
}
.icon-services:before {
@ -372,7 +372,7 @@
.icon-unavailable:before {
content: "\e96e";
}
.icon-verde:before {
.icon-greenery:before {
content: "\e96f";
}
.icon-volume:before {

View File

@ -82,7 +82,7 @@
<vn-quick-link
tooltip="Client invoices list"
state="['invoiceOut.index', {q: $ctrl.filter}]"
icon="icon-invoices">
icon="icon-invoice">
</vn-quick-link>
</div>
<div ng-transclude="btnThree">

View File

@ -16,7 +16,7 @@
{"state": "client.card.note.index", "icon": "insert_drive_file"},
{"state": "client.card.credit.index", "icon": "credit_card"},
{"state": "client.card.greuge.index", "icon": "work"},
{"state": "client.card.balance.index", "icon": "icon-invoices"},
{"state": "client.card.balance.index", "icon": "icon-invoice"},
{"state": "client.card.recovery.index", "icon": "icon-recovery"},
{"state": "client.card.webAccess", "icon": "cloud"},
{"state": "client.card.log", "icon": "history"},

View File

@ -13,7 +13,7 @@
{"state": "supplier.card.fiscalData", "icon": "account_balance"},
{"state": "supplier.card.billingData", "icon": "icon-payment"},
{"state": "supplier.card.address.index", "icon": "icon-delivery"},
{"state": "supplier.card.account", "icon": "icon-accounts"},
{"state": "supplier.card.account", "icon": "icon-account"},
{"state": "supplier.card.contact", "icon": "contact_phone"},
{"state": "supplier.card.log", "icon": "history"},
{"state": "supplier.card.consumption", "icon": "show_chart"}

View File

@ -167,7 +167,7 @@
tooltip-position="left">
</vn-button>
<vn-button class="round sm vn-mb-sm"
icon="icon-invoices"
icon="icon-invoice"
ng-click="makeInvoiceConfirmation.show()"
ng-show="$ctrl.totalChecked > 0"
vn-tooltip="Make invoice..."

View File

@ -83,7 +83,7 @@
"worker": "$ctrl.worker"
}
}, {
"url": "/time-control",
"url": "/time-control?timestamp",
"state": "worker.card.timeControl",
"component": "vn-worker-time-control",
"description": "Time control",

View File

@ -91,6 +91,7 @@
</vn-label-value>
</div>
<vn-calendar
vn-id="calendar"
class="vn-pt-md"
ng-model="$ctrl.date"
has-events="$ctrl.hasEvents($day)">

View File

@ -15,7 +15,15 @@ class Controller extends Section {
}
$postLink() {
this.date = new Date();
const timestamp = this.$params.timestamp;
let initialDate = new Date();
if (timestamp) {
initialDate = new Date(timestamp * 1000);
this.$.calendar.defaultDate = initialDate;
}
this.date = initialDate;
}
get worker() {

View File

@ -129,5 +129,28 @@ describe('Component vnWorkerTimeControl', () => {
expect(controller.fetchHours).toHaveBeenCalledWith();
});
});
describe('$postLink() ', () => {
it(`should set the controller date as today if no timestamp is defined`, () => {
controller.$.model = {applyFilter: jest.fn().mockReturnValue(Promise.resolve())};
controller.$params = {timestamp: undefined};
controller.$postLink();
expect(controller.date).toEqual(jasmine.any(Date));
});
it(`should set the controller date using the received timestamp`, () => {
const timestamp = 1;
const date = new Date(timestamp);
controller.$.model = {applyFilter: jest.fn().mockReturnValue(Promise.resolve())};
controller.$.calendar = {};
controller.$params = {timestamp: timestamp};
controller.$postLink();
expect(controller.date.toDateString()).toEqual(date.toDateString());
});
});
});
});