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

links from Profile page show users collections and works #4322

Merged
merged 1 commit into from
May 21, 2020

Conversation

blancoj
Copy link
Contributor

@blancoj blancoj commented May 20, 2020

This is a resubmission with some changes/improvements for the stale and closed PR:
#4024

Fixes #3478

With this change, if a user goes to the Profile page from the dashboard, and then tries to see a listing of works and collections created by the user, the listing should be presented.

The code originally used the params search_field and a value for q to search for the depositor. For example, search_field=depositor&q=user@abc.com and then it appended a facet to indicate if looking for a work or a collection. I could not get this to work. The search_field with q value did not really seem to do anything. So...I tried using facets for depositor value, and this seems to work just fine.

Guidance for testing, such as acceptance criteria or new user interface behaviors:

Since there is a change to the catalog controller generator, you will need to bundle exec rake engine_cart:generate, if you do not do this, it will still work, but the label for Depositor will not be right.
The user should have a few works and collections.
Go to the dashboard and select Profile from Your activity dropdown.
Click on Works created and then Collections created and make sure that the lists are accurate in both cases.

@samvera/hyrax-code-reviewers

@blancoj blancoj changed the title links from Profile page show users collections and works [WIP] links from Profile page show users collections and works May 20, 2020
@no-reply
Copy link
Contributor

is this ready for re-review, or still WIP?

@blancoj blancoj changed the title [WIP] links from Profile page show users collections and works links from Profile page show users collections and works May 21, 2020
@blancoj
Copy link
Contributor Author

blancoj commented May 21, 2020

@no-reply This can be reviewed now

@no-reply no-reply merged commit b04c41d into master May 21, 2020
@no-reply no-reply deleted the issue-3478-v2 branch May 21, 2020 19:24
jeremyf added a commit that referenced this pull request Sep 2, 2020
Prior to this commit, we could be passing the application controller's
`params` instead of of the local variable `params`.  This could result
in some unexpected behavior.

Note, in SHA @b04c41d2772505d8a548c3fd48774a5642d3ac90 we went from:

```ruby
params = { search_field: name, q: "\"#{value}\"" }
state = search_state_with_facets(params, facet_hash)
```

to

```ruby
params = { search_field: name, q: "\"#{value}\"" } if name != ''
state = search_state_with_facets(params, facet_hash)
```

The prior change meant that instead of always having the local variable
named `params`, we would sometimes fallback to the application's
`params` method.

I don't think this is a major issue, but one that could introduce some
unexpected results.

Related to #4322, #3478
jeremyf added a commit that referenced this pull request Sep 15, 2020
Prior to this commit, we could be passing the application controller's
`params` instead of of the local variable `params`.  This could result
in some unexpected behavior.

Note, in SHA @b04c41d2772505d8a548c3fd48774a5642d3ac90 we went from:

```ruby
params = { search_field: name, q: "\"#{value}\"" }
state = search_state_with_facets(params, facet_hash)
```

to

```ruby
params = { search_field: name, q: "\"#{value}\"" } if name != ''
state = search_state_with_facets(params, facet_hash)
```

The prior change meant that instead of always having the local variable
named `params`, we would sometimes fallback to the application's
`params` method.

I don't think this is a major issue, but one that could introduce some
unexpected results.

Related to #4322, #3478
no-reply pushed a commit that referenced this pull request Oct 7, 2020
Prior to this commit, we could be passing the application controller's
`params` instead of of the local variable `params`.  This could result
in some unexpected behavior.

Note, in SHA @b04c41d2772505d8a548c3fd48774a5642d3ac90 we went from:

```ruby
params = { search_field: name, q: "\"#{value}\"" }
state = search_state_with_facets(params, facet_hash)
```

to

```ruby
params = { search_field: name, q: "\"#{value}\"" } if name != ''
state = search_state_with_facets(params, facet_hash)
```

The prior change meant that instead of always having the local variable
named `params`, we would sometimes fallback to the application's
`params` method.

I don't think this is a major issue, but one that could introduce some
unexpected results.

Related to #4322, #3478
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.

"Works created" link on profile page does not return any results
2 participants