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 upgrade an app on a specified site collection using a action in the app catalog app list view #351

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

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 a new action which under the hood will use CLI for Microsoft 365 command:

  • Upgrade - this will upgrade an app from the specified app catalog in the site. Under the hood it should use m365 spo app upgrade. When clicking on this action we should add prompt for siteUrl which is needed so that we will know to which site we should upgrade the selected 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 take it?

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

Adam-it commented Nov 20, 2024

Can I take it?

All yours

Saurabh7019 added a commit to Saurabh7019/vscode-viva that referenced this issue Nov 21, 2024
Adam-it pushed a commit to Saurabh7019/vscode-viva that referenced this issue Nov 23, 2024
@Adam-it Adam-it linked a pull request Nov 23, 2024 that will close this issue
2 tasks
Adam-it pushed a commit that referenced this issue Nov 23, 2024
…loses: #351 (#357)

## 🎯 Aim

Upgrades an app to the latest version available in the app catalog for the specified site

## 📷 Result

![image](https://github.com/user-attachments/assets/3c9255b0-28de-4365-9bce-d12452c611be)


## ✅ What was done

- [X] New action to upgrade an app in the specified site.
- [X] Prompt for the site URL only when upgrading tenant app catalog
apps. For site collection app catalog apps, it uses the site collection
app catalog URL and scope.

## 🔗 Related issue

Closes: #351
@Adam-it
Copy link
Member Author

Adam-it commented Nov 23, 2024

PR merged. This will be live as a new pre-release soon.
Thank you once again for helping out in making the best SPFx tooling in the world 🚀

@Adam-it Adam-it closed this as completed Nov 23, 2024
Adam-it pushed a commit that referenced this issue Dec 10, 2024
…loses: #351 (#357)

## 🎯 Aim

Upgrades an app to the latest version available in the app catalog for the specified site

## 📷 Result

![image](https://github.com/user-attachments/assets/3c9255b0-28de-4365-9bce-d12452c611be)


## ✅ What was done

- [X] New action to upgrade an app in the specified site.
- [X] Prompt for the site URL only when upgrading tenant app catalog
apps. For site collection app catalog apps, it uses the site collection
app catalog URL and scope.

## 🔗 Related issue

Closes: #351
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

Successfully merging a pull request may close this issue.

2 participants