mirror of
https://github.com/strapi/strapi.git
synced 2025-09-01 04:42:58 +00:00
feat: add content preview (remove future flag)
This commit is contained in:
parent
2dcec09530
commit
81b62a508e
@ -1,5 +1 @@
|
|||||||
module.exports = ({ env }) => ({
|
module.exports = ({ env }) => ({});
|
||||||
future: {
|
|
||||||
preview: env.bool('STRAPI_FUTURE_PREVIEW', false),
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
export const FEATURE_ID = 'preview';
|
|
@ -1,18 +1,12 @@
|
|||||||
/* eslint-disable check-file/no-index */
|
/* eslint-disable check-file/no-index */
|
||||||
|
|
||||||
import { PreviewSidePanel } from './components/PreviewSidePanel';
|
import { PreviewSidePanel } from './components/PreviewSidePanel';
|
||||||
import { FEATURE_ID } from './constants';
|
|
||||||
|
|
||||||
import type { ContentManagerPlugin } from '../content-manager';
|
import type { ContentManagerPlugin } from '../content-manager';
|
||||||
import type { PluginDefinition } from '@strapi/admin/strapi-admin';
|
import type { PluginDefinition } from '@strapi/admin/strapi-admin';
|
||||||
|
|
||||||
const previewAdmin = {
|
const previewAdmin = {
|
||||||
bootstrap(app) {
|
bootstrap(app) {
|
||||||
// TODO: Add license registry check when it's available
|
|
||||||
if (!window.strapi.future.isEnabled(FEATURE_ID)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const contentManagerPluginApis = app.getPlugin('content-manager')
|
const contentManagerPluginApis = app.getPlugin('content-manager')
|
||||||
.apis as ContentManagerPlugin['config']['apis'];
|
.apis as ContentManagerPlugin['config']['apis'];
|
||||||
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
export const FEATURE_ID = 'preview';
|
|
@ -1,6 +1,5 @@
|
|||||||
import type { Plugin } from '@strapi/types';
|
import type { Plugin } from '@strapi/types';
|
||||||
|
|
||||||
import { FEATURE_ID } from './constants';
|
|
||||||
import { routes } from './routes';
|
import { routes } from './routes';
|
||||||
import { controllers } from './controllers';
|
import { controllers } from './controllers';
|
||||||
import { services } from './services';
|
import { services } from './services';
|
||||||
@ -11,15 +10,6 @@ import { getService } from './utils';
|
|||||||
* so that we can assume it is enabled in the other files.
|
* so that we can assume it is enabled in the other files.
|
||||||
*/
|
*/
|
||||||
const getFeature = (): Partial<Plugin.LoadedPlugin> => {
|
const getFeature = (): Partial<Plugin.LoadedPlugin> => {
|
||||||
if (!strapi.features.future.isEnabled(FEATURE_ID)) {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Add license registry check when it's available
|
|
||||||
// if (!strapi.ee.features.isEnabled('cms-content-preview')) {
|
|
||||||
// return {};
|
|
||||||
// }
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
register() {
|
register() {
|
||||||
const config = getService(strapi, 'preview-config');
|
const config = getService(strapi, 'preview-config');
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
export interface FeaturesConfig {
|
export interface FeaturesConfig {
|
||||||
future?: {
|
future?: object;
|
||||||
preview?: boolean;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FeaturesService {
|
export interface FeaturesService {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user