Skip to content

Commit

Permalink
Merge branch 'dev' into dev-to-master
Browse files Browse the repository at this point in the history
  • Loading branch information
nertim committed Jul 20, 2018
2 parents 4a1df43 + d7998a1 commit 88a111c
Show file tree
Hide file tree
Showing 70 changed files with 5,406 additions and 1,490 deletions.
2 changes: 2 additions & 0 deletions client/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { UserService } from './shared/services/user.service';
import { RouterModule, Resolve, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import { SharedModule } from './shared/shared.module';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgModule, Injectable } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
Expand Down Expand Up @@ -90,6 +91,7 @@ export class AppModule {
SharedModule.forRoot(),
ReactiveFormsModule,
BrowserModule,
BrowserAnimationsModule,
HttpModule,
TranslateModule.forRoot(),
PopoverModule,
Expand Down
6 changes: 6 additions & 0 deletions client/src/app/binding-input/binding-input.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@
(selectItem)="finishDialogPicker($event)">
</notification-hub>

<cosmos-db *ngIf="pickerName === 'CosmosDB'"
[viewInfo]="viewInfo"
(close)="closePicker($event)"
(selectItem)="finishDialogPicker($event)">
</cosmos-db>

<popover-content #pickerPopover
placement="auto right"
[animation]="true"
Expand Down
5 changes: 3 additions & 2 deletions client/src/app/binding-input/binding-input.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export class BindingInputComponent extends FunctionAppContextComponent {
this.pickerName = 'AppSetting';
break;
case ResourceType.DocumentDB:
this.pickerName = this.useCustomFunctionInputPicker ? 'AppSetting' : 'DocDbPickerBlade';
this.pickerName = this.useCustomFunctionInputPicker ? 'AppSetting' : 'CosmosDB';
break;
case ResourceType.ServiceBus:
this.pickerName = this.useCustomFunctionInputPicker ? 'AppSetting' : 'NotificationHubPickerBlade';
Expand Down Expand Up @@ -135,7 +135,8 @@ export class BindingInputComponent extends FunctionAppContextComponent {
if (this.pickerName !== 'EventHub' &&
this.pickerName !== 'ServiceBus' &&
this.pickerName !== 'AppSetting' &&
this.pickerName !== 'NotificationHub') {
this.pickerName !== 'NotificationHub' &&
this.pickerName !== 'CosmosDB') {

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

Expand Down
1 change: 1 addition & 0 deletions client/src/app/busy-state/busy-state.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export type BusyStateName =
| 'site-api-definition'
| 'site-continuous-deployment'
| 'logic-apps'
| 'console'
| 'scale-up'
| 'deployment-slots-config'
| 'standalone-config';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { Subject } from 'rxjs/Subject';
import { Component, Input, Output } from '@angular/core';
import { KeyCodes } from 'app/shared/models/constants';
import { FunctionAppService } from '../shared/services/function-app.service';
import { FileUtilities } from '../shared/Utilities/file';
import { GlobalStateService } from '../shared/services/global-state.service';

type DownloadOption = 'siteContent' | 'vsProject';

Expand All @@ -22,7 +24,9 @@ export class DownloadFunctionAppContentComponent {
public currentDownloadOption: DownloadOption;
public includeAppSettings: boolean;

constructor(private _translateService: TranslateService, private _functionAppService: FunctionAppService) {
constructor(private _translateService: TranslateService,
private _functionAppService: FunctionAppService,
private _globalStateService: GlobalStateService) {
this.close = new Subject<boolean>();
this.downloadOptions = [{
displayLabel: this._translateService.instant(PortalResources.downloadFunctionAppContent_siteContent),
Expand All @@ -38,13 +42,15 @@ export class DownloadFunctionAppContentComponent {
downloadFunctionAppContent() {
if (this.context) {
const includeCsProj = this.currentDownloadOption === 'siteContent' ? false : true;

this._globalStateService.setBusyState();
this.closeModal();
this._functionAppService.getAppContentAsZip(this.context, includeCsProj, this.includeAppSettings)
.subscribe(data => {
if (data.isSuccessful) {
window.open(window.URL.createObjectURL(data.result));
FileUtilities.saveFile(data.result, `${this.context.site.name}.zip`);
}
});
this._globalStateService.clearBusyState();
}, () => this._globalStateService.clearBusyState());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
(close)="closePicker($event)"
(selectItem)="finishDialogPicker($event)">
</sql>

<cosmos-db *ngIf="pickerName === 'CosmosDB'"
[viewInfo]="viewInfo"
(close)="closePicker($event)"
(selectItem)="finishDialogPicker($event)">
</cosmos-db>

<tooltip-content #freeAccountTooltip>
<p>
{{ 'tryNow_FreeAccountToolTip' | translate }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class BindingInputV2Component extends FunctionAppContextComponent {
this.pickerName = 'AppSetting';
break;
case ResourceType.DocumentDB:
this.pickerName = this.useCustomFunctionInputPicker ? 'AppSetting' : 'DocDbPickerBlade';
this.pickerName = this.useCustomFunctionInputPicker ? 'AppSetting' : 'CosmosDB';
break;
case ResourceType.ServiceBus:
this.pickerName = this.useCustomFunctionInputPicker ? 'AppSetting' : 'NotificationHubPickerBlade';
Expand All @@ -128,7 +128,10 @@ export class BindingInputV2Component extends FunctionAppContextComponent {
const picker = <PickerInput>this.input;
picker.inProcess = true;

if (this.pickerName !== 'EventHub' && this.pickerName !== 'ServiceBus' && this.pickerName !== 'AppSetting') {
if (this.pickerName !== 'EventHub' &&
this.pickerName !== 'ServiceBus' &&
this.pickerName !== 'AppSetting' &&
this.pickerName !== 'CosmosDB') {

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

Expand Down
4 changes: 3 additions & 1 deletion client/src/app/functions.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import { ErrorsWarningsComponent } from './errors-warnings/errors-warnings.compo
import { MonitorDetailsComponent } from './function-monitor/monitor-details/monitor-details.component';
import { SidebarModule } from 'ng-sidebar';
import { MonitorConfigureComponent } from './function-monitor/monitor-configure/monitor-configure.component';
import { CosmosDBComponent } from './pickers/cosmos-db/cosmos-db.component';

const routing: ModuleWithProviders = RouterModule.forChild([
{
Expand Down Expand Up @@ -142,7 +143,8 @@ const routing: ModuleWithProviders = RouterModule.forChild([
JavaSplashPageComponent,
ExtensionCheckerComponent,
ErrorsWarningsComponent,
MonitorConfigureComponent
MonitorConfigureComponent,
CosmosDBComponent
],
providers: []
})
Expand Down
63 changes: 63 additions & 0 deletions client/src/app/pickers/cosmos-db/cosmos-db.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<div class="modal fade in" id="cosmos-picker" >
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" (click)="onClose()">&times;</button>
<label>{{'eventHubPicker_connection' | translate}} </label>
</div>
<div class="modal-body" style="display: flex;flex-direction:column;">
<div style="margin-bottom: 10px;">
<radio-selector [options]="options" [defaultValue]="optionTypes.cosmosDB" (value)="optionsChange.next($event)"></radio-selector>
</div>

<div *ngIf="option === optionTypes.cosmosDB" class="line">
<div class="select-container">
<label>{{'subscriptionName' | translate}}</label>
<div *ngIf="subscriptions?.length == 0" class="text-label">{{'notFound' | translate}}</div>
<i *ngIf="!subscriptions" class="fa fa-refresh fa-spin fa-fw margin-bottom"></i>
<select *ngIf="subscriptions?.length > 0" (change)="onChangeSubscription($event.target.value)" [(ngModel)]="selectedSubscription">
<option *ngFor="let item of subscriptions" [value]="item.value.subscriptionId">{{item.displayLabel}}</option>
</select>
</div>
<div *ngIf="selectedSubscription" class="select-container">
<label>{{'databaseAccount' | translate}}</label>
<div *ngIf="databases?.value.length == 0" class="text-label">{{'notFound' | translate}}</div>
<i *ngIf="!databases?.value" class="fa fa-refresh fa-spin fa-fw margin-bottom"></i>
<select *ngIf="databases?.value?.length > 0" [(ngModel)]="selectedDatabase">
<option *ngFor="let item of databases.value" [value]="item.id">{{item.name}}</option>
</select>
</div>
</div>

<div *ngIf="option === optionTypes.custom">
<div class="input-container">
<label>{{'eventHubPicker_appSettingName' | translate}}</label>
<div>
<input type="text" (keyup)="setSelect()" [(ngModel)]="appSettingName" />
</div>
</div>
<div class="input-container">
<label>{{'eventHubPicker_appSettingValue' | translate}}</label>
<div>
<input type="text" (keyup)="setSelect()" [(ngModel)]="appSettingValue" />
</div>
</div>
</div>

<div class="button-conainer">
<button *ngIf="!selectInProcess"
(click)="onSelect()"
[disabled]="!canSelect"
class="custom-button">

<ng-container *ngIf="option !== optionTypes.custom">{{ 'select' | translate }}</ng-container>
<ng-container *ngIf="option === optionTypes.custom">{{ 'create' | translate }}</ng-container>
</button>
<i *ngIf="selectInProcess" class="fa fa-refresh fa-spin fa-fw margin-bottom button-spin"></i>
</div>
</div>
</div>
</div>
</div>

<div class="modal-backdrop fade in"></div>
Loading

0 comments on commit 88a111c

Please sign in to comment.