fix: test
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2023-07-14 13:01:31 +02:00
parent 4f183d1c6a
commit 5716acaa3c
4 changed files with 202 additions and 201 deletions

View File

@ -1,9 +1,9 @@
<div ng-if="$ctrl.card.hasWorkCenter">
<vn-crud-model
<vn-crud-model
url="AbsenceTypes"
data="absenceTypes"
auto-load="true">
</vn-crud-model>
</vn-crud-model>
<div ng-if="$ctrl.card.hasWorkCenter">
<div class="vn-w-lg">
<vn-card class="vn-pa-sm calendars">
<vn-icon ng-if="::$ctrl.isSubordinate" icon="info" color-marginal
@ -21,7 +21,14 @@
</vn-calendar>
</vn-card>
</div>
<vn-side-menu side="right">
</div>
<div
ng-if="!$ctrl.card.hasWorkCenter"
class="bg-title"
translate>
Autonomous worker
</div>
<vn-side-menu side="right">
<div class="vn-pa-md">
<div class="totalBox vn-mb-sm" style="text-align: center;">
<h6>{{'Contract' | translate}} #{{$ctrl.businessId}}</h6>
@ -82,9 +89,9 @@
<vn-icon icon="check" ng-if="absenceType.id == $ctrl.absenceType.id"></vn-icon>
</vn-avatar>
{{absenceType.name}}
</vn-chip>
</div>
<div class="vn-py-md">
</vn-chip>
</div>
<div class="vn-py-md">
<vn-chip>
<vn-avatar class="festive">
</vn-avatar>
@ -95,19 +102,12 @@
</vn-avatar>
<span translate>Current day</span>
</vn-chip>
</div>
</div>
</vn-side-menu>
<vn-confirm
</div>
</div>
</vn-side-menu>
<vn-confirm
vn-id="confirm"
message="This item will be deleted"
question="Are you sure you want to continue?">
</vn-confirm>
</div>
<div
ng-if="!$ctrl.card.hasWorkCenter"
class="bg-title"
translate>
Autonomous worker
</div>
</vn-confirm>

View File

@ -20,6 +20,9 @@ describe('Worker', () => {
controller.absenceType = {id: 1, name: 'Holiday', code: 'holiday', rgb: 'red'};
controller.$params.id = 1106;
controller._worker = {id: 1106};
controller.card = {
hasWorkCenter: true
};
}));
describe('year() getter', () => {
@ -74,7 +77,7 @@ describe('Worker', () => {
let yesterday = new Date(today.getTime());
yesterday.setDate(yesterday.getDate() - 1);
controller.worker = {id: 1107, hasWorkCenter: true};
controller.worker = {id: 1107};
expect(controller.getIsSubordinate).toHaveBeenCalledWith();
expect(controller.getActiveContract).toHaveBeenCalledWith();

View File

@ -105,9 +105,15 @@
ng-show="::$ctrl.isHr">
</vn-button>
</vn-button-bar>
</div>
<div
ng-if="!$ctrl.card.hasWorkCenter"
class="bg-title"
translate>
Autonomous worker
</div>
<vn-side-menu side="right">
<vn-side-menu side="right">
<div class="vn-pa-md">
<div class="totalBox" style="text-align: center;">
<h6 translate>Hours</h6>
@ -129,9 +135,9 @@
has-events="$ctrl.hasEvents($day)">
</vn-calendar>
</div>
</vn-side-menu>
</vn-side-menu>
<vn-dialog
<vn-dialog
vn-id="addTimeDialog"
on-accept="$ctrl.addTime()"
message="Add time">
@ -157,16 +163,16 @@
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
<button response="accept" translate>Save</button>
</tpl-buttons>
</vn-dialog>
<vn-confirm
</vn-dialog>
<vn-confirm
vn-id="delete-entry-dialog"
on-accept="$ctrl.deleteTimeEntry()"
message="This time entry will be deleted"
question="Are you sure you want to delete this entry?">
</vn-confirm>
</vn-confirm>
<!-- Edit entry Popover -->
<vn-popover vn-id="editEntry">
<!-- Edit entry Popover -->
<vn-popover vn-id="editEntry">
<vn-horizontal class="vn-pa-sm edit-time-entry">
<vn-autocomplete class="dense"
ng-model="$ctrl.selectedRow.direction"
@ -181,9 +187,9 @@
ng-click="$ctrl.save()">
</vn-icon-button>
</vn-horizontal>
</vn-popover>
</vn-popover>
<vn-dialog
<vn-dialog
vn-id="reason"
on-accept="$ctrl.isUnsatisfied()">
<tpl-body>
@ -201,9 +207,9 @@
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
<button response="accept" translate>Save</button>
</tpl-buttons>
</vn-dialog>
</vn-dialog>
<vn-dialog
<vn-dialog
vn-id="sendEmailConfirmation"
on-accept="$ctrl.resendEmail()"
message="Send time control email">
@ -214,11 +220,4 @@
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
<button response="accept" translate>Confirm</button>
</tpl-buttons>
</vn-dialog>
</div>
<div
ng-if="!$ctrl.card.hasWorkCenter"
class="bg-title"
translate>
Autonomous worker
</div>
</vn-dialog>

View File

@ -16,9 +16,8 @@ describe('Component vnWorkerTimeControl', () => {
$scope = $rootScope.$new();
$element = angular.element('<vn-worker-time-control></vn-worker-time-control>');
controller = $componentController('vnWorkerTimeControl', {$element, $scope});
controller.worker = {
hasWorkerCenter: true
controller.card = {
hasWorkCenter: true
};
}));