Feature: close content detail workspace when complete (#17498)
* make sure to close the modal when submit was completed * rename to _closeModal * remove comments
This commit is contained in:
@@ -573,6 +573,8 @@ export abstract class UmbContentDetailWorkspaceContextBase<
|
||||
});
|
||||
eventContext.dispatchEvent(event);
|
||||
this.setIsNew(false);
|
||||
|
||||
this._closeModal();
|
||||
}
|
||||
|
||||
async #update(variantIds: Array<UmbVariantId>, saveData: DetailModelType) {
|
||||
@@ -604,6 +606,7 @@ export abstract class UmbContentDetailWorkspaceContextBase<
|
||||
});
|
||||
|
||||
eventContext.dispatchEvent(event);
|
||||
this._closeModal();
|
||||
}
|
||||
|
||||
abstract getContentTypeUnique(): string | undefined;
|
||||
|
||||
@@ -124,12 +124,6 @@ export abstract class UmbSubmittableWorkspaceContextBase<WorkspaceDataModelType>
|
||||
this.#submitPromise = undefined;
|
||||
this.#submitResolve = undefined;
|
||||
this.#submitReject = undefined;
|
||||
|
||||
// If we do not want to close a modal when saving something with errors, then move this part down to #completeSubmit method. [NL]
|
||||
if (this.modalContext) {
|
||||
this.modalContext?.setValue(this.getData());
|
||||
this.modalContext?.submit();
|
||||
}
|
||||
};
|
||||
|
||||
#completeSubmit = () => {
|
||||
@@ -138,8 +132,17 @@ export abstract class UmbSubmittableWorkspaceContextBase<WorkspaceDataModelType>
|
||||
// Calling reset on the validation context here. [NL]
|
||||
// TODO: Capture the validation messages on open, and then reset to that.
|
||||
//this.validation.reset();
|
||||
|
||||
this._closeModal();
|
||||
};
|
||||
|
||||
protected _closeModal() {
|
||||
if (this.modalContext) {
|
||||
this.modalContext?.setValue(this.getData());
|
||||
this.modalContext?.submit();
|
||||
}
|
||||
}
|
||||
|
||||
//abstract getIsDirty(): Promise<boolean>;
|
||||
abstract getUnique(): string | null | undefined;
|
||||
abstract getEntityType(): string;
|
||||
|
||||
@@ -334,6 +334,8 @@ export class UmbDocumentWorkspaceContext
|
||||
});
|
||||
|
||||
eventContext.dispatchEvent(event);
|
||||
|
||||
this._closeModal();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user