do not not accept scaffold model from modals
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import type { UmbPropertyTypeModel } from '@umbraco-cms/backoffice/content-type';
|
||||
import type { UmbPropertyTypeModel, UmbPropertyTypeScaffoldModel } from '@umbraco-cms/backoffice/content-type';
|
||||
import { UmbModalToken } from '@umbraco-cms/backoffice/modal';
|
||||
|
||||
export type UmbPropertySettingsModalData = {
|
||||
documentTypeId: string;
|
||||
};
|
||||
export type UmbPropertySettingsModalValue = UmbPropertyTypeModel;
|
||||
export type UmbPropertySettingsModalValue = UmbPropertyTypeModel | UmbPropertyTypeScaffoldModel;
|
||||
|
||||
export const UMB_PROPERTY_SETTINGS_MODAL = new UmbModalToken<
|
||||
UmbPropertySettingsModalData,
|
||||
|
||||
@@ -96,7 +96,10 @@ export class UmbDocumentTypeWorkspacePropertyElement extends UmbLitElement {
|
||||
return { data: { documentTypeId }, value: propertyData };
|
||||
})
|
||||
.onSubmit((result) => {
|
||||
this._partialUpdate(result);
|
||||
if (!result.dataType) {
|
||||
throw new Error('No dataType found on property');
|
||||
}
|
||||
this._partialUpdate(result as UmbPropertyTypeModel);
|
||||
})
|
||||
.observeRouteBuilder((routeBuilder) => {
|
||||
this._modalRoute = routeBuilder(null);
|
||||
|
||||
@@ -142,7 +142,10 @@ export class UmbMediaTypeWorkspaceViewEditPropertiesElement extends UmbLitElemen
|
||||
return { data: { documentTypeId: mediaTypeId }, value: propertyData }; //TODO: Should we have a separate modal for mediaTypes?
|
||||
})
|
||||
.onSubmit((value) => {
|
||||
this.#addProperty(value);
|
||||
if (!value.dataType) {
|
||||
throw new Error('No data type selected');
|
||||
}
|
||||
this.#addProperty(value as UmbPropertyTypeModel);
|
||||
})
|
||||
.observeRouteBuilder((routeBuilder) => {
|
||||
this._modalRouteNewProperty = routeBuilder(null);
|
||||
|
||||
@@ -96,7 +96,10 @@ export class UmbMediaTypeWorkspacePropertyElement extends UmbLitElement {
|
||||
return { data: { documentTypeId: mediaTypeId }, value: propertyData }; //TODO: Should we have a separate modal for mediaTypes?
|
||||
})
|
||||
.onSubmit((result) => {
|
||||
this._partialUpdate(result);
|
||||
if (!result.dataType) {
|
||||
throw new Error('No dataType found on property');
|
||||
}
|
||||
this._partialUpdate(result as UmbPropertyTypeModel);
|
||||
})
|
||||
.observeRouteBuilder((routeBuilder) => {
|
||||
this._modalRoute = routeBuilder(null);
|
||||
|
||||
Reference in New Issue
Block a user