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

[RFR] Fix missing core constants #3927

Merged
merged 2 commits into from
Nov 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions packages/ra-core/src/core/components.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import CoreAdmin from './CoreAdmin';
import CoreAdminContext from './CoreAdminContext';
import CoreAdminRouter from './CoreAdminRouter';
import CoreAdminUI from './CoreAdminUI';
import createAdminStore from './createAdminStore';
import RoutesWithLayout from './RoutesWithLayout';
import Resource from './Resource';

export {
CoreAdmin,
CoreAdminContext,
CoreAdminRouter,
CoreAdminUI,
createAdminStore,
RoutesWithLayout,
Resource,
};
20 changes: 3 additions & 17 deletions packages/ra-core/src/core/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
import CoreAdmin from './CoreAdmin';
import CoreAdminContext from './CoreAdminContext';
import CoreAdminRouter from './CoreAdminRouter';
import CoreAdminUI from './CoreAdminUI';
import createAdminStore from './createAdminStore';
import RoutesWithLayout from './RoutesWithLayout';
import Resource from './Resource';

export {
CoreAdmin,
CoreAdminContext,
CoreAdminRouter,
CoreAdminUI,
createAdminStore,
RoutesWithLayout,
Resource,
};
export * from './dataFetchActions';
export * from './components';
// there seems to be a bug in TypeScript: this only works if the exports are in this order.
// Swapping the two exports leads to the core module missing the dataFetchActions constants
10 changes: 6 additions & 4 deletions packages/ra-core/src/dataProvider/useDataProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ const performUndoableQuery = ({
warnBeforeClosingWindow
);
}
console.error(error);
return logoutIfAccessDenied(error).then(loggedOut => {
if (loggedOut) return;
dispatch({
Expand Down Expand Up @@ -354,8 +355,9 @@ const performQuery = ({
onSuccess && onSuccess(response);
return response;
})
.catch(error =>
logoutIfAccessDenied(error).then(loggedOut => {
.catch(error => {
console.error(error);
return logoutIfAccessDenied(error).then(loggedOut => {
if (loggedOut) return;
dispatch({
type: `${action}_FAILURE`,
Expand All @@ -372,8 +374,8 @@ const performQuery = ({
dispatch({ type: FETCH_ERROR, error });
onFailure && onFailure(error);
throw error;
})
);
});
});
};

interface QueryFunctionParams {
Expand Down