Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SS-765: Remove assignment time from distribute schedule #187

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions web/src/components/ShiftSchedule/DistributeSchedule.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<b-card bg-variant="white" class="home" no-body>

<distribute-header v-on:change="loadScheduleInformation" />
<distribute-header v-on:change="loadScheduleInformation" @includeTime="includeTime=$event" />

<b-card id="pdf" v-if="isDistributeDataMounted" class="container" no-body>

Expand Down Expand Up @@ -38,7 +38,7 @@
<loading-spinner :inline="true"/>
</template>
<div v-for="page,inx in sheriffPages" :key="'pdf-'+inx" class="ss-body">
<weekly-schedule :key="updateTable" :fields="fields" :sheriffSchedules="sheriffSchedules.slice(page.start,page.end)" v-if="weekView" />
<weekly-schedule :key="updateTable" :fields="fields" :sheriffSchedules="sheriffSchedules.slice(page.start,page.end)" :includeTime="includeTime" v-if="weekView" />
<daily-schedule :key="updateDailyTable" :dailySheriffSchedules="dailySheriffSchedules.slice(page.start,page.end)" v-else/>

<div v-if="!isDistributeDataMounted && sheriffSchedules.length == 0" style="min-height:115.6px;">
Expand Down Expand Up @@ -114,7 +114,8 @@
today = '';
numberOfheaderDates = 7;
updateTable=0;
updateDailyTable=0;
updateDailyTable=0;
includeTime=true;

errorText='';
openErrorModal=false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</b-navbar-nav>

<b-navbar-nav v-else class="custom-navbar">
<b-col class="my-1">
<b-col style="margin:0.7rem 0;">
<b-row style="width:17.75rem">
<b-button style=" height: 2rem;" size="sm" variant="secondary" @click="previousDateRange" class="my-0 mx-1"><b-icon-chevron-left /></b-button>

Expand All @@ -50,8 +50,18 @@
</b-col>
</b-navbar-nav>

<b-navbar-nav class="mr-2">
<b-input-group class="mr-2 my-0" style="height: 40px">
<b-navbar-nav class="mr-2 ml-n5">
<b-nav-form>
<div :class="includeTimeChecked?'bg-success':''" style="border:1px solid green;border-radius:5px; margin-left: 15px; width: 10rem;">
<b-form-checkbox class="mx-1 my-1" v-model="includeTimeChecked" @change="changeIncludeTime()" size="lg" switch>
<div style="font-size: 16px;" class="text-white">Include Time</div>
</b-form-checkbox>
</div>
</b-nav-form>
</b-navbar-nav>

<b-navbar-nav class="mr-n2">
<b-input-group class="mr-0 my-0" style="height: 40px">
<b-input-group-prepend is-text>
<b-icon icon="person-fill"></b-icon>
</b-input-group-prepend>
Expand All @@ -71,7 +81,7 @@

<b-navbar-nav class="mr-2">
<b-nav-form>
<div :class="showWeekViewChecked?'bg-success':''" style="border:1px solid green;border-radius:5px; margin-left: 15px; width: 8.5rem;">
<div :class="showWeekViewChecked?'bg-success':''" style="border:1px solid green;border-radius:5px; margin-left: 15px; width: 8.75rem;">
<b-form-checkbox class="mx-1 my-1" v-model="showWeekViewChecked" @change="getSchedule()" size="lg" switch>
<div style="font-size: 16px;" class="text-white">{{viewRange}}</div>
</b-form-checkbox>
Expand Down Expand Up @@ -249,6 +259,7 @@
contentState = true;
allSelected = false;
loadingPdf = false;
includeTimeChecked = true;

selectedTeamMember = {sheriffId: '', name: 'All', email: ''} as distributeTeamMemberInfoType;

Expand All @@ -272,6 +283,7 @@
mounted() {
this.loadingPdf = false;
this.showWeekViewChecked = true;
this.includeTimeChecked = true;
this.hasPermissionToViewDutyRoster = this.userDetails.permissions.includes("ViewDutyRoster");
this.teamMemberEmailList = this.teamMemberList.map(member => member.email);

Expand All @@ -295,6 +307,10 @@
})
}

public changeIncludeTime(){
Vue.nextTick(()=> this.$emit('includeTime',this.includeTimeChecked) )
}

public emailSchedule(){

this.errorMsg = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div style="font-size: 6pt; border: none; line-height: 0.55rem;" class="m-0 p-0" v-for="duty,inx in sortEvents(sheriffEvent.duties)" :key="'duty-name-'+inx+'-'+duty.startTime">
<div :style="'color: ' + duty.color">
<b v-if="duty.isOvertime">*</b>
<b> {{duty.startTime}}-{{duty.endTime}}</b>
<b v-if="includeTime"> {{duty.startTime}}-{{duty.endTime}}</b>
<span v-if="duty.dutyType!='Training' && duty.dutyType!='Leave' && duty.dutyType!='Loaned'" > {{duty.dutySubType}} </span>
{{ duty.dutyType | getTypeAbrv }}
</div>
Expand Down Expand Up @@ -75,6 +75,9 @@
@Prop({required: true})
scheduleInfo!: manageAssignmentsScheduleInfoType[];

@Prop({required: true})
includeTime!: boolean;

@commonState.State
public location!: locationInfoType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</template>

<template v-slot:cell() = "data">
<weekly-assignment-card :scheduleInfo="data.item[data.field.key]" />
<weekly-assignment-card :scheduleInfo="data.item[data.field.key]" :includeTime="includeTime" />
</template>

</b-table>
Expand Down Expand Up @@ -80,6 +80,9 @@
@Prop({required: true})
fields!: any[];

@Prop({required: true})
includeTime!: boolean;

@commonState.State
public location!: locationInfoType;

Expand Down
Loading