-
Notifications
You must be signed in to change notification settings - Fork 6
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
[#8661] Add 'Save Profile' button #5940
Conversation
@vellip Thanks for reviewing the other PR before it inadvertently closed! I've tackled all of code changes and commit suggestions from the previous PR in this one. I'll list what I commented on, so we can keep track of them (or talk about them in here): I thought the name is generated by the backend? Should we add an anchor link to the particular profile in question? ...#search-profile-3 |
a3fa4d1
to
1a072c4
Compare
@sevfurneaux the name is generated as |
Thanks @m4ra. I actually implemented this due to it being noted in the #8661
But presumably it wasn't updated prior to the ticket being created for the backend implementation. Hopefully that won't happen again! 🤞 Ok, so shall I remove my implementation? Presumably you'll add the additional functionality beyond |
@sevfurneaux That's getting more confusing now. No, we are not implementing naming based on metadata. @janeklqd can you please clarify whether we save the names as autogenerated with
|
districts = AdministrativeDistrict.objects.all() | ||
district_names_list = [district.name for district in districts] | ||
district_names_list.append(str(city_wide)) | ||
return json.dumps(district_names_list) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@goapunk any idea if the district polygons are used anywhere outside the plans, anything to do with bplans? Since @sevfurneaux is removing these methods, would be good to double check with you as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sevfurneaux the map on the project list will not be highlighting the district borders any more? If that's the case I think removing this is fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, only a check for the user that is not required, and waiting for Julien to confirm we are not in need of the district_polygons context.
@@ -119,6 +137,12 @@ def get_search_profile(self): | |||
pass | |||
return None | |||
|
|||
def get_search_profiles_count(self): | |||
if self.request.user.is_authenticated: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK no need for this check, as the view is allowed only to registered users. Same in the get_search_profile
method above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, verified, we don't need these authentication checks, they are inherited from adhocracy4 as a mixin in this view class declaration above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks. But this view is for the plans map (/projects
) page, so users can be unauthenticated here, so we'll still need it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed, as this page can be viewed by anyone I think we need the check
@m4ra thank you! Looks like there's |
|
||
useEffect(() => { | ||
const handlePopState = () => { | ||
window.location.reload() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try replaceState
instead of pushState
so we don't need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just changed to replaceState
👍. I misunderstood replaceState
, thanks! So now when the user uses back/forward it goes to the previous page.
We should usually, but let's move on with this. Once Julian confirms, you can merge it. |
1a072c4
to
b3826a4
Compare
@sevfurneaux hey :) will have a look later today! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sevfurneaux looks good to me, I left a question for you regarding the district polygons, if the answer is positive then go ahead and merge. Ignoring the coveralls check is ok
districts = AdministrativeDistrict.objects.all() | ||
district_names_list = [district.name for district in districts] | ||
district_names_list.append(str(city_wide)) | ||
return json.dumps(district_names_list) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sevfurneaux the map on the project list will not be highlighting the district borders any more? If that's the case I think removing this is fine
@@ -119,6 +137,12 @@ def get_search_profile(self): | |||
pass | |||
return None | |||
|
|||
def get_search_profiles_count(self): | |||
if self.request.user.is_authenticated: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed, as this page can be viewed by anyone I think we need the check
Thanks for reviewing @goapunk.
From testing, ...but |
I never saw any designs highlighting district borders anymore with the redesign. |
b3826a4
to
f6645e4
Compare
Describe your changes
This PR adds the "Save Search Profile" button.
Tasks