Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validating if user is community or council member #26

Merged
merged 12 commits into from
Jan 13, 2024

Conversation

RamboGj
Copy link

@RamboGj RamboGj commented Jan 9, 2024

Resolves #16

What I did:

  • Now we are validating if accountId is a community or council member trought these lines
const alreadyJoinedRolesNames = ["community", "council"];

const group = policy.roles
  .filter((role) => alreadyJoinedRolesNames.includes(role.name))
  .map((role) => {
    return role.kind.Group;
  });

const accounts = new Set(group[0].concat(group[1]));

const isCommunityOrCouncilMember = accounts.has(accountId);
  • Removed unused constans.

WARNING: AFTER JOINING THE BUILD DAO WITH MY NEAR WALLET "rambo-dev.near" I CAN'T FIND MY ACCOUNTID INSIDE COMMUNITY GROUP ARRAY FROM get_policy METHOD.
transaction

Copy link

vercel bot commented Jan 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gateway ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 11, 2024 4:23pm

@elliotBraem
Copy link
Contributor

Could you extend this PR to also have the join page react accordingly ;

For example, I am a member of Build DAO, but I still see an option to Join, and I can mistakenly propose myself again:
Screenshot 2024-01-09 at 3 46 01 PM

I'd like the nearbuilders.org/join page to reflect my status and say

"Joined"
Then it can say "View Activity" and redirect to nearbuilders.org/feed

Screenshot 2024-01-09 at 3 48 00 PM

See the designs here: https://www.figma.com/file/YxjgMO6YlW8wvK6obiQgfU/Build-DAO?node-id=1401%3A134&mode=dev
From Design V1

@RamboGj RamboGj changed the title Validating if user is community or council member Validating if user is community or council member _Resolves #16_ Jan 9, 2024
@RamboGj RamboGj changed the title Validating if user is community or council member _Resolves #16_ Validating if user is community or council member Jan 9, 2024
@RamboGj
Copy link
Author

RamboGj commented Jan 9, 2024

Yep, I'll do it

@elliotBraem
Copy link
Contributor

It looks like we are successfully confirming whether or not someone has joined Build DAO -- this looks good.

A couple changes, however:

In the main navigation bar, rather than showing "Joined", let's show the profile as you see on nearbuilders.org/join
Screenshot 2024-01-10 at 4 18 38 PM

Like this:
Screenshot 2024-01-10 at 4 19 49 PM

And then on the /join page, if I am already a member/council, I expect to see "View Activity" button:

image

Acceptance Criteria

Main Navigation

  • If a user is not logged in, button should show "Join Now" and link to /join page
  • If a user is logged in and is not a member/council, button should show "Join Now" and link to /join page
  • If a user is logged in and is member/council, this should show Profile

Join Page

  • If a user is not logged in, button should show "Login"
  • If a user is logged in and is not member/council, button should show "Join Now" and click should bring up proposal
  • If a user is logged in and is member/council, this should show Joined and View activity

I also think join-now button should be renamed to JoinNow.
What about create-something? Is there a better name for this?

@RamboGj
Copy link
Author

RamboGj commented Jan 10, 2024

I'll review the components names. I didn't want to change what was already there, but if you give me this freedom to rename and change components directly, it'd be nice.
Is there anyway I can watch what components are already coded and what is supposed to be done?
Will update this PR with the addressed criterias.

@elliotBraem elliotBraem merged commit fe4cbfd into NEARBuilders:main Jan 13, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not show "Join now" button if already member, council, or currently proposed
2 participants