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-770: add a confirmation popup modal before populating duties for all assignments #241

Merged
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
26 changes: 25 additions & 1 deletion web/src/components/DutyRoster/components/DutyRosterHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
style="max-height: 40px;"
size="sm"
variant="white"
@click="populateAllAssignmentDutiesForTheCurrentDateRange()"
@click="confirmPopulateAllAssignmentDuties()"
class="my-1 mr-3">
<b-icon icon="file-plus" font-scale="2.0" variant="white"/>
</b-button>
Expand Down Expand Up @@ -347,6 +347,22 @@
>&times;</b-button>
</template>
</b-modal>

<b-modal v-model="showConfirmPopulateAllAssignmentDuties" header-class="bg-warning text-light">
<template v-slot:modal-title>
<h2 class="mb-0 text-light"> Confirm Populate Assignments </h2>
</template>
<h4 >Are you sure you want to populate Duties for all Assignments shown in the current date range?</h4>
<template v-slot:modal-footer>
<b-button variant="success" @click="populateAllAssignmentDutiesForTheCurrentDateRange()">Confirm</b-button>
<b-button variant="primary" @click="showConfirmPopulateAllAssignmentDuties=false">Cancel</b-button>
</template>
<template v-slot:modal-header-close>
<b-button variant="outline-warning" class="text-light closeButton" @click="showConfirmPopulateAllAssignmentDuties=false">
&times;
</b-button>
</template>
</b-modal>

</div>
</template>
Expand Down Expand Up @@ -483,6 +499,8 @@
assignmentErrorMsg = '';
assignmentErrorMsgDesc = '';

showConfirmPopulateAllAssignmentDuties = false;

weekDayNames = ['sunday','monday','tuesday','wednesday','thursday','friday','saturday'];

mounted() {
Expand Down Expand Up @@ -797,7 +815,13 @@
})
}

public confirmPopulateAllAssignmentDuties() {
this.showConfirmPopulateAllAssignmentDuties = true;
}

public populateAllAssignmentDutiesForTheCurrentDateRange() {
this.showConfirmPopulateAllAssignmentDuties = false;

// Get all assignment for the current location for the current date range
const assignmentsQueryString = `?locationId=${this.location.id}&start=${this.dutyRangeInfo.startDate}&end=${this.dutyRangeInfo.endDate}`;
const assignmentUrl = `api/assignment${assignmentsQueryString}`;
Expand Down
Loading