ImanKahlila / ProjectHunt

1 stars 7 forks source link

added organization creation/selection functionalitity to project crea… #58

Closed ThomasCarney315 closed 1 year ago

ThomasCarney315 commented 1 year ago

…tion page

@andrewquach-dev big thanks for the good use of comments throughout the code !!

Cheesely commented 1 year ago

I want to review this PR but I'm not totally sure what an organization is. Is this change related to any of the issues in the project space? I'm not seeing organization anywhere else in the project. (I've been a bit out of the loop lately however, so that might be why)

ImanKahlila commented 1 year ago

@Cheesely "organizations" are different bootcamps/schools.

ThomasCarney315 commented 1 year ago

I want to review this PR but I'm not totally sure what an organization is. Is this change related to any of the issues in the project space? I'm not seeing organization anywhere else in the project. (I've been a bit out of the loop lately however, so that might be why)

issue #52 is where this PR comes from. The lucid chart Shcema shows that Organization(eg: 100devs, University, etc.) is one of the [details/values/fields] in the Project [entity/model/document].

The Organization itself is a [document/entity]; therefore, the Project's organization field is a reference to the organization [document/entity].

No problem, you're all good.

andrewquach-dev commented 1 year ago

Great job implementing the organization selection! I tweaked it a bit to make it so that the organization website input field gets auto-filled too if the organization input field was autocompleted. I think that fits the user experience better since we don't want the user to autofill the organization but type out the organization's website after.

Cheesely commented 1 year ago

Ok I figured out what organization is. And that makes sense. Thanks @ImanKahlila and @ThomasCarney315 for explaining that to me.

One issue I found is if person 1 adds a new project and adds an organization with a URL that is www.wrong.com, but they get the URL wrong. When person 2 comes along and fills out the organization field, the autocorrect will auto fill an incorrect URL. This is not so bad, but say if they try to fix it, by changing the URL, to www.correct.com, they will click save and think that they've fixed it, but really the organization stays the same and the URL is still www.wrong.com.

All in all, it seems strange that our users would be able to choose what the URL is for an organization that we are adding to our system. In my opinion, we should have control over that so that we can make sure it's correct. If their "organization" isn't on the list.. we could just add "other" as an option.

What do you guys think?

ThomasCarney315 commented 1 year ago

@andrewquach-dev, that's a great feature with auto-filling the website with our current schema.

@Cheesely Yeah, I agree. That was something I was considering, and I figured we would end up crossing that bridge sooner(now) or later(a new issue). I ended up just sticking with the DB schema at the time. You are correct. Currently, the first person to create an org determines the website forever. Which is weird.

I considered these :

I suppose that the primary purpose of the org field is to eventually find people/projects based on org if someone wants. The website URL for the organization I believe is secondary.

I suppose at this point we should determine if we want to merge this and open a new issue to address this as new change or just hold a discussion and vote here in the PR.

Let me know what you all think.

andrewquach-dev commented 1 year ago

One option is to scratch out the website field in the model and creation page, make it so that only we can add new organizations, and create a pre-existing list of organizations. Users will be able to select from a dropdown list of organizations and we would have to manually add organizations through mongodb's website. That way users are restricted from creating their own custom organizations.

ThomasCarney315 commented 1 year ago

Yes, that is also something to consider. Users creating organizations with ridiculous names could become an issue

ThomasCarney315 commented 1 year ago

Okay, how about a vote?

Cheesely commented 1 year ago

🚀

But I think we should add a property in projects for “other organization” so that people can freetype the name if they choose other from the drop-down instead of one our pre-existing ones. This would be an optional field) That way we can look at user’s responses and know if a new organization needs to be added.

And long term we can have admin functions that are only available for admin users. One of those admin functions can be

ImanKahlila commented 1 year ago

I wrote this in the Discord channel also, but I wanted to write it here too.

Are we able to make auto generated drop down selections for our text input fields? Example: User begins typing "100" and the drop down menu suggests "100 Devs" ? Also maybe if it isn't options to choose from when they're typing, then no drop down menu shows up? Hopefully that makes sense, lol.

ThomasCarney315 commented 1 year ago

@Cheesely I agree with you, eliminate the website and allow project creators to freetype or select an orgname. but I think another field such as “other organization” is unnecessary as the organization field can hold the orgname whether manually typed in or selected from the prepopulated list.

@ImanKahlila Yes we can. pretty much exactly like that.

ThomasCarney315 commented 1 year ago

Based on input so far, this is what I propose:

What does everyone think?

ImanKahlila commented 1 year ago

Sounds good! @ThomasCarney315

ThomasCarney315 commented 1 year ago

Ok. I made the changes as discussed.

@Cheesely @ImanKahlila @andrewquach-dev

ThomasCarney315 commented 1 year ago

I also moved some of the logic from the organization.js to controllers/projects.js for speed purposes

ImanKahlila commented 1 year ago

Should I go ahead and merge this even though we need another review?

ThomasCarney315 commented 1 year ago

Should I go ahead and merge this even though we need another review?

No big hurry. @Cheesely @andrewquach-dev, have you had a chance to look at the changes?

andrewquach-dev commented 1 year ago

Should I go ahead and merge this even though we need another review?

No big hurry. @Cheesely @andrewquach-dev, have you had a chance to look at the changes?

Can we code review this part? I think it might need to be changed to this but I'm not totally sure. image

ThomasCarney315 commented 1 year ago

@andrewquach-dev . you're correct. I fixed the typo. Apparently it still worked like that though lol🤔