mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 02:44:55 +00:00
Add temp injection zone in the tutorial box
Signed-off-by: soupette <cyril@strapi.io>
This commit is contained in:
parent
ea30ae8731
commit
ae420069df
@ -168,6 +168,7 @@ class StrapiApp {
|
||||
addSettingsLinks: this.addSettingsLinks,
|
||||
getPlugin: this.getPlugin,
|
||||
injectContentManagerComponent: this.injectContentManagerComponent,
|
||||
injectAdminComponent: this.injectAdminComponent,
|
||||
registerHook: this.registerHook,
|
||||
});
|
||||
}
|
||||
@ -183,6 +184,7 @@ class StrapiApp {
|
||||
addSettingsLinks: this.addSettingsLinks,
|
||||
getPlugin: this.getPlugin,
|
||||
injectContentManagerComponent: this.injectContentManagerComponent,
|
||||
injectAdminComponent: this.injectAdminComponent,
|
||||
registerHook: this.registerHook,
|
||||
});
|
||||
}
|
||||
@ -299,6 +301,16 @@ class StrapiApp {
|
||||
this.admin.injectionZones.contentManager[containerName][blockName].push(component);
|
||||
};
|
||||
|
||||
injectAdminComponent = (containerName, blockName, component) => {
|
||||
invariant(
|
||||
this.admin.injectionZones.admin[containerName]?.[blockName],
|
||||
`The ${containerName} ${blockName} zone is not defined in the admin`
|
||||
);
|
||||
invariant(component, 'A Component must be provided');
|
||||
|
||||
this.admin.injectionZones.admin[containerName][blockName].push(component);
|
||||
};
|
||||
|
||||
/**
|
||||
* Load the admin translations
|
||||
* @returns {Object} The imported admin translations
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
import React from 'react';
|
||||
import { useIntl } from 'react-intl';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { InjectionZone } from '../../../shared/components';
|
||||
import StyledLink from './StyledLink';
|
||||
|
||||
function StaticLinks() {
|
||||
@ -38,6 +39,7 @@ function StaticLinks() {
|
||||
</li>
|
||||
);
|
||||
})}
|
||||
<InjectionZone area="admin.tutorials.links" />
|
||||
</ul>
|
||||
);
|
||||
}
|
||||
|
||||
@ -5,6 +5,12 @@
|
||||
* @type {Object}
|
||||
*/
|
||||
const injectionZones = {
|
||||
admin: {
|
||||
// Temporary injection zone, support for the react-tour plugin in foodadvisor
|
||||
tutorials: {
|
||||
links: [],
|
||||
},
|
||||
},
|
||||
contentManager: {
|
||||
editView: { informations: [], 'right-links': [] },
|
||||
listView: { actions: [], deleteModalAdditionalInfos: [] },
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user