zubhub icon indicating copy to clipboard operation
zubhub copied to clipboard

Add the option to add/edit projects for a team in ZubHub

Open iamhks opened this issue 1 year ago • 27 comments

Description

Do a checkout to ZubHub in master branch, do local setup and create an account. Thereafter go to the profile page and click on Create Team. (You will need to change TEAM_ENABLED tag in the CreateTeam.jsx file to true for the page to load) Complete the steps and create a team. After it's successful you'll be redirected to the teams page. You will see there in no place to add/edit team projects. Navigate to the projects section. Uncomment the Add Project button in Team.jsx line: 342 Redirect that button to a new page where we can add/remove projects.

Learning objectives

Understand the backend api's present in zubhub_backend/zubhub/creators/views: EditCreatorGroupAPIView (Make changes if required)

Todo

Add the option to add/edit projects for a team in ZubHub

Designs

Take reference of the code from the 3rd page of team creation and use the same design.

iamhks avatar Sep 07 '23 13:09 iamhks

isn't this a duplicate of #734

coderatomy avatar Sep 29 '23 14:09 coderatomy

@coderatomy No, that was for team members and this is for projects.

iamhks avatar Sep 29 '23 14:09 iamhks

hi @srish, I would love to work on this issue. since it hasn't been assigned to anyone can you kindly assign it to me? @iamhks has already provided enough information to fix the problem

iykat avatar Sep 30 '23 16:09 iykat

Hi @iykat Since this is a high priority issue, it would be nice if you could show us some proof of work like @Formasitchijoh did in #734. We would be happy to assign the issue to you.

iamhks avatar Oct 01 '23 06:10 iamhks

Thanks @iamhks. So following up on this, whenever I tried to my profile page/profile, I was receiving a blank page. Checking the console, I noticed that we were iterating through the newTeams object yet at some point it is null. Check the screencast attached. Fix in draft PR here

Screencast from 2023-10-02 15-48-56.webm

The one blocker am still facing here @iamhks is that the page continues to load. Even when I've updated the TEAM_ENABLED boolean to true

image

Let me see if I can figure it out

coderatomy avatar Oct 02 '23 13:10 coderatomy

Figured 🚩 We were returning a loading component when loading is true and we set it to true initially: Check HERE I think it would be best to ignore this property for now and return the ErrorComponet straight up once there is an error. This current implementation actually keeps the loading spinner loading once the request is not successful in any way Now am getting the ErrorComponent😂 Propably some error handling. Then am good to go. image

So far what I see is that I have to first get the profile page up, then see the way forward, right @iamhks? If so please assign me this issue. I think I can handle it

coderatomy avatar Oct 02 '23 13:10 coderatomy

Continuing on this @iamhks. According to the api documentation, to access the user profile object, we need the username of the signed in user which we tried to get here Logging the props object to the console, I noticed that the username property is not available params object, and neither is it in auth object. Check screenshot attached below

image

This makes the username to be null, hence having this failing request in the network tab

image

To confirm if the endpoint works very fine, I tried with my username and got the response as shown below

image

coderatomy avatar Oct 02 '23 21:10 coderatomy

@coderatomy Can you tell me whether this issue exists even after taking latest pull from master branch? And fresh install/setup

iamhks avatar Oct 03 '23 02:10 iamhks

It returns a loading state, but I know how to fix that. Atleast now it can pick my username. It's no longer giving null. Thanks @iamhks

image image

coderatomy avatar Oct 03 '23 05:10 coderatomy

Continuing on this @iamhks. According to the api documentation, to access the user profile object, we need the username of the signed in user which we tried to get here Logging the props object to the console, I noticed that the username property is not available params object, and neither is it in auth object. Check screenshot attached below

image

This makes the username to be null, hence having this failing request in the network tab

image

To confirm if the endpoint works very fine, I tried with my username and got the response as shown below

image

Hi @coderatomy with regards to the users objects, i think you should look and understand how the redux store manages the, authenticated user equally the authReducers and the UserActions. It'll give you an understanding of how and when to access the state from the store

Formasitchijoh avatar Oct 03 '23 05:10 Formasitchijoh

Thanks @iamhks and @Formasitchijoh for your help. I had to rebuild the docker images with sudo make init, this is what I was missing. Now the page loads up successfully ,with the updated theme. Thanks alot guys image

coderatomy avatar Oct 03 '23 06:10 coderatomy

CONTINUING... I have successfully seen the pages as you directed @iamhks. Just a few breakings in the UI. Check the screencast attached

  • Edit profile button text is not visible
  • Create team button text is also not visible
  • Once you reach the create-team page, and input the Team name and about, there is actually no way to go the next page and finish up the Team creation.

Screencast from 2023-10-03 10-09-47.webm

coderatomy avatar Oct 03 '23 07:10 coderatomy

Another note on this @iamhks , the UIs for creating a Project and a Teamare the same. Note the highlighted urls at the top image image

coderatomy avatar Oct 03 '23 12:10 coderatomy

@coderatomy I feel there is some issue with your local repo. Can you check you App.js file where it /create-team pointing to? It should point to CreateTeam.jsx

iamhks avatar Oct 03 '23 18:10 iamhks

Yes it does point to the CreateTeam component @iamhks. It's just that the code is similar inside the two components. Maybe was copy-pasted for later update. Check createTeam.jsx and createProject.jsx image

coderatomy avatar Oct 03 '23 21:10 coderatomy

hi @coderatomy do you need any help with the designs if so can we work on it together?

Marhiposa avatar Oct 03 '23 22:10 Marhiposa

Surely @Marhiposa. Am sure we need mock-ups for this Team Project feature. I will be happy to work with you. @iamhks, is there anyway @Marhiposa can help on this interms of designs?

coderatomy avatar Oct 03 '23 22:10 coderatomy

For this issue it's already mentioned to use the designs from Step3 of Create Team.

iamhks avatar Oct 04 '23 00:10 iamhks

Successfully created a Team @iamhks. I was having outdated backend. I pruned all images and started again. Thanks image

coderatomy avatar Oct 04 '23 10:10 coderatomy

So here is the page am on Screencast from 2023-10-04 13-43-35.webm

coderatomy avatar Oct 04 '23 10:10 coderatomy

So I should make a change such that the Add Project button doesn't route to /create-team but instead to a new page where I will add the logic and UI, right @iamhks?

image

coderatomy avatar Oct 04 '23 11:10 coderatomy

Correct @coderatomy

iamhks avatar Oct 04 '23 11:10 iamhks

One more thing @iamhks. Can you direct me where you meant with the 3rd page of team creation. Am failing to locate that in the UI

coderatomy avatar Oct 04 '23 11:10 coderatomy

@coderatomy Step 3 in Create Team

iamhks avatar Oct 04 '23 11:10 iamhks

I have added and extensional route /add to the /teams/:groupname that will be responsible to load up the Add project page. I think the same should be done for the edit team projects @iamhks image

coderatomy avatar Oct 04 '23 13:10 coderatomy

@coderatomy It's upto you but if possible we can keep just one page for edit/add projects wherein if the page loads it shows the projects already selected and other projects too. User can do their action and click on save and we should do all the processing whether user added/edited/removed.

iamhks avatar Oct 04 '23 14:10 iamhks

@coderatomy It's upto you but if possible we can keep just one page for edit/add projects wherein if the page loads it shows the projects already selected and other projects too. User can do their action and click on save and we should do all the processing whether user added/edited/removed.

This is actually a better solution @iamhks. Thanks. Have you also thought about privileges or it will be a later thing?

coderatomy avatar Oct 04 '23 17:10 coderatomy