wazedev / wme-place-harmonizer Goto Github PK
View Code? Open in Web Editor NEWHarmonize, format, and lock Waze places
Harmonize, format, and lock Waze places
I noticed WMEPH doesn't "use strict".
I want to know what you guys think about maybe as a part of the refactoring process, attempting to "use strict" coding practices in an effort to reduce "loose" code.
Advantages:
Disadvantages:
What are your thoughts?
Waze has a save error when a place has the same open and close times set (e.g. 9a-9a). This was not generated by WMEPH, but it would be nice if it checked for the issue.
PNH is not replacing approved name in some cases. Examples include Country Inns & Suites by Carlson, and some hotels with "localizers"
The localizers would be ideally saved, but the PNH name would need to replace the matched search name.
When this occurs users are not able to follow the PNH sheet as the script intends. This is a mild bug, as it does not make WMEPH stop working, but it is a High priority because the script is not working as intended with the PNH Sheet.
Under WMEPH tab, Highlighter settings:
Add option: [ ] Disable highlighting for lock > user
Review and address any missing PLA flags, such as blue for missing details.
Feature request, to allow people to verify correct Google link.
note from readme. **Note that for some app-submitted places, no state name is stored. In these cases, you have to enter at least a city and street in the address field for the script to run.
It would be ideal to fix this issue. however this has been an issue for a long time.
If 24/7 is "on" and you click any other services icon, it turns 24/7 off (doesn't affect the actual hours). One report said that other icons are also affected, but it isn't consistent. Also noticed that clicking 24/7 when hours already exist doesn't seem to work as expected. And adding hours manually doesn't cause 24/7 to turn off (not sure if it used to, but it should).
Waze seems to have its own ideas as to what the "primary" category of a place should be, regardless of the order we put the categories in. WMEPH should look to see if any of the assigned categories for a place are area types before making a recommendation to convert to a point place.
Rest area checks not functioning as intended.
Currently for point Hospital/Medical the script attempts to guess if something looks like a hospital and offers to convert to Offices. But in a great many cases it guesses wrong and only offers the option to change to area.
I'd like to suggest that for these point places the option of "Convert to Area" and "Convert to Offices" should be universally available, without trying to guess
Entering "M-F: 10-7" yields "Mon-Fri 10:00-07:00". Should be "Mon-Fri 10:00-19:00"
Idea: Add field to insert entire address, then parse into separate fields.
Example: Place has an inferred city, incorrect street, no house number.
Copy and paste entire correct address in:
Add address: [ 123 Correct St., Americaland, US ]
It parses and overwrites the incorrect data.
We need to fully identify and document modifiers for WMEPH worksheet in the PNH sheet so we can continue to maintain the functionality of the script.
Items such as notAbank and brandParent# etc. need to be documented so others can maintain it.
Categorizing this a major bug because it could affect a lot of places (not sure). It affects at least some (all?) places that don't have an address.
This line:
W.geometryEditing.editors.venue.navigationPoint.lonlat.toPoint();
Causes this console error:
VM796:6207 Uncaught TypeError: Cannot read property 'venue' of null
at WMEPH_inferAddress (eval at <anonymous> (:2:297), <anonymous>:6207:38)
at harmonizePlaceGo (eval at <anonymous> (:2:297), <anonymous>:3084:47)
at harmonizePlace (eval at <anonymous> (:2:297), <anonymous>:1637:21)
at HTMLInputElement.btn.onclick (eval at <anonymous> (:2:297), <anonymous>:5119:25)
JustinS83 says:
Failing to infer the address
W.geometryEditing.venue no longer exists
Was changed because of upcoming multiple entry/exit points
You have to iterate the array
selectedItem.model.attributes.entryExitPoints
At this point, just pull [0]
Maybe a simple fix?
The URL's and phones will probably be standard at least by the region.
Idea: Add Input box for missing URL (like phone).
This is a radical idea, but I think a good one. Typescript is a definitely typed version of Javascript that my team at work uses. We code in TS and then use the typescript transpiler to render as plain Javascript.
Running this way has all but eliminated the plague of runtime type errors that Javascript is prone to because type errors are caught by the IDE. Also gives you excellent intellisense capability.
Like I said we've had a lot of success with typescript at work and I personally think it takes most of the pain of Javascript out of the equation while keeping its flexibility
Street name does not copy when using place cloning tools.
One big monolithic file makes it harder to track down issues. Splitting the code into separate files based on logical relationships (say the hours parser could have its file or group of files, the services buttons another). This makes maintenance and development of new features much easier. You would then run a minifier to combine everything into a single script for tampermonkey to consume
Would factor in to both completion and highlighting levels. Personally, I'd like to see it be a requirement for Green.
Ultimate dream would be if it could be automatically found by the script and proposed for verification. But that's probably for another day.
Add hours not working, replace all fully functional
Need to detect when multiple versions of wmeph are running and inform the user to remove or disable the old versions. The code is in the script to detect when beta and prod are running at the same time, we need to fix the names in the script so that works again, however when running two production versions or two beta versions the script can cause issues with itself.
So, I was working on capitalization functions and in order to easily find the process that takes place when the script button is pressed, I added some logging. This was the result of ONE button press on ONE venue with ONE name (and two alternate names):
WMEPH-Beta: Running script on selected place...
First round of function calls:
Calling toTitleCase() from line 2241.
toTitleCase(Herndon - Monroe Deck #250 (customers only)) was called.
Calling toTitleCase() from line 2246.
toTitleCase(Herndon Monroe Parking) was called.
Calling toTitleCase() from line 2246.
toTitleCase(Herndon-Monroe Park & Ride) was called.
Second round:
Calling toTitleCaseStrong() from line 2901.
toTitleCaseStrong(Herndon - Monroe Deck #250 (Customers Only)) was called.
Calling toTitleCase() from line 2976.
toTitleCase(Herndon Monroe Parking) was called.
Calling toTitleCase() from line 2976.
toTitleCase(Herndon-Monroe Park & Ride) was called.
Third round:
Calling toTitleCase() from line 2241.
toTitleCase(Herndon - Monroe Deck #250 (Customers Only)) was called.
Calling toTitleCase() from line 2246.
toTitleCase(Herndon Monroe Parking) was called.
Calling toTitleCase() from line 2246.
toTitleCase(Herndon-Monroe Park & Ride) was called.
Fourth round:
Calling toTitleCaseStrong() from line 2901.
toTitleCaseStrong(Herndon - Monroe Deck #250 (Customers Only)) was called.
Calling toTitleCase() from line 2976.
toTitleCase(Herndon Monroe Parking) was called.
Calling toTitleCase() from line 2976.
toTitleCase(Herndon-Monroe Park & Ride) was called.
Fifth:
Calling toTitleCase() from line 2241.
toTitleCase(Herndon - Monroe Deck #250 (Customers Only)) was called.
Calling toTitleCase() from line 2246.
toTitleCase(Herndon Monroe Parking) was called.
Calling toTitleCase() from line 2246.
toTitleCase(Herndon-Monroe Park & Ride) was called.
Sixth:
Calling toTitleCaseStrong() from line 2901.
toTitleCaseStrong(Herndon - Monroe Deck #250 (Customers Only)) was called.
Calling toTitleCase() from line 2976.
toTitleCase(Herndon Monroe Parking) was called.
Calling toTitleCase() from line 2976.
toTitleCase(Herndon-Monroe Park & Ride) was called.
As far as workflow goes, I think we should create separate issues for each inefficiency we find. As long as we add them to the "Refactor 2017" project, it shouldn't be an issue. But this way, as we tackle individual problems, we can scratch them off, instead of trying to fix them all under one issue.
Some places don't list am/pm and it's easy to copy/paste and forget about it. We should add some way to verify that the hours being added are am/pm.
When making a PM bug report, for multiple match, include the row numbers in the subject.
Include a PL of the location in question for testing. I might be able to fix this myself, but I'd appreciate a quick fix on this.
Feature request. Does this make sense in WMEPH?
Add something in wmeph like jnf had that limited the distance when searching for linked places
There are multiple bootstrap and external setTimeout functions that run before anything gets done. I don't see any need for the setTimeout functions that don't serve a "wait a moment before retrying" purpose. Those could be stripped down. I would recommend a bootstrap that waits for necessary Waze functionality to load, then calls a single init function. The init function would handle calling any other functions that load external resources, set up the initial UI, and then wait for any async functions to finish before adding listening events.
Adding House Number with no street and no city results in an unsaved change, but doesn't add the house number.
This is due to the fact that WMEPH strips http:// in the beginning of the address and then adds it back on later when creating the button. Technically, a normalized URL (in IT perspective) is made up of a protocol, domain, then resource in the format: protocol://domainname/resource?key1=value1&key2=value2 (etc.)
Line 776:
var m = s.match(/^http:\/\/(.*)$/i); // remove http://
Won't match "https://". It could be easily fixed to match either, but then the protocol would still get stripped, and some websites don't perform a URL rewrite on http requests to change them to https.
There are three options to solve this problem:
/^https?:\/\/(.*)$/i);
and hope that when the URL gets http:// added back again, the website forces a URL rewrite on their end.openPlaceWebsiteURL = 'http:\/\/' + newURL;
to
if ( /^http:/.test(newURL) ) {
openPlaceWebsiteURL = 'http:\/\/' + newURL;
}
Currently, unnamed PLA's can't be locked because they are "red". nzahn stated that he thought this was a potential problem due to the # of (legitimate) unnamed PLA's that will probably be created in the future.
Some ideas:
Use shared / merged whitelists. This sounds good in theory, but I don't know if it works in practice. People tend to keep to themselves and rarely, if ever, share whitelists. However, if there were shared whitelists by region and/or state, and these were actively promoted and maintained by RC's and/or SM's, this would seem more feasible.
Don't flag/lock PLA's with missing names. Probably not a good idea if we want to encourage naming PLA's that really need a name.
Allow manual locking of unnamed PLA's. If user manually locks, it's assumed the name was intentionally left blank and flag can be removed.
Create a slightly different outline for unnamed PLA's vs named PLA's. Users can see there's something different about them, but they don't show up bright red and visually pollute the map.
Wmeph adds a space to the primary names of hotels. This is a low priority minor bug because WME automatically fixes this issue.
... And I do mean slightly. I am willing to bet a lot of WMEPH users are older and their eyesight might not be so good.
One major win would be altering the bullet list so there wouldn't be so much wasted space between the bullets and the text. That and it looks a bit tacky.
Would require adding a column to the PNH spreadsheet to identify old / obsolete business names that should be removed or renamed. Then the code can change the highlight for those to red, or something else to draw attention.
I haven't done a study but off the top of my head I would estimate that about 15% of the URs I fix could have been prevented were the pin for the place GLinked to its google equivalent.
As such I wanted to suggest that we have some way of flagging that a place isn't fully complete if it isn't GLinked. I would say this behavior would only be enabled for editors of a rank to be able to GLink a place. I was thinking leave it blue, Josh suggested adding another color option. The specifics can be worked out, I just wanted to request some means of flagging these places (Needs to be white-listable)
Places are initially assigned a temporary negative ID value starting at -100 (and decrementing with each new place) until they are saved and they receive their permanent ID. The temporary ID is stored in the whitelist if applied before the place is saved. Once saved, the place "loses" its WL. Also, the next time the page is refreshed, the starting ID value for new places resets to -100, so any whitelisted issues previously assigned to those negative ID's will be applied to new places (though they will also "lose" them once saved).
A couple potential options:
From a usability perspective, item 1 would be the best option if it is possible.
Don't capitalize any words inside parentheses for PLA's.
example: Denny's Parking Lot (customers only)
Occasionally I'll run across a place with a phone number spelled out in letters (E.G. White Castle's official phone number is 1-800-THE-CRAVE). The phone number parser should be able to parse out what numbers those correspond to in a traditional phone keypad
Per press of the run button pnh only updates one or two fields from the PNH sheet
I'd like to see a "zoom to place" button on the script.
I see two main use cases:
The applyHighlightsTest
function is called repeatedly whenever multiple changes are applied, e.g. when Run WMEPH changes several fields. It's caused by this code in bootstrapWMEPH_CH
function:
// Add listeners
W.model.venues.on('objectschanged', function (e) {
applyHighlightsTest(e);
});
So every time a venue is changed, the function is called. To fix this, we could add a global boolean value (call it _disableHighlightsTest
or something like that) and set it to TRUE whenever multiple updates need to be made. Then set it back to false afterward and then call applyHighlightsTest
manually.
Change the bootstrapWMEPH_CH
function to look like this:
// Add listeners
W.model.venues.on('objectschanged', function (e) {
if(!_disableHighlightsTest) {
applyHighlightsTest(e);
}
});
This is related to pnh matching. the script is setting parking lots to categories that are matched to a pnh place.
Re: [Script] WME Place Harmonizer: Version 1.1, Mar 2016
postby benandjerry » Thu Dec 15, 2016 4:01 am
Not sure if feasible, but can the PH recommend an expected lot size (amount of cars)?
I did some size vs. surface area measurements and found that a decent average is 3 cars per 1000sq.ft.
Using the toolbox measurement tool for surface area it is then easy to divide the area by 1000 and multiply by 3 to get to the average amount of cars for the lot.
This is an internal enhancement that RavenDT and I believe would help code readability / stability, eliminate some bugs, and help prevent new ones from appearing.
This will be a big undertaking, so deciding on when / how to implement will be important. I recommend that we finish tackling any MAJOR bugs, then work on a refactoring plan. Once we are ready to start, create a new branch off of Beta. Any minor bug fixes done in Beta after that point should also be fixed in the new branch so they are not re-introduced later.
We believe this should be done as soon as possible, while maintaining the major functionality in the Beta version, i.e. ignore minor Issues as much as possible until the refactoring is complete, and add a "this is in the refactored code" comment to any Issues that are solved during refactoring.
Let's discuss further, once all major bugs are tackled...
One big monolithic file makes it harder to track down issues. Splitting the code into separate files based on logical relationships (say the hours parser could have its file or group of files, the services buttons anoth
Check the distance between the Google place and the WME place. Make the flag distance a customizable option.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.