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]: Allow to install/uninstall an app on a specified site collection using a action in the app catalog app list view #350

Open
Adam-it opened this issue Nov 19, 2024 · 2 comments
Assignees
Labels
⭐ enhancement New feature or request 💪 good first issue Good for newcomers 👨‍💻work in progress I am working on it
Milestone

Comments

@Adam-it
Copy link
Member

Adam-it commented Nov 19, 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:

  • Install - this will install an app from the specified app catalog in the site. Under the hood it should use m365 spo app install. When clicking on this action we should add prompt for siteUrl which is needed so that we will know to which site we should install the selected app
  • Uninstall - this will uninstall an app from the specified site. Under the hood it should use m365 spo app uninstall. When clicking on this action we should add prompt for siteUrl which is needed so that we will know to from which site we should uninstall the selected app. We should also prompt for confirmation with a yes/no- notify if the user is sure to uninstall the app.

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

📷 Images (if possible) with expected result

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

🤔 Additional remarks or comments

parent issue #324

@Adam-it Adam-it added ⭐ enhancement New feature or request 💪 good first issue Good for newcomers 🙏 help wanted Open for contributors labels Nov 19, 2024
@Saurabh7019
Copy link
Contributor

Can I work on it?

@Adam-it Adam-it added 👨‍💻work in progress I am working on it and removed 🙏 help wanted Open for contributors labels Nov 22, 2024
@Adam-it
Copy link
Member Author

Adam-it commented Nov 22, 2024

Can I work on it?

All yours 👍🤩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⭐ enhancement New feature or request 💪 good first issue Good for newcomers 👨‍💻work in progress I am working on it
Projects
None yet
Development

No branches or pull requests

2 participants