Skip to content
This repository was archived by the owner on Apr 29, 2025. It is now read-only.

Commit 125e98c

Browse files
authored
Merge pull request #2449 from Azure/ehamai-master
Merging sprint payload dev -> master
2 parents b1c1fbc + aac9cb2 commit 125e98c

File tree

50 files changed

+4004
-823
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+4004
-823
lines changed
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<div
22
class="info-box"
33
[ngClass]="typeClass"
4-
[class.clickable]="!!infoLink"
4+
[class.clickable]="!!infoLink || !!infoActionFn"
55
(click)="onClick($event)"
6-
[tabIndex]="!!infoLink ? 0 : -1"
6+
[tabIndex]="(!!infoLink || !!infoActionFn) ? 0 : -1"
77
(keydown)="onKeyPress($event)">
88

99
<div class="info-icon-container">
@@ -12,8 +12,11 @@
1212
<div class="info-text-container">
1313
<div>{{ infoText }}</div>
1414
</div>
15-
<div *ngIf="!!infoLink" class="info-link-container">
16-
<span load-image="image/learn-more.svg" class="icon-small"></span>
15+
<div *ngIf="!!infoLink || !!infoActionFn" class="info-link-container">
16+
<span
17+
class="icon-small"
18+
[load-image]="infoActionIcon || 'image/learn-more.svg'">
19+
</span>
1720
</div>
1821

1922
</div>

AzureFunctions.AngularClient/src/app/controls/info-box/info-box.component.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export class InfoBoxComponent {
1010

1111
@Input() infoText: string = null;
1212
@Input() infoLink: string = null;
13+
@Input() infoActionFn: () => void = null;
14+
@Input() infoActionIcon: string = null;
1315

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

3436
onClick(event: any) {
35-
if (!!this.infoLink) {
36-
window.open(this.infoLink, '_blank');
37-
}
37+
this._invoke();
3838
}
3939

4040
onKeyPress(event: KeyboardEvent) {
41-
if (!!this.infoLink && event.keyCode === KeyCodes.enter) {
41+
if (event.keyCode === KeyCodes.enter) {
42+
this._invoke();
43+
}
44+
}
45+
46+
private _invoke() {
47+
if (!!this.infoActionFn) {
48+
this.infoActionFn();
49+
} else if (!!this.infoLink) {
4250
window.open(this.infoLink, '_blank');
4351
}
4452
}

AzureFunctions.AngularClient/src/app/controls/textbox/textbox.component.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@
22

33
<input *ngIf="!control"
44
type="text"
5+
(change)="onChange($event.target.value)"
6+
(keyup)="onKeyUp($event.target.value)"
7+
[readonly]="readonly"
8+
[disabled]="disabled"
59
[placeholder]="placeholder" />
610

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

913
<input #textboxInput
1014
type="text"
15+
(change)="onChange($event.target.value)"
16+
(keyup)="onKeyUp($event.target.value)"
17+
[readonly]="readonly"
18+
[disabled]="disabled"
1119
[formControl]="control"
1220
[placeholder]="placeholder"
1321
[class.dirty]="highlightDirty && control?.dirty" />

AzureFunctions.AngularClient/src/app/controls/textbox/textbox.component.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { FormControl } from '@angular/forms';
2-
import { Component, OnInit, Input, ViewChild } from '@angular/core';
2+
import { Component, Input, OnInit, Output, ViewChild } from '@angular/core';
3+
import { Subject } from 'rxjs/Subject';
34

45
@Component({
56
selector: 'textbox',
@@ -11,12 +12,19 @@ export class TextboxComponent implements OnInit {
1112
@Input() control: FormControl;
1213
@Input() placeholder = '';
1314
@Input() highlightDirty: boolean;
15+
@Input() readonly: boolean;
16+
@Input() disabled: boolean;
17+
18+
@Output() change: Subject<string>;
19+
@Output() value: Subject<string>;
1420

1521
@ViewChild('textboxInput') textboxInput: any;
1622

1723
public Obj = Object;
1824

1925
constructor() {
26+
this.change = new Subject<string>();
27+
this.value = new Subject<string>();
2028
}
2129

2230
ngOnInit() {
@@ -27,4 +35,12 @@ export class TextboxComponent implements OnInit {
2735
this.textboxInput.nativeElement.focus();
2836
}
2937
}
38+
39+
onChange(value: string) {
40+
this.change.next(value);
41+
}
42+
43+
onKeyUp(value: string) {
44+
this.value.next(value);
45+
}
3046
}

AzureFunctions.AngularClient/src/app/function-quickstart/function-quickstart.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ <h2>{{ 'intro_chooseLanguage' | translate }}</h2>
5555
<div id="quickstart-lang-radios">
5656
<label><input type="radio" name="language" [(ngModel)]="selectedLanguage" value="CSharp" checked>CSharp</label>
5757
<label><input type="radio" name="language" [(ngModel)]="selectedLanguage" value="JavaScript">JavaScript</label>
58-
<label><input type="radio" name="language" [(ngModel)]="selectedLanguage" value="FSharp">FSharp</label>
59-
<label><input type="radio" name="language" [(ngModel)]="selectedLanguage" value="Java">Java</label>
58+
<label *ngIf="runtimeVersion === 'V1'"><input type="radio" name="language" [(ngModel)]="selectedLanguage" value="FSharp">FSharp</label>
59+
<label *ngIf="runtimeVersion === 'V1'"><input type="radio" name="language" [(ngModel)]="selectedLanguage" value="Java">Java</label>
6060
</div>
6161

62-
<div id="quickstart-lang-custom">
62+
<div *ngIf="runtimeVersion === 'V1'" id="quickstart-lang-custom">
6363
{{ 'intro_ifYou' | translate }}
6464
<span class="link"
6565
role="link"

AzureFunctions.AngularClient/src/app/function-quickstart/function-quickstart.component.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { FunctionAppContextComponent } from 'app/shared/components/function-app-
2222
import { Subscription } from 'rxjs/Subscription';
2323
import { KeyCodes } from '../shared/models/constants';
2424
import { Dom } from '../shared/Utilities/dom';
25+
import { Observable } from 'rxjs/Observable';
2526

2627

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

4446
private functionsNode: FunctionsNode;
4547
private _viewInfoStream = new Subject<TreeViewInfo<any>>();
@@ -69,15 +71,18 @@ export class FunctionQuickstartComponent extends FunctionAppContextComponent {
6971
return this.viewInfoEvents
7072
.switchMap(r => {
7173
this.functionsNode = r.node as FunctionsNode;
72-
return this._functionAppService.getFunctions(this.context);
74+
return Observable.zip(
75+
this._functionAppService.getFunctions(this.context),
76+
this._functionAppService.getRuntimeGeneration(this.context));
7377
})
7478
.do(null, e => {
7579
this._aiService.trackException(e, '/errors/function-quickstart');
7680
console.error(e);
7781
})
78-
.subscribe(fcs => {
82+
.subscribe(tuple => {
7983
this._globalStateService.clearBusyState();
80-
this.functionsInfo = fcs.result;
84+
this.functionsInfo = tuple[0].result;
85+
this.runtimeVersion = tuple[1];
8186
});
8287
}
8388

@@ -166,9 +171,9 @@ export class FunctionQuickstartComponent extends FunctionAppContextComponent {
166171
}
167172
this._globalStateService.clearBusyState();
168173
},
169-
() => {
170-
this._globalStateService.clearBusyState();
171-
});
174+
() => {
175+
this._globalStateService.clearBusyState();
176+
});
172177
} catch (e) {
173178
this.showComponentError({
174179
message: this._translateService.instant(PortalResources.functionCreateErrorDetails, { error: JSON.stringify(e) }),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<busy-state name="site-tabs" cssClass="ibiza-feature"></busy-state>
2+
<deployment-slots *ngIf="viewInfo" [viewInfoInput]='viewInfo' [swapMode]='swapMode'></deployment-slots>

AzureFunctions.AngularClient/src/app/ibiza-feature/deployment-slots-shell/deployment-slots-shell.component.scss

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { DeploymentSlotsShellComponent } from './deployment-slots-shell.component';
4+
5+
describe('DeploymentSlotsShellComponent', () => {
6+
let component: DeploymentSlotsShellComponent;
7+
let fixture: ComponentFixture<DeploymentSlotsShellComponent>;
8+
9+
beforeEach(async(() => {
10+
TestBed.configureTestingModule({
11+
declarations: [DeploymentSlotsShellComponent]
12+
})
13+
.compileComponents();
14+
}));
15+
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(DeploymentSlotsShellComponent);
18+
component = fixture.componentInstance;
19+
fixture.detectChanges();
20+
});
21+
22+
it('should be created', () => {
23+
expect(component).toBeTruthy();
24+
});
25+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { DashboardType } from 'app/tree-view/models/dashboard-type';
2+
import { TreeViewInfo, SiteData } from './../../tree-view/models/tree-view-info';
3+
import { Component, OnDestroy } from '@angular/core';
4+
import { TranslateService } from '@ngx-translate/core';
5+
import { ActivatedRoute } from '@angular/router';
6+
import { Subject } from 'rxjs/Subject';
7+
8+
@Component({
9+
selector: 'app-deployment-slots-shell',
10+
templateUrl: './deployment-slots-shell.component.html',
11+
styleUrls: ['./deployment-slots-shell.component.scss']
12+
})
13+
export class DeploymentSlotsShellComponent implements OnDestroy {
14+
viewInfo: TreeViewInfo<SiteData>;
15+
swapMode: boolean;
16+
ngUnsubscribe: Subject<void>;
17+
18+
constructor(translateService: TranslateService, route: ActivatedRoute) {
19+
this.ngUnsubscribe = new Subject<void>();
20+
21+
route.params
22+
.takeUntil(this.ngUnsubscribe)
23+
.subscribe(x => {
24+
this.viewInfo = {
25+
resourceId: `/subscriptions/${x['subscriptionId']}/resourceGroups/${x[
26+
'resourceGroup'
27+
]}/providers/Microsoft.Web/sites/${x['site']}` + (x['slot'] ? `/slots/${x['slot']}` : ``),
28+
dashboardType: DashboardType.none,
29+
node: null,
30+
data: null
31+
};
32+
33+
if (x['action'] && x['action'] === 'swap') {
34+
this.swapMode = true;
35+
}
36+
});
37+
}
38+
39+
ngOnDestroy(): void {
40+
this.ngUnsubscribe.next();
41+
}
42+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { NgModule, ModuleWithProviders } from '@angular/core';
2+
import { DeploymentSlotsShellComponent } from './deployment-slots-shell.component';
3+
import { RouterModule } from '@angular/router';
4+
import { DeploymentSlotsComponent } from 'app/site/deployment-slots/deployment-slots.component';
5+
import { SharedFunctionsModule } from 'app/shared/shared-functions.module';
6+
import { SharedModule } from 'app/shared/shared.module';
7+
import { TranslateModule } from '@ngx-translate/core';
8+
import { DeploymentSlotsModule } from 'app/site/deployment-slots/deployment-slots.module';
9+
import 'rxjs/add/operator/takeUntil';
10+
11+
const routing: ModuleWithProviders = RouterModule.forChild([{ path: '', component: DeploymentSlotsShellComponent }]);
12+
13+
@NgModule({
14+
entryComponents: [DeploymentSlotsComponent],
15+
imports: [TranslateModule.forChild(), SharedModule, SharedFunctionsModule, DeploymentSlotsModule, routing],
16+
declarations: [],
17+
providers: []
18+
})
19+
export class DeploymentSlotsShellModule { }

AzureFunctions.AngularClient/src/app/ibiza-feature/ibiza-feature.module.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,23 @@ const routing: ModuleWithProviders = RouterModule.forChild([
2929
{
3030
path: 'subscriptions/:subscriptionId/resourcegroups/:resourceGroup/providers/microsoft.web/sites/:site/slots/:slot/deployment',
3131
loadChildren: 'app/ibiza-feature/deployment-shell/deployment-shell.module#DeploymentShellModule'
32-
}
32+
},
33+
{
34+
path: 'subscriptions/:subscriptionId/resourcegroups/:resourceGroup/providers/microsoft.web/sites/:site/deploymentslots',
35+
loadChildren: 'app/ibiza-feature/deployment-slots-shell/deployment-slots-shell.module#DeploymentSlotsShellModule'
36+
},
37+
{
38+
path: 'subscriptions/:subscriptionId/resourcegroups/:resourceGroup/providers/microsoft.web/sites/:site/slots/:slot/deploymentslots',
39+
loadChildren: 'app/ibiza-feature/deployment-slots-shell/deployment-slots-shell.module#DeploymentSlotsShellModule'
40+
},
41+
{
42+
path: 'subscriptions/:subscriptionId/resourcegroups/:resourceGroup/providers/microsoft.web/sites/:site/deploymentslots/actions/:action',
43+
loadChildren: 'app/ibiza-feature/deployment-slots-shell/deployment-slots-shell.module#DeploymentSlotsShellModule'
44+
},
45+
{
46+
path: 'subscriptions/:subscriptionId/resourcegroups/:resourceGroup/providers/microsoft.web/sites/:site/slots/:slot/deploymentslots/actions/:action',
47+
loadChildren: 'app/ibiza-feature/deployment-slots-shell/deployment-slots-shell.module#DeploymentSlotsShellModule'
48+
},
3349
]
3450
}
3551
]);
@@ -38,4 +54,4 @@ const routing: ModuleWithProviders = RouterModule.forChild([
3854
imports: [TranslateModule.forChild(), SharedModule, routing],
3955
declarations: [IbizaFeatureComponent]
4056
})
41-
export class IbizaFeatureModule {}
57+
export class IbizaFeatureModule { }

0 commit comments

Comments
 (0)