Skip to content

Commit

Permalink
disabled fcb for portal preview release (#45)
Browse files Browse the repository at this point in the history
Co-authored-by: Ashish Choudhary <[email protected]>
  • Loading branch information
ashishchoudhary001 and Ashish-portalFxDev authored May 25, 2021
1 parent 5e5ec4c commit 81c20c3
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 72 deletions.
10 changes: 0 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,6 @@
"onLanguage:html"
],
"contributes": {
"configuration": {
"title": "powerplatform-vscode",
"properties": {
"powerplatform-vscode.enablePortalFeatures": {
"type": "boolean",
"default": false,
"description": "Enable Portal features in VSCode Extension"
}
}
},
"commands": [
{
"command": "pacCLI.openDocumentation",
Expand Down
119 changes: 57 additions & 62 deletions src/client/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,70 +25,65 @@ export async function activate(

_context = context;

const isPaportalFeatureEnabled = vscode.workspace
.getConfiguration("powerplatform-vscode")
.get("enablePortalFeatures");
if (isPaportalFeatureEnabled) {
// add portal specific features in this block

vscode.workspace.onDidOpenTextDocument(didOpenTextDocument);
vscode.workspace.textDocuments.forEach(didOpenTextDocument);

// portal web view panel
_context.subscriptions.push(
vscode.commands.registerCommand(
"microsoft-powerapps-portals.preview-show",
() => {
PortalWebView.createOrShow(_context);
}
)
);

_context.subscriptions.push(
vscode.workspace.onDidOpenTextDocument(() => {
if (vscode.window.activeTextEditor === undefined) {
return;
} else if (
vscode.workspace.workspaceFolders !== undefined &&
PortalWebView.currentPanel &&
PortalWebView.currentDocument !==
vscode.window.activeTextEditor.document.fileName &&
PortalWebView.checkDocumentIsHTML()
) {
PortalWebView.currentPanel._update();
}
})
);
_context.subscriptions.push(
vscode.workspace.onDidChangeTextDocument(() => {
if (vscode.window.activeTextEditor === undefined) {
return;
} else if (
vscode.workspace.workspaceFolders !== undefined &&
PortalWebView.currentPanel &&
PortalWebView.currentDocument ===
vscode.window.activeTextEditor.document.fileName
// add portal specific features in this block

vscode.workspace.onDidOpenTextDocument(didOpenTextDocument);
vscode.workspace.textDocuments.forEach(didOpenTextDocument);

// portal web view panel
_context.subscriptions.push(
vscode.commands.registerCommand(
"microsoft-powerapps-portals.preview-show",
() => {
PortalWebView.createOrShow(_context);
}
)
);

_context.subscriptions.push(
vscode.workspace.onDidOpenTextDocument(() => {
if (vscode.window.activeTextEditor === undefined) {
return;
} else if (
vscode.workspace.workspaceFolders !== undefined &&
PortalWebView.currentPanel &&
PortalWebView.currentDocument !==
vscode.window.activeTextEditor.document.fileName &&
PortalWebView.checkDocumentIsHTML()
) {
PortalWebView.currentPanel._update();
}
})
);
_context.subscriptions.push(
vscode.workspace.onDidChangeTextDocument(() => {
if (vscode.window.activeTextEditor === undefined) {
return;
} else if (
vscode.workspace.workspaceFolders !== undefined &&
PortalWebView.currentPanel &&
PortalWebView.currentDocument ===
vscode.window.activeTextEditor.document.fileName
) {
PortalWebView.currentPanel._update();
}
})
);

if (vscode.window.registerWebviewPanelSerializer) {
vscode.window.registerWebviewPanelSerializer(
PortalWebView.viewType,
{
async deserializeWebviewPanel(
webviewPanel: vscode.WebviewPanel
) {
PortalWebView.currentPanel._update();
}
})
PortalWebView.revive(
webviewPanel,
_context.extensionUri
);
},
}
);

if (vscode.window.registerWebviewPanelSerializer) {
vscode.window.registerWebviewPanelSerializer(
PortalWebView.viewType,
{
async deserializeWebviewPanel(
webviewPanel: vscode.WebviewPanel
) {
PortalWebView.revive(
webviewPanel,
_context.extensionUri
);
},
}
);
}
}

const cli = new CliAcquisition(new CliAcquisitionContext(_context));
Expand Down

0 comments on commit 81c20c3

Please sign in to comment.