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

Filters dev #225

Closed
wants to merge 9 commits into from
Closed

Filters dev #225

wants to merge 9 commits into from

Conversation

ekala
Copy link
Contributor

@ekala ekala commented Aug 2, 2012

Implements the river level filtering mechanism described in #188. The approach to the filters is the same as that of the channels on both the UX/UI but with slight modifications. The available filters are specified in application/config/filters.php.template

River filters settings page
River filter settings

Activating a filter for use
Add Filter

Adding a filter parameter
Add filter parameter

* The approach for the river filters is very much like that of the
river channels - use of a config (config/filters.template.php) file to
define the structure of the filter. As with channels and channel filter
options, each filter has a set of filter parameters. This therefore
introduces two new tables; river_filters and river_filter_parameters.

* I've also relaxed CSRF token regeneration. The tokens are now tied to
a user session. Once the session expires, the token also expires. This
now allows POST requests to be processed from more than one browser tab

* Deleted unused controllers and views from the repository

* TODO: Implement geo-fence filter and introduce configuration
parameter that will allow the site administrator to limit use of the
river filters
* Suffix the update script with the name of the affected tables or
relevant subject
* The post processor examines a drop and the river it's destined for vs
its filter. If the drop doesn't match the filter, it's left out of the
river. Since drops only get displayed when processing is complete, we
have to purge them from their respective rivers before their processing
status flag is flipped.
* Drops are only posted via the API once they've undergone
post-processing so there's no need for the REST endpoint to return the
list of freshly created drop entries

* Discard use of "droplet_processed" field (performance impedance
factor) when fetching drops since only processed drops get posted to
the droplets table
@@ -298,7 +300,6 @@ public static function get_droplets($user_id, $river_id, $drop_id = 0, $page = 1
->on('droplets.identity_id', '=', 'identities.id')
->where('rivers_droplets.droplet_date_pub', '>', '0000-00-00 00:00:00')
->where('rivers_droplets.river_id', '=', $river_id)
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing ';' at the end of this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

* The filters and channels are somewhat related so it makes more sense
to place them next to each other in order to avoid cognitive dissonance.

Recommended by @69mb
* A named filters facility to allow users to categorize the filters they would like to apply on their river. The named filters are ORd but the individual filter parameters in each named filter are ANDed

* Improved the river creation process. Drops do not appear in a river until the user has completed the river creation i.e. clicks "View my River" in the finish page

* Renamed the river_filter and river_filter_parameter tables to "filters" and "filter_parameters" respectively. This paves the way for bucket-level filters
* Run ".enable" or ".disable" events when a channel, filter or river is
enabled or disabled
@ekala
Copy link
Contributor Author

ekala commented Aug 11, 2012

@69mb @dkobia I've changed the second-level filters to named filters. The parameters (places, tags, keywords) for each named filter are ANDed while the name filters are OR'd (where a river has more than one named filter)

Screenie for the modified UI

River Filters

-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `filters` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`filter_target` varchar(20) NOT NULL DEFAULT COMMENT 'Object on which the filter is to be applied i.e. river or bucket',
Copy link

Choose a reason for hiding this comment

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

There is an error on this line ... has 'DEFAULT COMMENT ...' which is incorrect because COMMENT can't be a DEFAULT.

Copy link

Choose a reason for hiding this comment

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

Assuming this was supposed to be DEFAULT 'river' ?

@dkobia
Copy link

dkobia commented Aug 13, 2012

  • I seem to be having issues adding a filter parameter. Click and ... nothing. And no console error.
  • Also it seems a little confusing to have a filter button, then another 'River Filter' section in the river settings -- wondering how best to separate the two?

@ekala
Copy link
Contributor Author

ekala commented Aug 13, 2012

Agreed. I ran out of terminology. Perhaps call them "Saved Filters" or something...

@69mb
Copy link
Contributor

69mb commented Aug 13, 2012

  • I think this can be separated by bringing up a modal to enter filter name when "Add Filter" is clicked instead of in place which is confusing.
  • Needs visual feedback: show the loading icon, success + error messages & prevent multiple submission.
  • Add 'channel' as a parameter. Thinking I could add rss and sms to my river but I want all SMS and only feed items matching certain keywords. So I would have 2 filters in this river, one with channel rss + my keywords and another with just channel sms to allow all sms drops.
  • Also for twitter, I think what we have now as keyword and people channel_filter_options should be filter parameters. Instead of entering keywords on the channel settings page and again on the filters page, we should only select twitter as a channel and it will have no parameters(no channel options in the config file), then on the river filter enter the people and keywords. We could then have a single web.river.new topic that the firehose application will listen to and update itself is a message comes in for a river with a twitter channel. On startup, it will read the filter_parameters table and listen to filter updates.

Take a look at this gist for what I have in mind for the web.river.new message https://gist.github.com/2a4ea18343aadcc6d4a3 maybe this clarifies somewhat?

RSS urls I think are part of channel configuration and can be left in channel_filter_options but the rss scheduler could listen for the new river event and update itself for rivers with an rss channel.

@brandonrosage
Copy link
Contributor

I’ve completed a solid round of work in the /markup prototype that offers the “Flow” UI within an existing river’s settings. I’d like to bring a similar concept to the river creation process, next, as Emmanuel suggested earlier.

You can find the “Flow” UI in the “ui-dev” branch of the SwiftRiver repo: https://github.com/ushahidi/SwiftRiver/tree/ui-dev

As I discussed before, this approach offers the ability to save filters and distinguish them as either permanent or temporary—but through language on the frontend that’s more consistent with the rest of the app.

SCREENSHOT: http://cl.ly/image/0Q1T2q0C0m2c

To designate a group of filters as temporary, the user effectively makes the group “for their eyes only.” To do this, they select a filter group’s settings and designate “Who can see this group” as “Only you.” Then the filter is applied, but only for that user—it’s not part of the river’s overall makeup.

Take a look and let me know if there are any holes for me to fill.

@69mb 69mb closed this Dec 13, 2012
@69mb
Copy link
Contributor

69mb commented Dec 13, 2012

Closing this pull request. Superseded by rules.

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.

4 participants