Browse Source

Fix schema switch.

pull/1017/head
Sebastian 3 years ago
parent
commit
533daf1c54
  1. 2
      frontend/src/app/features/content/pages/contents/contents-page.component.ts
  2. 14
      frontend/src/app/features/content/pages/contents/custom-view-editor.component.html

2
frontend/src/app/features/content/pages/contents/contents-page.component.ts

@ -108,7 +108,7 @@ export class ContentsPageComponent extends ResourceOwner implements OnInit {
this.own(
combineLatest([schema$, tableName$])
.subscribe(([schema, fieldNames]) => {
if (!this.schema) {
if (this.schema?.id !== schema.id) {
this.resetSelection();
this.schema = schema;

14
frontend/src/app/features/content/pages/contents/custom-view-editor.component.html

@ -17,7 +17,12 @@
<div class="form-check">
<input class="form-check-input" type="checkbox" checked (click)="removeField(field)" id="field_{{field}}" [disabled]="!field">
<label class="form-check-label" for="field_{{field}}">
{{(field.title || field.label) | sqxTranslate}}: <code>{{field.name}}</code>
<span *ngIf="field.name">
{{(field.title || field.label) | sqxTranslate}}: <code>{{field.name}}</code>
</span>
<span class="text-muted" *ngIf="!field.name">
- Placeholder -
</span>
</label>
</div>
</div>
@ -33,7 +38,12 @@
<div class="form-check">
<input class="form-check-input" type="checkbox" (click)="addField(field)" id="field_{{field}}">
<label class="form-check-label" for="field_{{field}}">
{{(field.title || field.label) | sqxTranslate}}: <code>{{field.name}}</code>
<span *ngIf="field.name">
{{(field.title || field.label) | sqxTranslate}}: <code>{{field.name}}</code>
</span>
<span class="text-muted" *ngIf="!field.name">
- Placeholder -
</span>
</label>
</div>
</div>

Loading…
Cancel
Save