Skip to content

Commit

Permalink
Fix environment comparison case sensitivity and update Microsoft.Powe…
Browse files Browse the repository at this point in the history
…rApps.CLI to 1.8.5 (#10)

* Comment unused webpack dependencies in gulpfile

* Update Microsoft.PowerApps.CLI to 1.8.5

* Fix environment comparison case sensitivity
  • Loading branch information
ikappas authored Jul 24, 2021
1 parent ae41882 commit cecb58a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ const gulp = require('gulp');
const eslint = require('gulp-eslint');
const mocha = require('gulp-mocha');
const moment = require('moment');
const gulpWebpack = require('webpack-stream');
const webpack = require('webpack');
// const gulpWebpack = require('webpack-stream');
// const webpack = require('webpack');
const vsce = require('vsce');
const argv = require('yargs').argv;

Expand Down Expand Up @@ -209,8 +209,8 @@ async function snapshot() {

const recompile = gulp.series(
clean,
async () => nugetInstall('nuget.org', 'Microsoft.PowerApps.CLI', '1.7.2', path.resolve(distdir, 'pac')),
async () => nugetInstall('nuget.org', 'Microsoft.PowerApps.CLI.Core.osx-x64', '1.7.2', path.resolve(distdir, 'pac')),
async () => nugetInstall('nuget.org', 'Microsoft.PowerApps.CLI', '1.8.5', path.resolve(distdir, 'pac')),
async () => nugetInstall('nuget.org', 'Microsoft.PowerApps.CLI.Core.osx-x64', '1.8.5', path.resolve(distdir, 'pac')),
compile,
);

Expand Down
28 changes: 14 additions & 14 deletions src/entities/PowerApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { env } from 'process';
import { APIUtils } from '../helpers/APIUtils';

export class PowerApp extends TreeItemWithParent {

constructor(
public readonly id: string,
public readonly name: string,
Expand All @@ -23,9 +23,9 @@ export class PowerApp extends TreeItemWithParent {
public readonly environment: Environment | undefined,
public readonly collapsibleState: vscode.TreeItemCollapsibleState,
public readonly command?: vscode.Command
) {
) {
super(`${displayName}`, collapsibleState);

this.id = id;
this.name = name;
this.displayName = displayName;
Expand All @@ -43,7 +43,7 @@ export class PowerApp extends TreeItemWithParent {
`|-:|:-:|:-|`,
`|*Name:* ||${name}|`,
`|*App-Version:* ||${version}|`,
`|*App Plan Classification:*||${this.properties?.appPlanClassification}|`,
`|*App Plan Classification:*||${this.properties?.appPlanClassification}|`,
`|*Designer-Version:* ||${this.properties?.createdByClientVersion?.major}.${this.properties?.createdByClientVersion?.minor}.${this.properties?.createdByClientVersion?.build}.${this.properties?.createdByClientVersion?.revision}|`,
`|*CanvasApp-Id:* ||${id?.split("/")?.slice(-1)[0]}|`, // unauthenticatedWebPackageHint
`|*Id:* ||${id}|`,
Expand All @@ -70,25 +70,25 @@ export class PowerApp extends TreeItemWithParent {
light: path.join(path.dirname(__filename), '..', '..', 'media', 'powerapps.svg'),
dark: path.join(path.dirname(__filename), '..', '..', 'media', 'powerapps.svg')
};
public connections?: Connection[];

public connections?: Connection[];

static convert (data: any, environments?: Environment[]): PowerApp {
const properties = data.properties;
const version = properties.appPackageDetails !== undefined ? properties.appPackageDetails.documentServerVersion : {};
const toConnections = (app: PowerApp, connections: any): Connection[] => { return connections === undefined ? [] : Object.entries(connections).map<Connection>(([k, v]) => Connection.convert(app, k, v)); };
const environment = environments?.filter(e => e.id === properties.environment.id)[0];
const environment = environments?.filter(e => e.id.toLowerCase() === properties.environment.id.toLowerCase())[0];
const powerApp = new PowerApp(
data.id,
data.name,
version !== undefined ? `${version.major}.${version.minor}.${version.build}.${version.revision}` : "",
properties.displayName,
properties.description,
properties.appOpenUri,
data.name,
version !== undefined ? `${version.major}.${version.minor}.${version.build}.${version.revision}` : "",
properties.displayName,
properties.description,
properties.appOpenUri,
properties.appUris !== undefined && properties.appUris.documentUri !== undefined ? properties.appUris.documentUri.value : undefined,
properties,
environment,
vscode.TreeItemCollapsibleState.Collapsed,
vscode.TreeItemCollapsibleState.Collapsed,
undefined);

powerApp.connections = toConnections(powerApp, properties.connectionReferences);
Expand Down

0 comments on commit cecb58a

Please sign in to comment.