Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,8 @@ export abstract class UmbContentDetailWorkspaceContextBase<
});
eventContext.dispatchEvent(event);
this.setIsNew(false);

this._closeModal();
}

async #update(variantIds: Array<UmbVariantId>, saveData: DetailModelType) {
Expand Down Expand Up @@ -604,6 +606,7 @@ export abstract class UmbContentDetailWorkspaceContextBase<
});

eventContext.dispatchEvent(event);
this._closeModal();
}

abstract getContentTypeUnique(): string | undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ export class UmbDocumentWorkspaceContext
});

eventContext.dispatchEvent(event);

this._closeModal();
}
}

Expand Down