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

Content modelling/628 organisation by user #9565

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

Harriethw
Copy link
Contributor

@Harriethw Harriethw commented Oct 28, 2024

  • set the default organisation to the user's when viewing content blocks, and set the session params as in Whitehall
  • also change the 'none' option to say 'All organisations'

Screenshot 2024-10-28 at 16 59 21


⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

Follow these steps if you are doing a Rails upgrade.

@Harriethw Harriethw marked this pull request as ready for review October 28, 2024 17:10
@Harriethw Harriethw marked this pull request as draft October 28, 2024 17:11
@Harriethw Harriethw force-pushed the content-modelling/628-organisation-by-user branch from ed96457 to 9fc8ed2 Compare October 29, 2024 11:06
This mimics the default behaviour when viewing all
Documents in Whitehall:
* if there are no filters provided, then the
  user's organisation is set as the lead
  organisation
* otherwise we take from the session so that their
  search is not lost between page navigations.

This does make other integration and feature tests
a bit complicated - as the first time a user goes
to the page their organisation will be set as a
filter. In the feature tests I'm checking that and
then setting to 'All organisations' to ensure the
scope of other tests is set to specific filters.
@Harriethw Harriethw force-pushed the content-modelling/628-organisation-by-user branch from 9fc8ed2 to a56e699 Compare October 29, 2024 11:14
@Harriethw Harriethw marked this pull request as ready for review October 29, 2024 11:17
Copy link
Contributor

@pezholio pezholio left a comment

Choose a reason for hiding this comment

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

LGTM - one minor suggestion

}
end
end

def options_for_lead_organisation
[all_organisations_option].push(*taggable_organisations_options)
Copy link
Contributor

Choose a reason for hiding this comment

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

Would [all_organisations_option, taggable_organisations_options].flatten be more readable here?

again mimic-ing what Whitehall have on their
filters, and makes it clearer to the user what
they are selecting.
@Harriethw Harriethw force-pushed the content-modelling/628-organisation-by-user branch from a56e699 to 37e6e07 Compare October 29, 2024 11:50
@Harriethw Harriethw merged commit 1e34fa8 into main Oct 29, 2024
19 checks passed
@Harriethw Harriethw deleted the content-modelling/628-organisation-by-user branch October 29, 2024 11:56
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.

2 participants