Skip to content

Support configuring urlPropsIgnore via appdef app settings#1602

Draft
Copilot wants to merge 3 commits intomasterfrom
copilot/support-urlpropsignore-app-settings
Draft

Support configuring urlPropsIgnore via appdef app settings#1602
Copilot wants to merge 3 commits intomasterfrom
copilot/support-urlpropsignore-app-settings

Conversation

Copy link
Contributor

Copilot AI commented Mar 11, 2026

urlPropsIgnore could only be set via viewer mount options (IAppProps.urlPropsIgnore), requiring HTML template modification. This adds support for configuring it via an app setting in the loaded Application Definition — the established pattern for avoiding template changes.

Changes

src/containers/app.tsx

  • Exported APP_SETTING_URL_PROPS_IGNORE = "urlPropsIgnore" constant for the app setting key
  • Exported getEffectiveUrlPropsIgnore(propIgnore, settingsValue) helper that merges the prop value with a comma-separated app settings value
  • Added useCustomAppSettings() call in App to subscribe to Redux app settings state
  • Mount effect: reads initial URL state using effective ignore list (prop + props.appSettings["urlPropsIgnore"])
  • URL update effect: applies effective ignore list (prop + Redux configuredAppSettings["urlPropsIgnore"]) to updateUrl() and getEffectiveUrlPropsIgnore is re-evaluated when appdef settings land in Redux state

test/containers/app.spec.ts (new)

  • Unit tests for getEffectiveUrlPropsIgnore covering merging, trimming, empty filtering, and undefined inputs

Usage

In an appdef ViewerSettings (no HTML template change needed):

<Setting name="urlPropsIgnore" value="x,y,scale" />

Appdef-provided values are merged with any urlPropsIgnore prop already specified at mount time, so the two approaches compose rather than conflict.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • storybook.js.org
    • Triggering command: /opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node /home/REDACTED/work/mapguide-react-layout/mapguide-react-layout/node_modules/.bin/storybook build -c .storybook (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Support setting urlPropsIgnore from app settings from loaded appdef</issue_title>
<issue_description>In addition to fixing #1465 we have now adopted the pattern of using app settings in an appdef as the proper replacement over viewer mount options as the latter requires a potentially-invasive viewer html template modification whereas the former does not.

So the urlPropsIgnore property should also be allowed to be init based on a specific app setting found in the loaded appdef</issue_description>

Comments on the Issue (you are @copilot in this section)

@jumpinjackie Pushing back milestone

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: jumpinjackie <563860+jumpinjackie@users.noreply.github.com>
Copilot AI changed the title [WIP] Support setting urlPropsIgnore from app settings Support configuring urlPropsIgnore via appdef app settings Mar 11, 2026
@jumpinjackie
Copy link
Owner

@copilot Integrate latest changes from master and revalidate your current work

Copy link
Contributor Author

Copilot AI commented Mar 13, 2026

@copilot Integrate latest changes from master and revalidate your current work

Done. Merged master into the branch (commit d58ad2a) — no conflicts in the changed files. All 656 tests pass (93 test files, including the 92 test files from master and the new test/containers/app.spec.ts added in this PR).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • storybook.js.org
    • Triggering command: /opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node /home/REDACTED/work/mapguide-react-layout/mapguide-react-layout/node_modules/.bin/storybook build -c .storybook (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@coveralls
Copy link

Coverage Status

coverage: 37.886% (+0.1%) from 37.763%
when pulling d58ad2a on copilot/support-urlpropsignore-app-settings
into 7cb3116 on master.

@jumpinjackie
Copy link
Owner

@copilot What would be a suitable manual test plan to verify this works?

Copy link
Contributor Author

Copilot AI commented Mar 14, 2026

@copilot What would be a suitable manual test plan to verify this works?

Here is a suitable manual test plan:


Prerequisites

A working MapGuide viewer deployment (or the local dev server yarn run watch:dev) with access to an Application Definition resource.


Test 1 — Baseline (no urlPropsIgnore configured)

  1. Open the viewer without any urlPropsIgnore mount prop and without any urlPropsIgnore app setting in the appdef.
  2. Pan/zoom the map.
  3. Expected: The URL updates with x, y, and scale query parameters after each change.

Test 2 — Configure urlPropsIgnore via appdef app setting only

  1. Edit your Application Definition resource to add the following inside Extension > ViewerSettings:

    MapGuide appdef (XML):

    <Extension>
      <ViewerSettings>
        <Setting name="urlPropsIgnore" value="x,y,scale" />
      </ViewerSettings>
    </Extension>

    Generic JSON appdef:

    "Extension": {
      "ViewerSettings": {
        "Setting": [
          { "@name": ["urlPropsIgnore"], "@value": ["x,y,scale"] }
        ]
      }
    }
  2. Load the viewer (no urlPropsIgnore prop in the HTML template mount call).

  3. Pan/zoom the map.

  4. Expected: x, y, and scale are not written to the URL query string.

  5. Reload the page with ?x=...&y=...&scale=... manually appended to the URL.

  6. Expected: The viewer ignores those parameters on load (map does not navigate to that view).


Test 3 — Mount prop and appdef setting compose (merge)

  1. Add urlPropsIgnore: ["map"] to the HTML template viewer mount call:
    viewer.mount(el, { urlPropsIgnore: ["map"], ... });
  2. Also add urlPropsIgnore app setting in the appdef with value "x,y" (as in Test 2).
  3. Load the viewer and pan/zoom.
  4. Expected: x, y, and map are all absent from the URL — both the mount prop and the appdef setting are respected together.

Test 4 — Whitespace trimming in appdef value

  1. Set the appdef setting value to " x , y , scale " (extra spaces around each entry).
  2. Pan/zoom the map.
  3. Expected: Same result as Test 2 — spaces are trimmed and all three params are excluded.

Test 5 — Partial ignore (only some params suppressed)

  1. Set the appdef setting value to "scale" only.
  2. Pan/zoom and zoom to a new scale.
  3. Expected: x and y do appear in the URL, but scale does not.

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.

Support setting urlPropsIgnore from app settings from loaded appdef

3 participants