Compare commits

...

3 Commits

Author SHA1 Message Date
Joe Li
1d3d86ea13 chore(nvd3): delete unused vendored explore URL helpers
The vendored exploreUtils module in legacy-preset-chart-nvd3 exports
getURIDirectory and getExploreLongUrl, but nothing imports either one. The
only module used from that vendor directory is AnnotationTypes.ts, and the
file is not re-exported from the plugin's src/index.ts, so it is not part of
the package's API surface either.

Its `/superset/explore_json/` literal was the only reason this branch touched
the file; deleting it drops the literal outright rather than pointing dead
code at a canonical path. The live copy of the same helper in
preset-chart-deckgl, reached from Multi.tsx, keeps the `/explore_json/` path
set in the previous commit.

This leaves fast-safe-stringify -- now unused across the whole frontend --
still declared in the plugin's package.json. Removing it requires
regenerating package-lock.json, so it is better done on its own.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-22 12:12:26 -07:00
Joe Li
f1880ff77a Merge remote-tracking branch 'origin/master' into chore/drop-legacy-superset-prefix-remnants 2026-07-22 12:10:35 -07:00
Joe Li
b1242ab316 chore: drop legacy /superset prefix from remaining hardcoded URLs
Following #39925, which collapsed the historical `/superset/` prefix off
all canonical views, a few hardcoded literals still emit the old form and
rely on the closed-set 308 redirect shim (scheduled for removal at EOL
5.0.0). Point them at the canonical paths directly:

- deck.gl and legacy nvd3 `getURIDirectory()`:
  `/superset/explore_json/` -> `/explore_json/`
- filter-box -> native-filter migration markdown href:
  `/superset/slice/{id}/` -> `/slice/{id}/`

The migration-helper change only affects future upgrade runs; markdown
already written to migrated dashboards is untouched (and still shim-covered
until 5.0.0). No tests pin these literals, and `/explore_json/` and
`/slice/<int>/` are live routes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 14:54:17 -07:00
3 changed files with 2 additions and 71 deletions

View File

@@ -1,69 +0,0 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
// @ts-nocheck -- vendor file; not fully typed
/* eslint camelcase: 0 */
import URI from 'urijs';
import safeStringify from 'fast-safe-stringify';
const MAX_URL_LENGTH = 8000;
export function getURIDirectory(formData, endpointType = 'base') {
// Building the directory part of the URI
let directory = '/explore/';
if (['json', 'csv', 'query', 'results', 'samples'].includes(endpointType)) {
directory = '/superset/explore_json/';
}
return directory;
}
export function getExploreLongUrl(
formData,
endpointType,
allowOverflow = true,
extraSearch = {},
) {
if (!formData.datasource) {
return null;
}
const uri = new URI('/');
const directory = getURIDirectory(formData, endpointType);
const search = uri.search(true);
Object.keys(extraSearch).forEach(key => {
search[key] = extraSearch[key];
});
search.form_data = safeStringify(formData);
if (endpointType === 'standalone') {
search.standalone = 'true';
}
const url = uri.directory(directory).search(search).toString();
if (!allowOverflow && url.length > MAX_URL_LENGTH) {
const minimalFormData = {
datasource: formData.datasource,
viz_type: formData.viz_type,
};
return getExploreLongUrl(minimalFormData, endpointType, false, {
URL_IS_TOO_LONG_TO_SHARE: null,
});
}
return url;
}

View File

@@ -26,7 +26,7 @@ export function getURIDirectory(endpointType = 'base') {
// Building the directory part of the URI
let directory = '/explore/';
if (['json', 'csv', 'query', 'results', 'samples'].includes(endpointType)) {
directory = '/superset/explore_json/';
directory = '/explore_json/';
}
return directory;

View File

@@ -335,7 +335,7 @@ def migrate_dashboard(dashboard: Dashboard) -> None: # noqa: C901
meta["code"] = dedent(
f"""
&#9888; The <a href="/superset/slice/{slc.id}/">{slc.slice_name}
&#9888; The <a href="/slice/{slc.id}/">{slc.slice_name}
</a> filter-box chart has been migrated to a native filter.
"""
)