Skip to content

Commit a7cabab

Browse files
ehamaihartra344
authored andcommitted
Fixes #2256 and Fixes #2432 - Logic apps in national clouds and delete function bugs (#2472)
1 parent ffeefa9 commit a7cabab

File tree

4 files changed

+29
-22
lines changed

4 files changed

+29
-22
lines changed

AzureFunctions.AngularClient/src/app/shared/models/constants.ts

+1
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ export class ScenarioIds {
168168
public static readonly addConsole = 'AddConsole';
169169
public static readonly addSsh = 'AddSsh';
170170
public static readonly addTopLevelAppsNode = 'AddTopLevelAppsNode';
171+
public static readonly addLogicApps = 'AddLogicApps';
171172
public static readonly enableAppInsights = 'EnableAppInsights';
172173
public static readonly enablePushNotifications = 'EnablePushNotifications';
173174
public static readonly enableAuth = 'EnableAuth';

AzureFunctions.AngularClient/src/app/shared/services/function-app.service.ts

+12-14
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,16 @@ export class FunctionAppService {
126126
return this
127127
.getClient(context)
128128
.execute(
129-
{ resourceId: context.site.id }, /*input*/
130-
token => Observable /*query*/
129+
{ resourceId: context.site.id }, /*input*/
130+
token => Observable /*query*/
131131
.zip(
132132
this.retrieveProxies(context, token),
133133
this._cacheService.get('assets/schemas/proxies.json', false, this.portalHeaders(token)),
134134
(p, s) => ({ proxies: p, schema: s }))
135135
.flatMap(response => this.validateAndGetProxies(response.proxies, response.schema)));
136136
}
137137

138-
private retrieveProxies(context: FunctionAppContext, token: string) : Observable<any> {
138+
private retrieveProxies(context: FunctionAppContext, token: string): Observable<any> {
139139
return this._cacheService
140140
.get(context.urlTemplates.proxiesJsonUrl, false, this.headers(token))
141141
.catch(err => err.status === 404
@@ -147,8 +147,7 @@ export class FunctionAppService {
147147
: Observable.throw(err));
148148
}
149149

150-
private validateAndGetProxies(proxiesResponse: any, schemaResponse: any) : Observable<ApiProxy[]>
151-
{
150+
private validateAndGetProxies(proxiesResponse: any, schemaResponse: any): Observable<ApiProxy[]> {
152151
let proxiesJson, schemaJson;
153152

154153
try {
@@ -181,7 +180,7 @@ export class FunctionAppService {
181180
});
182181
}
183182
}
184-
183+
185184
return Observable.of(ApiProxy.fromJson(proxiesJson));
186185
}
187186

@@ -431,14 +430,13 @@ export class FunctionAppService {
431430
}
432431

433432
deleteFunction(context: FunctionAppContext, functionInfo: FunctionInfo): Result<void> {
434-
return this.getClient(context).execute({ resourceId: context.site.id }, t =>
435-
this._cacheService.delete(functionInfo.href, this.jsonHeaders(t)));
436-
// .concatMap(r => this.getRuntimeGeneration())
437-
// .concatMap((runtimeVersion: string) => {
438-
// return runtimeVersion === 'V2'
439-
// ? this.updateDisabledAppSettings([functionInfo])
440-
// : Observable.of(null);
441-
// }));
433+
return this.getClient(context)
434+
.execute({ resourceId: context.site.id }, t => {
435+
return this._cacheService.delete(functionInfo.href, this.jsonHeaders(t));
436+
})
437+
.do(r => {
438+
this._cacheService.clearCachePrefix(context.urlTemplates.functionsUrl);
439+
});
442440
}
443441

444442
// TODO: [ahmels] change to Result<T>

AzureFunctions.AngularClient/src/app/shared/services/scenario/national-cloud.environment.ts

+7
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ export class NationalCloudEnvironment extends AzureEnvironment {
3939
}
4040
};
4141

42+
this.scenarioChecks[ScenarioIds.addLogicApps] = {
43+
id: ScenarioIds.addLogicApps,
44+
runCheck: () => {
45+
return { status: 'disabled' };
46+
}
47+
};
48+
4249
this.scenarioChecks[ScenarioIds.enableAppInsights] = {
4350
id: ScenarioIds.enableAppInsights,
4451
runCheck: () => {

AzureFunctions.AngularClient/src/app/site/site-manage/site-manage.component.ts

+9-8
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,15 @@ export class SiteManageComponent extends FeatureComponent<TreeViewInfo<SiteData>
198198
];
199199

200200
const developmentToolFeatures = [
201-
new TabFeature(
202-
this._translateService.instant(PortalResources.tab_logicApps),
203-
this._translateService.instant(PortalResources.tab_logicApps),
204-
this._translateService.instant(PortalResources.feature_logicAppsInfo),
205-
'image/logicapp.svg',
206-
SiteTabIds.logicApps,
207-
this._broadcastService
208-
),
201+
this._scenarioService.checkScenario(ScenarioIds.addLogicApps, { site: site }).status !== 'disabled'
202+
? new TabFeature(
203+
this._translateService.instant(PortalResources.tab_logicApps),
204+
this._translateService.instant(PortalResources.tab_logicApps),
205+
this._translateService.instant(PortalResources.feature_logicAppsInfo),
206+
'image/logicapp.svg',
207+
SiteTabIds.logicApps,
208+
this._broadcastService
209+
) : null,
209210

210211
this._scenarioService.checkScenario(ScenarioIds.addConsole, { site: site }).status !== 'disabled'
211212
? new DisableableBladeFeature(

0 commit comments

Comments
 (0)