vscode-viva icon indicating copy to clipboard operation
vscode-viva copied to clipboard

πŸ’‘ [Feature]: Add copy/move app actions

Open Adam-it opened this issue 1 year ago β€’ 6 comments

🎯 Aim of the feature

Currently, we have a few actions available for each app in the app catalog list. The idea/aim is to add two new actions which under the hood will use CLI for Microsoft 365 commands:

  • Copy - this will copy a sppkg package from the provided app catalog to a selected one. When using this action the extension should prompt for the target app catalog to which the app (spfx package) should be copied. We should be able to do that using m365 file copy command. Example CLI for M365 command that should be executed under the hood m365 file copy --webUrl "https://tenanttocheck.sharepoint.com/sites/PnPDemo2" --sourceUrl "/sites/PnPDemo2/AppCatalog/react-mega-menu.sppkg" --targetUrl "sites/PnPDemo/AppCatalog"
  • Move - this will move a sppkg package from the provided app catalog to a selected one. When using this action the extension should prompt for the target app catalog to which the app (spfx package) should be copied and should prompt for confirmation. We should be able to do that using m365 file move command. Example CLI for M365 command that should be executed under the hood: m365 file move--webUrl "https://tenanttocheck.sharepoint.com/sites/PnPDemo2" --sourceUrl "/sites/PnPDemo2/AppCatalog/react-mega-menu.sppkg" --targetUrl "sites/PnPDemo/AppCatalog"

Tips how to go about it, which should be done similar like already available actions

  • we should define it as a new app action like this https://github.com/pnp/vscode-viva/blob/59190115e0c676068a3f1a3698e31f3500aee3f6/src/constants/Commands.ts#L56-L62

  • we should add a new option for it visible in the menu under the app like this https://github.com/pnp/vscode-viva/blob/59190115e0c676068a3f1a3698e31f3500aee3f6/src/panels/CommandPanel.ts#L210-L216

  • we should handle this new action like this https://github.com/pnp/vscode-viva/blob/59190115e0c676068a3f1a3698e31f3500aee3f6/src/services/actions/CliActions.ts#L54-L56 and add logic for the new method like this https://github.com/pnp/vscode-viva/blob/59190115e0c676068a3f1a3698e31f3500aee3f6/src/services/actions/CliActions.ts#L182

  • The yes/no prompt may be done similar to this https://github.com/pnp/vscode-viva/blob/59190115e0c676068a3f1a3698e31f3500aee3f6/src/services/actions/CliActions.ts#L539C5-L545C69

  • we should also update the readme

  • [x] In order to be able to do that we need to add the file copy and file move command to the cjs version of CLI we maintain for this extension - done βœ…

πŸ“· Images (if possible) with expected result

current state of actions for each app in the app catalog list image

πŸ€” Additional remarks or comments

we should also update the readme with docs/guidance about the additional feature and the extension walkthrough as well

parent issue: #324

Adam-it avatar Dec 02 '24 22:12 Adam-it

I extended the CLI for Microsoft 365 package we maintain in commonjs for this extension with file move and file copy commands https://github.com/Adam-it/cli-microsoft365/commit/49b0e3ff0297199461d2c40599219afa35b9ddee So we may now open up and this feature is ready to be taken for development

Adam-it avatar Feb 13 '25 23:02 Adam-it

Hi @Adam-it . I would like to take this one. Thanks for the implementation guidance. I may have a question about the action logic later on.

ervingayle avatar Feb 14 '25 03:02 ervingayle

Hi @Adam-it . I would like to take this one. Thanks for the implementation guidance. I may have a question about the action logic later on.

Sure thing. All yours πŸ‘ You Rock 🀩

Adam-it avatar Feb 14 '25 07:02 Adam-it

@ervingayle I was wondering if you could provide a short update on this issue? Is there anything we could help out with to get you unblocked? If anything changed and you are not able to commit please do let us know so we may open it up for the community

Adam-it avatar Apr 25 '25 08:04 Adam-it

@ervingayle any update on this issue? It's totally fine if you currently you may not commit to this. In that case we may open it up again for the community to pick it up πŸ‘ Please do let us know πŸ‘

Adam-it avatar May 07 '25 22:05 Adam-it

@ervingayle May I kindly ask you to provide some update on this issue πŸ™πŸ™πŸ™πŸ™πŸ™

Adam-it avatar May 17 '25 19:05 Adam-it

Hello @Adam-it . Yes, I still want to work on this. I have just been stuck on the other custom settings task but will get to this one.

ervingayle avatar May 25 '25 12:05 ervingayle

Hello @Adam-it . Yes, I still want to work on this. I have just been stuck on the other custom settings task but will get to this one.

Thanks for letting us know. Maybe you want to unblock this one until you finish the PR with custom actions?

Adam-it avatar May 25 '25 13:05 Adam-it

@ervingayle let's make this issue open again to the community,y and if anything changes we may always assign you back πŸ‘. Thank you for taking up your time in helping us out πŸ‘πŸ‘πŸ‘πŸ‘ You Rock 🀩

Adam-it avatar Jun 12 '25 22:06 Adam-it

Hey @Adam-it, copying/moving files from tenant app catalog to site collection app catalogs don't work using m365 file commands. Strangely, the tenant AppCatalog is not a drive, whereas the site collection AppCatalog is.

Image

should we use m365 spo file commands instead? I remember reading in CLI for M365 repo that m365 spo file commands will be removed at some point.

Saurabh7019 avatar Aug 07 '25 08:08 Saurabh7019

Hey @Adam-it, copying/moving files from tenant app catalog to site collection app catalogs don't work using m365 file commands. Strangely, the tenant AppCatalog is not a drive, whereas the site collection AppCatalog is.

Image

should we use m365 spo file commands instead? I remember reading in CLI for M365 repo that m365 spo file commands will be removed at some point.

TBH I don't remember this kind of conversation. I think we did consider something like this could happen but only if the m365 file commands will have 100% same functionality as m365 spo file commands which we see is not the case and I think we already notice in other things like maintaining version history etc. Those are totally different APIs under the hood.

Adam-it avatar Aug 07 '25 22:08 Adam-it

Okay, I will use m365 spo file to implement this feature then.

Saurabh7019 avatar Aug 09 '25 18:08 Saurabh7019