Skip to content

Commit

Permalink
Replacing the string for empty swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
soninaren authored and ahmelsayed committed Mar 30, 2017
1 parent 2372e40 commit 0b54ea7
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@ export class PortalResources
public static swaggerDefinition_documentation: string = "swaggerDefinition_documentation";
public static swaggerDefinition_feature_overview: string = "swaggerDefinition_feature_overview";
public static swaggerDefinition_getting_started: string = "swaggerDefinition_getting_started";
public static swaggerDefinition_placeHolder: string = "swaggerDefinition_placeHolder";
}

Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export class SwaggerDefinitionComponent implements OnInit {
}

if (!this.swaggerDocument) {
this.swaggerDocument = {};
this.swaggerDocument = this._translateService.instant(PortalResources.swaggerDefinition_placeHolder);
}

this.swaggerEditor.setDocument(this.swaggerDocument);
Expand Down Expand Up @@ -289,7 +289,7 @@ export class SwaggerDefinitionComponent implements OnInit {
return this._functionsService.getSwaggerDocument(key);
}).catch(error => {
// get document fails
return Observable.of({});
return Observable.of(this._translateService.instant(PortalResources.swaggerDefinition_placeHolder));
}).flatMap(swaggerDoc => {
this.swaggerDocument = swaggerDoc;
this.assignDocumentToEditor(swaggerDoc);
Expand Down
1 change: 1 addition & 0 deletions AzureFunctions.Client/app/models/portal-resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@ export class PortalResources
public static swaggerDefinition_documentation: string = "swaggerDefinition_documentation";
public static swaggerDefinition_feature_overview: string = "swaggerDefinition_feature_overview";
public static swaggerDefinition_getting_started: string = "swaggerDefinition_getting_started";
public static swaggerDefinition_placeHolder: string = "swaggerDefinition_placeHolder";
}

9 changes: 9 additions & 0 deletions AzureFunctions/ResourcesPortal/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions AzureFunctions/ResourcesPortal/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1261,4 +1261,7 @@
<data name="swaggerDefinition_getting_started" xml:space="preserve">
<value>Check out our getting started tutorial</value>
</data>
<data name="swaggerDefinition_placeHolder" xml:space="preserve">
<value>#Click "Load Generated API Definition" to get started</value>
</data>
</root>

0 comments on commit 0b54ea7

Please sign in to comment.