Skip to content

Commit e6293fd

Browse files
nicodecleyreAdam-it
authored andcommitted
Refactor CommandPanel and CliActions: streamline app catalog handling and enhance form customizer setup
1 parent 003d26d commit e6293fd

File tree

2 files changed

+403
-417
lines changed

2 files changed

+403
-417
lines changed

src/panels/CommandPanel.ts

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -251,32 +251,17 @@ export class CommandPanel {
251251
for (let i = 1; i < appCatalogUrls.length; i++) {
252252
const siteAppCatalogUrl = appCatalogUrls[i];
253253

254-
const siteAppCatalogNode = new ActionTreeItem(
255-
siteAppCatalogUrl.replace(origin, '...'),
256-
'',
257-
{ name: 'globe', custom: false },
258-
showExpandTreeIcon,
259-
'vscode.open',
260-
`${Uri.parse(siteAppCatalogUrl)}/AppCatalog`,
261-
'sp-app-catalog-url',
262-
undefined,
254+
const siteAppCatalogNode = new ActionTreeItem(siteAppCatalogUrl.replace(origin, '...'), '', { name: 'globe', custom: false }, showExpandTreeIcon, 'vscode.open', `${Uri.parse(siteAppCatalogUrl)}/AppCatalog`, 'sp-app-catalog-url', undefined,
263255
async () => {
264256
const siteAppCatalogApps = await CliActions.getAppCatalogApps(siteAppCatalogUrl);
265257
const siteAppCatalogAppsList: ActionTreeItem[] = [];
266-
258+
267259
if (siteAppCatalogApps && siteAppCatalogApps.length > 0) {
268260
siteAppCatalogApps.forEach((app) => {
269261
const appStoreUrl = `${siteAppCatalogUrl}/_layouts/15/appStore.aspx/appDetail/${app.ID}?sorting=1&from=0&catalog=3`;
270-
262+
271263
siteAppCatalogAppsList.push(
272-
new ActionTreeItem(
273-
app.Title,
274-
'',
275-
{ name: 'package', custom: false },
276-
undefined,
277-
'vscode.open',
278-
Uri.parse(appStoreUrl),
279-
ContextKeys.hasAppCatalogApp,
264+
new ActionTreeItem(app.Title, '', { name: 'package', custom: false }, undefined, 'vscode.open', Uri.parse(appStoreUrl), ContextKeys.hasAppCatalogApp,
280265
[
281266
new ActionTreeItem('Deploy', '', undefined, undefined, Commands.deployAppCatalogApp, [app.ID, app.Title, siteAppCatalogUrl, app.Deployed], ContextKeys.deployApp),
282267
new ActionTreeItem('Retract', '', undefined, undefined, Commands.retractAppCatalogApp, [app.ID, app.Title, siteAppCatalogUrl, app.Deployed], ContextKeys.retractApp),
@@ -293,7 +278,7 @@ export class CommandPanel {
293278
} else {
294279
siteAppCatalogAppsList.push(new ActionTreeItem('No app found', ''));
295280
}
296-
281+
297282
return siteAppCatalogAppsList;
298283
}
299284
);

0 commit comments

Comments
 (0)