diff --git a/backend/i18n/frontend_en.json b/backend/i18n/frontend_en.json index 7daa8257a..423855d30 100644 --- a/backend/i18n/frontend_en.json +++ b/backend/i18n/frontend_en.json @@ -399,8 +399,8 @@ "contents.deleteConfirmText": "Do you really want to delete the content?", "contents.deleteConfirmTitle": "Delete content", "contents.deleteManyConfirmText": "Do you really want to delete the selected content items?", - "contents.deleteReferrerConfirmText": "The content is referenced by another content item.\n\nDo you really want to delete this content?", - "contents.deleteReferrerConfirmTitle": "Delete content", + "contents.deleteReferrerConfirmText": "The content is referenced by another content item.\n\nDo you really want to delete/unpublish this content?", + "contents.deleteReferrerConfirmTitle": "Delete/unpublish content", "contents.deleteVersionConfirmText": "Do you really want to delete this version?", "contents.deleteVersionFailed": "Failed to delete version. Please reload.", "contents.draftNew": "New Draft", diff --git a/backend/i18n/source/backend_en.json b/backend/i18n/source/backend_en.json index 3a3d04d0d..60a7c749b 100644 --- a/backend/i18n/source/backend_en.json +++ b/backend/i18n/source/backend_en.json @@ -131,7 +131,7 @@ "contents.invalidNumber": "Invalid json type, expected number.", "contents.invalidString": "Invalid json type, expected string.", "contents.listReferences": "{count} Reference(s)", - "contents.referenced": "Content is referenced by another content and cannot be deleted.", + "contents.referenced": "Content is referenced by another content and cannot be deleted or unpublished.", "contents.singletonNotChangeable": "Singleton content cannot be updated.", "contents.singletonNotCreatable": "Singleton content cannot be created.", "contents.singletonNotDeletable": "Singleton content cannot be deleted.", diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/Guards/ValidationExtensions.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/Guards/ValidationExtensions.cs index b676c2146..2fc376e0b 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/Guards/ValidationExtensions.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/Guards/ValidationExtensions.cs @@ -98,7 +98,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.DomainObject.Guards if (hasReferrer) { - throw new DomainException(T.Get("contents.referenced", "OBJECT_REFERENCED")); + throw new DomainException(T.Get("contents.referenced"), "OBJECT_REFERENCED"); } } diff --git a/backend/src/Squidex.Shared/Texts.resx b/backend/src/Squidex.Shared/Texts.resx index 680ccf20d..fe2053103 100644 --- a/backend/src/Squidex.Shared/Texts.resx +++ b/backend/src/Squidex.Shared/Texts.resx @@ -479,7 +479,7 @@ {count} Reference(s) - Content is referenced by another content and cannot be deleted. + Content is referenced by another content and cannot be deleted or unpublished. Singleton content cannot be updated. diff --git a/frontend/app/shared/services/contents.service.ts b/frontend/app/shared/services/contents.service.ts index 00809dc5e..ec0131142 100644 --- a/frontend/app/shared/services/contents.service.ts +++ b/frontend/app/shared/services/contents.service.ts @@ -143,7 +143,7 @@ export class ContentsService { public getContents(appName: string, schemaName: string, q?: ContentQueryDto): Observable { const { ids, maxLength } = q || {}; - const { fullQuery, queryOdataParts, queryObj } = buildQuery(q); + const { fullQuery, odataParts: queryOdataParts, queryObj } = buildQuery(q); if (fullQuery.length > (maxLength || 2000)) { const body: any = {}; @@ -348,7 +348,7 @@ function buildQuery(q?: ContentQueryDto) { const { ids, query, skip, take } = q || {}; const queryParts: string[] = []; - const queryOdataParts: string[] = []; + const odataParts: string[] = []; let queryObj: Query | undefined; @@ -357,14 +357,14 @@ function buildQuery(q?: ContentQueryDto) { } else { if (query && query.fullText && query.fullText.indexOf('$') >= 0) { - queryOdataParts.push(`${query.fullText.trim()}`); + odataParts.push(`${query.fullText.trim()}`); if (take && take > 0) { - queryOdataParts.push(`$top=${take}`); + odataParts.push(`$top=${take}`); } if (skip && skip > 0) { - queryOdataParts.push(`$skip=${skip}`); + odataParts.push(`$skip=${skip}`); } } else { queryObj = { ...query }; @@ -381,8 +381,9 @@ function buildQuery(q?: ContentQueryDto) { } } - const fullQuery = [...queryParts, ...queryOdataParts].join('&'); - return { fullQuery, queryOdataParts, queryObj }; + const fullQuery = [...queryParts, ...odataParts].join('&'); + + return { fullQuery, odataParts, queryObj }; } function parseContent(response: any) { @@ -423,5 +424,6 @@ function parseError(response: any) { return new ErrorDto( response.statusCode, response.message, + response.errorCode, response.details); } \ No newline at end of file