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

Refactor embed.js.erb with layers.yml #5571

Closed
wants to merge 10,000 commits into from

Conversation

hlfan
Copy link
Contributor

@hlfan hlfan commented Jan 29, 2025

Like #5550 but with reading the layers.yml file instead of duplicating information

AntonKhorev and others added 30 commits December 31, 2024 23:37
This function doesn't update any existing marker.
This function adds a marker to notes layer. This controller doesn't need to do anything with markers of existing notes.
We want the new note marker in the same layer with its halo. Also we don't want to put anything in noteLayer because it clears its contents on certain zoom levels.
newHalo() wasn't always creating new halos. It had an event type argument that was checked against drag event. Depending on this check, newHalo() could remove the halo.
This ensures that marker is always added/removed together with its halo.
It was also called from noteCreated() but that triggered page.unload() via OSM.router.route().
Same reasons as in the previous commit.
Note that addNoteButton.hasClass("active") check in page.load is useless because page.unload removes this class.
If not done, it's possible to lose the marker when starting from low zooms.
It was supposed to mean that the block is past its end date but still wasn't read by the user. That turned out to be confusing because although it said "expired", such blocks were active.
Copy link

1 Warning
⚠️ Merge commits are found in PR. Please rebase to get rid of the merge commits in this PR, see CONTRIBUTING.md.

Generated by 🚫 Danger

@hlfan hlfan closed this Jan 30, 2025
@hlfan hlfan deleted the embed-unified-layers branch January 30, 2025 06:23
@hlfan hlfan restored the embed-unified-layers branch January 30, 2025 06:27
@hlfan hlfan reopened this Jan 30, 2025
@hlfan
Copy link
Contributor Author

hlfan commented Jan 30, 2025

Ok I don't think I could've failed harder in squashing the previous commits 🫠

Copy link
Member

@tomhughes tomhughes left a comment

Choose a reason for hiding this comment

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

The code changes here look great now but the commit history is rather messy - can we get rid of the merges please and rebase it instead? and merge any fixup commits into the thing they're fixing - having two Refactor embed.js.erb with layers.yml commits in one PR can't be right.

hlfan and others added 2 commits February 1, 2025 05:46
Remove other whitespace in layerId too

Consolidate options destructuring

Add Sprockets directive
@hlfan hlfan closed this Feb 1, 2025
@hlfan hlfan deleted the embed-unified-layers branch February 1, 2025 04:49
@hlfan hlfan restored the embed-unified-layers branch February 1, 2025 04:54
@hlfan
Copy link
Contributor Author

hlfan commented Feb 1, 2025

The code changes here look great now but the commit history is rather messy - can we get rid of the merges please and rebase it instead? and merge any fixup commits into the thing they're fixing - having two Refactor embed.js.erb with layers.yml commits in one PR can't be right.

Well, I tried to and failed miserably, as you may have seen. I fixed it in another branch, but as PRs can't have the source branch changed, I opened #5580.

@tomhughes
Copy link
Member

You don't need to "change the source branch" because the source branch will still be master.

What you need to do is to rebase, and then force push.

@hlfan hlfan deleted the embed-unified-layers branch February 1, 2025 09:04
@hlfan hlfan restored the embed-unified-layers branch February 1, 2025 09:04
@hlfan hlfan reopened this Feb 1, 2025
@hlfan hlfan changed the base branch from master to forms February 1, 2025 09:05
@hlfan hlfan closed this Feb 1, 2025
@hlfan hlfan deleted the embed-unified-layers branch February 1, 2025 09:05
@hlfan
Copy link
Contributor Author

hlfan commented Feb 1, 2025

But I don't want to pull from the master anyway but from my dev branch, the master should stay the target branch (why would I want to change that now).

What you need to do is to rebase, and then force push.

What do you think have I been trying to do? Unnecessarily messing up the commit history? This is what I get for trying to follow CONTRIBUTING.md

@AntonKhorev
Copy link
Collaborator

git rebase master your-branch-name

@tomhughes
Copy link
Member

In this case git rebase -i master is probably better so you can then choose to fold some of the fixup commits into the thing they're fixing, and then git push -f to force push the result.

But it you've done a separate PR now then I can review that instead so probably no point in redoing this one now, just something to bear in mind for the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants