@datawheel/data-explorer 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.mjs +20 -13
- package/package.json +1 -1
package/dist/main.mjs
CHANGED
|
@@ -449,7 +449,7 @@ var vizbuilderTranslation = {
|
|
|
449
449
|
action_fileissue: "Report an issue",
|
|
450
450
|
action_retry: "Retry",
|
|
451
451
|
aggregator: {
|
|
452
|
-
average: "Average {{measure}}",
|
|
452
|
+
average: "Average walter {{measure}}",
|
|
453
453
|
max: "Max {{measure}}",
|
|
454
454
|
min: "Min {{measure}}",
|
|
455
455
|
sum: "{{measure}}"
|
|
@@ -2234,19 +2234,19 @@ function pickDefaultDrilldowns(dimensions) {
|
|
|
2234
2234
|
// src/hooks/useQueryApi.ts
|
|
2235
2235
|
function useServerSchema() {
|
|
2236
2236
|
const { tesseract } = useLogicLayer();
|
|
2237
|
-
const { serverURL,
|
|
2237
|
+
const { serverURL, defaultLocale } = useSettings();
|
|
2238
2238
|
return useQuery({
|
|
2239
|
-
queryKey: ["schema", serverURL,
|
|
2239
|
+
queryKey: ["schema", serverURL, defaultLocale],
|
|
2240
2240
|
queryFn: async () => {
|
|
2241
2241
|
const search = new URLSearchParams(location.search);
|
|
2242
|
-
const locale = search.get("locale");
|
|
2242
|
+
const locale = defaultLocale || search.get("locale") || void 0;
|
|
2243
2243
|
try {
|
|
2244
|
-
const schema = await tesseract.fetchSchema({ locale
|
|
2244
|
+
const schema = await tesseract.fetchSchema({ locale });
|
|
2245
2245
|
const cubes = schema.cubes.filter((cube) => !cube.annotations.hide_in_ui);
|
|
2246
2246
|
const cubeMap = keyBy(cubes, "name");
|
|
2247
2247
|
return {
|
|
2248
2248
|
cubeMap,
|
|
2249
|
-
locale:
|
|
2249
|
+
locale: defaultLocale || schema.default_locale,
|
|
2250
2250
|
localeOptions: schema.locales,
|
|
2251
2251
|
online: true,
|
|
2252
2252
|
url: serverURL
|
|
@@ -2254,7 +2254,7 @@ function useServerSchema() {
|
|
|
2254
2254
|
} catch (error) {
|
|
2255
2255
|
return {
|
|
2256
2256
|
cubeMap: {},
|
|
2257
|
-
locale:
|
|
2257
|
+
locale: defaultLocale || "",
|
|
2258
2258
|
localeOptions: [],
|
|
2259
2259
|
online: false,
|
|
2260
2260
|
url: serverURL
|
|
@@ -2340,12 +2340,18 @@ function useFetchQuery(queryParams, queryLink, options) {
|
|
|
2340
2340
|
if (withoutPagination) {
|
|
2341
2341
|
request.limit = "0,0";
|
|
2342
2342
|
}
|
|
2343
|
-
const response = await tesseract.fetchData({
|
|
2343
|
+
const response = await tesseract.fetchData({
|
|
2344
|
+
request,
|
|
2345
|
+
format: "jsonrecords"
|
|
2346
|
+
});
|
|
2344
2347
|
const content = await response.json();
|
|
2345
2348
|
if (!response.ok) {
|
|
2346
2349
|
throw new Error(`Backend Error: ${content.detail}`);
|
|
2347
2350
|
}
|
|
2348
|
-
const cubeData = await tesseract.fetchCube({
|
|
2351
|
+
const cubeData = await tesseract.fetchCube({
|
|
2352
|
+
cube: queryParams.cube,
|
|
2353
|
+
locale: queryParams.locale
|
|
2354
|
+
});
|
|
2349
2355
|
return {
|
|
2350
2356
|
data: content.data,
|
|
2351
2357
|
page: content.page,
|
|
@@ -3015,7 +3021,7 @@ function useTable({
|
|
|
3015
3021
|
handlerCreateFilter,
|
|
3016
3022
|
handlerCreateMeasure
|
|
3017
3023
|
]);
|
|
3018
|
-
const { isLoading, isFetching, isError, data
|
|
3024
|
+
const { isLoading, isFetching, isError, data } = useTableData({
|
|
3019
3025
|
columns: finalUniqueKeys,
|
|
3020
3026
|
pagination,
|
|
3021
3027
|
cube: cube.name
|
|
@@ -3395,6 +3401,7 @@ function MultiFilter({ header }) {
|
|
|
3395
3401
|
const cutItems = useSelector$1(selectCutItems);
|
|
3396
3402
|
const drilldownItems = useSelector$1(selectDrilldownItems);
|
|
3397
3403
|
const label = header.column.id;
|
|
3404
|
+
const localeLabel = header.column.columnDef.header;
|
|
3398
3405
|
const drilldown = drilldownItems.find((d) => d.level === header.column.id);
|
|
3399
3406
|
const actions2 = useActions();
|
|
3400
3407
|
const { idFormatters } = useidFormatters();
|
|
@@ -3436,7 +3443,7 @@ function MultiFilter({ header }) {
|
|
|
3436
3443
|
newQuery.params.cuts[cut.key] = { ...newCut, members: value };
|
|
3437
3444
|
debouncedUpdateUrl(newQuery);
|
|
3438
3445
|
},
|
|
3439
|
-
placeholder: t("params.filter_by", { name:
|
|
3446
|
+
placeholder: t("params.filter_by", { name: localeLabel }),
|
|
3440
3447
|
value: cut.members || [],
|
|
3441
3448
|
data: drilldown.members.map((m) => {
|
|
3442
3449
|
const idFormatter = idFormatters[`${label} ID`];
|
|
@@ -6146,7 +6153,7 @@ function AppProviders({ children }) {
|
|
|
6146
6153
|
const queryItem = useSelector$1(selectCurrentQueryItem);
|
|
6147
6154
|
const actions2 = useActions();
|
|
6148
6155
|
const isInitialMount = useRef(true);
|
|
6149
|
-
const {
|
|
6156
|
+
const { setLocale } = useTranslation();
|
|
6150
6157
|
useEffect(() => {
|
|
6151
6158
|
if (isInitialMount.current) {
|
|
6152
6159
|
isInitialMount.current = false;
|
|
@@ -6155,7 +6162,7 @@ function AppProviders({ children }) {
|
|
|
6155
6162
|
actions2.updateLocale(defaultLocale);
|
|
6156
6163
|
updateUrl({ ...queryItem, params: { ...queryItem.params, locale: defaultLocale } });
|
|
6157
6164
|
setLocale(defaultLocale);
|
|
6158
|
-
}, [defaultLocale, setLocale]);
|
|
6165
|
+
}, [defaultLocale, setLocale, actions2]);
|
|
6159
6166
|
return /* @__PURE__ */ React13.createElement(QueryClientProvider, { client: queryClient }, /* @__PURE__ */ React13.createElement(TableRefreshProvider, { serverURL }, /* @__PURE__ */ React13.createElement(
|
|
6160
6167
|
LogicLayerProvider,
|
|
6161
6168
|
{
|