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

Flatten converted all expression filters #7679

Merged
merged 1 commit into from
Dec 6, 2018
Merged

Conversation

elifitch
Copy link
Contributor

@elifitch elifitch commented Dec 6, 2018

When converting a legacy filter to an expressionized all expression filter, you could see nested all expressions with only one element. This PR removes that redundant nested all expression.

I think maybe an example would demonstrate this better:

// Legacy filter
[
  "all",
  [
    "in",
    "$type",
    "Polygon",
    "LineString",
    "Point"
  ],
  [
    "all",
    ["in", "type", "island"]
  ]
]

// Converted (before this PR)
[
  "all",
  [
    "match",
    ["geometry-type"],
    ["Polygon", "LineString", "Point"],
    true,
    false
  ],
  [
    "all",
    [
      "match",
      ["get", "type"],
      ["island"],
      true,
      false
    ]
  ]
]

// Converted (after this PR)
[
  "all",
  [
    "match",
    ["geometry-type"],
    ["Polygon", "LineString", "Point"],
    true,
    false
  ],
  [
    "match",
    ["get", "type"],
    ["island"],
    true,
    false
  ]
]

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • document any changes to public APIs
  • tagged @mapbox/studio and/or @mapbox/maps-design if this PR includes style spec changes

cc @mapbox/studio @mapbox/maps-design

@elifitch elifitch force-pushed the flatten-converted-filter branch from 7704b52 to 6d2580e Compare December 6, 2018 17:42
Copy link
Contributor

@asheemmamoowala asheemmamoowala left a comment

Choose a reason for hiding this comment

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

Pending test name change.

@@ -100,6 +100,45 @@ test('convert legacy filters to expressions', t => {
t.end();
});

t.test('foople barp garp', (t) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use an appropriate and descriptive name for the test.

@elifitch
Copy link
Contributor Author

elifitch commented Dec 6, 2018

oh my god @asheemmamoowala 🤦‍♂️* ∞

@elifitch elifitch force-pushed the flatten-converted-filter branch from 6d2580e to 2274ff1 Compare December 6, 2018 18:28
@elifitch elifitch merged commit 7ddbfa2 into master Dec 6, 2018
@elifitch elifitch deleted the flatten-converted-filter branch December 6, 2018 18:36
katydecorah pushed a commit that referenced this pull request Jan 23, 2019
* publisher-production: (115 commits)
  fix inter-documentation link (#7791)
  [docs] use docs subdomain in examples (#7789)
  Bump Publisher
  First shot at new-domain staging
  [docs] Update page shell (#7760)
  updates API docs links to new url structure (#7757)
  add mapbox-gl-utils to plugins (#7752)
  [docs] Use docs-page-shell (#7742)
  Fixes bugs in documentation (#7741)
  Add worldviews example (#7720)
  Update compatibility matrix for `fill-extrusion-vertical-gradient` for ios & macos. (#7712)
  updates mapbox-gl-directions version in example (#7719)
  v0.52.0
  cherry-pick color state fix to release branch (#7715)
  Update location of drone video used in examples.
  v0.52.0-beta.2
  Cache hillshade textures based on texture size, not tile size. (#7695)
  avoid incomplete webp support in Edge 18 (#7687) (#7692)
  only align raster sources to pixel grid when map is idle to prevent shaking (#7426) (#7694)
  Flattens nested single element all expressions when converting to expressions (#7679)
  ...
katydecorah pushed a commit that referenced this pull request Jan 23, 2019
* publisher-production: (115 commits)
  fix inter-documentation link (#7791)
  [docs] use docs subdomain in examples (#7789)
  Bump Publisher
  First shot at new-domain staging
  [docs] Update page shell (#7760)
  updates API docs links to new url structure (#7757)
  add mapbox-gl-utils to plugins (#7752)
  [docs] Use docs-page-shell (#7742)
  Fixes bugs in documentation (#7741)
  Add worldviews example (#7720)
  Update compatibility matrix for `fill-extrusion-vertical-gradient` for ios & macos. (#7712)
  updates mapbox-gl-directions version in example (#7719)
  v0.52.0
  cherry-pick color state fix to release branch (#7715)
  Update location of drone video used in examples.
  v0.52.0-beta.2
  Cache hillshade textures based on texture size, not tile size. (#7695)
  avoid incomplete webp support in Edge 18 (#7687) (#7692)
  only align raster sources to pixel grid when map is idle to prevent shaking (#7426) (#7694)
  Flattens nested single element all expressions when converting to expressions (#7679)
  ...
katydecorah pushed a commit that referenced this pull request Jan 25, 2019
* initial layout

* clean up style spec layout

* clean up examples page

* fix links in style spec toc

* split style spec

* add examples landing page

* update plugins page layout

* format roadmap page

* fix icon positioning

* delete generated bench files

* address @mollymerp's feedback

* update dr ui version

* clean up console errors

* refactor page shell

* use docs-page-shell; update dr-ui and assembly; remove ProductDropdown

* fix spacing; add borderRadius

* various spacing, sizing

* remove additional space between h2  h3 siblings

* runs eslint --fix on component files

* remove unused lines; linting fixes

* navigation style updates: make link `link--gray` indent nested items

* add spacing to code blocks

* remove `color-gray` from non link elements

* api item + member styling

* remove base classes from /plugins; fix heading spacing

* use mr-ui copy-button in copyable.js

* run eslint --fix on docs/pages, docs/util

* linter fixes

* heading spacing for mobile

* rework copyable to use codesnippet

* add hover class to simple-map card

* make examples header consistent with other headers

* turn off h2 borders for the api section as they clash with the instance members toggle sections; max height and pretty scroll for code examples

* remove unused css

* adds hover state

* replace color-gray-light with color-gray; it's too light on white backgrounds

* remove padding conditional

* rm unused file

* break style-spec into components

* make tocnote link--gray

* adds back top padding to ApiItemMember

* set borderRadius on table rows

* readjust border on ApiItemMember

* adds txt-break-word to overflowing code blocks

* adds style spec to header

* light header adjustments

* style error note

* Merge branch 'publisher-production' into docs-redesign

* publisher-production: (115 commits)
  fix inter-documentation link (#7791)
  [docs] use docs subdomain in examples (#7789)
  Bump Publisher
  First shot at new-domain staging
  [docs] Update page shell (#7760)
  updates API docs links to new url structure (#7757)
  add mapbox-gl-utils to plugins (#7752)
  [docs] Use docs-page-shell (#7742)
  Fixes bugs in documentation (#7741)
  Add worldviews example (#7720)
  Update compatibility matrix for `fill-extrusion-vertical-gradient` for ios & macos. (#7712)
  updates mapbox-gl-directions version in example (#7719)
  v0.52.0
  cherry-pick color state fix to release branch (#7715)
  Update location of drone video used in examples.
  v0.52.0-beta.2
  Cache hillshade textures based on texture size, not tile size. (#7695)
  avoid incomplete webp support in Edge 18 (#7687) (#7692)
  only align raster sources to pixel grid when map is idle to prevent shaking (#7426) (#7694)
  Flattens nested single element all expressions when converting to expressions (#7679)
  ...

* update batfish, react, and react-dom

* rm unused module

* update mr-ui and github-slugger

* adds version var to OverviewHeader

* mb-pages -> publisher-production

* fix bool on iframe

* clean up page shell to fix build errors

* update/add pathname; add descriptions

* make toggles buttons for acessbility; increase hit box; make icon larger; do not change location on click

* use push state to change hash on click, but not to move page

* update dr-ui

* adds interactiveClass and sideBarColSize

* smaller sidebar on spec

* adds addtional padding to h3s on api page to clear the sticker

* make hit box larger for nav items on sidebard

* adjust topbarstick columns when `sidebarColSize` is set

* adds make-table-scroll plugin; make non markdown table scroll

* remove extra docs-content ids

* make table scroll; wrap code

* reorder tabs

* adds back to top button long pages

* update dr-ui

* sets unStickWidth on TopbarSticker

* Update batfish.config.js

* Update yarn.lock

* adds unit tests for examples

* fix tests

* add missing images

* adds test to make sure every example as a thumbnail image

* compress images

* resize thumbnail images to 1200 x 500

* compress again

* add a little wiggle room for image size

* updates documentation for tags and adds information about example thumbnail images
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