sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Question - How to Deactivate Feature in package-solution.json when deploying SPFx

Open OverkillTV opened this issue 9 years ago • 8 comments

  • [x ] Question
  • [ ] Typo
  • [ ] Bug
  • [ ] Additional article idea

I have a feature which will provisions SiteColumns, Lists, etc... in my package-solution.json. Is there anyway I could disable that feature so that the Administrator will have to go in the Site Collection Features and Enable them instead of automatically Enable the feature when the solution is deployed ?

Thanks,

OverkillTV avatar Oct 09 '17 02:10 OverkillTV

@OverkillTV - When you include a feature in a package it will automatically get activated when that solution is added to a site collection. This is by design as the admin has chosen to add the app.

Can you explain the scenario where this is not desired?

Since this is by design I am closing the issue, but I am still interested in the reasoning that you want to do that.

Thanks, Graham

GrahamMcMynn avatar Oct 12 '17 18:10 GrahamMcMynn

@mcmynn83 Probably when we use Central Site to manage data. Example: I have a SPFx package that contains 2 features, one is the columns,lists provision, the other is SPFx Extension.

  • I need to deploy the app to multiple site collections to use the SPFx Extension on those Sites.
  • But all of those sites are using the lists that have been provision at the Central Site to work.

If The provision feature doesn't got disabled in those site collection then there will be lost of wasted lists provision on those sites. Either I will have to delete them all or hide them from UI.

Thanks,

OverkillTV avatar Oct 13 '17 03:10 OverkillTV

@OverkillTV - Thanks for the feedback. However, a suggestion on how you should do this is create 2 packages. One for your central site, and then a separate one for the extension that lives on each site. Is there a reason that approach will not work?

Thanks, Graham

GrahamMcMynn avatar Oct 13 '17 06:10 GrahamMcMynn

The customer wants one single package that's all, for convenience when deploying I think. But I guess I will try to convince them to use separated packages for now.

Thanks,

OverkillTV avatar Oct 13 '17 06:10 OverkillTV

@mcmynn83 Hi. Not sure the suggestion works if I have some mutualised code between 2 spfx extensions. I have the same problem here.

@OverkillTV If you use pnp provisioning template to add the solution to the sites, you can desactivate one of the feature.

Regards.

guillaume-kizilian avatar Mar 28 '18 12:03 guillaume-kizilian

@OverkillTV @guillaume-kizilian - thank you for the feedback. We are working on a feature that will help @guillaume-kizilian scenario which will allow shared code from a separate package. However, the design change you are requesting is a new feature. If you are still interested in it and hope it gains traction so we implement it please got to uservoice and suggest the new feature. Depending on community feedback we may or may not implement suggestions from their.

Thanks!

GrahamMcMynn avatar Mar 28 '18 16:03 GrahamMcMynn

I am also looking for similar kind of functionality. Due to limitation of single package (by Client) and multiple features, segregating each feature for different site collection require a property to not activate a feature by default. Reason being is assets provisioning for single site collection by feature-1 get activated to other site collections where its associated assets are not required.

AteetAgarwal avatar Dec 18 '18 10:12 AteetAgarwal

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

msft-github-bot avatar Jan 29 '20 00:01 msft-github-bot