Browse Source

Marker for deleted content items. (#961)

pull/965/head
Sebastian Stehle 4 years ago
committed by GitHub
parent
commit
eb479e4767
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      backend/i18n/frontend_en.json
  2. 2
      backend/i18n/frontend_it.json
  3. 2
      backend/i18n/frontend_nl.json
  4. 2
      backend/i18n/frontend_pt.json
  5. 2
      backend/i18n/frontend_zh.json
  6. 2
      backend/i18n/source/frontend_en.json
  7. 1
      frontend/src/app/features/content/pages/content/content-page.component.html
  8. 19
      frontend/src/app/features/content/pages/content/editor/content-editor.component.html
  9. 3
      frontend/src/app/features/content/pages/content/editor/content-editor.component.ts
  10. 4
      frontend/src/app/shared/components/schema-category.component.html
  11. 4
      frontend/src/app/shared/components/schema-category.component.scss
  12. 6
      frontend/src/app/shared/services/contents.service.spec.ts
  13. 2
      frontend/src/app/shared/services/contents.service.ts

2
backend/i18n/frontend_en.json

@ -448,6 +448,7 @@
"contents.currentStatusLabel": "Current Version",
"contents.deleteConfirmText": "Do you really want to delete the content?",
"contents.deleteConfirmTitle": "Delete content",
"contents.deleted": "This content item has been deleted.",
"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",
@ -513,6 +514,7 @@
"contents.versionCompare": "Compare",
"contents.versionDelete": "Delete this Version",
"contents.versionViewing": "Viewing version **{version}**.",
"contents.versionViewingDeleted": "Viewing deleted version **{version}**.",
"contents.viewLatest": "View latest",
"contents.viewReset": "Reset Default View",
"contributors.add": "Add Contributor",

2
backend/i18n/frontend_it.json

@ -448,6 +448,7 @@
"contents.currentStatusLabel": "Versione corrente",
"contents.deleteConfirmText": "Sei sicuro di voler eliminare il contenuto?",
"contents.deleteConfirmTitle": "Elimina il contenuto",
"contents.deleted": "This content item has been deleted.",
"contents.deleteManyConfirmText": "Sei sicuro di voler eliminare gli elementi del contenuto selezionati?",
"contents.deleteReferrerConfirmText": "Il contenuto è collegato a un altro contenuto.\n\nSei sicuro di volerlo cancellare?",
"contents.deleteReferrerConfirmTitle": "Contenuto cancellato",
@ -513,6 +514,7 @@
"contents.versionCompare": "Confronta",
"contents.versionDelete": "Cancella questa Versione",
"contents.versionViewing": "Stai guardando la versione **{version}**.",
"contents.versionViewingDeleted": "Viewing deleted version **{version}**.",
"contents.viewLatest": "Visualizza l'ultima",
"contents.viewReset": "Imposta la visualizzazione predefinita",
"contributors.add": "Aggiungi un collaboratore",

2
backend/i18n/frontend_nl.json

@ -448,6 +448,7 @@
"contents.currentStatusLabel": "Huidige versie",
"contents.deleteConfirmText": "Wilt je de inhoud echt verwijderen?",
"contents.deleteConfirmTitle": "Inhoud verwijderen",
"contents.deleted": "This content item has been deleted.",
"contents.deleteManyConfirmText": "Weet je zeker dat je de geselecteerde inhoudsitems wilt verwijderen?",
"contents.deleteReferrerConfirmText": "Er wordt naar de inhoud verwezen door een ander inhoudsitem. \n \n Wil je de inhoud echt verwijderen?",
"contents.deleteReferrerConfirmTitle": "Inhoud verwijderen",
@ -513,6 +514,7 @@
"contents.versionCompare": "Vergelijk",
"contents.versionDelete": "Verwijder deze versie",
"contents.versionViewing": "Bekijk versie **{version}**.",
"contents.versionViewingDeleted": "Viewing deleted version **{version}**.",
"contents.viewLatest": "Bekijk laatste",
"contents.viewReset": "Standaardweergave herstellen",
"contributors.add": "Bijdrager toevoegen",

2
backend/i18n/frontend_pt.json

@ -448,6 +448,7 @@
"contents.currentStatusLabel": "Versão atual",
"contents.deleteConfirmText": "Deseja mesmo apagar o conteúdo?",
"contents.deleteConfirmTitle": "Eliminar conteúdo",
"contents.deleted": "This content item has been deleted.",
"contents.deleteManyConfirmText": "Deseja mesmo eliminar os itens de conteúdo selecionados?",
"contents.deleteReferrerConfirmText": "O conteúdo é referenciado por outro item de conteúdo.\n\nDeseja mesmo eliminar este conteúdo?",
"contents.deleteReferrerConfirmTitle": "Eliminar conteúdo",
@ -513,6 +514,7 @@
"contents.versionCompare": "Comparar",
"contents.versionDelete": "Excluir esta versão",
"contents.versionViewing": "Versão de visualização **{version}***",
"contents.versionViewingDeleted": "Viewing deleted version **{version}**.",
"contents.viewLatest": "Ver as últimas",
"contents.viewReset": "Ver por defeito de reposição",
"contributors.add": "Adicionar Colaborador",

2
backend/i18n/frontend_zh.json

@ -448,6 +448,7 @@
"contents.currentStatusLabel": "当前版本",
"contents.deleteConfirmText": "你真的要删除内容吗?",
"contents.deleteConfirmTitle": "删除内容",
"contents.deleted": "This content item has been deleted.",
"contents.deleteManyConfirmText": "您真的要删除选定的内容项吗?",
"contents.deleteReferrerConfirmText": "该内容被另一个内容项引用。\n\n您真的要删除该内容吗?",
"contents.deleteReferrerConfirmTitle": "删除内容",
@ -513,6 +514,7 @@
"contents.versionCompare": "比较",
"contents.versionDelete": "删除此版本",
"contents.versionViewing": "查看版本**{version}**。",
"contents.versionViewingDeleted": "Viewing deleted version **{version}**.",
"contents.viewLatest": "查看最新",
"contents.viewReset": "重置默认视图",
"contributors.add": "添加贡献者",

2
backend/i18n/source/frontend_en.json

@ -448,6 +448,7 @@
"contents.currentStatusLabel": "Current Version",
"contents.deleteConfirmText": "Do you really want to delete the content?",
"contents.deleteConfirmTitle": "Delete content",
"contents.deleted": "This content item has been deleted.",
"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",
@ -513,6 +514,7 @@
"contents.versionCompare": "Compare",
"contents.versionDelete": "Delete this Version",
"contents.versionViewing": "Viewing version **{version}**.",
"contents.versionViewingDeleted": "Viewing deleted version **{version}**.",
"contents.viewLatest": "View latest",
"contents.viewReset": "Reset Default View",
"contributors.add": "Add Contributor",

1
frontend/src/app/features/content/pages/content/content-page.component.html

@ -159,6 +159,7 @@
(loadLatest)="loadLatest()"
[(language)]="language"
[isNew]="!content"
[isDeleted]="content?.isDeleted"
[contentForm]="contentForm"
[contentFormCompare]="contentFormCompare"
[contentVersion]="contentVersion"

19
frontend/src/app/features/content/pages/content/editor/content-editor.component.html

@ -2,12 +2,29 @@
<sqx-list-view>
<ng-container topHeader>
<div *ngIf="isNew && showIdInput">
<input class="form-control" placeholder="{{ 'contents.idPlaceholder' | sqxTranslate }}"
[ngModel]="contentId"
(ngModelChange)="contentIdChange.emit($event)" />
</div>
<div class="alert alert-danger" *ngIf="!contentVersion && isDeleted">
{{ 'contents.deleted' | sqxTranslate }}
</div>
<div class="alert alert-danger" *ngIf="contentVersion">
<div class="float-end">
<a (click)="loadLatest.emit()">{{ 'contents.viewLatest' | sqxTranslate }}</a>
</div>
<div [innerHTML]="'contents.versionViewing' | sqxTranslate: { version: contentVersion } | sqxMarkdownInline | sqxSafeHtml"></div>
<div *ngIf="isDeleted"
[innerHTML]="'contents.versionViewingDeleted' | sqxTranslate: { version: contentVersion } | sqxMarkdownInline | sqxSafeHtml">
</div>
<div *ngIf="!isDeleted"
[innerHTML]="'contents.versionViewing' | sqxTranslate: { version: contentVersion } | sqxMarkdownInline | sqxSafeHtml">
</div>
</div>
<div *ngIf="isNew && showIdInput">

3
frontend/src/app/features/content/pages/content/editor/content-editor.component.ts

@ -26,6 +26,9 @@ export class ContentEditorComponent {
@Input()
public isNew = false;
@Input()
public isDeleted?: boolean;
@Input()
public showIdInput = false;

4
frontend/src/app/shared/components/schema-category.component.html

@ -6,13 +6,13 @@
(cdkDropListDropped)="changeCategory($event)">
<li class="nav-item nav-heading">
<div class="row g-1 align-items-center">
<div class="row g-1 align-items-center overflow-hidden">
<div class="col-auto">
<button type="button" class="btn btn-sm btn-decent btn-text-secondary btn-toggle" (click)="toggle()">
<i [class.icon-caret-right]="isCollapsed" [class.icon-caret-down]="!isCollapsed"></i>
</button>
</div>
<div class="col pe-1">
<div class="col overflow-hidden pe-1">
<sqx-editable-title
size="sm"
[closeButton]="false"

4
frontend/src/app/shared/components/schema-category.component.scss

@ -44,6 +44,10 @@ $drag-margin: -8px;
}
}
.overflow-hidden {
overflow: hidden;
}
.cdk-drag-placeholder {
display: none;
}

6
frontend/src/app/shared/services/contents.service.spec.ts

@ -366,7 +366,7 @@ describe('ContentsService', () => {
id: `id${id}`,
status: `Status${id}`,
statusColor: 'black',
newStatus: `NewStatus${id}`,
newStatus: `StatusNew${id}`,
newStatusColor: 'black',
created: `${id % 1000 + 2000}-12-12T10:10:00Z`,
createdBy: `creator${id}`,
@ -378,6 +378,7 @@ describe('ContentsService', () => {
color: 'red',
dueTime: `${id % 1000 + 2000}-11-11T10:10:00Z`,
},
isDeleted: false,
data: {},
schemaName: 'my-schema',
schemaDisplayName: 'MySchema',
@ -405,9 +406,10 @@ export function createContent(id: number, suffix = '') {
new Version(key),
`Status${key}`,
'black',
`NewStatus${key}`,
`StatusNew${key}`,
'black',
new ScheduleDto('Draft', `Scheduler${id}`, 'red', DateTime.parseISO(`${id % 1000 + 2000}-11-11T10:10:00Z`)),
false,
{},
'my-schema',
'MySchema',

2
frontend/src/app/shared/services/contents.service.ts

@ -51,6 +51,7 @@ export class ContentDto {
public readonly newStatus: string | undefined,
public readonly newStatusColor: string | undefined,
public readonly scheduleJob: ScheduleDto | null | undefined,
public readonly isDeleted: boolean,
public readonly data: ContentData,
public readonly schemaName: string,
public readonly schemaDisplayName: string,
@ -425,6 +426,7 @@ function parseContent(response: any) {
response.newStatus,
response.newStatusColor,
parseScheduleJob(response.scheduleJob),
response.isDeleted,
response.data,
response.schemaName,
response.schemaDisplayName,

Loading…
Cancel
Save