-
-
-
+
You can use these FLO credentials with other RanchiMall apps too.
@@ -344,100 +329,6 @@
-
-
- Task
- Internship
-
@@ -645,18 +532,12 @@
-
Pinned
@@ -611,10 +502,6 @@No interns added
No pending requests
Check status of your applications
-
-
-
-
+
+
+
Task applications
-No task requests
+
+
- Task applications
+Check status of your applications
-
-
+ Internship applications
-No applications
-No task requests
@@ -920,8 +801,10 @@
@@ -1102,10 +985,10 @@
options.pinned = true
break;
}
- getRef("notification_drawer").push(message, { icon, ...options });
if (mode === 'error') {
console.error(message)
}
+ return getRef("notification_drawer").push(message, { icon, ...options });
}
// detect browser version
@@ -1261,7 +1144,7 @@
if (!document.querySelector(`#${pageId}`)?.classList.contains('inner-page')) return
try {
- if (floDapps.user.id && (generalPages.includes(pageId))) {
+ if (floDapps.user.id && (['sign_up', 'sign_in', 'loading', 'landing'].includes(pageId))) {
history.replaceState(null, null, '#/dashboard_page');
pageId = 'dashboard_page'
}
@@ -1277,32 +1160,7 @@
if (params)
appState.params = params
if (firstLoad && floGlobals.tempUserTaskRequest && RIBC.getAllTasks()[floGlobals.tempUserTaskRequest]) {
- if (typeOfUser === 'general') {
- getRef('intern_apply__task').textContent = RIBC.getAllTasks()[floGlobals.tempUserTaskRequest].title
- openPopup('apply_for_task_popup', true)
- } else if (typeOfUser === 'intern') {
- const taskRequests = RIBC.getTaskRequests();
- const hasApplied = [...taskRequests, ...sessionTaskRequests].find(({ projectCode, branch, task }) => {
- return floGlobals.tempUserTaskRequest === `${projectCode}_${branch}_${task}`
- })
- if (hasApplied) {
- notify('You have already applied for this task', 'error')
- } else {
- const [projectCode, branch, task] = floGlobals.tempUserTaskRequest.split('_')
- const { title } = RIBC.getTaskDetails(projectCode, branch, task)
- getConfirmation(`Do you want to apply for "${title}"`, { confirmText: 'Apply' }).then((result) => {
- if (result) {
- RIBC.applyForTask(projectCode, branch, task).then((result) => {
- notify('Applied successfully.', 'success')
- sessionTaskRequests.add({ projectCode, branch, task })
- floGlobals.tempUserTaskRequest = null
- })
- }
- }).catch((error) => {
- notify(error, 'error')
- })
- }
- }
+ requestForTask()
}
switch (pageId) {
case 'landing':
@@ -1320,6 +1178,13 @@
if (!params || !params.id) return;
const [projectCode, branch, task] = params.id.split('_')
const { title, description, category, maxSlots, duration, durationType, reward } = RIBC.getTaskDetails(projectCode, branch, task)
+ let hasApplied = false
+ try {
+ floDapps.user.id
+ hasApplied = [...RIBC.getTaskRequests(), ...sessionTaskRequests].find(({ details }) => {
+ return params.id === details.taskId
+ })
+ } catch (e) { }
renderElem(getRef('task_details_wrapper'), html`
-
+ ${!hasApplied ? html`
+
+ `: ''}
`)
} break;
case 'sign_up':
@@ -1386,7 +1253,7 @@
renderInternUpdates(matchedUpdates)
} break;
case 'applications':
- render.internApplications()
+ render.taskApplications()
break;
case 'all_interns_page':
renderAllInterns()
@@ -1749,7 +1616,7 @@
target.type = target.type === 'password' ? 'text' : 'password';
target.focusIn()
}
- function filteredMap(array, mapFn) {
+ function filterMap(array, mapFn) {
const result = [];
array.forEach((element, index) => {
const mapped = mapFn(element, index)
@@ -1779,7 +1646,7 @@
return html`
${floGlobals.taskCategories[category]}
@@ -1348,7 +1213,9 @@ `: ''}
-
${floGlobals.taskCategories[category]}
+ ${floGlobals.taskCategories[category]}
View details
@@ -1832,7 +1699,7 @@
taskCard(task) {
const taskDetails = { title, description, category, maxSlots, duration, durationType, reward } = RIBC.getTaskDetails(appState.params.id, appState.params.branch, task)
const branches = getAllBranches(appState.params.id)
- const branchesButtons = filteredMap(branches, (branch) => {
+ const branchesButtons = filterMap(branches, (branch) => {
const { branchName, parentBranch, startPoint, endPoint } = branch
if (parentBranch === appState.params.branch && startPoint === task) {
return render.branchButton({
@@ -1843,13 +1710,13 @@
}
})
const assignedInterns = RIBC.getAssignedInterns(appState.params.id, appState.params.branch, task) || []
- const assignedInternsCards = filteredMap(assignedInterns, (internFloId) => render.assignedInternCard(internFloId));
+ const assignedInternsCards = filterMap(assignedInterns, (internFloId) => render.assignedInternCard(internFloId));
const status = RIBC.getTaskStatus(appState.params.id, appState.params.branch, task)
let applyButton
- if (typeOfUser === 'intern' && !assignedInterns.includes(myFloID)) {
+ if (!assignedInterns.includes(myFloID)) {
const taskRequests = RIBC.getTaskRequests();
- const hasApplied = [...taskRequests, ...sessionTaskRequests].find(({ projectCode, branch, task: taskId }) => {
- return `${appState.params.id}_${appState.params.branch}_${task}` === `${projectCode}_${branch}_${taskId}`
+ const hasApplied = [...taskRequests, ...sessionTaskRequests].find(({ details }) => {
+ return `${appState.params.id}_${appState.params.branch}_${task}` === details.taskId
})
applyButton = html`