π‘ [Feature]: Add copy/move app actions
π― 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 copyandfile movecommand 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
π€ 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
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
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.
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 π€©
@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
@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 π
@ervingayle May I kindly ask you to provide some update on this issue πππππ
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.
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?
@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 π€©
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.
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.
Hey @Adam-it, copying/moving files from tenant app catalog to site collection app catalogs don't work using
m365 filecommands. Strangely, the tenant AppCatalog is not a drive, whereas the site collection AppCatalog is.![]()
should we use
m365 spo filecommands instead? I remember reading in CLI for M365 repo thatm365 spo filecommands 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.
Okay, I will use m365 spo file to implement this feature then.