refs #5688 fix: e2e
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2023-06-22 13:30:53 +02:00
parent 5f4b62f133
commit d26778e94e
2 changed files with 110 additions and 113 deletions

View File

@ -4,7 +4,7 @@
filter="::$ctrl.filter"
data="$ctrl.hours">
</vn-crud-model>
<div ng-if="$ctrl.card.worker.hasWorkCenter">
<div ng-if="$ctrl.worker.hasWorkCenter">
<vn-card class="vn-pa-lg vn-w-lg">
<vn-table model="model" auto-load="false">
<vn-thead>
@ -105,114 +105,6 @@
ng-show="::$ctrl.isHr">
</vn-button>
</vn-button-bar>
<vn-side-menu side="right">
<div class="vn-pa-md">
<div class="totalBox" style="text-align: center;">
<h6 translate>Hours</h6>
<vn-label-value
label="Week total"
value="{{$ctrl.weekTotalHours}} h.">
</vn-label-value>
<vn-label-value
label="Finish at"
value="{{$ctrl.getFinishTime()}}">
</vn-label-value>
</div>
<vn-calendar
vn-id="calendar"
class="vn-pt-md"
ng-model="$ctrl.date"
format-week="$ctrl.formatWeek($element)"
on-move="$ctrl.getMailStates($date)"
has-events="$ctrl.hasEvents($day)">
</vn-calendar>
</div>
</vn-side-menu>
<vn-dialog
vn-id="addTimeDialog"
on-accept="$ctrl.addTime()"
message="Add time">
<tpl-body>
<vn-input-time
vn-one
vn-focus
ng-model="$ctrl.newTimeEntry.timed"
label="Hour"
required="true">
</vn-input-time>
<vn-autocomplete
label="Type"
ng-model="$ctrl.newTimeEntry.direction"
data="$ctrl.entryDirections"
select-fields="['code','description']"
show-field="description"
value-field="code"
required="true">
</vn-autocomplete>
</tpl-body>
<tpl-buttons>
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
<button response="accept" translate>Save</button>
</tpl-buttons>
</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>
<!-- 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"
data="$ctrl.entryDirections"
select-fields="['code','description']"
show-field="description"
value-field="code">
</vn-autocomplete>
<vn-icon-button vn-none
icon="check"
vn-tooltip="Save"
ng-click="$ctrl.save()">
</vn-icon-button>
</vn-horizontal>
</vn-popover>
<vn-dialog
vn-id="reason"
on-accept="$ctrl.isUnsatisfied()">
<tpl-body>
<div class="reasonDialog">
<vn-textarea
label="Reason"
ng-model="$ctrl.reason"
disabled="!$ctrl.isHimSelf"
rows="5"
required="true">
</vn-textarea>
</div>
</tpl-body>
<tpl-buttons ng-if="$ctrl.isHimSelf">
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
<button response="accept" translate>Save</button>
</tpl-buttons>
</vn-dialog>
<vn-dialog
vn-id="sendEmailConfirmation"
on-accept="$ctrl.resendEmail()"
message="Send time control email">
<tpl-body>
<span translate>Are you sure you want to send it?</span>
</tpl-body>
<tpl-buttons>
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
<button response="accept" translate>Confirm</button>
</tpl-buttons>
</vn-dialog>
</div>
<div
ng-if="!$ctrl.worker.hasWorkCenter"
@ -220,3 +112,111 @@
translate>
Autonomous worker
</div>
<vn-side-menu side="right">
<div class="vn-pa-md">
<div class="totalBox" style="text-align: center;">
<h6 translate>Hours</h6>
<vn-label-value
label="Week total"
value="{{$ctrl.weekTotalHours}} h.">
</vn-label-value>
<vn-label-value
label="Finish at"
value="{{$ctrl.getFinishTime()}}">
</vn-label-value>
</div>
<vn-calendar
vn-id="calendar"
class="vn-pt-md"
ng-model="$ctrl.date"
format-week="$ctrl.formatWeek($element)"
on-move="$ctrl.getMailStates($date)"
has-events="$ctrl.hasEvents($day)">
</vn-calendar>
</div>
</vn-side-menu>
<vn-dialog
vn-id="addTimeDialog"
on-accept="$ctrl.addTime()"
message="Add time">
<tpl-body>
<vn-input-time
vn-one
vn-focus
ng-model="$ctrl.newTimeEntry.timed"
label="Hour"
required="true">
</vn-input-time>
<vn-autocomplete
label="Type"
ng-model="$ctrl.newTimeEntry.direction"
data="$ctrl.entryDirections"
select-fields="['code','description']"
show-field="description"
value-field="code"
required="true">
</vn-autocomplete>
</tpl-body>
<tpl-buttons>
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
<button response="accept" translate>Save</button>
</tpl-buttons>
</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>
<!-- 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"
data="$ctrl.entryDirections"
select-fields="['code','description']"
show-field="description"
value-field="code">
</vn-autocomplete>
<vn-icon-button vn-none
icon="check"
vn-tooltip="Save"
ng-click="$ctrl.save()">
</vn-icon-button>
</vn-horizontal>
</vn-popover>
<vn-dialog
vn-id="reason"
on-accept="$ctrl.isUnsatisfied()">
<tpl-body>
<div class="reasonDialog">
<vn-textarea
label="Reason"
ng-model="$ctrl.reason"
disabled="!$ctrl.isHimSelf"
rows="5"
required="true">
</vn-textarea>
</div>
</tpl-body>
<tpl-buttons ng-if="$ctrl.isHimSelf">
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
<button response="accept" translate>Save</button>
</tpl-buttons>
</vn-dialog>
<vn-dialog
vn-id="sendEmailConfirmation"
on-accept="$ctrl.resendEmail()"
message="Send time control email">
<tpl-body>
<span translate>Are you sure you want to send it?</span>
</tpl-body>
<tpl-buttons>
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
<button response="accept" translate>Confirm</button>
</tpl-buttons>
</vn-dialog>

View File

@ -151,7 +151,7 @@ class Controller extends Section {
}
getAbsences() {
if (!this.card.worker.hasWorkerCenter) return;
if (!this.worker.hasWorkerCenter) return;
const fullYear = this.started.getFullYear();
let params = {
workerFk: this.$params.id,
@ -486,8 +486,5 @@ ngModule.vnComponent('vnWorkerTimeControl', {
controller: Controller,
bindings: {
worker: '<'
},
require: {
card: '^vnWorkerCard'
}
});