Skip to content

Commit

Permalink
✨ feat(Status Rules): remove justification if on going is select and …
Browse files Browse the repository at this point in the history
…available
  • Loading branch information
MetalPrime committed May 10, 2024
1 parent 4f587ef commit 41aa052
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -558,10 +558,6 @@ function validateCurrentDate() {

function justificationByStatus(statusId) {

const $expectedYearBlock = $('#deliverableYear');
const $expectedYearSelect = $expectedYearBlock.find('select');
const expectedYear = $expectedYearSelect.val();

var $newExpectedYearBlock = $('#newExpectedYear');
var $newExpectedYearSelect = $newExpectedYearBlock.find('select');
var newExpectedYear = $newExpectedYearSelect.val();
Expand All @@ -585,6 +581,8 @@ function justificationByStatus(statusId) {
if (isStatusOnGoing(statusId)) {
console.log("if");
showNewExpectedComponent(false);
$newExpectedYearSelect.val("-1").trigger("change.select2");
$statusDescription.find('textarea').val("");
} else {
console.log("else");
if (statusId == 4) {
Expand All @@ -606,7 +604,7 @@ function justificationByStatus(statusId) {

}

//Display the overlay thaty block the possibility to change the expected year
//Display the overlay that block the possibility to change the expected year
function showNewExpectedComponent(state) {
var $newExpectedYearBlock = $('#newExpectedYear');
var $yearOverlay = $('#deliverableYear .overlay');
Expand All @@ -628,10 +626,6 @@ function validateDeliverableStatus(canChangeStatus) {
const $expectedYearSelect = $expectedYearBlock.find('select');
const expectedYear = $expectedYearSelect.val();

var $newExpectedYearBlock = $('#newExpectedYear');
var $newExpectedYearSelect = $newExpectedYearBlock.find('select');
var newExpectedYear = $newExpectedYearSelect.val();

var isAdmin = document.getElementById("adminRole").value;

// New Expected year should be greater than current reporting cycle year
Expand Down

0 comments on commit 41aa052

Please sign in to comment.