Skip to content

Commit

Permalink
Merge 6506a3b into 60d2bf8
Browse files Browse the repository at this point in the history
  • Loading branch information
ehamai committed Apr 12, 2018
2 parents 60d2bf8 + 6506a3b commit af26f0d
Show file tree
Hide file tree
Showing 31 changed files with 103 additions and 88 deletions.
13 changes: 11 additions & 2 deletions client/src/app/busy-state/busy-state.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,18 @@ import { Guid } from './../shared/Utilities/Guid';
export type BusyStateName =
'global'
| 'dashboard'
| 'site-tabs'
| 'try-functions'
| 'function-keys';
| 'function-keys'
| 'site-summary'
| 'site-manage'
| 'site-config'
| 'site-function-settings'
| 'site-api-definition'
| 'site-continuous-deployment'
| 'logic-apps'
| 'scale-up'
| 'deployment-slots-config'
| 'standalone-config';

@Component({
selector: 'busy-state',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<busy-state name="site-tabs" cssClass="ibiza-feature"></busy-state>
<busy-state name="site-config" cssClass="ibiza-feature"></busy-state>
<site-config *ngIf="viewInfo" [viewInfoInput]='viewInfo'></site-config>
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<busy-state name="site-tabs" cssClass="ibiza-feature"></busy-state>
<busy-state name="site-continuous-deployment" cssClass="ibiza-feature"></busy-state>
<app-deployment-center *ngIf="viewInfo" [viewInfoInput]='viewInfo'></app-deployment-center>
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<busy-state name="site-tabs" cssClass="ibiza-feature"></busy-state>
<busy-state name="deployment-slots-config" cssClass="ibiza-feature"></busy-state>
<deployment-slots *ngIf="viewInfo" [viewInfoInput]='viewInfo' [swapMode]='swapMode'></deployment-slots>
4 changes: 2 additions & 2 deletions client/src/app/logic-apps/logic-apps.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ArmSiteDescriptor } from 'app/shared/resourceDescriptors';
import { FunctionAppService } from 'app/shared/services/function-app.service';
import { FunctionAppContextComponent } from 'app/shared/components/function-app-context-component';
import { LogCategories } from './../shared/models/constants';
import { LogCategories, SiteTabIds } from './../shared/models/constants';
import { LogService } from './../shared/services/log.service';
import { ArmService } from 'app/shared/services/arm.service';
import { BusyStateScopeManager } from './../busy-state/busy-state-scope-manager';
Expand Down Expand Up @@ -79,7 +79,7 @@ export class LogicAppsComponent extends FunctionAppContextComponent {
broadcastService: BroadcastService) {
super('logic-apps', _functionAppService, broadcastService);

this._busyManager = new BusyStateScopeManager(broadcastService, 'site-tabs');
this._busyManager = new BusyStateScopeManager(broadcastService, SiteTabIds.logicApps);
}

setup(): RxSubscription {
Expand Down
1 change: 1 addition & 0 deletions client/src/app/shared/components/feature-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export abstract class FeatureComponent<T> extends ErrorableComponent implements
ngOnDestroy(): void {
this.ngUnsubscribe.next();
if (this.__busyManager) {
this.__logService.debug(LogCategories.featureComponent, `In destroy. Clearing busy for componentName: ${this.componentName}`);
this.__busyManager.clearBusy();
}
}
Expand Down
25 changes: 12 additions & 13 deletions client/src/app/shared/models/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,18 @@ export class TabCommunicationVerbs {
}

export class SiteTabIds {
public static readonly overview = 'overview';
public static readonly monitor = 'monitor';
public static readonly features = 'platformFeatures';
public static readonly functionRuntime = 'functionRuntimeSettings';
public static readonly apiDefinition = 'apiDefinition';
public static readonly config = 'config';
public static readonly applicationSettings = 'appSettings';
public static readonly continuousDeployment = 'continuousDeployment';
public static readonly logicApps = 'logicApps';
public static readonly deploymentSlotsConfig = 'deploymentSlotsConfig';
public static readonly deploymentSlotsSwap = 'deploymentSlotsSwap';
public static readonly deploymentSlotsCreate = 'deploymentSlotsCreate';
public static readonly scaleUp = 'scaleUp';
public static readonly overview = 'site-summary';
public static readonly platformFeatures = 'site-manage';
public static readonly functionRuntime = 'site-function-settings';
public static readonly apiDefinition = 'site-api-definition';
public static readonly standaloneConfig = 'standalone-config';
public static readonly applicationSettings = 'site-config';
public static readonly continuousDeployment = 'site-continuous-deployment';
public static readonly logicApps = 'logic-apps';
public static readonly deploymentSlotsConfig = 'deployment-slots-config';
public static readonly deploymentSlotsSwap = 'deployment-slots-swap';
public static readonly deploymentSlotsCreate = 'deployment-slots-create';
public static readonly scaleUp = 'scale-up';
}

export class Arm {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ArmObj } from 'app/shared/models/arm/arm-obj';
import { Site } from 'app/shared/models/arm/site';
import { PublishingCredentials } from 'app/shared/models/publishing-credentials';
import { LogService } from 'app/shared/services/log.service';
import { LogCategories } from 'app/shared/models/constants';
import { LogCategories, SiteTabIds } from 'app/shared/models/constants';
import { summaryItem } from 'app/site/deployment-center/Models/summary-item';
import { sourceControlProvider } from 'app/site/deployment-center/deployment-center-setup/wizard-logic/deployment-center-setup-models';
import { TranslateService } from '@ngx-translate/core';
Expand All @@ -37,7 +37,7 @@ export class StepCompleteComponent implements OnInit {
private _logService: LogService,
private _translateService: TranslateService
) {
this._busyManager = new BusyStateScopeManager(_broadcastService, 'site-tabs');
this._busyManager = new BusyStateScopeManager(_broadcastService, SiteTabIds.continuousDeployment);

this.wizard.resourceIdStream$
.takeUntil(this._ngUnsubscribe$)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { BroadcastService } from 'app/shared/services/broadcast.service';
import { BroadcastEvent } from 'app/shared/models/broadcast-event';
import { OnDestroy } from '@angular/core/src/metadata/lifecycle_hooks';
import { TreeViewInfo, SiteData } from 'app/tree-view/models/tree-view-info';
import { LogCategories } from 'app/shared/models/constants';
import { LogCategories, SiteTabIds } from 'app/shared/models/constants';
import { LogService } from 'app/shared/services/log.service';

@Component({
Expand Down Expand Up @@ -52,7 +52,7 @@ export class DeploymentCenterComponent implements OnDestroy {
private _logService: LogService,
broadcastService: BroadcastService
) {
this._busyManager = new BusyStateScopeManager(broadcastService, 'site-tabs');
this._busyManager = new BusyStateScopeManager(broadcastService, SiteTabIds.continuousDeployment);

this.viewInfoStream
.takeUntil(this._ngUnsubscribe$)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { BusyStateScopeManager } from 'app/busy-state/busy-state-scope-manager';
import { BroadcastService } from 'app/shared/services/broadcast.service';
import { BroadcastEvent } from 'app/shared/models/broadcast-event';
import { LogService } from 'app/shared/services/log.service';
import { LogCategories } from 'app/shared/models/constants';
import { LogCategories, SiteTabIds } from 'app/shared/models/constants';
class KuduTableItem implements TableItem {
public type: 'row' | 'group';
public time: string;
Expand Down Expand Up @@ -57,7 +57,7 @@ export class KuduDashboardComponent implements OnChanges, OnDestroy {
private _broadcastService: BroadcastService,
private _logService: LogService
) {
this._busyManager = new BusyStateScopeManager(_broadcastService, 'site-tabs');
this._busyManager = new BusyStateScopeManager(_broadcastService, SiteTabIds.continuousDeployment);
this._tableItems = [];
this.viewInfoStream$ = new Subject<string>();
this._viewInfoSubscription$ = this.viewInfoStream$
Expand Down Expand Up @@ -93,29 +93,29 @@ export class KuduDashboardComponent implements OnChanges, OnDestroy {
);
})
.subscribe(
r => {
this._busyManager.clearBusy();
this._forceLoad = false;
this.deploymentObject = {
site: r.site,
siteConfig: r.siteConfig,
sourceControls: r.sourceControl,
publishingCredentials: r.pubCreds,
deployments: r.deployments,
publishingUser: r.publishingUser
};
this._populateTable();
r => {
this._busyManager.clearBusy();
this._forceLoad = false;
this.deploymentObject = {
site: r.site,
siteConfig: r.siteConfig,
sourceControls: r.sourceControl,
publishingCredentials: r.pubCreds,
deployments: r.deployments,
publishingUser: r.publishingUser
};
this._populateTable();

this._writePermission = r.writePermission;
this._readOnlyLock = r.readOnlyLock;
this.hasWritePermissions = r.writePermission && !r.readOnlyLock;
},
err => {
this._busyManager.clearBusy();
this._forceLoad = false;
this.deploymentObject = null;
this._logService.error(LogCategories.cicd, '/deployment-center-initial-load', err);
}
this._writePermission = r.writePermission;
this._readOnlyLock = r.readOnlyLock;
this.hasWritePermissions = r.writePermission && !r.readOnlyLock;
},
err => {
this._busyManager.clearBusy();
this._forceLoad = false;
this.deploymentObject = null;
this._logService.error(LogCategories.cicd, '/deployment-center-initial-load', err);
}
);

//refresh automatically every 5 seconds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { SimpleChanges, OnDestroy } from '@angular/core/src/metadata/lifecycle_h
import { Deployment, DeploymentData } from '../../Models/deployment-data';
import { Component, Input, OnChanges, ViewChild } from '@angular/core';
import * as moment from 'moment-mini-ts';
import { LogCategories } from 'app/shared/models/constants';
import { LogCategories, SiteTabIds } from 'app/shared/models/constants';
import { LogService } from 'app/shared/services/log.service';
import { BusyStateScopeManager } from '../../../../busy-state/busy-state-scope-manager';
import { ArmService } from '../../../../shared/services/arm.service';
Expand Down Expand Up @@ -47,7 +47,7 @@ export class VsoDashboardComponent implements OnChanges, OnDestroy {
private _translateService: TranslateService,
private _broadcastService: BroadcastService
) {
this._busyManager = new BusyStateScopeManager(_broadcastService, 'site-tabs');
this._busyManager = new BusyStateScopeManager(_broadcastService, SiteTabIds.continuousDeployment);
this.viewInfoStream$ = new Subject<string>();
this.viewInfoStream$
.takeUntil(this._ngUnsubscribe$)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LogCategories } from 'app/shared/models/constants';
import { LogCategories, SiteTabIds } from 'app/shared/models/constants';
import { LogService } from 'app/shared/services/log.service';
import { Component, Injector, Input, OnDestroy, Output } from '@angular/core';
import { Observable } from 'rxjs/Observable';
Expand Down Expand Up @@ -64,7 +64,7 @@ export class AddSlotComponent extends FeatureComponent<ResourceId> implements On
private _authZService: AuthzService,
private _injector: Injector
) {
super('AddSlotComponent', _injector, 'site-tabs');
super('AddSlotComponent', _injector, SiteTabIds.deploymentSlotsConfig);

// TODO [andimarc]
// For ibiza scenarios, this needs to match the deep link feature name used to load this in ibiza menu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { FeatureComponent } from 'app/shared/components/feature-component';
import { ArmObj, ResourceId } from 'app/shared/models/arm/arm-obj';
import { Site } from 'app/shared/models/arm/site';
import { SiteConfig } from 'app/shared/models/arm/site-config';
import { Links, LogCategories } from 'app/shared/models/constants';
import { Links, LogCategories, SiteTabIds } from 'app/shared/models/constants';
import { PortalResources } from 'app/shared/models/portal-resources';
import { RoutingRule } from 'app/shared/models/arm/routing-rule';
import { ArmSiteDescriptor } from 'app/shared/resourceDescriptors';
Expand Down Expand Up @@ -85,7 +85,7 @@ export class DeploymentSlotsComponent extends FeatureComponent<TreeViewInfo<Site
private _translateService: TranslateService,
injector: Injector) {

super('SlotsComponent', injector, 'site-tabs');
super('SlotsComponent', injector, SiteTabIds.deploymentSlotsConfig);

// TODO [andimarc]
// For ibiza scenarios, this needs to match the deep link feature name used to load this in ibiza menu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { FeatureComponent } from 'app/shared/components/feature-component';
import { ArmObj, ResourceId, ArmArrayResult } from 'app/shared/models/arm/arm-obj';
import { Site } from 'app/shared/models/arm/site';
import { SlotsDiff } from 'app/shared/models/arm/slots-diff';
import { LogCategories } from 'app/shared/models/constants';
import { LogCategories, SiteTabIds } from 'app/shared/models/constants';
import { DropDownElement } from 'app/shared/models/drop-down-element';
import { PortalResources } from 'app/shared/models/portal-resources';
import { ArmSiteDescriptor } from 'app/shared/resourceDescriptors';
Expand Down Expand Up @@ -88,7 +88,7 @@ export class SwapSlotsComponent extends FeatureComponent<ResourceId> implements
private _translateService: TranslateService,
injector: Injector
) {
super('SwapSlotsComponent', injector, 'site-tabs');
super('SwapSlotsComponent', injector, SiteTabIds.deploymentSlotsConfig);

this.close = new Subject<boolean>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class FunctionRuntimeComponent extends FunctionAppContextComponent {
private _languageService: LanguageService) {
super('function-runtime', _functionAppService, broadcastService, () => this._busyManager.setBusy());

this._busyManager = new BusyStateScopeManager(broadcastService, 'site-tabs');
this._busyManager = new BusyStateScopeManager(broadcastService, SiteTabIds.functionRuntime);

this.functionStatusOptions = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class SiteConfigStandaloneComponent implements OnDestroy {
private _aiService: AiService,
private _broadcastService: BroadcastService,
) {
this._busyManager = new BusyStateScopeManager(_broadcastService, 'site-tabs');
this._busyManager = new BusyStateScopeManager(_broadcastService, SiteTabIds.standaloneConfig);

this.viewInfoStream = new Subject<TreeViewInfo<SiteData>>();
this._viewInfoSubscription = this.viewInfoStream
Expand Down Expand Up @@ -136,7 +136,7 @@ export class SiteConfigStandaloneComponent implements OnDestroy {
connectionStrings: connectionStrings
});

this._broadcastService.clearDirtyState(SiteTabIds.config);
this._broadcastService.clearDirtyState(SiteTabIds.standaloneConfig);

if (this._valueSubscription) {
this._valueSubscription.unsubscribe();
Expand All @@ -145,7 +145,8 @@ export class SiteConfigStandaloneComponent implements OnDestroy {
this._valueSubscription = this.mainForm.valueChanges.subscribe(() => {
// There isn't a callback for dirty state on a form, so this is a workaround.
if (this.mainForm.dirty) {
this._broadcastService.setDirtyState(SiteTabIds.config);
this._broadcastService.clearDirtyState(SiteTabIds.standaloneConfig);
this._broadcastService.setDirtyState(SiteTabIds.standaloneConfig);
}
});
}
Expand Down Expand Up @@ -177,7 +178,7 @@ export class SiteConfigStandaloneComponent implements OnDestroy {
this._valueSubscription.unsubscribe();
this._valueSubscription = null;
}
this._broadcastService.clearDirtyState(SiteTabIds.config);
this._broadcastService.clearDirtyState(SiteTabIds.standaloneConfig);
}

save() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { SiteTabIds } from './../../../shared/models/constants';
import { ConfigSaveComponent, ArmSaveConfigs } from 'app/shared/components/config-save-component';
import { Component, Injector, Input, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
import { FormArray, FormBuilder, FormGroup, Validators, ValidatorFn } from '@angular/forms';
Expand Down Expand Up @@ -51,7 +52,7 @@ export class AppSettingsComponent extends ConfigSaveComponent implements OnChang
private _siteService: SiteService,
injector: Injector
) {
super('AppSettingsComponent', injector, ['ApplicationSettings', 'SlotConfigNames'], 'site-tabs');
super('AppSettingsComponent', injector, ['ApplicationSettings', 'SlotConfigNames'], SiteTabIds.applicationSettings);

this._resetPermissionsAndLoadingState();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ConfigSaveComponent, ArmSaveConfigs } from 'app/shared/components/config-save-component';
import { LogService } from 'app/shared/services/log.service';
import { LogCategories } from './../../../shared/models/constants';
import { LogCategories, SiteTabIds } from './../../../shared/models/constants';
import { errorIds } from 'app/shared/models/error-ids';
import { Component, Injector, Input, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
import { FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms';
Expand Down Expand Up @@ -49,7 +49,7 @@ export class ConnectionStringsComponent extends ConfigSaveComponent implements O
private _logService: LogService,
injector: Injector
) {
super('ConnectionStringsComponent', injector, ['ConnectionStrings', 'SlotConfigNames'], 'site-tabs');
super('ConnectionStringsComponent', injector, ['ConnectionStrings', 'SlotConfigNames'], SiteTabIds.applicationSettings);

this._resetPermissionsAndLoadingState();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ConfigSaveComponent, ArmSaveConfigs } from 'app/shared/components/config-save-component';
import { LogCategories } from './../../../shared/models/constants';
import { LogCategories, SiteTabIds } from './../../../shared/models/constants';
import { LogService } from './../../../shared/services/log.service';
import { SiteService } from 'app/shared/services/site.service';
import { Component, Injector, Input, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
Expand Down Expand Up @@ -45,7 +45,7 @@ export class DefaultDocumentsComponent extends ConfigSaveComponent implements On
private _siteService: SiteService,
injector: Injector
) {
super('DefaultDocumentComponent', injector, ['SiteConfig'], 'site-tabs');
super('DefaultDocumentComponent', injector, ['SiteConfig'], SiteTabIds.applicationSettings);

this._resetPermissionsAndLoadingState();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ConfigSaveComponent, ArmSaveConfigs } from 'app/shared/components/config-save-component';
import { Links, LogCategories } from './../../../shared/models/constants';
import { Links, LogCategories, SiteTabIds } from './../../../shared/models/constants';
import { PortalService } from './../../../shared/services/portal.service';
import { Component, Injector, Input, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
Expand Down Expand Up @@ -89,7 +89,7 @@ export class GeneralSettingsComponent extends ConfigSaveComponent implements OnC
private _siteService: SiteService,
injector: Injector
) {
super('GeneralSettingsComponent', injector, ['Site', 'SiteConfig'], 'site-tabs');
super('GeneralSettingsComponent', injector, ['Site', 'SiteConfig'], SiteTabIds.applicationSettings);

this._resetSlotsInfo();

Expand Down

0 comments on commit af26f0d

Please sign in to comment.