Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💡 [Feature]: Add copy/move app actions #373

Open
Adam-it opened this issue Dec 2, 2024 · 0 comments
Open

💡 [Feature]: Add copy/move app actions #373

Adam-it opened this issue Dec 2, 2024 · 0 comments
Assignees
Labels
👨‍💻 CLI for Microsoft 365 Requires to first extend CLI for Microsoft 365 ⭐ enhancement New feature or request 🤚 on hold I need to wait for something else
Milestone

Comments

@Adam-it
Copy link
Member

Adam-it commented Dec 2, 2024

🎯 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
  • 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

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
    // App actions
    deployAppCatalogApp: `${EXTENSION_NAME}.deployAppCatalogApp`,
    retractAppCatalogApp: `${EXTENSION_NAME}.retractAppCatalogApp`,
    removeAppCatalogApp: `${EXTENSION_NAME}.removeAppCatalogApp`,
    enableAppCatalogApp: `${EXTENSION_NAME}.enableAppCatalogApp`,
    disableAppCatalogApp: `${EXTENSION_NAME}.disableAppCatalogApp`,
    showMoreActions: `${EXTENSION_NAME}.showMoreActions`
  • we should add a new option for it visible in the menu under the app like this
    new ActionTreeItem(app.Title, '', { name: 'package', custom: false }, undefined, 'vscode.open', Uri.parse(appStoreUrl), ContextKeys.hasAppCatalogApp,
    [
    new ActionTreeItem('Deploy', '', undefined, undefined, Commands.deployAppCatalogApp, [app.ID, app.Title, undefined, app.Deployed], ContextKeys.deployApp),
    new ActionTreeItem('Retract', '', undefined, undefined, Commands.retractAppCatalogApp, [app.ID, app.Title, undefined, app.Deployed], ContextKeys.retractApp),
    new ActionTreeItem('Remove', '', undefined, undefined, Commands.removeAppCatalogApp, [app.ID, app.Title], ContextKeys.removeApp),
    new ActionTreeItem('Enable', '', undefined, undefined, Commands.enableAppCatalogApp, [app.Title, tenantAppCatalogUrl, app.Enabled], ContextKeys.enableApp),
    new ActionTreeItem('Disable', '', undefined, undefined, Commands.disableAppCatalogApp, [app.Title, tenantAppCatalogUrl, app.Enabled], ContextKeys.disableApp)
  • we should handle this new action like this
    subscriptions.push(
    commands.registerCommand(Commands.removeAppCatalogApp, CliActions.removeAppCatalogApp)
    );
    and add logic for the new method like this
    public static async removeAppCatalogApp(node: ActionTreeItem) {
  • 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

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

📷 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 Adam-it added ⭐ enhancement New feature or request 🤚 on hold I need to wait for something else 👨‍💻 CLI for Microsoft 365 Requires to first extend CLI for Microsoft 365 labels Dec 2, 2024
@Adam-it Adam-it added this to the v4.X milestone Dec 2, 2024
@Adam-it Adam-it self-assigned this Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👨‍💻 CLI for Microsoft 365 Requires to first extend CLI for Microsoft 365 ⭐ enhancement New feature or request 🤚 on hold I need to wait for something else
Projects
None yet
Development

No branches or pull requests

1 participant