Skip to content

Commit

Permalink
Merge from Dev to Master (#2340)
Browse files Browse the repository at this point in the history
* Making sure selected option in DropDownComponent matches the selected option in the native select element (fixes #2060)

* Add CRM headers (#2225)

* Revert "Check referer before checking X-MS-CLIENT-PRINCIPAL-NAME (#2218)"

This reverts commit 300746c.

* add keyboard controls to download function app

* CRM headers only on create and delete (#2226)

* rp update

* add headers only on create and delete calls

* pr updates and add headers for get entities

* update delete calls to include headers

* Tentatively remove MSA login for Try Functions

* update icon (#2236)

fixes #2235

* Use ARM url specified from Ibiza for national clouds (#2239)

* Revert "Revert "Check referer before checking X-MS-CLIENT-PRINCIPAL-NAME (#2218)""

This reverts commit 481a96b.

* Use ARM url specified from Ibiza for national clouds

* Fixing CR comments

* Experimental Language Toggle (#2238)

* Experimental Language Toggle

* pr updates

* Add TIP1 to accepted origins (#2242)

* Handling namespace for embedded scenario (#2237)

* Fixes #1592 - [Accessibility] Screen reader does not read tree node options when in focus (#2221)

* Minor embedded updates (#2245)

* update templates and filter out errors

* remove retrieve option

* Fixing runtime upgrade warning string

* Updating Ibiza redirect URL's (#2247)

* Minor fixes to disable some features that don't work in national clouds (#2249)

* Fix all functions caching (#2250)

* Fix all functions caching on create

* update function create calls

* nit update

* Change SiteManage component to open the new App Service Plan blade

* Change Destroy to Delete (#2252)

* Fixing build

* Add durable resources (#2251)

* CICD Rework ( Deployment Center)  (#2205)

* CICD Rework

* Fixing a build break and updating the portal-resources.ts file

* Fixing Resources from a bad merge

* Adding flag in tsc to not check lib typings

* correcting import casing for linux build server

* Fixing issues in build with unused variables

* Polish adjustments dashboard tables and auto refreshing of data

* adding state to bitbucket and github oauth

* cleaned up deployment detail log and fixed some translate pipes

* removing unused variables to make compiler happy

* removing bad debug logging from server code

* Made first pass at a basic summary page

* adding some support for summary of Local Git Choice

* first pass at PR Comments, any that are currently marked resolved should be fixed here

* Adjustments based on PR comments

* Fixing build break

* Update travis.yml angular cli

* Removing nodejs server auth and making pug use minified

* adding production check for optimized js files

* adding AI support on the server

* fixing azure head pug

* Fixing some bugs around loading

* Fixing PR changes

* Hiding Deployment Center behind a feature flag

* Fixing build breaks from last commit

* adjustments based on PR comments

* Last of PR comments

* Fixing file name casing issues for linux builds

* securing session cookie

* fixing file names to match our format

* Addressing PR Comment

* Stop showing invalid connection string types, except when already configured (fixes #2248)

* Adding build badges

* Fixing windows local server running (#2268)

* Fixes #2267 and Fixes #2227 Adding mime type for static json files for iisnode (#2269)

* Let NodeJS handle static file loading

* Trying different fix

* Embedded updates (#2271)

* Add preview and update editor name for embedded

* Add ibiza support for deployment center (#2272)

* Let NodeJS handle static file loading

* Trying different fix

* Adding support for loading deployment center inside of ibiza

* fixing build

* build fixes

* Updated settings file to format TS files on save

* Fixing deployment center to load itself rather than app settings

* Adding site service and generalizing conditional-http-client (#2266)

* Adding site service and generalizing conditional-http-client

* Removing arm-preconditions

* Moving precondition.ts back to where it was originally

* Removing deployment center auth state check from returning auth tokens

* Adding telemetry for AppSettings and creating base FeatureComponent (#2280)

* Adding telemetry for AppSettings and creating base FeatureComponent

* Updating with code review comments

* Added parent component concept to make sure we log feature timings only when a parent exists to represent the entire feature

* Whitelist update and accessibility updates (#2273)

* whitelist update and accessibility updates

* remove comment

* pr updates

* Making sure the form control and displayed value are in sync for the AutoSwapSlotName dropdown (fixes #2275)

* EventGrid UI support in function2.0. Fixes #2199

* Disable "enable/disable" and "delete" for VS functions

* Add variable cdn url injected at build time

* Setting view cache to true on node server to check performance increase in next

* making cdn url in body.pug correct

* Fixing typo in index.pug that is preventing the rendering in ng-min

* Updating the referenced templates (#2291)

* Fixing web config to add static file mime types

* Make gulp ignore resources made specifically for Visual Studio that aren't used for portal

* Updating template package, fixing resources

* Updating the swagger editor to match the luminosity ratio (#2288)

* manage blade, focus on input when adding key

* [API definition blade] adding role for expand / collapse (#2286)

* Create from Integrate Tab (#2296)

* Embedded templates "type" update (#2295)

* xrmwebhooktrigger replaces synctrigger

* update binding type

* Moving as many pieces as possible to go through CDN rather than directly to the app (#2300)

* Add variable cdn url injected at build time

* trigger build

* Adding Woff Mime type to web.config

* fixing mime map in web.config

* Adding mime types to web config

* moving more assets to load from cdn

* fixing mime types

* adding ttf mime type

* get resources from cdn when possible

* Moving pieces to load from CDN where available

* fixing cdn image loading

* Adding cache breaking cdn calls

* focus on combo box when get function url clicked

* Adding Cache break query for image loading (#2303)

* add role and label to click to show/click to hide

* undo template update (#2305)

* Add redirects for people going directly to functions.azure.com (#2313)

* correct fowarding address for try functions

* Updated Travis CI link

* xrmwebhooktrigger change (#2314)

* Fixes #2267 - Updating conditional http client to handle complex error types being thrown (#2311)

* Fixing TriggerFunctionAPIM api for ASP.Net controller

* Fixing build

* Implement /api/runtimetoken in node server. Closes #2253 (#2298)

* Implement /api/runtimetoken in node server. Closes #2253

* CR 1

* Temporarily updating APIMTrigger API in node for debugging purposes

* Updating site-config to do permission/lock checks after initial load (#2318)

* Updating site-config to do permission/lock checks after initial load

* Add error handling to several components

* Fixing connection string type

* Error handle updates (#2323)

* creation error handle

* update log error catch

* type update

* Support linux function apps that don't have scm endpoint (#2322)

* Support linux function apps that don't have scm endpoint

* Updating site summary and site manage tabs to inherit from FeatureComponent (#2326)

* Updating site summary and site manage tabs to inherit from FeatureComponent

* Updated SiteEnabledFeaturesComponent to be a FeatureComponent

* Cleaning up based on PR feedback

* PR feedback

* Upgrading from Angular 4 to Angular 5 (#2335)

* Update embedded API version (#2336)

* add role link to revoke renew

* removing vendor import script that is not there in Angular 5

* Fixing local loading

* Update embedded logging (#2337)

* update embedded logging

* remove first do/retry

* Only display error on HostStatus === 'Error'. Closes #2330

* Fixing bug in embedded logging
  • Loading branch information
hartra344 authored Feb 13, 2018
1 parent b8acf02 commit dff737f
Show file tree
Hide file tree
Showing 68 changed files with 1,330 additions and 985 deletions.
35 changes: 18 additions & 17 deletions AzureFunctions.AngularClient/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,24 @@
},
"private": true,
"dependencies": {
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"@ngx-translate/core": "^6.0.1",
"@angular/animations": "^5.0.0",
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
"@angular/core": "^5.0.0",
"@angular/forms": "^5.0.0",
"@angular/http": "^5.0.0",
"@angular/platform-browser": "^5.0.0",
"@angular/platform-browser-dynamic": "^5.0.0",
"@angular/platform-server": "^5.0.0",
"@angular/router": "^5.0.0",
"@ngx-translate/core": "^9.1.1",
"angular2-uuid": "^1.1.1",
"azure-mobile-apps-client": "^2.0.1",
"bootstrap": "^3.3.7",
"core-js": "^2.4.1",
"font-awesome": "^4.7.0",
"jsonschema": "^1.1.1",
"lodash": "4.17.4",
"marked": "^0.3.9",
"moment": "^2.17.0",
"monaco-editor": "^0.10.0",
Expand All @@ -38,20 +41,18 @@
"ng2-file-upload": "~1.2.1",
"ng2-popover": "^0.0.14",
"node-sass": "^4.7.2",
"rxjs": "^5.1.0",
"swagger-editor": "git+/~https://github.com/azure/swagger-editor.git#ff974a50cc7c756f0a96a66f1e92f1286324c549",
"rxjs": "^5.5.2",
"swagger-editor": "git+/~https://github.com/azure/swagger-editor.git#5c7736ff93ffe36569e1f21efd72a91c9c1f9f77",
"ts-helpers": "^1.1.1",
"zone.js": "^0.8.4",
"ng-sidebar": "^6.0.1",
"lodash": "4.17.4"
"zone.js": "^0.8.4"
},
"devDependencies": {
"@angular/cli": "^1.1.3",
"@angular/compiler-cli": "^4.0.0",
"@angular/compiler-cli": "^5.0.0",
"@types/jasmine": "2.5.38",
"@types/jsonschema": "^1.1.1",
"@types/node": "~6.0.60",
"@types/lodash": "^4.14.80",
"@types/node": "~6.0.60",
"codelyzer": "~2.0.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
Expand All @@ -64,7 +65,7 @@
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "^2.4.1",
"typescript": "2.4.2",
"webpack-bundle-analyzer": "^2.9.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export class ApiDetailsComponent extends NavigableComponent implements OnDestroy
route = '/' + route;
}

this.proxyUrl = `https://${this.context.site.properties.hostNameSslStates.find(s => s.hostType === 0).name}` + route;
this.proxyUrl = `https://${this.context.mainSiteUrl}` + route;

const methods = {};
methods['method_GET'] = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ export class ApiNewComponent extends NavigableComponent {
}
if (res.proxies.isSuccessful) {
this.apiProxies = res.proxies.result;
} else if (res.proxies.error.errorId === errorIds.proxyJsonNotFound ||
res.proxies.error.message === errorIds.proxyJsonNotFound) {
} else if (res.proxies.error.errorId === errorIds.proxyJsonNotFound) {
this.apiProxies = [];
} else {
this.showComponentError({
Expand Down
1 change: 1 addition & 0 deletions AzureFunctions.AngularClient/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import 'rxjs/add/operator/mergeMap';
import 'rxjs/add/observable/of';
import 'rxjs/add/operator/retry';
import 'rxjs/add/operator/switchMap';
import 'rxjs/add/operator/take';
import 'rxjs/add/operator/takeUntil';
import 'rxjs/add/observable/timer';
import 'rxjs/add/observable/throw';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LogCategories } from './../../shared/models/constants';
import { LogCategories, Constants } from './../../shared/models/constants';
import { Guid } from './../../shared/Utilities/Guid';
import { LogService } from './../../shared/services/log.service';
import { CacheService } from './../../shared/services/cache.service';
Expand All @@ -20,8 +20,9 @@ export class LoadImageDirective implements OnChanges {

ngOnChanges() {
if (this.imageUrl) {
const cdnUrl = Constants.cdnNgMin;
if (!this.imageUrl.toLowerCase().endsWith('.svg')) {
this._elementRef.nativeElement.innerHTML = `<img src="${this.imageUrl}" />`;
this._elementRef.nativeElement.innerHTML = `<img src="${cdnUrl}${this.imageUrl}?cacheBreak=${window.appsvc.cacheBreakQuery}" />`;
} else {
const headers = new Headers();
headers.append('Accept', 'image/webp,image/apng,image/*,*/*;q=0.8');
Expand All @@ -32,7 +33,7 @@ export class LoadImageDirective implements OnChanges {
// cacheService isn't entirely necessary, though it does mimic actual browser
// behavior a little better which doesn't make new requests (even to local disk) for
// every instance of an image
this._cacheService.get(this.imageUrl, false, headers)
this._cacheService.get(`${cdnUrl}${this.imageUrl}?cacheBreak=${window.appsvc.cacheBreakQuery}`, false, headers)
.subscribe(image => {
this._elementRef.nativeElement.innerHTML = image.text();
}, (e => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
<div class="modal-body keys-dialog-body">
<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>
<select #selectKeys (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 class="text-label">{{'keysDialog_url' | translate}}</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { FunctionAppService } from './../shared/services/function-app.service';
import { FileUtilities } from './../shared/Utilities/file';
import { EditModeHelper } from './../shared/Utilities/edit-mode.helper';
import { ConfigService } from './../shared/services/config.service';
import { Component, QueryList, ViewChild, ViewChildren, OnDestroy, ElementRef, ChangeDetectorRef, AfterViewInit, AfterContentInit } from '@angular/core';
import { Component, QueryList, ViewChild, ViewChildren, OnDestroy, ElementRef, ChangeDetectorRef, AfterViewInit, AfterContentInit, AfterViewChecked } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import { Subscription } from 'rxjs/Subscription';
Expand Down Expand Up @@ -40,7 +40,7 @@ import { AccessibilityHelper } from '../shared/Utilities/accessibility-helper';
templateUrl: './function-dev.component.html',
styleUrls: ['./function-dev.component.scss']
})
export class FunctionDevComponent extends FunctionAppContextComponent implements AfterViewInit, AfterContentInit, OnDestroy {
export class FunctionDevComponent extends FunctionAppContextComponent implements AfterViewInit, AfterContentInit, OnDestroy, AfterViewChecked {
@ViewChild(FileExplorerComponent) fileExplorer: FileExplorerComponent;
@ViewChild(RunHttpComponent) runHttp: RunHttpComponent;
@ViewChildren(BusyStateComponent) BusyStates: QueryList<BusyStateComponent>;
Expand All @@ -51,6 +51,7 @@ export class FunctionDevComponent extends FunctionAppContextComponent implements
@ViewChild('editorContainer') editorContainer: ElementRef;
@ViewChild('rightContainer') rightContainer: ElementRef;
@ViewChild('bottomContainer') bottomContainer: ElementRef;
@ViewChild('selectKeys') selectKeys: ElementRef;

public functionInfo: FunctionInfo;
public functionUpdate: Subscription;
Expand Down Expand Up @@ -146,7 +147,7 @@ export class FunctionDevComponent extends FunctionAppContextComponent implements

setup(): Subscription {
return this.viewInfoEvents
.switchMap(functionView => {
.switchMap(functionView => {
delete this.updatedTestContent;
delete this.runResult;
this.disabled = this._functionAppService.getFunctionAppEditMode(functionView.context)
Expand All @@ -162,7 +163,7 @@ export class FunctionDevComponent extends FunctionAppContextComponent implements
.subscribe(tuple => {
if (tuple[2].isSuccessful) {
const status = tuple[2].result;
if (status.state !== 'Running' && status.state !== 'Default') {
if (status.state === 'Error') {
status.errors = status.errors || [];
this.showComponentError({
message: this._translateService.instant(PortalResources.error_functionRuntimeIsUnableToStart)
Expand Down Expand Up @@ -317,6 +318,12 @@ export class FunctionDevComponent extends FunctionAppContextComponent implements
this.onDisableTestData(this._disableTestDataAfterViewInit);
}

ngAfterViewChecked() {
if (this.showFunctionInvokeUrlModal) {
this.selectKeys.nativeElement.focus();
}
}

private setInvokeUrlVisibility() {
if (this.functionInfo.config.bindings) {
const b = this.functionInfo.config.bindings.find((b) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,51 +13,79 @@
<tbody>
<tr class="not-clickable" *ngFor="let key of keys">
<td><label id="keyNameLabel">{{key.name}}</label></td>
<td>
<a (click)="key.show=!key.show"
<td>
<a *ngIf="key.show"
role="button"
(click)="key.show=!key.show"
(keydown)="keyDown($event, 'showKey', key)"
class="operation"
tabindex="0"
[attr.aria-expanded]="key.show"
[attr.aria-label]="clickToHide">
{{'functionKeys_clickToHide' | translate}}
</a>
<a *ngIf="!key.show"
role="button"
(click)="key.show=!key.show"
(keydown)="keyDown($event, 'showKey', key)"
class="operation"
tabindex="0"
[attr.aria-expanded]="key.show"
[attr.aria-label]="key.name"
>
<ng-container *ngIf="key.show">{{'functionKeys_clickToHide' | translate}}</ng-container>
<ng-container *ngIf="!key.show">{{'functionKeys_clickToShow' | translate}}</ng-container>
[attr.aria-label]="clickToShow">
{{'functionKeys_clickToShow' | translate}}
</a>
<span *ngIf="key.show" [attr.aria-label]="key.value" tabindex="0">{{ key.value }}</span>
</td>
<td>
<div id="operations-bar">
<pop-over message="{{ 'copypre_copied' | translate }}" hideAfter="300">
<pop-over message="{{ 'copypre_copied' | translate }}" hideAfter="300">
<span class="operation"
(click)="copyKey(key)"
(keydown)="keyDown($event, 'copyKey', key)"
>
(keydown)="keyDown($event, 'copyKey', key)">
<i class="fa fa-copy"></i> {{'functionKeys_copy' | translate}}
</span>
</pop-over>
<a class="operation"
<a class="operation"
role="link"
(click)="renewKey(key)"
(keydown)="keyDown($event, 'renewKey', key)"
tabindex="0"
id="renewKeyAction"
aria-labelledby="keyNameLabel renewKeyAction">
<i class="fa fa-refresh"></i> {{'functionKeys_renew' | translate}}</a>
<a class="operation"
<i class="fa fa-refresh"></i>
{{'functionKeys_renew' | translate}}
</a>
<a class="operation"
role="link"
*ngIf="key.name !== '_master'"
(click)="revokeKey(key)"
(keydown)="keyDown($event, 'revokeKey', key)"
tabindex="0"
id="revokeKeyAction"
aria-labelledby="keyNameLabel revokeKeyAction">
<i class="fa fa-times"></i> {{'functionKeys_revoke' | translate}}
<i class="fa fa-times"></i>
{{'functionKeys_revoke' | translate}}
</a>
</div>
</td>
</tr>
<tr *ngIf="addingNew" class="not-clickable">
<td><input type="text" id="newKeyName" (keyup)="checkValidName($event)" [(ngModel)]="newKeyName" placeholder="{{'functionKeys_enterKeyName' | translate}}" /></td>
<td><input type="text" id="newKeyValue" (keyup)="checkValidName($event)" [(ngModel)]="newKeyValue" placeholder="{{'functionKeys_enterKeyValue' | translate}}" /></td>
<td>
<input #newKeyInput
type="text"
id="newKeyName"
(keyup)="checkValidName($event)"
[(ngModel)]="newKeyName"
placeholder="{{'functionKeys_enterKeyName' | translate}}" />
</td>
<td>
<input
type="text"
id="newKeyValue"
(keyup)="checkValidName($event)"
[(ngModel)]="newKeyValue"
placeholder="{{'functionKeys_enterKeyValue' | translate}}" />
</td>
<td>
<button
class="custom-button"
Expand All @@ -66,7 +94,7 @@
tabindex="0"
id="saveNewKeyButton"
aria-labelledby="newKeyName newKeyValue saveNewKeyButton">
{{'save' | translate}}
{{'save' | translate}}
</button>
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Input, ViewChild } from '@angular/core';
import { Component, Input, ViewChild, AfterViewChecked, ElementRef } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/debounceTime';
Expand Down Expand Up @@ -28,10 +28,12 @@ import { ReplaySubject } from 'rxjs/ReplaySubject';
templateUrl: './function-keys.component.html',
styleUrls: ['./function-keys.component.scss', '../table-function-monitor/table-function-monitor.component.scss']
})
export class FunctionKeysComponent extends FunctionAppContextComponent {
export class FunctionKeysComponent extends FunctionAppContextComponent implements AfterViewChecked {
@Input() autoSelect: boolean;
@Input() adminKeys: boolean;
@ViewChild(BusyStateComponent) busyState: BusyStateComponent;
@ViewChild('newKeyInput') newKeyInput: ElementRef;

public newKeyName: string;
public newKeyValue: string;
public validKey: boolean;
Expand Down Expand Up @@ -103,6 +105,16 @@ export class FunctionKeysComponent extends FunctionAppContextComponent {
});
}

setFocusNewKeyInput() {
this.newKeyInput.nativeElement.focus();
}

ngAfterViewChecked () {
if (this.addingNew) {
this.setFocusNewKeyInput();
}
}

showOrHideNewKeyUi() {
if (this.addingNew) {
this.resetState();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ export class EmbeddedFunctionEditorComponent implements OnInit, AfterContentInit
setBottomBarState(expanded: boolean) {
this.bottomBarExpanded = expanded;

console.log('editor bottom bar expanded - ' + this.bottomBarExpanded);

setTimeout(() => {
this.codeEditor.resize();
});
Expand Down Expand Up @@ -170,22 +168,22 @@ export class EmbeddedFunctionEditorComponent implements OnInit, AfterContentInit
if (result) {
this._busyManager.setBusy();
this._embeddedService.deleteFunction(this.resourceId)
.subscribe(r => {
.subscribe(r => {
if (r.isSuccessful) {
this._busyManager.clearBusy();
this._broadcastService.broadcastEvent<TreeUpdateEvent>(BroadcastEvent.TreeUpdate, {
resourceId: this.resourceId,
operation: 'remove'
});
this._busyManager.clearBusy();
this._broadcastService.broadcastEvent<TreeUpdateEvent>(BroadcastEvent.TreeUpdate, {
resourceId: this.resourceId,
operation: 'remove'
});
} else {
this._busyManager.clearBusy();
this._broadcastService.broadcast<ErrorEvent>(BroadcastEvent.Error, {
message: r.error.message,
errorId: r.error.errorId,
resourceId: this.resourceId,
});
this._busyManager.clearBusy();
this._broadcastService.broadcast<ErrorEvent>(BroadcastEvent.Error, {
message: r.error.message,
errorId: r.error.errorId,
resourceId: this.resourceId,
});
}
});
});
}
}
}
Loading

0 comments on commit dff737f

Please sign in to comment.