rename perform to submit

This commit is contained in:
Niels Lyngsø
2024-03-25 14:24:30 +01:00
parent 19f5ef7d66
commit c76a12481a
21 changed files with 22 additions and 22 deletions

View File

@@ -108,7 +108,7 @@ export class UmbBlockGridAreaTypeWorkspaceContext
}
}
async performSave() {
async submit() {
if (!this.#data.value) return;
this.consumeContext(UMB_PROPERTY_CONTEXT, (context) => {

View File

@@ -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) => {

View File

@@ -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;

View File

@@ -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;
}
/*

View File

@@ -314,7 +314,7 @@ export class UmbDataTypeWorkspaceContext
}
}
async performSave() {
async submit() {
if (!this.#currentData.value) return;
if (!this.#currentData.value.unique) return;

View File

@@ -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;

View File

@@ -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');

View File

@@ -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> = [];

View File

@@ -111,7 +111,7 @@ export class UmbLanguageWorkspaceContext
this.#data.update({ fallbackIsoCode: unique });
}
async performSave() {
async submit() {
const newData = this.getData();
if (!newData) return;

View File

@@ -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) {

View File

@@ -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();

View File

@@ -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');

View File

@@ -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');

View File

@@ -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');

View File

@@ -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;

View File

@@ -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;

View File

@@ -125,7 +125,7 @@ export class UmbScriptWorkspaceContext
}
}
async performSave() {
async submit() {
if (!this.#data.value) throw new Error('Data is missing');
let newData = undefined;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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?

View File

@@ -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');