feat: add content preview (remove future flag)

This commit is contained in:
Rémi de Juvigny 2024-12-04 09:36:19 +01:00
parent 2dcec09530
commit 81b62a508e
6 changed files with 2 additions and 26 deletions

View File

@ -1,5 +1 @@
module.exports = ({ env }) => ({
future: {
preview: env.bool('STRAPI_FUTURE_PREVIEW', false),
},
});
module.exports = ({ env }) => ({});

View File

@ -1 +0,0 @@
export const FEATURE_ID = 'preview';

View File

@ -1,18 +1,12 @@
/* eslint-disable check-file/no-index */
import { PreviewSidePanel } from './components/PreviewSidePanel';
import { FEATURE_ID } from './constants';
import type { ContentManagerPlugin } from '../content-manager';
import type { PluginDefinition } from '@strapi/admin/strapi-admin';
const previewAdmin = {
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')
.apis as ContentManagerPlugin['config']['apis'];

View File

@ -1 +0,0 @@
export const FEATURE_ID = 'preview';

View File

@ -1,6 +1,5 @@
import type { Plugin } from '@strapi/types';
import { FEATURE_ID } from './constants';
import { routes } from './routes';
import { controllers } from './controllers';
import { services } from './services';
@ -11,15 +10,6 @@ import { getService } from './utils';
* so that we can assume it is enabled in the other files.
*/
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 {
register() {
const config = getService(strapi, 'preview-config');

View File

@ -1,7 +1,5 @@
export interface FeaturesConfig {
future?: {
preview?: boolean;
};
future?: object;
}
export interface FeaturesService {