Skip to content

Commit

Permalink
chore: remove history future flag (#20131)
Browse files Browse the repository at this point in the history
  • Loading branch information
remidej committed Apr 17, 2024
1 parent b2d2f81 commit d23c1d5
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 16 deletions.
1 change: 0 additions & 1 deletion .github/actions/run-e2e-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ runs:
env:
RUN_EE: ${{ inputs.runEE }}
JEST_OPTIONS: ${{ inputs.jestOptions }}
STRAPI_FEATURES_FUTURE_CONTENT_HISTORY: ${{ inputs.enableFutureFeatures }}
STRAPI_FEATURES_FUTURE_RELEASES_SCHEDULING: ${{ inputs.enableFutureFeatures }}
shell: bash
1 change: 0 additions & 1 deletion examples/getstarted/config/features.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module.exports = ({ env }) => ({
future: {
history: env.bool('STRAPI_FEATURES_FUTURE_CONTENT_HISTORY', false),
contentReleasesScheduling: env.bool('STRAPI_FUTURE_CONTENT_RELEASES_SCHEDULING', false),
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ const HistoryAction: DocumentActionComponent = ({ model, document }) => {
const navigate = useNavigate();
const pluginsQueryParams = stringify({ plugins: query.plugins }, { encode: false });

if (
!window.strapi.features.isEnabled('cms-content-history') ||
!window.strapi.future.isEnabled('history')
) {
if (!window.strapi.features.isEnabled('cms-content-history')) {
return null;
}

Expand Down
7 changes: 2 additions & 5 deletions packages/core/content-manager/server/src/history/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@ import { getService } from './utils';
import { historyVersion } from './models/history-version';

/**
* Check once if the feature is enabled (both license info & feature flag) before loading it,
* Check once if the feature is enabled before loading it,
* so that we can assume it is enabled in the other files.
*/
const getFeature = (): Partial<Plugin.LoadedPlugin> => {
if (
strapi.features.future.isEnabled('history') &&
strapi.ee.features.isEnabled('cms-content-history')
) {
if (strapi.ee.features.isEnabled('cms-content-history')) {
return {
register({ strapi }) {
strapi.get('models').add(historyVersion);
Expand Down
1 change: 0 additions & 1 deletion packages/core/types/src/modules/features.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export interface FeaturesConfig {
future?: {
contentReleases?: boolean;
history?: boolean;
};
}

Expand Down
1 change: 0 additions & 1 deletion tests/e2e/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@

# Examples:
STRAPI_LICENSE=your_license_key
STRAPI_FEATURES_FUTURE_CONTENT_HISTORY=true
1 change: 0 additions & 1 deletion tests/e2e/app-template/config/features.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module.exports = ({ env }) => ({
future: {
history: env.bool('STRAPI_FEATURES_FUTURE_CONTENT_HISTORY', false),
contentReleasesScheduling: env.bool('STRAPI_FEATURES_FUTURE_RELEASES_SCHEDULING', false),
},
});
4 changes: 2 additions & 2 deletions tests/e2e/tests/content-manager/history.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { describeOnCondition } from '../../utils/shared';
import { resetFiles } from '../../utils/file-reset';
import { waitForRestart } from '../../utils/restart';

const hasFutureFlag = process.env.STRAPI_FEATURES_FUTURE_CONTENT_HISTORY === 'true';
const edition = process.env.STRAPI_DISABLE_EE === 'true' ? 'CE' : 'EE';

describeOnCondition(hasFutureFlag)('History', () => {
describeOnCondition(edition === 'EE')('History', () => {
test.describe('Collection Type', () => {
test.beforeEach(async ({ page }) => {
await resetDatabaseAndImportDataFromPath('with-admin.tar');
Expand Down

0 comments on commit d23c1d5

Please sign in to comment.