@datawheel/data-explorer 1.0.6 → 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 +18 -12
- 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
|
|
@@ -6147,7 +6153,7 @@ function AppProviders({ children }) {
|
|
|
6147
6153
|
const queryItem = useSelector$1(selectCurrentQueryItem);
|
|
6148
6154
|
const actions2 = useActions();
|
|
6149
6155
|
const isInitialMount = useRef(true);
|
|
6150
|
-
const {
|
|
6156
|
+
const { setLocale } = useTranslation();
|
|
6151
6157
|
useEffect(() => {
|
|
6152
6158
|
if (isInitialMount.current) {
|
|
6153
6159
|
isInitialMount.current = false;
|
|
@@ -6156,7 +6162,7 @@ function AppProviders({ children }) {
|
|
|
6156
6162
|
actions2.updateLocale(defaultLocale);
|
|
6157
6163
|
updateUrl({ ...queryItem, params: { ...queryItem.params, locale: defaultLocale } });
|
|
6158
6164
|
setLocale(defaultLocale);
|
|
6159
|
-
}, [defaultLocale, setLocale]);
|
|
6165
|
+
}, [defaultLocale, setLocale, actions2]);
|
|
6160
6166
|
return /* @__PURE__ */ React13.createElement(QueryClientProvider, { client: queryClient }, /* @__PURE__ */ React13.createElement(TableRefreshProvider, { serverURL }, /* @__PURE__ */ React13.createElement(
|
|
6161
6167
|
LogicLayerProvider,
|
|
6162
6168
|
{
|