Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
alrod committed Jul 7, 2017
2 parents ab90f56 + 8d0a730 commit 1ae6937
Show file tree
Hide file tree
Showing 78 changed files with 7,618 additions and 1,929 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@
<Content Include="src\app\slots-list\slots-list.component.scss" />
<Content Include="src\app\slot-new\slot-new.component.scss" />
<Content Include="src\app\search-box\search-box.component.scss" />
<None Include="src\app\tabs\tabs.component.scss" />
<Content Include="src\app\tabs\tabs.component.html" />
<Content Include="src\app\tab\tab.component.html" />
<None Include="src\app\template-picker\template-picker.component.scss" />
Expand Down Expand Up @@ -657,7 +656,6 @@
<Content Include=".ember-cli" />
</ItemGroup>
<ItemGroup>
<Content Include="src\app\api-details\api-details.component.css" />
<None Include="src\app\api-new\api-new.component.scss" />
<Content Include="src\app\top-bar\top-bar.component.scss" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions AzureFunctions.AngularClient/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"zone.js": "^0.8.4"
},
"devDependencies": {
"@angular/cli": "^1.0.1",
"@angular/cli": "^1.1.3",
"@angular/compiler-cli": "^4.0.0",
"@types/jasmine": "2.5.38",
"@types/jsonschema": "^1.1.1",
Expand All @@ -55,6 +55,6 @@
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "~2.2.0"
"typescript": "^2.4.1"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
<div class="newproxy-container">

<div class="header">
<div>
<span class="text-level1-heading">{{apiProxyEdit.name}}&nbsp;</span>
<span class="link" (click)="deleteProxyClicked()">
<i class="fa fa-remove"></i> {{ 'apiProxy_delete' | translate }}
</span>
</div>
<div class="link" (click)="openAdvancedEditor()">
<i class="fa fa-edit"></i> {{ 'functionIntegrate_advancedEditor' | translate }}
</div>
</div>

<app-edit-mode-warning [functionApp]="functionApp" [appNode]="appNode"></app-edit-mode-warning>

<form [formGroup]="complexForm">
Expand Down Expand Up @@ -98,14 +110,9 @@

</div>

<div style="display: flex;">
<div style="flex-grow:1;align-items:center;">
<button (click)="submitForm(complexForm.value)" [class.custom-button-disabled]="!complexForm.valid || !complexForm.dirty" [disabled]="!complexForm.valid || !complexForm.dirty" class="custom-button">{{ 'save' | translate }}</button>
<button (click)="onReset()" [class.custom-button-disabled]="!complexForm.valid || !complexForm.dirty" [disabled]="!complexForm.valid || !complexForm.dirty" class="custom-button">{{ 'discrard' | translate }}</button>
</div>
<div class="link" style="flex-grow:0" (click)="deleteProxyClicked()">
<i class="fa fa-remove"></i> Delete proxy
</div>
<div>
<button (click)="submitForm(complexForm.value)" [class.custom-button-disabled]="!complexForm.valid || !complexForm.dirty" [disabled]="!complexForm.valid || !complexForm.dirty" class="custom-button">{{ 'save' | translate }}</button>
<button (click)="onReset()" [class.custom-button-disabled]="!complexForm.valid || !complexForm.dirty" [disabled]="!complexForm.valid || !complexForm.dirty" class="custom-button">{{ 'discrard' | translate }}</button>
</div>

</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,9 @@ export class ApiDetailsComponent implements OnInit {

//this.isEnabled = this._globalStateService.IsRoutingEnabled;
}

openAdvancedEditor() {
let scmUrl = this.apiProxyEdit.functionApp.getScmUrl();
window.open(`${scmUrl}/dev/wwwroot/proxies.json`);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<div class="newproxy-container">

<div class="text-level1-heading">{{ 'apiProxy_new' | translate }} </div>

<app-edit-mode-warning [functionApp]="functionApp" [appNode]="appNode"></app-edit-mode-warning>

<form [formGroup]="complexForm" (ngSubmit)="submitForm(complexForm.value)">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import '../../sass/main';

form {
padding:30px;
padding:15px 0px 0px 0px;
}

form > div {
Expand All @@ -20,3 +20,14 @@ form > div {
padding: 20px;
background-color: $body-bg-color;
}

.header {
display: flex;
div:nth-child(1) {
flex-grow:1;
align-items:center;
}
div:nth-child(2) {
flex-grow:0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -220,5 +220,4 @@ export class ApiNewComponent implements OnInit {
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
<td>{{item.location}}</td>
</tr>

<tr *ngIf="appsNode?.isLoading">
<td *ngIf="appsNode?.isLoading" colspan="4">{{'functionMonitor_loading' | translate}}</td>
<td *ngIf="!appsNode?.isLoading" colspan="4"></td>
<tr *ngIf="isLoading">
<td *ngIf="isLoading" colspan="4">{{'functionMonitor_loading' | translate}}</td>
<td *ngIf="isLoading" colspan="4"></td>
</tr>
</tbl>
<div *ngIf="!appsNode?.isLoading && table.items.length === 0" class="empty-browse">
<div *ngIf="!isLoading && table.items.length === 0" class="empty-browse">
<img src="images/emptybrowse-functions.svg" />
<h4>{{'emptyBrowse_title' | translate}}</h4>
<span>{{'emptyBrowse' | translate}}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ export class AppsListComponent implements OnInit, OnDestroy {
public apps : AppNode[] = [];
public appsNode : AppsNode;

public isLoading = true;

private _viewInfoSubscription : RxSubscription;
private _origRefToItems : AppNode[];

constructor() {
this.viewInfoStream = new Subject<TreeViewInfo>();
Expand All @@ -29,20 +30,12 @@ export class AppsListComponent implements OnInit, OnDestroy {
.distinctUntilChanged()
.switchMap(viewInfo =>{
this.appsNode = (<AppsNode>viewInfo.node);
/* this is need to avoid flickering b/w no list view & table on load
see https://github.com/Azure/azure-functions-ux/issues/1286 */
this.appsNode.isLoading = true;
this.isLoading = true;
return (<AppsNode>viewInfo.node).childrenStream;
})
.subscribe(children =>{
this.apps = children;

/* fix for https://github.com/Azure/azure-functions-ux/issues/1374
if the FunctionApps node has a sibling, the below logic will need to be updated */
if(children.length > 0){
this.appsNode.isLoading = false;
}
this._origRefToItems = children;
this.isLoading = false;
});

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
<h3 class="binding-title pull-left">
{{model.label}}
</h3>
<span [fnWriteAccess]="functionApp" *ngIf="canDelete && !bindingValue.newBinding" class="link" (click)="removeClicked()">{{ 'binding_delete' | translate }}</span>
<span [fnWriteAccess]="functionApp" *ngIf="canDelete && !bindingValue.newBinding" class="link" (click)="removeClicked()">
<i class="fa fa-remove"></i> {{ 'binding_delete' | translate }}
</span>
<div class="clearfix"></div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
border: none;
padding-left: 0px;
padding-right: 0px;

span:nth-child(2) {
vertical-align:middle;
}
}

.control-label{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ export class BindingComponent{
break;
}

this.model.label = this.bindingValue.displayName + " " + bindingTypeString + " (" + this.bindingValue.name + ")";
this.model.label = this.bindingValue.displayName + " " + bindingTypeString;
}

private isHidden(name: string) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { SiteDashboardComponent } from './../site/site-dashboard/site-dashboard.component';
import { Subject } from 'rxjs/Subject';
import { Subscription as RxSubscription } from 'rxjs/Subscription';

Expand Down Expand Up @@ -157,13 +158,14 @@ export class TabFeature extends FeatureItem{
title : string,
keywords : string,
info : string,
public componentName : string,
public tabSub : Subject<string>){
imageUrl : string,
public featureId : string,
private _siteDashboard : SiteDashboardComponent){

super(title, keywords, info);
super(title, keywords, info, imageUrl);
}

click(){
this.tabSub.next(this.componentName.toLowerCase());
this._siteDashboard.openFeature(this.featureId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@
<span class="text-label">{{'keysDialog_getFunctionUrl' | translate}}</span>
</div>
<div class="modal-body keys-dialog-body">
<div *ngIf="isHttpFunction && authLevel && authLevel.toLowerCase() ==='function' && hostKeys">
<div *ngIf="isHttpFunction && hostKeys">
<div class="text-label">{{'keysDialog_key' | translate}}</div>
<select (change)="onChangeKey($event.target.value)">
<option *ngFor="let key of functionKeys.keys" [value]="key.value">{{key.name}} (Function key)</option>
<option *ngFor="let key of hostKeys.keys" [value]="key.value">{{key.name}} (Host key)</option>
</select>
</div>
<div class="keys-dialog-body-invokeUrl">
<div *ngIf="authLevel && authLevel.toLowerCase() !=='admin'" class="text-label">{{'keysDialog_url' | translate}}</div>
<div *ngIf="authLevel && authLevel.toLowerCase() ==='admin'" class="text-label">{{'keysDialog_urlAndAdminKey' | translate}}</div>
<div class="text-label">{{'keysDialog_url' | translate}}</div>
<div><copy-pre [content]="functionInvokeUrl"></copy-pre></div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,7 @@ export class FunctionDevComponent implements OnChanges, OnDestroy {
}
this.updateKeys();

inputBinding = (this.functionInfo.config && this.functionInfo.config.bindings
? this.functionInfo.config.bindings.find(e => e.type === 'httpTrigger')
: null);
if (inputBinding) {
this.isHttpFunction = true;
} else {
this.isHttpFunction = false;
}
this.isHttpFunction = BindingManager.isHttpFunction(this.functionInfo);

setTimeout(() => {
this.onResize();
Expand Down Expand Up @@ -374,15 +367,37 @@ export class FunctionDevComponent implements OnChanges, OnDestroy {
}
private setFunctionInvokeUrl(key?: string) {
if (this.isHttpFunction) {
var code = '';
if (this.webHookType === 'github' || this.authLevel === 'anonymous') {
code = '';
} else if (key) {
code = `?code=${key}`;

//No webhook https://xxx.azurewebsites.net/api/HttpTriggerCSharp1?code=[keyvalue]
//WebhookType = "Generic JSON" https://xxx.azurewebsites.net/api/HttpTriggerCSharp1?code=[keyvalue]&clientId=[keyname]
//WebhookType = "GitHub" or "Slack" https://xxx.azurewebsites.net/api/HttpTriggerCSharp1?clientId=[keyname]
let code = '';
let clientId = '';
let queryParams = '';
if (key) {
code = key;
} else if (this.isHttpFunction && this.secrets && this.secrets.key) {
code = `?code=${this.secrets.key}`;
code = this.secrets.key;
} else if (this.isHttpFunction && this.functionApp.HostSecrets && !this._isClientCertEnabled) {
code = `?code=${this.functionApp.HostSecrets}`;
code = this.functionApp.HostSecrets;
}

if (this.webHookType && key) {
var allKeys = this.functionKeys.keys.concat(this.hostKeys.keys);
var keyWithValue = allKeys.find(k => k.value == key);
if (keyWithValue) {
clientId = keyWithValue.name;
}

if (this.webHookType.toLowerCase() !== 'genericjson') {
code = '';
}
}
if (code) {
queryParams = `?code=${code}`;
}
if (clientId) {
queryParams = queryParams ? `${queryParams}&clientId=${clientId}` : `?clientId=${clientId}`;
}

this.functionApp.getHostJson().subscribe((jsonObj) => {
Expand All @@ -402,7 +417,7 @@ export class FunctionDevComponent implements OnChanges, OnDestroy {
var find = '//';
var re = new RegExp(find, 'g');
path = path.replace(re, '/');
path = path.replace('/?', '?') + code;
path = path.replace('/?', '?') + queryParams;

this.functionInvokeUrl = this.functionApp.getMainSiteUrl() + path;
this.runValid = true;
Expand Down Expand Up @@ -612,7 +627,12 @@ export class FunctionDevComponent implements OnChanges, OnDestroy {
}

setShowFunctionInvokeUrlModal(value: boolean) {
var allKeys = this.functionKeys.keys.concat(this.hostKeys.keys);
if (allKeys.length > 0) {
this.onChangeKey(allKeys[0].value);
}
this.showFunctionInvokeUrlModal = value;

}

setShowFunctionKeyModal(value: boolean) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<div *ngIf="!isStandalone">
<function-keys
*ngIf="functionApp?.isMultiKeySupported"
*ngIf="functionApp?.isMultiKeySupported && isHttpFunction"
[functionApp]="functionApp"
[functionInfo]="functionInfo"></function-keys>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {PortalResources} from '../shared/models/portal-resources';
import {FunctionApp} from '../shared/function-app';
import {TreeViewInfo} from '../tree-view/models/tree-view-info';
import {FunctionManageNode} from '../tree-view/function-node';
import {BindingManager} from '../shared/models/binding-manager';

@Component({
selector: 'function-manage',
Expand All @@ -30,7 +31,8 @@ export class FunctionManageComponent {
public functionStatusOptions: SelectOption<boolean>[];
public functionInfo : FunctionInfo;
public functionApp : FunctionApp;
public isStandalone : boolean;
public isStandalone: boolean;
public isHttpFunction: boolean = false;

private _viewInfoStream : Subject<TreeViewInfo>;
private _functionNode : FunctionManageNode;
Expand All @@ -51,6 +53,7 @@ export class FunctionManageComponent {
this._functionNode = <FunctionManageNode>viewInfo.node;
this.functionInfo = this._functionNode.functionInfo;
this.functionApp = this.functionInfo.functionApp;
this.isHttpFunction = BindingManager.isHttpFunction(this.functionInfo);
});

this.functionStatusOptions = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ <h3>{{ 'functionNew_nameYourFunction' | translate }}</h3>
[(ngModel)]="functionName"
(ngModelChange)="functionNameChanged($event)"
placeholder="{{ 'functionNew_functionName' | translate }}"
[ngClass]="{'input-error':!!functionNameError}">
[ngClass]="{'input-error':!!functionNameError}"
class="function-name">

<pop-over *ngIf="!!functionNameError" [message]="functionNameError" [isInputError]="true">
</pop-over>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,8 @@ input.input-error {

.choose {
padding-bottom:10px;
}

.function-name {
margin-bottom: 20px;
}
Loading

0 comments on commit 1ae6937

Please sign in to comment.