diff --git a/e2e/harmony/deprecate.e2e.1.ts b/e2e/harmony/deprecate.e2e.1.ts index 9465b1d7b8ed..1c30bcf658a0 100644 --- a/e2e/harmony/deprecate.e2e.1.ts +++ b/e2e/harmony/deprecate.e2e.1.ts @@ -211,5 +211,13 @@ describe('bit deprecate and undeprecate commands', function () { it('bit status should show the DeprecatedDependencies component-issue', () => { helper.command.expectStatusToHaveIssue(IssuesClasses.DeprecatedDependencies.name); }); + describe('un-deprecating it', () => { + before(() => { + helper.command.undeprecateComponent('comp2'); + }); + it('bit status should not show the DeprecatedDependencies component-issue anymore', () => { + helper.command.expectStatusToNotHaveIssue(IssuesClasses.DeprecatedDependencies.name); + }); + }); }); }); diff --git a/scopes/component/deprecation/deprecation.main.runtime.ts b/scopes/component/deprecation/deprecation.main.runtime.ts index 74e38bc8f5b8..0031f7c1582e 100644 --- a/scopes/component/deprecation/deprecation.main.runtime.ts +++ b/scopes/component/deprecation/deprecation.main.runtime.ts @@ -129,6 +129,9 @@ export class DeprecationMain { */ private async isDeprecatedByIdWithoutLoadingComponent(componentId: ComponentID): Promise { if (!componentId.hasVersion()) return false; + const bitmapEntry = this.workspace.bitMap.getBitmapEntryIfExist(componentId); + if (bitmapEntry && bitmapEntry.isDeprecated()) return true; + if (bitmapEntry && bitmapEntry.isUndeprecated()) return false; const modelComp = await this.workspace.scope.getBitObjectModelComponent(componentId); if (!modelComp) return false; const isDeprecated = await modelComp.isDeprecated( diff --git a/src/consumer/bit-map/component-map.ts b/src/consumer/bit-map/component-map.ts index 0e41e3e672f4..aaa532d3af96 100644 --- a/src/consumer/bit-map/component-map.ts +++ b/src/consumer/bit-map/component-map.ts @@ -317,6 +317,16 @@ export default class ComponentMap { if (!removeAspectConf) return false; return removeAspectConf !== '-' && removeAspectConf.removed === false; } + isDeprecated() { + const deprecationConf = this.config?.[Extensions.deprecation]; + if (!deprecationConf) return false; + return deprecationConf !== '-' && deprecationConf.deprecate; + } + isUndeprecated() { + const deprecationConf = this.config?.[Extensions.deprecation]; + if (!deprecationConf) return false; + return deprecationConf !== '-' && deprecationConf.deprecate === false; + } sort() { this.files = R.sortBy(R.prop('relativePath'), this.files);