Merge pull request #7575 from opf/fix/30787/never-persist-temporary-schema

[30787] Never persist an unsaved form schema to the schema cache
pull/7586/head
Henriette Dinger 5 years ago committed by GitHub
commit 7bd5aea614
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 19
      frontend/src/app/components/wp-buttons/wp-status-button/wp-status-button.component.ts
  2. 4
      frontend/src/app/components/wp-edit-form/work-package-changeset.ts

@ -60,26 +60,19 @@ export class WorkPackageStatusButtonComponent implements OnInit, OnDestroy {
}
ngOnInit() {
this.wpCacheService
.observe(this.workPackage.id!)
this.wpEditing
.temporaryEditResource(this.workPackage.id!)
.values$()
.pipe(
untilComponentDestroyed(this)
)
.subscribe((wp) => {
this.workPackage = wp;
this.cdRef.detectChanges();
this.workPackage.status.$load();
});
this.schemaCacheService
.state(this.workPackage)
.changes$()
.pipe(
untilComponentDestroyed(this)
)
.subscribe(() => {
// we have to explicitly force the component to update
this.cdRef.detectChanges();
if (this.workPackage.status) {
this.workPackage.status.$load();
}
});
}

@ -124,10 +124,6 @@ export class WorkPackageChangeset extends EditChangeset<WorkPackageResource> {
.update(payload)
.then((form:FormResource) => {
this.form = form;
if (!this.resource.isNew) {
this.schemaCacheService.state(this.resource).putValue(form.schema);
}
this.rebuildDefaults(form.payload);
this.buildResource();

Loading…
Cancel
Save