Skip to content

Commit

Permalink
feat(Preview): onlyOverview global feature flag (#8475)
Browse files Browse the repository at this point in the history
  • Loading branch information
luvkapur authored Jan 30, 2024
1 parent 8fb0283 commit 59e5ad9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scopes/preview/preview/preview.main.runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { ArtifactFiles } from '@teambit/legacy/dist/consumer/component/sources/a
import WatcherAspect, { WatcherMain } from '@teambit/watcher';
import GraphqlAspect, { GraphqlMain } from '@teambit/graphql';
import ScopeAspect, { ScopeMain } from '@teambit/scope';
import { ONLY_OVERVIEW, isFeatureEnabled } from '@teambit/legacy/dist/api/consumer/lib/feature-toggle';
import { BundlingStrategyNotFound } from './exceptions';
import { generateLink, MainModulesMap } from './generate-link';
import { PreviewArtifact } from './preview-artifact';
Expand Down Expand Up @@ -491,8 +492,7 @@ export class PreviewMain {
}

async isSupportSkipIncludes(component: Component) {
if (!this.config.onlyOverview) return false;

if (!this.config.onlyOverview && !isFeatureEnabled(ONLY_OVERVIEW)) return false;
const isCore = this.envs.isUsingCoreEnv(component);
if (isCore) return false;

Expand All @@ -505,7 +505,7 @@ export class PreviewMain {
* check if the component preview should only include the overview (skipping rendering of the compostions and properties table)
*/
async getOnlyOverview(component: Component): Promise<boolean> {
if (!this.config.onlyOverview) return false;
if (!this.config.onlyOverview && !isFeatureEnabled(ONLY_OVERVIEW)) return false;
const previewData = this.getPreviewData(component);
return previewData?.onlyOverview ?? false;
}
Expand Down
2 changes: 2 additions & 0 deletions src/api/consumer/lib/feature-toggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ export const LEGACY_SHARED_DIR_FEATURE = 'legacy-shared-dir';

export const NO_FS_CACHE_FEATURE = 'no-fs-cache';

export const ONLY_OVERVIEW = 'only-overview';

export const CLOUD_IMPORTER = 'cloud-importer';
export const CLOUD_IMPORTER_V2 = 'cloud-importer-v2';

Expand Down

0 comments on commit 59e5ad9

Please sign in to comment.