Project

General

Profile

Actions

Feature #14457

closed

Toggle for Public Sites in Course Directory

Added by Laurie Hurson almost 3 years ago. Updated over 2 years ago.

Status:
Resolved
Priority name:
Normal
Assignee:
Category name:
Courses
Target version:
Start date:
2021-05-14
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

HI All,

Adding this ticket following up the commons meeting today. Would it be possible to add a toggle to the search filter in the courses directory to allow users to filter and view only public groups and sites?

Do we want to think about the placement/function of this "view public courses" toggle along site the possible addition of an OER metadata tag and toggle?


Files

Screenshot_2021-05-25_15-51-52.png (14.9 KB) Screenshot_2021-05-25_15-51-52.png Boone Gorges, 2021-05-25 11:59 AM
Screenshot_2021-05-25_15-58-05.png (14.8 KB) Screenshot_2021-05-25_15-58-05.png Boone Gorges, 2021-05-25 11:59 AM
Screenshot_2021-05-25_15-51-52.png (16.2 KB) Screenshot_2021-05-25_15-51-52.png Sonja Leix, 2021-05-25 12:44 PM
Screenshot_2021-10-05_10-29-19.png (39.7 KB) Screenshot_2021-10-05_10-29-19.png Boone Gorges, 2021-10-05 11:29 AM
cac-fill-blog-public-courses.php (883 Bytes) cac-fill-blog-public-courses.php Boone Gorges, 2021-10-05 11:34 AM
site-still-shows.png (74.8 KB) site-still-shows.png Colin McDonald, 2021-12-10 10:25 AM
2-screenshot.png (37 KB) 2-screenshot.png Colin McDonald, 2021-12-13 12:29 PM
1-screenshot.png (47.7 KB) 1-screenshot.png Colin McDonald, 2021-12-13 12:29 PM
3-screenshot.png (57.1 KB) 3-screenshot.png Colin McDonald, 2021-12-13 12:29 PM
1-courses.png (36.6 KB) 1-courses.png Colin McDonald, 2021-12-13 04:53 PM
2-courses.png (56 KB) 2-courses.png Colin McDonald, 2021-12-13 04:53 PM

Related issues

Related to CUNY Academic Commons - Bug #14437: Deleted Sites Show Up On Courses TabResolvedBoone Gorges2021-05-10

Actions
Actions #1

Updated by Boone Gorges almost 3 years ago

Adding Sonja to get her brief thoughts.

Actions #2

Updated by Sonja Leix almost 3 years ago

Boone Gorges wrote:

Adding Sonja to get her brief thoughts.

Sorry for the late response to this. I took a look and since this is a toggle vs. the various drop down menus we have in our filter UI, I'd recommend to add a simple check box below the line of filters to toggle this feature on/off. It could read something like "Show public courses only"

Actions #3

Updated by Laurie Hurson almost 3 years ago

Thanks for your insight Sonja. This sounds like a good plan to me.

Would the check box be located in the gray filter box or below where the number of sites are listed? I think within the gray filter box might be more obvious.

Actions #4

Updated by Sonja Leix almost 3 years ago

Laurie Hurson wrote:

Thanks for your insight Sonja. This sounds like a good plan to me.

Would the check box be located in the gray filter box or below where the number of sites are listed? I think within the gray filter box might be more obvious.

Yes agreed, they should be part of the grey filter box. I suggest in the line below the other filters.

Actions #5

Updated by Boone Gorges almost 3 years ago

Thanks all. Agreed that a simple checkbox is fine.

I mocked up putting it in a second line. IMO it becomes confusing - it seems like it's tied to the search box, and it's no longer clear that the 'Filter' and 'Reset' buttons apply to this input.

I tried a second version that involved moving the action buttons to the second row. It's not visually great but it retains the distinction between filters and action buttons.

It's also worth flagging here that my mockups in #14170 suggest making other changes to this filter interface (though perhaps not on the Courses directory) and we risk mucking up an interface that we worked hard to keep clean and easy to understand.

Actions #6

Updated by Sonja Leix almost 3 years ago

Thanks Boone,
Since the user has to click "filter" after they check the new "public sites" checkbox, it makes more sense to drop the action buttons below the filter options. We might want to add a 1px separator between the action buttons and the filter options so it's clear, see rough adjusted mockup attached.

Actions #7

Updated by Laurie Hurson almost 3 years ago

  • Target version deleted (1.19.0)

Looks good to me, I like the 1px line separation.

Actions #8

Updated by Boone Gorges almost 3 years ago

  • Assignee set to Boone Gorges
  • Target version set to 1.19.0

Thanks, Sonja. Breaking the action buttons into a separate line gives us more flexibility in general, since we'll have more screen real estate to deal with. I'll see what I can do about working up a prototype.

Actions #9

Updated by Boone Gorges almost 3 years ago

  • Category name set to Courses
Actions #10

Updated by Colin McDonald over 2 years ago

I just wanted to bump this. Boone, did you end up working on a prototype? Is there anything else we can pass your way to help putting that together? We discussed on Friday that this ticket could be good to include in our regular package of release items related to teaching and course improvements.

Actions #11

Updated by Boone Gorges over 2 years ago

No, I haven't worked anything up, but I'll try to take a look in the next week or so.

Actions #12

Updated by Boone Gorges over 2 years ago

I've built a first pass at this, and it's ready for testing on cdev. A screenshot is also attached.

Fairly substantial changes were required to make this work. Here's a rundown, for posterity:
- Group 'status' and site 'blog_public' are stored in separate tables, in a way that could not be joined as part of the course query. As such, I needed to write routines to mirror these 'public' flags to postmeta, where I could use WP's meta_query.
- Some of the mirroring routines require a switch_to_blog(), because users can change their blog_public value while on the subsite. This means registering and unregistering certain taxonomies and post types on the fly, so that course queries work (WP doesn't handle this well natively; see https://core.trac.wordpress.org/ticket/20541)
- Because of the subsite issue, I also needed to change the plugin to be 'Network: true' so that it would detect blog_public changes on subsites. A side benefit of this change is that it's now possible to fix #14437, which I've done as part of my work here.
- I've written a CLI script to fill in the 'public' postmeta for existing courses, attached here. I'll need to run this after the release.

Actions #13

Updated by Boone Gorges over 2 years ago

  • Related to Bug #14437: Deleted Sites Show Up On Courses Tab added
Actions #14

Updated by Colin McDonald over 2 years ago

Thanks Boone, I checked it out on cdev and it worked well for me. One simple thing, sorry if it's come up before, but when I searched "english" the first result is "scott test group creation" and it has a public group and private site. After hitting the public courses only filter, that result is still there. Is that expected behavior, that we'd rather show the public group even if it has a private site? Makes sense to not hide both altogether?

Actions #15

Updated by Boone Gorges over 2 years ago

I've interpreted 'public' as "has either a public site or a public group". This can be changed if there's consensus that it should mean "has no private site or private group".

Actions #16

Updated by Colin McDonald over 2 years ago

That interpretation tracks for me too. Adding a couple other watchers here in case they want to weigh in.

Actions #17

Updated by Matt Gold over 2 years ago

As someone who teaches with a public site and private group, that makes sense to me

Actions #18

Updated by Laurie Hurson over 2 years ago

Yes, this make sense to me too. If either the group or site is public, the course should be visible when "view public courses" is checked.

Actions #19

Updated by Laurie Hurson over 2 years ago

This appears to work as intended on cdev.

With toggle clicked, courses display in directory if either group or site is public.

Actions #20

Updated by Colin McDonald over 2 years ago

I tried changing privacy settings for a group and a group+site, and this worked as intended. If changed to private, the result disappeared when Public Only was checked. But for this site:

https://teachtest.commons.gc.cuny.edu/

When I changed, it seemed to go private but not disappear from the results when the box is checked. See screenshot.

Actions #21

Updated by Boone Gorges over 2 years ago

Thanks, Colin. This is a bug related to the fact that you were changing the visibility on the site's Dashboard. The metadata saving routine wasn't configured to run on options-reading.php.

I fixed this, but then found that there was an odd problem with advanced-post-cache. The Course was still showing up even after the has-public-group-or-site postmeta was deleted. It could be that this is a core bug, or a bug in advanced-post-cache. I couldn't figure it out so I just excluded cac_course from advanced-post-cache altogether.

https://github.com/cuny-academic-commons/cac/commit/e147a636af712105ca643aafc8d6993cc7a9b2d5
https://github.com/cuny-academic-commons/cac/commit/8e7de897ea5a6f2829fc658ae512a15959d4ec3a
https://github.com/cuny-academic-commons/cac/commit/5249f04762f48de269a9310d39825c69a3aad985

Actions #22

Updated by Colin McDonald over 2 years ago

Hi Boone, I just set up a new public site that was NOT a teaching site, just a simple public site, "colin site to delete" at this URL added to hosts file:

https://todelete.commons.gc.cuny.edu

Then I went in and changed it to Teaching and it showed up in the Courses directory as in 1-screenshot attached. Then I changed it to private, and it still appeared with Show Public checked at the top of Newly Created, except with no links or other data as in 2-screenshot attached. Then I toggled back and see two different results, as in 3-screenshot attached.

Actions #23

Updated by Boone Gorges over 2 years ago

Colin - Somehow, your test site got associated with more than one Course object in the database. Once I deleted the duplicates, the problem no longer occurs.

I don't see how the duplicates occurred in the first place. If you manage to reproduce it, please take very careful note of the specific things you're doing, and share these notes with me. For example, it's critically important that I know exactly where you're going to toggle privacy changes, and what you're changing them from/to.

Actions #24

Updated by Colin McDonald over 2 years ago

Hi Boone, I was able to reproduce it this way, as detailed as I think I can describe:

- Created fresh new public site "delete later colin" via creation portal, campus Brooklyn and purpose Conference.
- In Settings > General, changed Purpose to Teaching, Term to Spring 2022, cluster to STEM. OER box is unchecked.
- The site now showed up in Courses as in attached 1-courses screenshot. Not sure if it should have had instructor or other lines within the item box.
- In Settings > Reading for the site, changed Site Visibility from Allow search engines... to I would like... users I add to it. Then refresh Courses, sorted by Newly Added, and two items appear as in 2-courses screenshot attached.

Left it like that for now in case you wanted to examine. Didn't want to try toggling back or complicating the sequence more.

Actions #25

Updated by Boone Gorges over 2 years ago

This issue is caused by what's described https://redmine.gc.cuny.edu/issues/14897#note-16 and should be fixed by the same changes.

Actions #26

Updated by Colin McDonald over 2 years ago

Great, thanks!

Actions #27

Updated by Boone Gorges over 2 years ago

  • Status changed from Testing Required to Resolved

I've run the migration script, and public courses are now showing up in the Courses directory: https://commons.gc.cuny.edu/courses/?filters%5Bkeyword%5D=&filters%5Bpublic%5D=on&order-by=semester

Actions

Also available in: Atom PDF