-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Org page #800
Org page #800
Conversation
UI unit Tests11 tests 11 ✅ 0s ⏱️ Results for commit c9240d6. ♻️ This comment has been updated with latest results. |
@hahn-kev @myieye - I'd like feedback on the members list component I just extracted. See PR description for screenshot; currently it looks and functions just like the members list for projects, except that I haven't yet implemented the "Add / Invite Member" button. (Or the bulk-add button). My concern, though, is as follows. Some orgs might be small ("Language Name Here dictionary team") while others might be large (SIL). For large orgs, I think we'd want a member list layout more similar to the users tab on the admin page, but the MembersList component is quite useful for small orgs. Perhaps we automatically switch between them based on member count, or perhaps we provide a UI toggle for org admins to choose which view we want. |
@myieye - Commit 3d93f26 reintroduces using roletext.toLowerCase() in the popup notification, but the role name for orgs is currently "user" and I had set the translated text to "member". Now the notification doesn't match what's in the role select choices. Should I change the translated role name to "User" rather than "Member" for orgs? |
I've now implemented an AddOrgMember button. Chose to copy the AddProjectMember button rather than refactor it to be in common, because the refactor would (IMHO) have added quite a lot of complexity to the button for not that much gain. But I can go back and refactor the two buttons to have common code if it turns out to be a good idea. |
Org page now has a users table where you can add and remove members. Currently adding is done with a button in the table header, and removing is done via a dropdown: It feels a little cramped: I think there needs to be a bit of vertical space between the tabs and the table, and maybe some space above the tabs. But this is shaping up to be a functional, if still very basic, page. It might be time to call this done and move to the next task: allowing admins to create orgs, and/or allowing orgs to own projects. |
Lots of merge conflicts since I've been on this PR for a while, and the |
@rmunn can you merge develop into this branch before we review is since it's so far behind? |
Actually that's a good idea. When I run |
aac0df9
to
1c65638
Compare
My first attempt to merge I should be able to resolve that merge conflict by hand, without having to merge |
DetailsPage, like HeaderPage, will end up combining the common concepts between org and project pages: a title, a badge list, a description, a list of properties (lex entry count / project count, and so on). Currently it is an empty shell around HeaderPage which passes through all slots unchanged, which means that rendering the placeholder org page is unchanged when you swap out HeaderPage for DetailsPage.
Not yet used in project page
This somewhat reduces the complexity of the project page layout.
Will allow sharing code with org members list
Needs role types (ProjectRole vs OrgRole) unified in some way before this will work; currently the MembersList component still has ProjectRole hardcoded because it was copied out of the project page.
Almost functional because the GraphQL query for SetOrgMemberRole takes an email or username, rather than a user ID. I'll need to either change the GQL query or else tweak the MembersList component to be able to handle either one.
@myieye - Many comments addressed, but ran out of time to do all of them. Will finish Monday. |
It's unnecessary friction when testing org creation & deletion, and we have a confirm dialog that requires you to type something so there's actual thought required, which is enough of a barrier to prevent accidental clicking having massive effects. Plus, we'll eventually be moving to a soft-delete for orgs just like we have for projects, which will make this unnecessary as soft-deletes are undoable.
I started implementing the "invite org member by email" flow and realized that it's going to take a bit more effort than I thought it would: we can't simply reuse the existing invite project member by email without changes. We'll need to change the acceptInvitation page to look for a list of orgs to join as well as projects to join, we'll need to edit the invitation JWT to optionally include a list of orgs as well as a list of projects... I think it's best if I push that work off to a separate PR, so that the org page work can be completed. So for now, I'll leave the "TODO: Implement inviting user" comment in OrgMutations.cs, as a reminder for us to do that work. (I'll also create an issue for it). |
We'll add that text back in once invitations are implemented for orgs
I looked into Scribe, and it requires either a Chrome or Edge extension. I uninstalled Chrome from my Linux computer ages ago because it's getting increasingly privacy-hostile (I use Chromium if I need to test something in Chrome), so I really don't want to reinstall it just for this. @myieye, could I ask you to create an Add_Org_Member scribe similar to the Add_Project_Member one? |
This was left over from when ChangeMemberRoleModal handled both project and org memberships, and needed to adjust its schema based on the now-removed roleType prop.
Only problem remaining is the Typescript errors that result from differing definitions of User/TableUser/etc. I don't have a good idea for how to fix them (my earlier attempts have led to much confusion), but perhaps I'm simply missing something obvious. @myieye, could I ask you to take a look and see if you spot something I missed? Run |
It looks to me like the TableUser type in
I'm too close to the problem to be able to see it clearly any more. I think I need input from someone who hasn't been staring at this code for a month. :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rmunn I just made a decently sized push:
- 461b789 Fixed the TypeScript errors
- 11cf0b9 maybe shouldn't be in this PR, but I was having lots of bizarre problems with SK and updating fixed them 🙃
- 4faa6df is the big one. I did several things:
- I realized that some components were still generalized for handling org or project roles or verbose vs non-verbose texts, but that the generalisations weren't needed anymore
- I moved a handfull of components back to the page that their page.ts/.svelte is in, because it makes them easier to find and in some cases there were still imports going back to the page files, so this cleaned them up
- I've adaopted the practice of exporting some types from page.ts that the svelte page and components can share (e.g. a page-specific User type or OrgUser type etc.)
- I made your Org role display name component work the same way as the project role display name component
- I standardized some texts on the org page to be more similar to the project page
Since ChangeOrgMemberRole is called directly from GraphQL, it's possible it could be passed a userId that isn't in our database. Ensure that it can't accidentally create an invalid OrgMember entry in that case.
🎉 I knew there would be an easy solution that I was just too close to the code to see. Thanks! I've done a self-review and found one bug, so I pushed commit c9240d6 to fix it. Everything else looks good to me. I think this is finally ready. @hahn-kev, you have the last remaining "Changes requested" review. Do you want to give this another look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a couple minor things, then this can be merged in. I also noticed a bit of a permissions issue so I created #879 to track that.
I propose you merge this PR right now and finish the TODOs in the scope of this new issue I created: |
I'd already implemented the settings tag change before you said that, but I hadn't committed it yet. I was thinking of pushing that commit then asking for thoughts, but instead I'll go ahead and make that commit part of the new branch for #881. I'll dismiss Kevin's review since you've created the issue to track those remaining tasks, and merge this. |
Dismissing as per Tim and Chris's suggestion; remaining work tracked at #881
Fixes #779.
Add an org page, parallel to the project page (and reusing several of its components), but with a slightly different layout, using tabs for the main body of the page.
Work done:
Deferred to other issues/PRs:
Screenshot:
Previous screenshots: