Skip to content

Commit

Permalink
Check for correction approved yet no changes made.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeburg committed Jul 30, 2024
1 parent 07ce60a commit fcfada5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
6 changes: 3 additions & 3 deletions app/components/event-radio-disclaimer.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<span class="text-danger">
Even if you are marked as Event Radio Eligible due to previous hours worked, we cannot guarantee you will receive
an Event Radio on playa. Radios are a finite resource and there may not be a sufficient quantity to
distribute one to every Ranger who is eligible.
Even if you are marked as Event Radio Eligible due to previous hours worked, we cannot guarantee that you will
receive an Event Radio on site. Radios are a finite resource, and there may not be enough to distribute to every
eligible Ranger.
</span>
13 changes: 10 additions & 3 deletions app/components/person/timesheet-manage.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {tracked} from '@glimmer/tracking';
import {service} from '@ember/service';
import {NON_RANGER} from "clubhouse/constants/person_status";
import {STATUS_PENDING, STATUS_REJECTED} from "clubhouse/models/timesheet";
import {APPROVED} from "clubhouse/models/timesheet-missing";

export default class PersonTimesheetManageComponent extends Component {
@service ajax;
Expand Down Expand Up @@ -155,9 +156,15 @@ export default class PersonTimesheetManageComponent extends Component {

async _saveCommon(model) {
const changes = model._changes;
if (model.review_status === STATUS_PENDING && (changes['on_duty'] || changes['off_duty'] || changes['position_id'])) {
this.modal.confirm('Timesheet Modified',
'The timesheet entry was modified, but the status was left Correction Requested. Are you sure you want to save the modifications without updating the status?',
const didChange = (changes['on_duty'] || changes['off_duty'] || changes['position_id']);

if (model.review_status === STATUS_PENDING && didChange) {
this.modal.confirm('Entry modified but not approved',
'The on duty time, off duty time, and/or position has been updated, but not saved yet, and the status remains as "Correction Requested." Are you sure you want to save the modifications without updating the status?',
() => this._performSave(model))
} else if (model.review_status === APPROVED && changes['review_status'] && !didChange) {
this.modal.confirm('No changes happened',
'You have indicated that the correction request is to be approved, but no changes have been made (i.e., neither the on duty time, off duty time, nor position was changed). Do you still want to proceed with updating the status to approved?',
() => this._performSave(model))
} else {
this._performSave(model);
Expand Down

0 comments on commit fcfada5

Please sign in to comment.