Skip to content

Commit

Permalink
Merge branch 'Sample-gallery-with-extension-type-pnp#219' of https://…
Browse files Browse the repository at this point in the history
…github.com/nicodecleyre/vscode-viva into Sample-gallery-with-extension-type-pnp#219
  • Loading branch information
nicodecleyre committed Aug 8, 2024
2 parents 69f8ce4 + 412d3b5 commit 1f4fb95
Show file tree
Hide file tree
Showing 13 changed files with 182 additions and 109 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
registry-url: https://registry.npmjs.org/

- name: Checkout vscode-viva
Expand Down Expand Up @@ -49,5 +49,5 @@ jobs:
continue-on-error: false

- name: Publish
run: npx @vscode/vsce publish -p ${{ secrets.VSCE_PAT }} --pre-release --baseImagesUrl https://raw.githubusercontent.com/pnp/vscode-viva/dev
run: npx @vscode/vsce@2.30.0 publish -p ${{ secrets.VSCE_PAT }} --pre-release --baseImagesUrl https://raw.githubusercontent.com/pnp/vscode-viva/dev
working-directory: vscode-viva
4 changes: 2 additions & 2 deletions .github/workflows/release-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
registry-url: https://registry.npmjs.org/

- name: Checkout vscode-viva
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:

- name: Package
run: |
npx @vscode/vsce package
npx @vscode/vsce@2.30.0 package
working-directory: vscode-viva

- name: Upload artifacts
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
registry-url: https://registry.npmjs.org/

- name: Checkout vscode-viva
Expand Down Expand Up @@ -52,5 +52,5 @@ jobs:
continue-on-error: false

- name: Publish
run: npx @vscode/vsce publish -p ${{ secrets.VSCE_PAT }}
run: npx @vscode/vsce@2.30.0 publish -p ${{ secrets.VSCE_PAT }}
working-directory: vscode-viva
56 changes: 51 additions & 5 deletions data/sp-dev-fx-samples.json
Original file line number Diff line number Diff line change
Expand Up @@ -3555,6 +3555,29 @@
"sampleGalerry": "sp-dev-fx-webparts",
"sampleType": "samples"
},
{
"name": "pnp-sp-dev-spfx-web-parts-react-appinsights-usage",
"title": "React AppInsights Usage WebParts",
"url": "https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-appinsights-usage",
"description": "This web parts shows different use cases for capturing data in your application and store it into the Azure Application Insights service.",
"image": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-appinsights-dashboard/assets/AppInsights_Dashboard.gif",
"authors": [
{
"name": "Peter Paul Kirschner",
"pictureUrl": "https://github.com/petkir.png"
}
],
"tags": [
"SharePoint"
],
"createDate": "2024-05-26",
"updateDate": "2024-05-26",
"version": "1.18.2",
"componentType": "webpart",
"extensionType": null,
"sampleGalerry": "sp-dev-fx-webparts",
"sampleType": "samples"
},
{
"name": "pnp-sp-dev-spfx-web-parts-react-associated-sites-links",
"title": "Associated Sites Links Web Part",
Expand Down Expand Up @@ -3872,7 +3895,7 @@
"SharePoint"
],
"createDate": "2020-12-04",
"updateDate": "2023-12-29",
"updateDate": "2024-06-28",
"version": "1.12.1",
"componentType": "webpart",
"extensionType": null,
Expand Down Expand Up @@ -4549,8 +4572,8 @@
"SharePoint"
],
"createDate": "2020-11-21",
"updateDate": "2020-11-21",
"version": "1.11.0",
"updateDate": "2024-06-28",
"version": "1.18.2",
"componentType": "webpart",
"extensionType": null,
"sampleGalerry": "sp-dev-fx-webparts",
Expand Down Expand Up @@ -6240,8 +6263,8 @@
"SharePoint"
],
"createDate": "2020-07-02",
"updateDate": "2020-07-02",
"version": "1.13.0",
"updateDate": "2024-05-26",
"version": "1.19.0",
"componentType": "webpart",
"extensionType": null,
"sampleGalerry": "sp-dev-fx-webparts",
Expand Down Expand Up @@ -8596,6 +8619,29 @@
"sampleGalerry": "sp-dev-fx-webparts",
"sampleType": "samples"
},
{
"name": "pnp-sp-dev-spfx-web-parts-react-site-secure-function-call",
"title": "Site Secure Function Call",
"url": "https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-office-offer-creation",
"description": "This combined SharePoint Framework and Azure Function solution is to provide the potentially most secure access from SharePoint Framework to any kind of third party API or Microsoft Graph.",
"image": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-site-secure-function-call/assets/SetSiteDescreption.gif",
"authors": [
{
"name": "Markus Moeller",
"pictureUrl": "https://github.com/mmsharepoint.png"
}
],
"tags": [
"SharePoint"
],
"createDate": "2024-07-12",
"updateDate": "2024-07-12",
"version": "1.18.2",
"componentType": "webpart",
"extensionType": null,
"sampleGalerry": "sp-dev-fx-webparts",
"sampleType": "samples"
},
{
"name": "pnp-sp-dev-spfx-web-parts-react-sitepages-metadata",
"title": "Sitepages Metadata Web Part",
Expand Down
6 changes: 3 additions & 3 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "viva-connections-toolkit",
"displayName": "SharePoint Framework Toolkit",
"description": "SharePoint Framework Toolkit aims to boost your productivity in developing and managing SharePoint Framework solutions helping at every stage of your development flow, from setting up your development workspace to deploying a solution straight to your tenant without the need to leave VS Code and now even create a CI/CD pipeline to introduce automate deployment of your app. This toolkit is provided by the community.",
"version": "3.4.0",
"version": "3.4.1",
"publisher": "m365pnp",
"preview": false,
"homepage": "https://github.com/pnp/vscode-viva",
Expand Down Expand Up @@ -167,6 +167,18 @@
"none"
],
"description": "Choose your preferred Node.js version manager. Choose between `nvs`, `nvm`, or `none`."
},
"spfx-toolkit.showServiceIncidentList": {
"title": "Show service health incidents",
"type": "boolean",
"default": "true",
"description": "Show the service health incidents in the account view."
},
"spfx-toolkit.showTenantWideExtensions": {
"title": "Show tenant-wide extensions",
"type": "boolean",
"default": "true",
"description": "Show the tenant-wide extensions in the account view."
}
}
},
Expand Down
18 changes: 7 additions & 11 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PnPWebview } from './webview/PnPWebview';
import { CommandPanel } from './panels/CommandPanel';
import * as vscode from 'vscode';
import { workspace, window, ThemeIcon, commands } from 'vscode';
import { workspace, commands } from 'vscode';
import { PROJECT_FILE, Scaffolder } from './services/Scaffolder';
import { Extension } from './services/Extension';
import { Dependencies } from './services/Dependencies';
Expand Down Expand Up @@ -39,32 +39,28 @@ export async function activate(context: vscode.ExtensionContext) {
if (fileContents) {
unlinkSync(files[0].fsPath);

const terminal = window.createTerminal({
name: 'Installing dependencies',
iconPath: new ThemeIcon('cloud-download')
});
const terminalTitle = 'Installing dependencies';
const terminalIcon = 'cloud-download';

if (fileContents.indexOf(ProjectFileContent.init) > -1 || fileContents.indexOf(ProjectFileContent.initScenario) > -1) {
terminal.sendText('npm i');
await TerminalCommandExecuter.runCommand('npm i', [], terminalTitle, terminalIcon);
}

if (fileContents.indexOf(ProjectFileContent.initScenario) > -1) {
commands.executeCommand('codetour.startTour');
}

if (fileContents.indexOf(ProjectFileContent.installReusablePropertyPaneControls) > -1) {
terminal.sendText('npm install @pnp/spfx-property-controls --save --save-exact');
await TerminalCommandExecuter.runCommand('npm install @pnp/spfx-property-controls --save --save-exact', [], terminalTitle, terminalIcon);
}

if (fileContents.indexOf(ProjectFileContent.installReusableReactControls) > -1) {
terminal.sendText('npm install @pnp/spfx-controls-react --save --save-exact');
await TerminalCommandExecuter.runCommand('npm install @pnp/spfx-controls-react --save --save-exact', [], terminalTitle, terminalIcon);
}

if (fileContents.indexOf(ProjectFileContent.installPnPJs) > -1) {
terminal.sendText('npm install @pnp/sp @pnp/graph --save');
await TerminalCommandExecuter.runCommand('npm install @pnp/sp @pnp/graph --save', [], terminalTitle, terminalIcon);
}

terminal.show(true);
}
}
});
Expand Down
50 changes: 31 additions & 19 deletions src/panels/CommandPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { TeamsToolkitIntegration } from '../services/TeamsToolkitIntegration';
import { AdaptiveCardCheck } from '../services/AdaptiveCardCheck';
import { Subscription } from '../models';
import { Extension } from '../services/Extension';
import { getExtensionSettings } from '../utils';


export class CommandPanel {
Expand Down Expand Up @@ -115,15 +116,18 @@ export class CommandPanel {
new ActionTreeItem(webApiPermissionManagementUrl.replace(`${adminOriginUrl}/_layouts/15/online/AdminHome.aspx#/`, '...'), '', { name: 'globe', custom: false }, undefined, 'vscode.open', Uri.parse(webApiPermissionManagementUrl), 'sp-admin-api-url')
]));

const healthInfoList = await CliActions.getTenantHealthInfo();
if (healthInfoList)
{
const healthInfoItems: ActionTreeItem[] = [];
for (let i = 0; i < healthInfoList.length; i++) {
healthInfoItems.push(new ActionTreeItem(healthInfoList[i].Title, '', { name: 'm365-warning', custom: true } , undefined, 'vscode.open', Uri.parse(healthInfoList[i].Url), 'm365-health-service-url'));
}
if (healthInfoItems.length > 0) {
accountCommands[0].children.push(new ActionTreeItem('Service health incidents', '', { name: 'm365-health', custom: true }, undefined, undefined, undefined, undefined, healthInfoItems));
const showServiceIncidentList = getExtensionSettings('showServiceIncidentList', true);
if (showServiceIncidentList === true) {
const healthInfoList = await CliActions.getTenantHealthInfo();
if (healthInfoList?.some)
{
const healthInfoItems: ActionTreeItem[] = [];
for (let i = 0; i < healthInfoList.length; i++) {
healthInfoItems.push(new ActionTreeItem(healthInfoList[i].Title, '', { name: 'm365-warning', custom: true } , undefined, 'vscode.open', Uri.parse(healthInfoList[i].Url), 'm365-health-service-url'));
}
if (healthInfoItems.length > 0) {
accountCommands[0].children.push(new ActionTreeItem('Service health incidents', '', { name: 'm365-health', custom: true }, undefined, undefined, undefined, undefined, healthInfoItems));
}
}
}
}
Expand Down Expand Up @@ -155,21 +159,29 @@ export class CommandPanel {
const origin = new URL(tenantAppCatalogUrl).origin;
commands.executeCommand('setContext', ContextKeys.hasAppCatalog, true);

const tenantWideExtensions = await CliActions.getTenantWideExtensions(tenantAppCatalogUrl);
const tenantWideExtensionsList: ActionTreeItem[] = [];
if (tenantWideExtensions && tenantWideExtensions?.length > 0) {
tenantWideExtensions.forEach((extension) => {
tenantWideExtensionsList.push(new ActionTreeItem(extension.Title, '', { name: 'spo-app', custom: true }, undefined, 'vscode.open', Uri.parse(extension.Url), 'sp-app-catalog-tenant-wide-extensions-url'));
});
}

environmentCommands.push(
new ActionTreeItem('Tenant App Catalog', '', { name: 'spo-logo', custom: true }, undefined, undefined, undefined, undefined, [
new ActionTreeItem(tenantAppCatalogUrl.replace(origin, '...'), '', { name: 'globe', custom: false }, undefined, 'vscode.open', Uri.parse(tenantAppCatalogUrl), 'sp-app-catalog-url'),
new ActionTreeItem('Tenant-wide Extensions', '', { name: 'spo-app-list', custom: true }, undefined, undefined, undefined, 'sp-app-catalog-tenant-wide-extensions', tenantWideExtensionsList)
new ActionTreeItem(tenantAppCatalogUrl.replace(origin, '...'), '', { name: 'globe', custom: false }, undefined, 'vscode.open', Uri.parse(tenantAppCatalogUrl), 'sp-app-catalog-url')
]),
);

const showTenantWideExtensions = getExtensionSettings('showTenantWideExtensions', true);

if (showTenantWideExtensions === true) {
const tenantWideExtensions = await CliActions.getTenantWideExtensions(tenantAppCatalogUrl);
const tenantWideExtensionsList: ActionTreeItem[] = [];
if (tenantWideExtensions && tenantWideExtensions?.length > 0) {
tenantWideExtensions.forEach((extension) => {
tenantWideExtensionsList.push(new ActionTreeItem(extension.Title, '', { name: 'spo-app', custom: true }, undefined, 'vscode.open', Uri.parse(extension.Url), 'sp-app-catalog-tenant-wide-extensions-url'));
});
}
else {
tenantWideExtensionsList.push(new ActionTreeItem('none', '', undefined, undefined, undefined, undefined, undefined));
}

environmentCommands.push(new ActionTreeItem('Tenant-wide Extensions', '', { name: 'spo-app-list', custom: true }, undefined, undefined, undefined, 'sp-app-catalog-tenant-wide-extensions', tenantWideExtensionsList));
}

const siteAppCatalogActionItems: ActionTreeItem[] = [];
for (let i = 1; i < appCatalogUrls.length; i++) {
siteAppCatalogActionItems.push(new ActionTreeItem(appCatalogUrls[i].replace(origin, '...'), '', { name: 'globe', custom: false }, undefined, 'vscode.open', Uri.parse(appCatalogUrls[i]), 'sp-app-catalog-url'));
Expand Down
Loading

0 comments on commit 1f4fb95

Please sign in to comment.