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

feat: add members space page #971

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

bartosz-io
Copy link

Summary

Add a new space page and item in the space menu called "Members".

Closes: #960

How to test

  1. Open a space with members
  2. Verify Members navigation item is visible
  3. Open Members
  4. If there are no members (admin, moderator, author) the navigation item is not rendered

@bonustrack bonustrack requested a review from Sekhmet November 26, 2024 17:54
@bonustrack
Copy link
Member

@Sekhmet can you review this PR?

apps/ui/src/components/App/Nav.vue Outdated Show resolved Hide resolved
apps/ui/src/components/App/Nav.vue Outdated Show resolved Hide resolved
apps/ui/src/components/App/Nav.vue Outdated Show resolved Hide resolved
apps/ui/src/networks/offchain/api/queries.ts Outdated Show resolved Hide resolved
Copy link
Member

@Sekhmet Sekhmet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where -> statementsWhere rename went wrong so query doesn't work right now.

Also recently we added class to our routes, but because SpaceMembers returns fragment that class doesn't have anywhere to go so we get a warning and padding is missing on this page:

<router-view class="pb-6" />

@bartosz-io
Copy link
Author

@Sekhmet Fixed.

Could you approve?

Comment on lines +371 to +376
statements(where: $statementsWhere) {
delegate
space
network
statement
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe as a precaution let's fetch 100 statements there, should be enough to cover members of most spaces, afraid that default (20) might not be always enough.

first arg controls how many we fetch.

Comment on lines +788 to +798
const { data } = await apollo.query({
query: STATEMENTS_AND_USERS_QUERY,
variables: {
where: {
delegate_in: userIds,
network: networkId,
space: spaceId
},
userIds
}
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const { data } = await apollo.query({
query: STATEMENTS_AND_USERS_QUERY,
variables: {
where: {
delegate_in: userIds,
network: networkId,
space: spaceId
},
userIds
}
});
const { data } = await apollo.query({
query: STATEMENTS_AND_USERS_QUERY,
variables: {
statementsWhere: {
delegate_in: userIds,
network: networkId,
space: spaceId
},
userIds
}
});

Right now we are not filtering statements at all because argument name doesn't match, so we just fetch random 20 statements that are most likely not for the members of the space.

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.

feat: add members space page
3 participants