Skip to content

Commit 88a111c

Browse files
committed
Merge branch 'dev' into dev-to-master
2 parents 4a1df43 + d7998a1 commit 88a111c

File tree

70 files changed

+5406
-1490
lines changed

Some content is hidden

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

70 files changed

+5406
-1490
lines changed

client/src/app/app.module.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { UserService } from './shared/services/user.service';
33
import { RouterModule, Resolve, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
44
import { SharedModule } from './shared/shared.module';
55
import { BrowserModule } from '@angular/platform-browser';
6+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
67
import { NgModule, Injectable } from '@angular/core';
78
import { ReactiveFormsModule } from '@angular/forms';
89
import { HttpModule } from '@angular/http';
@@ -90,6 +91,7 @@ export class AppModule {
9091
SharedModule.forRoot(),
9192
ReactiveFormsModule,
9293
BrowserModule,
94+
BrowserAnimationsModule,
9395
HttpModule,
9496
TranslateModule.forRoot(),
9597
PopoverModule,

client/src/app/binding-input/binding-input.component.html

+6
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@
3434
(selectItem)="finishDialogPicker($event)">
3535
</notification-hub>
3636

37+
<cosmos-db *ngIf="pickerName === 'CosmosDB'"
38+
[viewInfo]="viewInfo"
39+
(close)="closePicker($event)"
40+
(selectItem)="finishDialogPicker($event)">
41+
</cosmos-db>
42+
3743
<popover-content #pickerPopover
3844
placement="auto right"
3945
[animation]="true"

client/src/app/binding-input/binding-input.component.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export class BindingInputComponent extends FunctionAppContextComponent {
101101
this.pickerName = 'AppSetting';
102102
break;
103103
case ResourceType.DocumentDB:
104-
this.pickerName = this.useCustomFunctionInputPicker ? 'AppSetting' : 'DocDbPickerBlade';
104+
this.pickerName = this.useCustomFunctionInputPicker ? 'AppSetting' : 'CosmosDB';
105105
break;
106106
case ResourceType.ServiceBus:
107107
this.pickerName = this.useCustomFunctionInputPicker ? 'AppSetting' : 'NotificationHubPickerBlade';
@@ -135,7 +135,8 @@ export class BindingInputComponent extends FunctionAppContextComponent {
135135
if (this.pickerName !== 'EventHub' &&
136136
this.pickerName !== 'ServiceBus' &&
137137
this.pickerName !== 'AppSetting' &&
138-
this.pickerName !== 'NotificationHub') {
138+
this.pickerName !== 'NotificationHub' &&
139+
this.pickerName !== 'CosmosDB') {
139140

140141
this._globalStateService.setBusyState(this._translateService.instant(PortalResources.resourceSelect));
141142

client/src/app/busy-state/busy-state.component.ts

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export type BusyStateName =
2020
| 'site-api-definition'
2121
| 'site-continuous-deployment'
2222
| 'logic-apps'
23+
| 'console'
2324
| 'scale-up'
2425
| 'deployment-slots-config'
2526
| 'standalone-config';

client/src/app/download-function-app-content/download-function-app-content.component.ts

+10-4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { Subject } from 'rxjs/Subject';
66
import { Component, Input, Output } from '@angular/core';
77
import { KeyCodes } from 'app/shared/models/constants';
88
import { FunctionAppService } from '../shared/services/function-app.service';
9+
import { FileUtilities } from '../shared/Utilities/file';
10+
import { GlobalStateService } from '../shared/services/global-state.service';
911

1012
type DownloadOption = 'siteContent' | 'vsProject';
1113

@@ -22,7 +24,9 @@ export class DownloadFunctionAppContentComponent {
2224
public currentDownloadOption: DownloadOption;
2325
public includeAppSettings: boolean;
2426

25-
constructor(private _translateService: TranslateService, private _functionAppService: FunctionAppService) {
27+
constructor(private _translateService: TranslateService,
28+
private _functionAppService: FunctionAppService,
29+
private _globalStateService: GlobalStateService) {
2630
this.close = new Subject<boolean>();
2731
this.downloadOptions = [{
2832
displayLabel: this._translateService.instant(PortalResources.downloadFunctionAppContent_siteContent),
@@ -38,13 +42,15 @@ export class DownloadFunctionAppContentComponent {
3842
downloadFunctionAppContent() {
3943
if (this.context) {
4044
const includeCsProj = this.currentDownloadOption === 'siteContent' ? false : true;
41-
45+
this._globalStateService.setBusyState();
46+
this.closeModal();
4247
this._functionAppService.getAppContentAsZip(this.context, includeCsProj, this.includeAppSettings)
4348
.subscribe(data => {
4449
if (data.isSuccessful) {
45-
window.open(window.URL.createObjectURL(data.result));
50+
FileUtilities.saveFile(data.result, `${this.context.site.name}.zip`);
4651
}
47-
});
52+
this._globalStateService.clearBusyState();
53+
}, () => this._globalStateService.clearBusyState());
4854
}
4955
}
5056

client/src/app/function/binding-input-v2/binding-input-v2.component.html

+7
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@
2727
(close)="closePicker($event)"
2828
(selectItem)="finishDialogPicker($event)">
2929
</sql>
30+
31+
<cosmos-db *ngIf="pickerName === 'CosmosDB'"
32+
[viewInfo]="viewInfo"
33+
(close)="closePicker($event)"
34+
(selectItem)="finishDialogPicker($event)">
35+
</cosmos-db>
36+
3037
<tooltip-content #freeAccountTooltip>
3138
<p>
3239
{{ 'tryNow_FreeAccountToolTip' | translate }}

client/src/app/function/binding-input-v2/binding-input-v2.component.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export class BindingInputV2Component extends FunctionAppContextComponent {
105105
this.pickerName = 'AppSetting';
106106
break;
107107
case ResourceType.DocumentDB:
108-
this.pickerName = this.useCustomFunctionInputPicker ? 'AppSetting' : 'DocDbPickerBlade';
108+
this.pickerName = this.useCustomFunctionInputPicker ? 'AppSetting' : 'CosmosDB';
109109
break;
110110
case ResourceType.ServiceBus:
111111
this.pickerName = this.useCustomFunctionInputPicker ? 'AppSetting' : 'NotificationHubPickerBlade';
@@ -128,7 +128,10 @@ export class BindingInputV2Component extends FunctionAppContextComponent {
128128
const picker = <PickerInput>this.input;
129129
picker.inProcess = true;
130130

131-
if (this.pickerName !== 'EventHub' && this.pickerName !== 'ServiceBus' && this.pickerName !== 'AppSetting') {
131+
if (this.pickerName !== 'EventHub' &&
132+
this.pickerName !== 'ServiceBus' &&
133+
this.pickerName !== 'AppSetting' &&
134+
this.pickerName !== 'CosmosDB') {
132135

133136
this._globalStateService.setBusyState(this._translateService.instant(PortalResources.resourceSelect));
134137

client/src/app/functions.module.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import { ErrorsWarningsComponent } from './errors-warnings/errors-warnings.compo
5050
import { MonitorDetailsComponent } from './function-monitor/monitor-details/monitor-details.component';
5151
import { SidebarModule } from 'ng-sidebar';
5252
import { MonitorConfigureComponent } from './function-monitor/monitor-configure/monitor-configure.component';
53+
import { CosmosDBComponent } from './pickers/cosmos-db/cosmos-db.component';
5354

5455
const routing: ModuleWithProviders = RouterModule.forChild([
5556
{
@@ -142,7 +143,8 @@ const routing: ModuleWithProviders = RouterModule.forChild([
142143
JavaSplashPageComponent,
143144
ExtensionCheckerComponent,
144145
ErrorsWarningsComponent,
145-
MonitorConfigureComponent
146+
MonitorConfigureComponent,
147+
CosmosDBComponent
146148
],
147149
providers: []
148150
})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<div class="modal fade in" id="cosmos-picker" >
2+
<div class="modal-dialog modal-lg">
3+
<div class="modal-content">
4+
<div class="modal-header">
5+
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" (click)="onClose()">&times;</button>
6+
<label>{{'eventHubPicker_connection' | translate}} </label>
7+
</div>
8+
<div class="modal-body" style="display: flex;flex-direction:column;">
9+
<div style="margin-bottom: 10px;">
10+
<radio-selector [options]="options" [defaultValue]="optionTypes.cosmosDB" (value)="optionsChange.next($event)"></radio-selector>
11+
</div>
12+
13+
<div *ngIf="option === optionTypes.cosmosDB" class="line">
14+
<div class="select-container">
15+
<label>{{'subscriptionName' | translate}}</label>
16+
<div *ngIf="subscriptions?.length == 0" class="text-label">{{'notFound' | translate}}</div>
17+
<i *ngIf="!subscriptions" class="fa fa-refresh fa-spin fa-fw margin-bottom"></i>
18+
<select *ngIf="subscriptions?.length > 0" (change)="onChangeSubscription($event.target.value)" [(ngModel)]="selectedSubscription">
19+
<option *ngFor="let item of subscriptions" [value]="item.value.subscriptionId">{{item.displayLabel}}</option>
20+
</select>
21+
</div>
22+
<div *ngIf="selectedSubscription" class="select-container">
23+
<label>{{'databaseAccount' | translate}}</label>
24+
<div *ngIf="databases?.value.length == 0" class="text-label">{{'notFound' | translate}}</div>
25+
<i *ngIf="!databases?.value" class="fa fa-refresh fa-spin fa-fw margin-bottom"></i>
26+
<select *ngIf="databases?.value?.length > 0" [(ngModel)]="selectedDatabase">
27+
<option *ngFor="let item of databases.value" [value]="item.id">{{item.name}}</option>
28+
</select>
29+
</div>
30+
</div>
31+
32+
<div *ngIf="option === optionTypes.custom">
33+
<div class="input-container">
34+
<label>{{'eventHubPicker_appSettingName' | translate}}</label>
35+
<div>
36+
<input type="text" (keyup)="setSelect()" [(ngModel)]="appSettingName" />
37+
</div>
38+
</div>
39+
<div class="input-container">
40+
<label>{{'eventHubPicker_appSettingValue' | translate}}</label>
41+
<div>
42+
<input type="text" (keyup)="setSelect()" [(ngModel)]="appSettingValue" />
43+
</div>
44+
</div>
45+
</div>
46+
47+
<div class="button-conainer">
48+
<button *ngIf="!selectInProcess"
49+
(click)="onSelect()"
50+
[disabled]="!canSelect"
51+
class="custom-button">
52+
53+
<ng-container *ngIf="option !== optionTypes.custom">{{ 'select' | translate }}</ng-container>
54+
<ng-container *ngIf="option === optionTypes.custom">{{ 'create' | translate }}</ng-container>
55+
</button>
56+
<i *ngIf="selectInProcess" class="fa fa-refresh fa-spin fa-fw margin-bottom button-spin"></i>
57+
</div>
58+
</div>
59+
</div>
60+
</div>
61+
</div>
62+
63+
<div class="modal-backdrop fade in"></div>

0 commit comments

Comments
 (0)