Skip to content

Commit

Permalink
Merge pull request #2449 from Azure/ehamai-master
Browse files Browse the repository at this point in the history
Merging sprint payload dev -> master
  • Loading branch information
ehamai authored Mar 19, 2018
2 parents b1c1fbc + aac9cb2 commit 125e98c
Show file tree
Hide file tree
Showing 50 changed files with 4,004 additions and 823 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div
class="info-box"
[ngClass]="typeClass"
[class.clickable]="!!infoLink"
[class.clickable]="!!infoLink || !!infoActionFn"
(click)="onClick($event)"
[tabIndex]="!!infoLink ? 0 : -1"
[tabIndex]="(!!infoLink || !!infoActionFn) ? 0 : -1"
(keydown)="onKeyPress($event)">

<div class="info-icon-container">
Expand All @@ -12,8 +12,11 @@
<div class="info-text-container">
<div>{{ infoText }}</div>
</div>
<div *ngIf="!!infoLink" class="info-link-container">
<span load-image="image/learn-more.svg" class="icon-small"></span>
<div *ngIf="!!infoLink || !!infoActionFn" class="info-link-container">
<span
class="icon-small"
[load-image]="infoActionIcon || 'image/learn-more.svg'">
</span>
</div>

</div>
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export class InfoBoxComponent {

@Input() infoText: string = null;
@Input() infoLink: string = null;
@Input() infoActionFn: () => void = null;
@Input() infoActionIcon: string = null;

public typeClass = 'info';
public iconPath = 'image/info.svg';
Expand All @@ -32,13 +34,19 @@ export class InfoBoxComponent {
}

onClick(event: any) {
if (!!this.infoLink) {
window.open(this.infoLink, '_blank');
}
this._invoke();
}

onKeyPress(event: KeyboardEvent) {
if (!!this.infoLink && event.keyCode === KeyCodes.enter) {
if (event.keyCode === KeyCodes.enter) {
this._invoke();
}
}

private _invoke() {
if (!!this.infoActionFn) {
this.infoActionFn();
} else if (!!this.infoLink) {
window.open(this.infoLink, '_blank');
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@

<input *ngIf="!control"
type="text"
(change)="onChange($event.target.value)"
(keyup)="onKeyUp($event.target.value)"
[readonly]="readonly"
[disabled]="disabled"
[placeholder]="placeholder" />

<ng-container *ngIf="!!control">

<input #textboxInput
type="text"
(change)="onChange($event.target.value)"
(keyup)="onKeyUp($event.target.value)"
[readonly]="readonly"
[disabled]="disabled"
[formControl]="control"
[placeholder]="placeholder"
[class.dirty]="highlightDirty && control?.dirty" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { FormControl } from '@angular/forms';
import { Component, OnInit, Input, ViewChild } from '@angular/core';
import { Component, Input, OnInit, Output, ViewChild } from '@angular/core';
import { Subject } from 'rxjs/Subject';

@Component({
selector: 'textbox',
Expand All @@ -11,12 +12,19 @@ export class TextboxComponent implements OnInit {
@Input() control: FormControl;
@Input() placeholder = '';
@Input() highlightDirty: boolean;
@Input() readonly: boolean;
@Input() disabled: boolean;

@Output() change: Subject<string>;
@Output() value: Subject<string>;

@ViewChild('textboxInput') textboxInput: any;

public Obj = Object;

constructor() {
this.change = new Subject<string>();
this.value = new Subject<string>();
}

ngOnInit() {
Expand All @@ -27,4 +35,12 @@ export class TextboxComponent implements OnInit {
this.textboxInput.nativeElement.focus();
}
}

onChange(value: string) {
this.change.next(value);
}

onKeyUp(value: string) {
this.value.next(value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ <h2>{{ 'intro_chooseLanguage' | translate }}</h2>
<div id="quickstart-lang-radios">
<label><input type="radio" name="language" [(ngModel)]="selectedLanguage" value="CSharp" checked>CSharp</label>
<label><input type="radio" name="language" [(ngModel)]="selectedLanguage" value="JavaScript">JavaScript</label>
<label><input type="radio" name="language" [(ngModel)]="selectedLanguage" value="FSharp">FSharp</label>
<label><input type="radio" name="language" [(ngModel)]="selectedLanguage" value="Java">Java</label>
<label *ngIf="runtimeVersion === 'V1'"><input type="radio" name="language" [(ngModel)]="selectedLanguage" value="FSharp">FSharp</label>
<label *ngIf="runtimeVersion === 'V1'"><input type="radio" name="language" [(ngModel)]="selectedLanguage" value="Java">Java</label>
</div>

<div id="quickstart-lang-custom">
<div *ngIf="runtimeVersion === 'V1'" id="quickstart-lang-custom">
{{ 'intro_ifYou' | translate }}
<span class="link"
role="link"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { FunctionAppContextComponent } from 'app/shared/components/function-app-
import { Subscription } from 'rxjs/Subscription';
import { KeyCodes } from '../shared/models/constants';
import { Dom } from '../shared/Utilities/dom';
import { Observable } from 'rxjs/Observable';


type TemplateType = 'HttpTrigger' | 'TimerTrigger' | 'QueueTrigger';
Expand All @@ -40,6 +41,7 @@ export class FunctionQuickstartComponent extends FunctionAppContextComponent {
showJavaSplashPage = false;
setShowJavaSplashPage = new Subject<boolean>();
templateTypeOptions: TemplateType[] = ['HttpTrigger', 'TimerTrigger', 'QueueTrigger'];
runtimeVersion: string;

private functionsNode: FunctionsNode;
private _viewInfoStream = new Subject<TreeViewInfo<any>>();
Expand Down Expand Up @@ -69,15 +71,18 @@ export class FunctionQuickstartComponent extends FunctionAppContextComponent {
return this.viewInfoEvents
.switchMap(r => {
this.functionsNode = r.node as FunctionsNode;
return this._functionAppService.getFunctions(this.context);
return Observable.zip(
this._functionAppService.getFunctions(this.context),
this._functionAppService.getRuntimeGeneration(this.context));
})
.do(null, e => {
this._aiService.trackException(e, '/errors/function-quickstart');
console.error(e);
})
.subscribe(fcs => {
.subscribe(tuple => {
this._globalStateService.clearBusyState();
this.functionsInfo = fcs.result;
this.functionsInfo = tuple[0].result;
this.runtimeVersion = tuple[1];
});
}

Expand Down Expand Up @@ -166,9 +171,9 @@ export class FunctionQuickstartComponent extends FunctionAppContextComponent {
}
this._globalStateService.clearBusyState();
},
() => {
this._globalStateService.clearBusyState();
});
() => {
this._globalStateService.clearBusyState();
});
} catch (e) {
this.showComponentError({
message: this._translateService.instant(PortalResources.functionCreateErrorDetails, { error: JSON.stringify(e) }),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<busy-state name="site-tabs" cssClass="ibiza-feature"></busy-state>
<deployment-slots *ngIf="viewInfo" [viewInfoInput]='viewInfo' [swapMode]='swapMode'></deployment-slots>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { DeploymentSlotsShellComponent } from './deployment-slots-shell.component';

describe('DeploymentSlotsShellComponent', () => {
let component: DeploymentSlotsShellComponent;
let fixture: ComponentFixture<DeploymentSlotsShellComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [DeploymentSlotsShellComponent]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(DeploymentSlotsShellComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should be created', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { DashboardType } from 'app/tree-view/models/dashboard-type';
import { TreeViewInfo, SiteData } from './../../tree-view/models/tree-view-info';
import { Component, OnDestroy } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { ActivatedRoute } from '@angular/router';
import { Subject } from 'rxjs/Subject';

@Component({
selector: 'app-deployment-slots-shell',
templateUrl: './deployment-slots-shell.component.html',
styleUrls: ['./deployment-slots-shell.component.scss']
})
export class DeploymentSlotsShellComponent implements OnDestroy {
viewInfo: TreeViewInfo<SiteData>;
swapMode: boolean;
ngUnsubscribe: Subject<void>;

constructor(translateService: TranslateService, route: ActivatedRoute) {
this.ngUnsubscribe = new Subject<void>();

route.params
.takeUntil(this.ngUnsubscribe)
.subscribe(x => {
this.viewInfo = {
resourceId: `/subscriptions/${x['subscriptionId']}/resourceGroups/${x[
'resourceGroup'
]}/providers/Microsoft.Web/sites/${x['site']}` + (x['slot'] ? `/slots/${x['slot']}` : ``),
dashboardType: DashboardType.none,
node: null,
data: null
};

if (x['action'] && x['action'] === 'swap') {
this.swapMode = true;
}
});
}

ngOnDestroy(): void {
this.ngUnsubscribe.next();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { NgModule, ModuleWithProviders } from '@angular/core';
import { DeploymentSlotsShellComponent } from './deployment-slots-shell.component';
import { RouterModule } from '@angular/router';
import { DeploymentSlotsComponent } from 'app/site/deployment-slots/deployment-slots.component';
import { SharedFunctionsModule } from 'app/shared/shared-functions.module';
import { SharedModule } from 'app/shared/shared.module';
import { TranslateModule } from '@ngx-translate/core';
import { DeploymentSlotsModule } from 'app/site/deployment-slots/deployment-slots.module';
import 'rxjs/add/operator/takeUntil';

const routing: ModuleWithProviders = RouterModule.forChild([{ path: '', component: DeploymentSlotsShellComponent }]);

@NgModule({
entryComponents: [DeploymentSlotsComponent],
imports: [TranslateModule.forChild(), SharedModule, SharedFunctionsModule, DeploymentSlotsModule, routing],
declarations: [],
providers: []
})
export class DeploymentSlotsShellModule { }
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,23 @@ const routing: ModuleWithProviders = RouterModule.forChild([
{
path: 'subscriptions/:subscriptionId/resourcegroups/:resourceGroup/providers/microsoft.web/sites/:site/slots/:slot/deployment',
loadChildren: 'app/ibiza-feature/deployment-shell/deployment-shell.module#DeploymentShellModule'
}
},
{
path: 'subscriptions/:subscriptionId/resourcegroups/:resourceGroup/providers/microsoft.web/sites/:site/deploymentslots',
loadChildren: 'app/ibiza-feature/deployment-slots-shell/deployment-slots-shell.module#DeploymentSlotsShellModule'
},
{
path: 'subscriptions/:subscriptionId/resourcegroups/:resourceGroup/providers/microsoft.web/sites/:site/slots/:slot/deploymentslots',
loadChildren: 'app/ibiza-feature/deployment-slots-shell/deployment-slots-shell.module#DeploymentSlotsShellModule'
},
{
path: 'subscriptions/:subscriptionId/resourcegroups/:resourceGroup/providers/microsoft.web/sites/:site/deploymentslots/actions/:action',
loadChildren: 'app/ibiza-feature/deployment-slots-shell/deployment-slots-shell.module#DeploymentSlotsShellModule'
},
{
path: 'subscriptions/:subscriptionId/resourcegroups/:resourceGroup/providers/microsoft.web/sites/:site/slots/:slot/deploymentslots/actions/:action',
loadChildren: 'app/ibiza-feature/deployment-slots-shell/deployment-slots-shell.module#DeploymentSlotsShellModule'
},
]
}
]);
Expand All @@ -38,4 +54,4 @@ const routing: ModuleWithProviders = RouterModule.forChild([
imports: [TranslateModule.forChild(), SharedModule, routing],
declarations: [IbizaFeatureComponent]
})
export class IbizaFeatureModule {}
export class IbizaFeatureModule { }
Loading

0 comments on commit 125e98c

Please sign in to comment.