From 73abed668dc3f616b98d392e75cf91b500cc5baa Mon Sep 17 00:00:00 2001 From: sairaj mote Date: Sun, 5 Feb 2023 01:11:53 +0530 Subject: [PATCH] UI tweaks and bug fixes --- index.html | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/index.html b/index.html index c58b03f..285ca5c 100644 --- a/index.html +++ b/index.html @@ -1202,22 +1202,27 @@ } } if (!subPageId1) { - subPageId1 = userType === 'intern' ? 'my_tasks' : 'all_tasks' + if (userType === 'intern') + subPageId1 = 'my_tasks' + else if (userType === 'admin') + subPageId1 = 'projects' + else + subPageId1 = 'all_tasks' } //creates cards for highest performing interns renderElem(getRef('dashboard_page'), html` ${userType === 'intern' ? html`My tasks` : ''} - All tasks + ${userType !== 'admin' ? html`All tasks` : ''} Projects - ${floGlobals.isMobileView ? html`Leaderboard` : ''} + ${floGlobals.isMobileView ? html`Leaderboard` : ''} ${userType === 'intern' ? html`
` : ''} -
${render.displayTasks(params?.category, params?.search)}
+ ${userType !== 'admin' ? html`
${render.displayTasks(params?.category, params?.search)}
` : ''}
@@ -2046,7 +2051,7 @@ `; }, assignedInternCard(internFloId, taskId, options = {}) { - const { shouldShowOptions = false } = options + const { showOptions = false } = options const { hasDeadlinePassed, elapsedPercentage, taskDeadline } = getTaskDeadline(taskId, internFloId) const taskCompleted = RIBC.getInternRecord(internFloId).completedTasks.hasOwnProperty(taskId) let taskStatus = 'In Progress'; @@ -2060,12 +2065,12 @@ } let isInProgress = !taskCompleted && !hasDeadlinePassed let optionsButton - if (shouldShowOptions && taskId && !taskCompleted) { + if (showOptions && taskId && !taskCompleted) { optionsButton = html` `; } - const title = isInProgress ? `Deadline: ${getFormattedTime(taskDeadline, 'date-only')}` : '' + const title = isInProgress ? `Due ${getFormattedTime(taskDeadline, 'date-only')}` : '' return html` ${RIBC.getInternList()[internFloId]} @@ -2143,11 +2148,11 @@ return html`
  • -
    ID: ${task}
    - + ` : ''} @@ -2162,10 +2167,10 @@ Assign - + ` : ''}
    ${assignedInternsCards.length ? html`
    ${assignedInternsCards}
    ` : 'No interns assigned. Click on "Assign" to assign interns.'}
  • @@ -2310,7 +2315,7 @@

    ${title}

    ${hasDeadlinePassed ? html` -

    Deadline passed

    +

    Overdue

    `: html`
    @@ -2326,7 +2331,7 @@
    - Deadline + Due
    `}