Skip to content

Commit 9c03422

Browse files
madsrasmussenAndyButlandCopilot
authored
Data type References UI: Workspace + Delete (#18914)
* Updated management API endpoint and model for data type references to align with that used for documents, media etc. * Refactoring. * Update src/Umbraco.Core/Constants-ReferenceTypes.cs Co-authored-by: Copilot <[email protected]> * Fixed typos. * generate server models * add extension slot * register data type reference info app * add reference data mappers * Added id to tracked reference content type response. * Updated OpenApi.json. * Added missing updates. * generate new models * update models * register ref item * remove debugger * render types * register member type property type ref * register media type property type ref * Renamed model and constants from code review feedback. * register reference workspace info app kind * use kind for document references * use kind for media references * use kind for member references * use deleteWithRelation kind when deleting data types * fix manifest types * fix types * Update types.gen.ts * update code to fit new server models --------- Co-authored-by: Andy Butland <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent b61b9db commit 9c03422

File tree

58 files changed

+950
-679
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+950
-679
lines changed

src/Umbraco.Cms.Api.Management/OpenApi.json

Lines changed: 115 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -37996,7 +37996,42 @@
3799637996
},
3799737997
"additionalProperties": false
3799837998
},
37999-
"DocumentTypePropertyReferenceResponseModel": {
37999+
"DocumentTypePropertyTypeContainerResponseModel": {
38000+
"required": [
38001+
"id",
38002+
"sortOrder",
38003+
"type"
38004+
],
38005+
"type": "object",
38006+
"properties": {
38007+
"id": {
38008+
"type": "string",
38009+
"format": "uuid"
38010+
},
38011+
"parent": {
38012+
"oneOf": [
38013+
{
38014+
"$ref": "#/components/schemas/ReferenceByIdModel"
38015+
}
38016+
],
38017+
"nullable": true
38018+
},
38019+
"name": {
38020+
"type": "string",
38021+
"nullable": true
38022+
},
38023+
"type": {
38024+
"minLength": 1,
38025+
"type": "string"
38026+
},
38027+
"sortOrder": {
38028+
"type": "integer",
38029+
"format": "int32"
38030+
}
38031+
},
38032+
"additionalProperties": false
38033+
},
38034+
"DocumentTypePropertyTypeReferenceResponseModel": {
3800038035
"required": [
3800138036
"$type",
3800238037
"documentType",
@@ -38031,45 +38066,10 @@
3803138066
"discriminator": {
3803238067
"propertyName": "$type",
3803338068
"mapping": {
38034-
"DocumentTypePropertyReferenceResponseModel": "#/components/schemas/DocumentTypePropertyReferenceResponseModel"
38069+
"DocumentTypePropertyTypeReferenceResponseModel": "#/components/schemas/DocumentTypePropertyTypeReferenceResponseModel"
3803538070
}
3803638071
}
3803738072
},
38038-
"DocumentTypePropertyTypeContainerResponseModel": {
38039-
"required": [
38040-
"id",
38041-
"sortOrder",
38042-
"type"
38043-
],
38044-
"type": "object",
38045-
"properties": {
38046-
"id": {
38047-
"type": "string",
38048-
"format": "uuid"
38049-
},
38050-
"parent": {
38051-
"oneOf": [
38052-
{
38053-
"$ref": "#/components/schemas/ReferenceByIdModel"
38054-
}
38055-
],
38056-
"nullable": true
38057-
},
38058-
"name": {
38059-
"type": "string",
38060-
"nullable": true
38061-
},
38062-
"type": {
38063-
"minLength": 1,
38064-
"type": "string"
38065-
},
38066-
"sortOrder": {
38067-
"type": "integer",
38068-
"format": "int32"
38069-
}
38070-
},
38071-
"additionalProperties": false
38072-
},
3807338073
"DocumentTypePropertyTypeResponseModel": {
3807438074
"required": [
3807538075
"alias",
@@ -40099,7 +40099,42 @@
4009940099
},
4010040100
"additionalProperties": false
4010140101
},
40102-
"MediaTypePropertyReferenceResponseModel": {
40102+
"MediaTypePropertyTypeContainerResponseModel": {
40103+
"required": [
40104+
"id",
40105+
"sortOrder",
40106+
"type"
40107+
],
40108+
"type": "object",
40109+
"properties": {
40110+
"id": {
40111+
"type": "string",
40112+
"format": "uuid"
40113+
},
40114+
"parent": {
40115+
"oneOf": [
40116+
{
40117+
"$ref": "#/components/schemas/ReferenceByIdModel"
40118+
}
40119+
],
40120+
"nullable": true
40121+
},
40122+
"name": {
40123+
"type": "string",
40124+
"nullable": true
40125+
},
40126+
"type": {
40127+
"minLength": 1,
40128+
"type": "string"
40129+
},
40130+
"sortOrder": {
40131+
"type": "integer",
40132+
"format": "int32"
40133+
}
40134+
},
40135+
"additionalProperties": false
40136+
},
40137+
"MediaTypePropertyTypeReferenceResponseModel": {
4010340138
"required": [
4010440139
"$type",
4010540140
"id",
@@ -40134,45 +40169,10 @@
4013440169
"discriminator": {
4013540170
"propertyName": "$type",
4013640171
"mapping": {
40137-
"MediaTypePropertyReferenceResponseModel": "#/components/schemas/MediaTypePropertyReferenceResponseModel"
40172+
"MediaTypePropertyTypeReferenceResponseModel": "#/components/schemas/MediaTypePropertyTypeReferenceResponseModel"
4013840173
}
4013940174
}
4014040175
},
40141-
"MediaTypePropertyTypeContainerResponseModel": {
40142-
"required": [
40143-
"id",
40144-
"sortOrder",
40145-
"type"
40146-
],
40147-
"type": "object",
40148-
"properties": {
40149-
"id": {
40150-
"type": "string",
40151-
"format": "uuid"
40152-
},
40153-
"parent": {
40154-
"oneOf": [
40155-
{
40156-
"$ref": "#/components/schemas/ReferenceByIdModel"
40157-
}
40158-
],
40159-
"nullable": true
40160-
},
40161-
"name": {
40162-
"type": "string",
40163-
"nullable": true
40164-
},
40165-
"type": {
40166-
"minLength": 1,
40167-
"type": "string"
40168-
},
40169-
"sortOrder": {
40170-
"type": "integer",
40171-
"format": "int32"
40172-
}
40173-
},
40174-
"additionalProperties": false
40175-
},
4017640176
"MediaTypePropertyTypeResponseModel": {
4017740177
"required": [
4017840178
"alias",
@@ -40916,7 +40916,42 @@
4091640916
},
4091740917
"additionalProperties": false
4091840918
},
40919-
"MemberTypePropertyReferenceResponseModel": {
40919+
"MemberTypePropertyTypeContainerResponseModel": {
40920+
"required": [
40921+
"id",
40922+
"sortOrder",
40923+
"type"
40924+
],
40925+
"type": "object",
40926+
"properties": {
40927+
"id": {
40928+
"type": "string",
40929+
"format": "uuid"
40930+
},
40931+
"parent": {
40932+
"oneOf": [
40933+
{
40934+
"$ref": "#/components/schemas/ReferenceByIdModel"
40935+
}
40936+
],
40937+
"nullable": true
40938+
},
40939+
"name": {
40940+
"type": "string",
40941+
"nullable": true
40942+
},
40943+
"type": {
40944+
"minLength": 1,
40945+
"type": "string"
40946+
},
40947+
"sortOrder": {
40948+
"type": "integer",
40949+
"format": "int32"
40950+
}
40951+
},
40952+
"additionalProperties": false
40953+
},
40954+
"MemberTypePropertyTypeReferenceResponseModel": {
4092040955
"required": [
4092140956
"$type",
4092240957
"id",
@@ -40951,45 +40986,10 @@
4095140986
"discriminator": {
4095240987
"propertyName": "$type",
4095340988
"mapping": {
40954-
"MemberTypePropertyReferenceResponseModel": "#/components/schemas/MemberTypePropertyReferenceResponseModel"
40989+
"MemberTypePropertyTypeReferenceResponseModel": "#/components/schemas/MemberTypePropertyTypeReferenceResponseModel"
4095540990
}
4095640991
}
4095740992
},
40958-
"MemberTypePropertyTypeContainerResponseModel": {
40959-
"required": [
40960-
"id",
40961-
"sortOrder",
40962-
"type"
40963-
],
40964-
"type": "object",
40965-
"properties": {
40966-
"id": {
40967-
"type": "string",
40968-
"format": "uuid"
40969-
},
40970-
"parent": {
40971-
"oneOf": [
40972-
{
40973-
"$ref": "#/components/schemas/ReferenceByIdModel"
40974-
}
40975-
],
40976-
"nullable": true
40977-
},
40978-
"name": {
40979-
"type": "string",
40980-
"nullable": true
40981-
},
40982-
"type": {
40983-
"minLength": 1,
40984-
"type": "string"
40985-
},
40986-
"sortOrder": {
40987-
"type": "integer",
40988-
"format": "int32"
40989-
}
40990-
},
40991-
"additionalProperties": false
40992-
},
4099340993
"MemberTypePropertyTypeResponseModel": {
4099440994
"required": [
4099540995
"alias",
@@ -42163,19 +42163,19 @@
4216342163
"$ref": "#/components/schemas/DocumentReferenceResponseModel"
4216442164
},
4216542165
{
42166-
"$ref": "#/components/schemas/DocumentTypePropertyReferenceResponseModel"
42166+
"$ref": "#/components/schemas/DocumentTypePropertyTypeReferenceResponseModel"
4216742167
},
4216842168
{
4216942169
"$ref": "#/components/schemas/MediaReferenceResponseModel"
4217042170
},
4217142171
{
42172-
"$ref": "#/components/schemas/MediaTypePropertyReferenceResponseModel"
42172+
"$ref": "#/components/schemas/MediaTypePropertyTypeReferenceResponseModel"
4217342173
},
4217442174
{
4217542175
"$ref": "#/components/schemas/MemberReferenceResponseModel"
4217642176
},
4217742177
{
42178-
"$ref": "#/components/schemas/MemberTypePropertyReferenceResponseModel"
42178+
"$ref": "#/components/schemas/MemberTypePropertyTypeReferenceResponseModel"
4217942179
}
4218042180
]
4218142181
}
@@ -47248,4 +47248,4 @@
4724847248
}
4724947249
}
4725047250
}
47251-
}
47251+
}

src/Umbraco.Core/Services/DataTypeService.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public DataTypeService(
9494
public Attempt<OperationResult<OperationResultType, EntityContainer>?> CreateContainer(int parentId, Guid key, string name, int userId = Constants.Security.SuperUserId)
9595
{
9696
EventMessages evtMsgs = EventMessagesFactory.Get();
97-
using (ScopeProvider.CreateCoreScope(autoComplete:true))
97+
using (ScopeProvider.CreateCoreScope(autoComplete: true))
9898
{
9999
try
100100
{
@@ -161,7 +161,7 @@ public IEnumerable<EntityContainer> GetContainers(int[] containerIds)
161161
public Attempt<OperationResult?> SaveContainer(EntityContainer container, int userId = Constants.Security.SuperUserId)
162162
{
163163
EventMessages evtMsgs = EventMessagesFactory.Get();
164-
using (ScopeProvider.CreateCoreScope(autoComplete:true))
164+
using (ScopeProvider.CreateCoreScope(autoComplete: true))
165165
{
166166
var isNew = container.Id == 0;
167167
Guid? parentKey = isNew && container.ParentId > 0 ? _dataTypeContainerRepository.Get(container.ParentId)?.Key : null;
@@ -187,7 +187,7 @@ public IEnumerable<EntityContainer> GetContainers(int[] containerIds)
187187
public Attempt<OperationResult?> DeleteContainer(int containerId, int userId = Constants.Security.SuperUserId)
188188
{
189189
EventMessages evtMsgs = EventMessagesFactory.Get();
190-
using (ScopeProvider.CreateCoreScope(autoComplete:true))
190+
using (ScopeProvider.CreateCoreScope(autoComplete: true))
191191
{
192192
EntityContainer? container = _dataTypeContainerRepository.Get(containerId);
193193
if (container == null)
@@ -212,7 +212,7 @@ public IEnumerable<EntityContainer> GetContainers(int[] containerIds)
212212
public Attempt<OperationResult<OperationResultType, EntityContainer>?> RenameContainer(int id, string name, int userId = Constants.Security.SuperUserId)
213213
{
214214
EventMessages evtMsgs = EventMessagesFactory.Get();
215-
using (ScopeProvider.CreateCoreScope(autoComplete:true))
215+
using (ScopeProvider.CreateCoreScope(autoComplete: true))
216216
{
217217
try
218218
{
@@ -511,7 +511,7 @@ public async Task<Attempt<IDataType, DataTypeOperationStatus>> MoveAsync(IDataTy
511511
DataTypeOperationStatus.Success => OperationResult.Attempt.Succeed(MoveOperationStatusType.Success, evtMsgs, result.Result),
512512
DataTypeOperationStatus.CancelledByNotification => OperationResult.Attempt.Fail(MoveOperationStatusType.FailedCancelledByEvent, evtMsgs, result.Result),
513513
DataTypeOperationStatus.ParentNotFound => OperationResult.Attempt.Fail(MoveOperationStatusType.FailedParentNotFound, evtMsgs, result.Result),
514-
_ => OperationResult.Attempt.Fail(MoveOperationStatusType.FailedNotAllowedByPath, evtMsgs, result.Result, new InvalidOperationException($"Invalid operation status: {result.Status}")),
514+
_ => OperationResult.Attempt.Fail(MoveOperationStatusType.FailedNotAllowedByPath, evtMsgs, result.Result, new InvalidOperationException($"Invalid operation status: {result.Status}")),
515515
};
516516
}
517517

@@ -724,7 +724,7 @@ public IReadOnlyDictionary<Udi, IEnumerable<string>> GetReferences(int id)
724724
/// <inheritdoc />
725725
public async Task<Attempt<IReadOnlyDictionary<Udi, IEnumerable<string>>, DataTypeOperationStatus>> GetReferencesAsync(Guid id)
726726
{
727-
using ICoreScope scope = ScopeProvider.CreateCoreScope(autoComplete:true);
727+
using ICoreScope scope = ScopeProvider.CreateCoreScope(autoComplete: true);
728728
IDataType? dataType = GetDataTypeFromRepository(id);
729729
if (dataType == null)
730730
{

src/Umbraco.Web.UI.Client/src/external/backend-api/src/sdk.gen.ts

Lines changed: 72 additions & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)