Browse Source

Add odata query to exceptions.

pull/681/head
Sebastian Stehle 5 years ago
parent
commit
cdb44a2fdf
  1. 4
      backend/i18n/source/backend_en.json
  2. 10
      backend/src/Squidex.Domain.Apps.Entities/Assets/Queries/AssetQueryParser.cs
  3. 10
      backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentQueryParser.cs
  4. 4
      backend/src/Squidex.Shared/Texts.resx
  5. 7
      frontend/app/features/content/pages/content/content-page.component.ts

4
backend/i18n/source/backend_en.json

@ -91,9 +91,9 @@
"common.name": "Name",
"common.notFoundValue": "- not found -",
"common.numDays": "Num days",
"common.odataFailure": "Failed to parse query: {message}",
"common.odataFailure": "Failed to parse query: {message}, for query: {odata}",
"common.odataFilterNotValid": "OData $filter clause not valid: {message}",
"common.odataNotSupported": "OData operation is not supported.",
"common.odataNotSupported": "OData operation is not supported for query: {odata}",
"common.odataSearchNotValid": "OData $search clause not valid: {message}",
"common.oldPassword": "Old password",
"common.other": "Other",

10
backend/src/Squidex.Domain.Apps.Entities/Assets/Queries/AssetQueryParser.cs

@ -133,11 +133,17 @@ namespace Squidex.Domain.Apps.Entities.Assets.Queries
}
catch (NotSupportedException)
{
throw new ValidationException(T.Get("common.odataNotSupported"));
throw new ValidationException(T.Get("common.odataNotSupported", new { odata }));
}
catch (ODataException ex)
{
throw new ValidationException(T.Get("common.odataFailure", new { message = ex.Message }), ex);
var message = ex.Message;
throw new ValidationException(T.Get("common.odataFailure", new { odata, message }), ex);
}
catch (Exception)
{
throw new ValidationException(T.Get("common.odataNotSupported", new { odata }));
}
}

10
backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentQueryParser.cs

@ -187,11 +187,17 @@ namespace Squidex.Domain.Apps.Entities.Contents.Queries
}
catch (NotSupportedException)
{
throw new ValidationException(T.Get("common.odataNotSupported"));
throw new ValidationException(T.Get("common.odataNotSupported", new { odata }));
}
catch (ODataException ex)
{
throw new ValidationException(T.Get("common.odataFailure", new { message = ex.Message }), ex);
var message = ex.Message;
throw new ValidationException(T.Get("common.odataFailure", new { odata, message }), ex);
}
catch (Exception)
{
throw new ValidationException(T.Get("common.odataNotSupported", new { odata }));
}
}

4
backend/src/Squidex.Shared/Texts.resx

@ -359,13 +359,13 @@
<value>Num days</value>
</data>
<data name="common.odataFailure" xml:space="preserve">
<value>Failed to parse query: {message}</value>
<value>Failed to parse query: {message}, for query: {odata}</value>
</data>
<data name="common.odataFilterNotValid" xml:space="preserve">
<value>OData $filter clause not valid: {message}</value>
</data>
<data name="common.odataNotSupported" xml:space="preserve">
<value>OData operation is not supported.</value>
<value>OData operation is not supported for query: {odata}</value>
</data>
<data name="common.odataSearchNotValid" xml:space="preserve">
<value>OData $search clause not valid: {message}</value>

7
frontend/app/features/content/pages/content/content-page.component.ts

@ -209,9 +209,9 @@ export class ContentPageComponent extends ResourceOwner implements CanComponentD
const content = this.content;
if (content) {
this.contentsState.deleteMany([content]);
this.contentsState.deleteMany([content]).subscribe(() => {
this.back();
});
}
}
@ -271,10 +271,9 @@ export class ContentPageComponent extends ResourceOwner implements CanComponentD
private loadContent(data: any, isInitial: boolean) {
this.isLoadingContent = true;
try {
this.autoSaveService.remove(this.autoSaveKey);
try {
this.contentForm.load(data, isInitial);
this.contentForm.setEnabled(!this.content || this.content.canUpdate);
} finally {

Loading…
Cancel
Save