Open SteelWagstaff opened 6 months ago
I got a WIP PR: https://github.com/pressbooks/pressbooks-multi-institution/pull/159 Pending: add tests
@tw77 I got a PR with a working solution for this. I pushed it to ricardodev so you could do some early testing if you are willing to. An example of a testing case is described at https://github.com/pressbooks/pressbooks-multi-institution/pull/159
@MichelleWeremczuk please, feel free to provide feedback as needed in https://ricardodev.pressbooks.network about this feature. Example of testing case described in #159.
Everything seems to be working as expected except for one thing:
I recognize that I might not have something set up properly on my system, or I might be looking at the wrong thing.
@MichelleWeremczuk good catch! it is in the last item. I'll work on it
WP does not provide an easy way to change/edit an existing column from the user list, despite it does for custom columns like institutions
. We have the manage_users_custom_column
hook to change/add values to custom columns, but this is only for the newly added columns.
An option I can see today is to override the WP_List_Table class for users, something like:
class wpUserListTable extends WP_Users_List_Table {
// Override the column method for the blogs column
function column_blogs( $item ) {
return str_replace($item, ...); // replace links here
}
}
I do not like this approach because it would require to do some tricky things like:
add_action('load-users.php', function() {
$GLOBALS['wp_list_table'] = new wpUserListTable;
});
since WP does not provide a hook or something to override it.
I need to find a better way to make this column change.
@richard015ar aside from the item Michelle pointed out, the only other issue I notice so far in early testing is that as an institutional manager, I'm not able to add a new user to the network from https://ricardodev.pressbooks.network/wp/wp-admin/network/user-new.php, which the 'Add New User' button in the user list links to
It seems to be a pre-existing bug. In addition, as an IM I cannot add users either through the Add User
button at the top bar on dev.pressbooks.network.
I'll work on both cases in the same PR.
On the topic of modifying the blogs
column of WP_Users_List_Table
, another alternative I will explore is to completely remove the column through wpmu_users_columns
which is being used for adding the institutions' column in my branch and add in the same method a new custom column called books
.
Later on, I can use the manage_users_custom_column
hook already used to add the institution values to add the books value.
I will try it on.
Another bug found is when the H5P Plugin is active at the root site level, the menu item is displayed for IMs during root site pages navigation. We should remove it.
I was able to:
Pending to fix:
Although we estimated this task as a 5, I consider I already spent 5 story points working on this. We decided to move this task to future sprints, so I will consider in our metrics that we spent 5 points, but I will estimate the remaining effort needed to be 3.
As an institutional manager on a self-hosted open source PB network (i.e. one without pressbooks-network-analytics), I should see a user list with information specific to my institution, instead of the full network user list.
See https://www.figma.com/file/hAvkPJpDgJDDyh8g358AqR/PB-Site-Adjustments?type=design&node-id=34-10298&mode=design&t=6NpK2f6ILNHepftM-0
This should look like the current user list, but with a new column called 'Institution'. As an institutional manager, I should only be presented with the users assigned to my institution. If I try to view the full network user list, I should see a 'you don't have permissions to do this' style message.
DoD:
BOOKTITLE/wp-admin
rather thanwp-admin/network/site-info.php?id=765