diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 5f65bab7..ca879ab6 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -16,7 +16,7 @@ services: api: image: ss-api - environment: + environment: - LocationServicesClient__Username=${LocationServicesClientUsername} - LocationServicesClient__Password=${LocationServicesClientPassword} - LocationServicesClient__Url=${LocationServicesClientUrl} @@ -36,8 +36,8 @@ services: - ASPNETCORE_URLS=${ASPNETCORE_URLS} - WebBaseHref=${WEB_BASE_HREF} - SiteMinderLogoutUrl=${SiteMinderLogoutUrl} - - Logging__LogLevel__Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker=${ControllerLoggingLevel} - - Logging__LogLevel__SS.Api.infrastructure.middleware.ErrorHandlingMiddleware=${MiddlewareLoggingLevel} + - Logging__LogLevel__Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker=${ControllerLoggingLevel} + - Logging__LogLevel__SS.Api.infrastructure.middleware.ErrorHandlingMiddleware=${MiddlewareLoggingLevel} - Logging__LogLevel__Microsoft.EntityFrameworkCore.Database.Command=${DatabaseLoggingLevel} - ASPNETCORE_Kestrel__Certificates__Default__Password=${KestrelPassword} - ASPNETCORE_Kestrel__Certificates__Default__Path=${KestrelPath} @@ -67,8 +67,8 @@ services: - 5432:5432 volumes: - ./tmp:/tmp2 - + pdf: image: hassananv/weasyprint ports: - - 8083:5001 \ No newline at end of file + - 8083:5001 diff --git a/web/src/components/DutyRoster/DutyRosterWeekView.vue b/web/src/components/DutyRoster/DutyRosterWeekView.vue index 630564ba..8ab11858 100644 --- a/web/src/components/DutyRoster/DutyRosterWeekView.vue +++ b/web/src/components/DutyRoster/DutyRosterWeekView.vue @@ -42,7 +42,7 @@ diff --git a/web/src/components/DutyRoster/components/DutyCardWeekView.vue b/web/src/components/DutyRoster/components/DutyCardWeekView.vue index d3fe8824..fd01593f 100644 --- a/web/src/components/DutyRoster/components/DutyCardWeekView.vue +++ b/web/src/components/DutyRoster/components/DutyCardWeekView.vue @@ -266,8 +266,10 @@
×
- - + + + + @@ -277,9 +279,10 @@ import * as _ from 'underscore'; import moment from 'moment-timezone'; import AddDutySlotWeekForm from './AddDutySlotWeekForm.vue' - import {dutyRangeInfoType, dutySlotInfoType, assignDutySlotsInfoType, assignDutyInfoType, assignmentCardInfoType, dutyBlockWeekInfoType, myTeamShiftInfoType, selectedDutyCardInfoType, assignmentCardWeekInfoType } from '@/types/DutyRoster'; + import {dutyRangeInfoType, dutySlotInfoType, assignDutySlotsInfoType, assignDutyInfoType, assignmentCardInfoType, dutyBlockWeekInfoType, myTeamShiftInfoType, selectedDutyCardInfoType, assignmentCardWeekInfoType, attachedDutyInfoType } from '@/types/DutyRoster'; import {localTimeInfoType, userInfoType} from '@/types/common'; - import SheriffModal from './SheriffModal.vue' + import SheriffModal from './SheriffModal.vue'; + import BulkUnassignModal from '../../common/BulkUnassignModal.vue'; import { namespace } from "vuex-class"; import "@store/modules/CommonInformation"; @@ -290,7 +293,8 @@ @Component({ components: { AddDutySlotWeekForm, - SheriffModal + SheriffModal, + BulkUnassignModal } }) export default class DutyCardWeekView extends Vue { @@ -304,6 +308,9 @@ @commonState.State public userDetails!: userInfoType; + @Prop({required: true}) + dutyRostersJson!: attachedDutyInfoType[]; + @Prop({required: true}) dutyRosterInfo!: assignmentCardInfoType; @@ -370,6 +377,8 @@ showEditDutySheriffModal = false; editingBlockId='' + showBulkUnassignModal = false; + editDutyError = false; editDutyErrorMsg = ''; @@ -424,7 +433,7 @@ } - public editDutySheriffModal(day, e?, blkId?){ + public editDutySheriffModal(day, e?, blkId?){ if(e?.ctrlKey == true){ const block = this.dutyBlocks.filter(blk => blk.id==blkId) const assignment = this.dutyRosterInfo.assignment+'D'+day @@ -441,7 +450,10 @@ } this.UpdateSelectedDuties(selectedDuties) } - else if (blkId.includes('i')){ + else if (this.selectedDuties.length > 1 && this.shouldAllowBulkUnassign()) { + this.showBulkUnassignModal = true; + + } else if (blkId.includes('i')){ this.editDuty(day) } else{ @@ -453,6 +465,16 @@ } } + shouldAllowBulkUnassign() { + // show if all the selectedDuites are assigned to a sheriff + return this.selectedDuties.every((s) => + s.dutyBlock?.every((d) => { + if (!d.sheriffId || !d.dutyId) return false; + return true; + }) + ) + } + public editDuty(day, e?, blkId?){ this.isDutyDataMounted = false; this.dutyBlocksDay = (this.dutyBlocks.filter(dutyBlock=>{if(dutyBlock.day==day)return true;})); @@ -544,6 +566,13 @@ this.showEditDutySheriffModal = false; } + public closeBulkUnassignModelWindow(refreshData: boolean) { + this.showBulkUnassignModal = false; + if (refreshData) { + this.$emit('change', this.scrollPositions()); + } + } + public closeDutySlotForm() { this.addNewDutySlotForm= false; this.addFormColor = 'secondary'; @@ -571,7 +600,6 @@ } public extractDuty(){ - for(let day=0; day<7; day++){ if(this.dutyRosterInfo[day]){ const dutyInfo = this.dutyRosterInfo[day]; diff --git a/web/src/components/common/BulkUnassignModal.vue b/web/src/components/common/BulkUnassignModal.vue new file mode 100644 index 00000000..fff0fdd0 --- /dev/null +++ b/web/src/components/common/BulkUnassignModal.vue @@ -0,0 +1,192 @@ + + +