mirror of
https://github.com/strapi/strapi.git
synced 2025-09-21 06:22:30 +00:00
Merge pull request #8734 from strapi/rf/bug-fix
Fix small bugs related to RF migration
This commit is contained in:
commit
8d9eee1cb3
@ -44,7 +44,7 @@ const DynamicComponent = ({ componentUid, friendlyName, icon, setIsOverDynamicZo
|
||||
isOver={isOver}
|
||||
onClick={() => {
|
||||
if (!isLoading && canAccess) {
|
||||
push(`/plugins/${pluginId}/ctm-configurations/edit-settings/components/${componentUid}/`);
|
||||
push(`/plugins/${pluginId}/components/${componentUid}/configurations/edit`);
|
||||
}
|
||||
}}
|
||||
onMouseEvent={handleMouseEvent}
|
||||
|
@ -205,7 +205,10 @@ const CollectionTypeFormWrapper = ({ allLayoutData, children, from, slug }) => {
|
||||
const response = await request(endPoint, { method: 'POST', body });
|
||||
|
||||
emitEventRef.current('didCreateEntry', trackerProperty);
|
||||
strapi.notification.success(getTrad('success.record.save'));
|
||||
strapi.notification.toggle({
|
||||
type: 'success',
|
||||
message: { id: getTrad('success.record.save') },
|
||||
});
|
||||
|
||||
dispatch({ type: 'SUBMIT_SUCCEEDED', data: cleanReceivedData(response) });
|
||||
// Enable navigation and remove loaders
|
||||
@ -235,7 +238,10 @@ const CollectionTypeFormWrapper = ({ allLayoutData, children, from, slug }) => {
|
||||
dispatch({ type: 'SUBMIT_SUCCEEDED', data: cleanReceivedData(data) });
|
||||
dispatch({ type: 'SET_STATUS', status: 'resolved' });
|
||||
|
||||
strapi.notification.success(getTrad('success.record.publish'));
|
||||
strapi.notification.toggle({
|
||||
type: 'success',
|
||||
message: { id: getTrad('success.record.publish') },
|
||||
});
|
||||
} catch (err) {
|
||||
displayErrors(err);
|
||||
dispatch({ type: 'SET_STATUS', status: 'resolved' });
|
||||
@ -254,6 +260,10 @@ const CollectionTypeFormWrapper = ({ allLayoutData, children, from, slug }) => {
|
||||
const response = await request(endPoint, { method: 'PUT', body });
|
||||
|
||||
emitEventRef.current('didEditEntry', { trackerProperty });
|
||||
strapi.notification.toggle({
|
||||
type: 'success',
|
||||
message: { id: getTrad('success.record.save') },
|
||||
});
|
||||
|
||||
dispatch({ type: 'SUBMIT_SUCCEEDED', data: cleanReceivedData(response) });
|
||||
dispatch({ type: 'SET_STATUS', status: 'resolved' });
|
||||
|
@ -24,8 +24,6 @@ const SingleTypeFormWrapper = ({ allLayoutData, children, from, slug }) => {
|
||||
dispatch,
|
||||
] = useReducer(crudReducer, crudInitialState);
|
||||
|
||||
const id = get(data, 'id', '');
|
||||
|
||||
const cleanReceivedData = useCallback(
|
||||
data => {
|
||||
const cleaned = removePasswordFieldsFromData(
|
||||
@ -136,7 +134,7 @@ const SingleTypeFormWrapper = ({ allLayoutData, children, from, slug }) => {
|
||||
try {
|
||||
emitEventRef.current('willDeleteEntry', trackerProperty);
|
||||
|
||||
const response = await request(getRequestUrl(`${slug}/${id}`), {
|
||||
const response = await request(getRequestUrl(`${slug}`), {
|
||||
method: 'DELETE',
|
||||
});
|
||||
|
||||
@ -151,7 +149,7 @@ const SingleTypeFormWrapper = ({ allLayoutData, children, from, slug }) => {
|
||||
return Promise.reject(err);
|
||||
}
|
||||
},
|
||||
[id, slug]
|
||||
[slug]
|
||||
);
|
||||
|
||||
const onDeleteSucceeded = useCallback(() => {
|
||||
@ -170,7 +168,10 @@ const SingleTypeFormWrapper = ({ allLayoutData, children, from, slug }) => {
|
||||
const response = await request(endPoint, { method: 'PUT', body });
|
||||
|
||||
emitEventRef.current('didCreateEntry', trackerProperty);
|
||||
strapi.notification.success(getTrad('success.record.save'));
|
||||
strapi.notification.toggle({
|
||||
type: 'success',
|
||||
message: { id: getTrad('success.record.save') },
|
||||
});
|
||||
|
||||
dispatch({ type: 'SUBMIT_SUCCEEDED', data: cleanReceivedData(response) });
|
||||
setIsCreatingEntry(false);
|
||||
@ -194,7 +195,10 @@ const SingleTypeFormWrapper = ({ allLayoutData, children, from, slug }) => {
|
||||
const data = await request(endPoint, { method: 'POST' });
|
||||
|
||||
emitEventRef.current('didPublishEntry');
|
||||
strapi.notification.success(getTrad('success.record.publish'));
|
||||
strapi.notification.toggle({
|
||||
type: 'success',
|
||||
message: { id: getTrad('success.record.publish') },
|
||||
});
|
||||
|
||||
dispatch({ type: 'SUBMIT_SUCCEEDED', data: cleanReceivedData(data) });
|
||||
dispatch({ type: 'SET_STATUS', status: 'resolved' });
|
||||
@ -215,6 +219,11 @@ const SingleTypeFormWrapper = ({ allLayoutData, children, from, slug }) => {
|
||||
|
||||
const response = await request(endPoint, { method: 'PUT', body });
|
||||
|
||||
strapi.notification.toggle({
|
||||
type: 'success',
|
||||
message: { id: getTrad('success.record.save') },
|
||||
});
|
||||
|
||||
emitEventRef.current('didEditEntry', { trackerProperty });
|
||||
|
||||
dispatch({ type: 'SUBMIT_SUCCEEDED', data: cleanReceivedData(response) });
|
||||
|
Loading…
x
Reference in New Issue
Block a user