${internName}
- ${userType === 'admin' ? html` ` : ''}
+ ${userType === "admin" ? html` ` : ''}
@@ -2798,6 +2818,7 @@
RIBC.admin.putTaskStatus('incomplete', appState.params.id, appState.params.branch, currentTask.dataset.taskId)
// TODO: remove task scores from intern rating
renderBranchTasks()
+ adminDataChanged();
}
})
}
@@ -2816,6 +2837,7 @@
const taskId = `${appState.params.id}_${appState.params.branch}_${currentTask.dataset.taskId}`;
const filteredTasks = RIBC.getDisplayedTasks().filter(task => task !== taskId)
renderBranchTasks()
+ adminDataChanged();
}
function rateParticipants() {
document.querySelectorAll('.rating-part').forEach((ratingPart) => {
@@ -2849,6 +2871,7 @@
}
RIBC.admin.editTaskDetails(taskDetails, appState.params.id, appState.params.branch, currentTask.dataset.taskId)
notify('Changes saved locally, commit the changes to make them permanent', 'success')
+ adminDataChanged();
})
getRef('task_list').addEventListener('focusout', (e) => {
currentTask = e.target.closest('.admin-task');
@@ -2866,6 +2889,7 @@
if (ogTaskDetails[e.target.dataset.editField] !== newTaskDetails[e.target.dataset.editField]) {
RIBC.admin.editTaskDetails(newTaskDetails, appState.params.id, appState.params.branch, currentTask.dataset.taskId)
notify('Changes saved locally, commit the changes to make them permanent', 'success')
+ adminDataChanged();
}
})
getRef('task_list').addEventListener('dblclick', (e) => {
@@ -2990,6 +3014,7 @@
renderBranchTasks()
getRef('add_task').classList.remove('hidden')
notify('Task added to current branch', 'success')
+ adminDataChanged();
}
})
function markAsFailed(e) {
@@ -3001,6 +3026,7 @@
if (done) {
notify('Task marked as failed', 'success')
renderBranchTasks()
+ adminDataChanged();
} else {
notify('Failed to mark task as failed', 'error')
}
@@ -3013,6 +3039,7 @@
RIBC.admin.unassignInternFromTask(e.target.closest('.menu').dataset.floId, `${appState.params.id}_${appState.params.branch}_${currentTask.dataset.taskId}`)
notify('Intern removed from the task')
renderBranchTasks()
+ adminDataChanged();
}
})
}
@@ -3067,6 +3094,9 @@
if (result) {
RIBC.admin.updateObjects().then(res => {
notify('Changes committed.', 'success')
+ floGlobals.adminChanges = 0
+ getRef('commit_changes_button').removeAttribute('data-badge')
+ removeEventListener("beforeunload", beforeUnloadListener, { capture: true });
}).catch(err => {
console.error(err)
})
@@ -3080,6 +3110,7 @@
const taskId = `${appState.params.id}_${appState.params.branch}_${currentTask.dataset.taskId}`;
RIBC.admin.setDisplayedTasks(RIBC.getDisplayedTasks().filter(task => task !== taskId))
renderBranchTasks()
+ adminDataChanged();
}
})
}
@@ -3100,6 +3131,7 @@
})
notify(`Assigned task`, 'success')
closePopup()
+ adminDataChanged();
}
function renderAllInterns() {
@@ -3119,6 +3151,7 @@
notify(`Branch added ${branchName}`, 'success')
renderBranches()
closePopup()
+ adminDataChanged();
}
function toggleInternNameEditing(e) {
@@ -3136,6 +3169,7 @@
button.textContent = 'Edit';
document.getSelection().collapseToEnd()
floGlobals.tempEditableContent = '';
+ adminDataChanged();
} else {
makeEditable(getRef('intern_info__name'))
button.textContent = 'Done'
@@ -3422,7 +3456,7 @@
elem.classList.add('hidden')
})
}
- if (userType === 'admin') {
+ if (userType === "admin") {
document.querySelectorAll('.not-for-admin').forEach((elem) => {
elem.classList.add('hidden')
})