# Implementing the dynamic home page based on user

**URL:** <https://sef.discourse.group/t/implementing-the-dynamic-home-page-based-on-user/208>\
**Category:** ScholarX\
**Created:** [November 15, 2020, 9:52am UTC](https://sef.discourse.group/t/implementing-the-dynamic-home-page-based-on-user/208 "2020-11-15T09:52:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![anjisvj](https://yyz2.discourse-cdn.com/free1/user_avatar/sef.discourse.group/anjisvj/32/9_2.png) [@anjisvj](https://sef.discourse.group/u/anjisvj)\
**Post date:** [November 15, 2020, 9:52am UTC](https://sef.discourse.group/t/implementing-the-dynamic-home-page-based-on-user/208/1 "2020-11-15T09:52:11Z")

</div>

The current home page view is for the admin and we need to create the view for users as well. So the home page has to change a little bit according to the user role.

 ![image](https://global.discourse-cdn.com/free1/uploads/sef/original/1X/d1a52df79f5ff61359345303f9836d2e642d2b51.jpeg)

As the discussion, we had yesterday meeting and also in the quick meeting today with @Gravewalker. We are going to create three tabs instead of the current tabs.

1. Programs - Shows all the programs
2. My mentoring programs - shows the programs that user mentoring
3. My menteeing (not sure about the word 😅) programs - shows the programs that the user is a mentee

In order to achieve this, we need two APIs for,

1. Get the programs that the user is a mentor
2. Get the programs that the user is a mentee

I will update this thread with the wireframes later.  
@jaye @piumal1999 @YohanAvishke

---

<div class="post-metadata">

**Author:** ![anjisvj](https://yyz2.discourse-cdn.com/free1/user_avatar/sef.discourse.group/anjisvj/32/9_2.png) [@anjisvj](https://sef.discourse.group/u/anjisvj)\
**Post date:** [November 16, 2020, 3:26pm UTC](https://sef.discourse.group/t/implementing-the-dynamic-home-page-based-on-user/208/2 "2020-11-16T15:26:33Z")

</div>

Here are the wireframes:-

 ![image](https://global.discourse-cdn.com/free1/uploads/sef/original/1X/45b24f455d13fb85e018b83790572bcbd6cfa0dd.png)

 ![image](https://global.discourse-cdn.com/free1/uploads/sef/original/1X/f9e9225905711c70ef419edf19a687aedc6cb18c.png)

Here’s Github issue for this task:

> <https://github.com/sef-global/scholarx-frontend/issues/52>
>
> Is your feature request related to a problem? Please describe.
> The current home page view is for the admin and we need...

@jaye Is there going to be a button in my menteeing program cards?

---

<div class="post-metadata">

**Author:** ![jaye](https://yyz2.discourse-cdn.com/free1/user_avatar/sef.discourse.group/jaye/32/810_2.png) [@jaye](https://sef.discourse.group/u/jaye)\
**Post date:** [November 17, 2020, 3:35pm UTC](https://sef.discourse.group/t/implementing-the-dynamic-home-page-based-on-user/208/3 "2020-11-17T15:35:57Z")

</div>

Mentors might have. but mentees not. (Anyway we can move the manage mentee view to the program view later)

---

<div class="post-metadata">

**Author:** ![Gravewalker](https://yyz2.discourse-cdn.com/free1/user_avatar/sef.discourse.group/gravewalker/32/12_2.png) [@Gravewalker](https://sef.discourse.group/u/Gravewalker)\
**Post date:** [November 18, 2020, 1:04am UTC](https://sef.discourse.group/t/implementing-the-dynamic-home-page-based-on-user/208/4 "2020-11-18T01:04:18Z")

</div>

@anjisvj This is impressive, good job. But there shouldn’t be tabs for mentoring and menteeing programs in the admin view. Scratch that part otherwise someone might get confused.

---

<div class="post-metadata">

**Author:** ![anjisvj](https://yyz2.discourse-cdn.com/free1/user_avatar/sef.discourse.group/anjisvj/32/9_2.png) [@anjisvj](https://sef.discourse.group/u/anjisvj)\
**Post date:** [November 18, 2020, 2:22am UTC](https://sef.discourse.group/t/implementing-the-dynamic-home-page-based-on-user/208/5 "2020-11-18T02:22:53Z")

</div>

yeah those tabs are disabled. I’ll hide them and update the thread.

---

<div class="post-metadata">

**Author:** ![anjisvj](https://yyz2.discourse-cdn.com/free1/user_avatar/sef.discourse.group/anjisvj/32/9_2.png) [@anjisvj](https://sef.discourse.group/u/anjisvj)\
**Post date:** [November 18, 2020, 12:57pm UTC](https://sef.discourse.group/t/implementing-the-dynamic-home-page-based-on-user/208/6 "2020-11-18T12:57:38Z")

</div>

Here’s the draft PR for the above task,

> <https://github.com/sef-global/scholarx-frontend/pull/53>

---

<div class="post-metadata">

**Author:** ![anjisvj](https://yyz2.discourse-cdn.com/free1/user_avatar/sef.discourse.group/anjisvj/32/9_2.png) [@anjisvj](https://sef.discourse.group/u/anjisvj)\
**Post date:** [November 20, 2020, 2:00am UTC](https://sef.discourse.group/t/implementing-the-dynamic-home-page-based-on-user/208/7 "2020-11-20T02:00:21Z")

</div>

@piumal1999 What are the endpoints to get the mentee and mentor program?

---

<div class="post-metadata">

**Author:** ![piumal1999](https://yyz2.discourse-cdn.com/free1/user_avatar/sef.discourse.group/piumal1999/32/274_2.png) [@piumal1999](https://sef.discourse.group/u/piumal1999)\
**Post date:** [November 20, 2020, 7:56am UTC](https://sef.discourse.group/t/implementing-the-dynamic-home-page-based-on-user/208/8 "2020-11-20T07:56:31Z")

</div>

Mentee programs:  
me/programs/mentee

Mentor programs:  
/me/programs/mentor

---

<div class="post-metadata">

**Author:** ![anjisvj](https://yyz2.discourse-cdn.com/free1/user_avatar/sef.discourse.group/anjisvj/32/9_2.png) [@anjisvj](https://sef.discourse.group/u/anjisvj)\
**Post date:** [November 21, 2020, 11:26am UTC](https://sef.discourse.group/t/implementing-the-dynamic-home-page-based-on-user/208/10 "2020-11-21T11:26:27Z")

</div>

There was an issue with accessing the cookie which was throwing 401 even the user cookie is there.  
Me and @jaye had a call regarding this and fixed it by adding webconfig to allow CORS mapping.  
Here’s the PR for that: -

> <https://github.com/sef-global/scholarx/pull/82>

---

<div class="post-metadata">

**Author:** ![anjisvj](https://yyz2.discourse-cdn.com/free1/user_avatar/sef.discourse.group/anjisvj/32/9_2.png) [@anjisvj](https://sef.discourse.group/u/anjisvj)\
**Post date:** [November 21, 2020, 12:03pm UTC](https://sef.discourse.group/t/implementing-the-dynamic-home-page-based-on-user/208/11 "2020-11-21T12:03:24Z")

</div>

Here’s the final PR:

> <https://github.com/sef-global/scholarx-frontend/pull/53>

**Admin View**

 ![image](https://global.discourse-cdn.com/free1/uploads/sef/original/1X/b12992b9972f04584cb262406246505b06a816e9.jpeg)

**User (Logged in)**

 ![Kapture 2020-11-21 at 17.13.58](https://global.discourse-cdn.com/free1/uploads/sef/original/1X/dec1a0cde200ae4f033872af22c7e1b3fde3ca1c.gif)

**User (Logged Out)**

 ![image](https://global.discourse-cdn.com/free1/uploads/sef/original/1X/d5c0a6cfb7874cfbed51126835e00f5df98361eb.jpeg)
