rename perform to submit
This commit is contained in:
@@ -108,7 +108,7 @@ export class UmbBlockGridAreaTypeWorkspaceContext
|
||||
}
|
||||
}
|
||||
|
||||
async performSave() {
|
||||
async submit() {
|
||||
if (!this.#data.value) return;
|
||||
|
||||
this.consumeContext(UMB_PROPERTY_CONTEXT, (context) => {
|
||||
|
||||
@@ -147,7 +147,7 @@ export class UmbBlockTypeWorkspaceContext<BlockTypeData extends UmbBlockTypeWith
|
||||
}
|
||||
}
|
||||
|
||||
async performSave() {
|
||||
async submit() {
|
||||
if (!this.#data.value) return;
|
||||
|
||||
this.consumeContext(UMB_PROPERTY_CONTEXT, (context) => {
|
||||
|
||||
@@ -300,7 +300,7 @@ export class UmbBlockWorkspaceContext<LayoutDataType extends UmbBlockLayoutBaseM
|
||||
}
|
||||
}
|
||||
|
||||
async performSave() {
|
||||
async submit() {
|
||||
const layoutData = this.#layout.value;
|
||||
const contentData = this.content.getData();
|
||||
if (!layoutData || !this.#blockManager || !this.#blockEntries || !contentData || !this.#modalContext) return;
|
||||
|
||||
@@ -42,7 +42,7 @@ export abstract class UmbSaveableWorkspaceContextBase<WorkspaceDataModelType>
|
||||
constructor(host: UmbControllerHost, workspaceAlias: string) {
|
||||
super(host, UMB_WORKSPACE_CONTEXT.toString());
|
||||
this.workspaceAlias = workspaceAlias;
|
||||
this.#performSaveBind = this.performSave.bind(this);
|
||||
this.#performSaveBind = this.submit.bind(this);
|
||||
this.consumeContext(UMB_MODAL_CONTEXT, (context) => {
|
||||
(this.modalContext as UmbModalContext) = context;
|
||||
});
|
||||
@@ -103,7 +103,7 @@ export abstract class UmbSaveableWorkspaceContextBase<WorkspaceDataModelType>
|
||||
}
|
||||
|
||||
#performSaveBind: () => void;
|
||||
protected abstract performSave(): void;
|
||||
protected abstract submit(): void;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -314,7 +314,7 @@ export class UmbDataTypeWorkspaceContext
|
||||
}
|
||||
}
|
||||
|
||||
async performSave() {
|
||||
async submit() {
|
||||
if (!this.#currentData.value) return;
|
||||
if (!this.#currentData.value.unique) return;
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ export class UmbDictionaryWorkspaceContext
|
||||
this.#data.setValue(data);
|
||||
}
|
||||
|
||||
async performSave() {
|
||||
async submit() {
|
||||
if (!this.#data.value) return;
|
||||
if (!this.#data.value.unique) return;
|
||||
|
||||
|
||||
@@ -215,7 +215,7 @@ export class UmbDocumentTypeWorkspaceContext
|
||||
/**
|
||||
* Save or creates the document type, based on wether its a new one or existing.
|
||||
*/
|
||||
async performSave() {
|
||||
async submit() {
|
||||
const data = this.getData();
|
||||
if (data === undefined) throw new Error('Cannot save, no data');
|
||||
|
||||
|
||||
@@ -569,7 +569,7 @@ export class UmbDocumentWorkspaceContext
|
||||
this.workspaceComplete(data);
|
||||
}
|
||||
|
||||
public async performSave() {
|
||||
public async submit() {
|
||||
const { options, selected } = await this.#determineVariantOptions();
|
||||
|
||||
let variantIds: Array<UmbVariantId> = [];
|
||||
|
||||
@@ -111,7 +111,7 @@ export class UmbLanguageWorkspaceContext
|
||||
this.#data.update({ fallbackIsoCode: unique });
|
||||
}
|
||||
|
||||
async performSave() {
|
||||
async submit() {
|
||||
const newData = this.getData();
|
||||
if (!newData) return;
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ export class UmbMediaTypeWorkspaceContext
|
||||
/**
|
||||
* Save or creates the media type, based on wether its a new one or existing.
|
||||
*/
|
||||
async performSave() {
|
||||
async submit() {
|
||||
const data = this.getData();
|
||||
|
||||
if (!data) {
|
||||
|
||||
@@ -400,7 +400,7 @@ export class UmbMediaWorkspaceContext
|
||||
}
|
||||
}
|
||||
|
||||
async performSave() {
|
||||
async submit() {
|
||||
const data = this.getData();
|
||||
if (!data) throw new Error('Data is missing');
|
||||
await this.#createOrSave();
|
||||
|
||||
@@ -101,7 +101,7 @@ export class UmbMemberGroupWorkspaceContext
|
||||
return { data };
|
||||
}
|
||||
|
||||
async performSave() {
|
||||
async submit() {
|
||||
const data = this.getData();
|
||||
if (!data) throw new Error('No data to save');
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ export class UmbMemberTypeWorkspaceContext
|
||||
}
|
||||
}
|
||||
|
||||
async performSave() {
|
||||
async submit() {
|
||||
const data = this.getData();
|
||||
if (data === undefined) throw new Error('Cannot save, no data');
|
||||
|
||||
|
||||
@@ -323,7 +323,7 @@ export class UmbMemberWorkspaceContext
|
||||
}
|
||||
}
|
||||
|
||||
async performSave() {
|
||||
async submit() {
|
||||
if (!this.#currentData.value) throw new Error('Data is missing');
|
||||
if (!this.#currentData.value.unique) throw new Error('Unique is missing');
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ export class UmbRelationTypeWorkspaceContext
|
||||
this.#data.update({ name });
|
||||
}
|
||||
|
||||
async performSave() {
|
||||
async submit() {
|
||||
if (!this.#data.value) return;
|
||||
if (!this.#data.value.id) return;
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ export class UmbPartialViewWorkspaceContext
|
||||
}
|
||||
}
|
||||
|
||||
public async performSave() {
|
||||
public async submit() {
|
||||
if (!this.#data.value) throw new Error('Data is missing');
|
||||
|
||||
let newData = undefined;
|
||||
|
||||
@@ -125,7 +125,7 @@ export class UmbScriptWorkspaceContext
|
||||
}
|
||||
}
|
||||
|
||||
async performSave() {
|
||||
async submit() {
|
||||
if (!this.#data.value) throw new Error('Data is missing');
|
||||
|
||||
let newData = undefined;
|
||||
|
||||
@@ -126,7 +126,7 @@ export class UmbStylesheetWorkspaceContext
|
||||
}
|
||||
}
|
||||
|
||||
public async performSave() {
|
||||
public async submit() {
|
||||
if (!this.#data.value) throw new Error('Data is missing');
|
||||
|
||||
let newData = undefined;
|
||||
|
||||
@@ -185,7 +185,7 @@ ${currentContent}`;
|
||||
await this.setMasterTemplate(this.#parent.unique);
|
||||
}
|
||||
|
||||
async performSave() {
|
||||
async submit() {
|
||||
if (!this.#data.value) throw new Error('Data is missing');
|
||||
|
||||
let newData = undefined;
|
||||
|
||||
@@ -98,7 +98,7 @@ export class UmbUserGroupWorkspaceContext
|
||||
return this.#data.getValue();
|
||||
}
|
||||
|
||||
async performSave() {
|
||||
async submit() {
|
||||
if (!this.#data.value) return;
|
||||
|
||||
//TODO: Could we clean this code up?
|
||||
|
||||
@@ -84,7 +84,7 @@ export class UmbUserWorkspaceContext
|
||||
this.#currentData.update({ [propertyName]: value });
|
||||
}
|
||||
|
||||
async performSave() {
|
||||
async submit() {
|
||||
if (!this.#currentData.value) throw new Error('Data is missing');
|
||||
if (!this.#currentData.value.unique) throw new Error('Unique is missing');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user