UI changes and bug fixes

This commit is contained in:
sairaj mote 2022-11-06 15:12:53 +05:30
parent c745f17afb
commit b2533ee296
5 changed files with 13 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@ -1329,6 +1329,7 @@
dragger = dragula([getRef('display_task_map'), getRef('all_tasks')]) dragger = dragula([getRef('display_task_map'), getRef('all_tasks')])
dragger.on('dragend', function (el, source) { dragger.on('dragend', function (el, source) {
const newOrder = Array.from(getRef('display_task_map').children).map(el => el.dataset.taskId) const newOrder = Array.from(getRef('display_task_map').children).map(el => el.dataset.taskId)
console.log(newOrder)
RIBC.admin.setDisplayedTasks(newOrder) RIBC.admin.setDisplayedTasks(newOrder)
}); });
break; break;
@ -2756,7 +2757,7 @@
getRef('task_list').lastElementChild.scrollIntoView({ behavior: "smooth" }); getRef('task_list').lastElementChild.scrollIntoView({ behavior: "smooth" });
} }
function commitToChanges() { function commitToChanges() {
getConfirmation("Do you want to commit to changes?").then((result) => { getConfirmation("Do you want to commit to changes?", { confirmText: 'Save' }).then((result) => {
if (result) { if (result) {
RIBC.admin.updateObjects().then(res => { RIBC.admin.updateObjects().then(res => {
notify('Changes committed.', 'success') notify('Changes committed.', 'success')
@ -3022,14 +3023,14 @@
document.addEventListener('popupopened', e => { document.addEventListener('popupopened', e => {
getRef('main_page').setAttribute('inert', '') getRef('main_page').setAttribute('inert', '')
switch (e.detail.popup.id) { switch (e.target.id) {
case 'intern_list_popup': case 'intern_list_popup':
renderElem(getRef('intern_list_container'), filterInterns('', { availableInternsOnly: true })) renderElem(getRef('intern_list_container'), filterInterns('', { availableInternsOnly: true }))
break; break;
} }
}) })
document.addEventListener('popupclosed', e => { document.addEventListener('popupclosed', e => {
switch (e.detail.popup.id) { switch (e.target.id) {
case 'intern_list_popup': case 'intern_list_popup':
renderElem(getRef('intern_list_container'), html``) renderElem(getRef('intern_list_container'), html``)
getRef('intern_search_field').value = '' getRef('intern_search_field').value = ''

File diff suppressed because one or more lines are too long

View File

@ -167,6 +167,12 @@
_.internRating[floID] = 1 _.internRating[floID] = 1
return true; return true;
} }
Admin.renameIntern = function (floID, newName) {
if (!(floID in _.internList))
return false;
_.internList[floID] = newName;
return true;
}
Admin.removeIntern = function (floID) { Admin.removeIntern = function (floID) {
if (!(floID in _.internList)) if (!(floID in _.internList))

2
scripts/ribc.min.js vendored

File diff suppressed because one or more lines are too long