Skip to content
This repository was archived by the owner on Feb 10, 2024. It is now read-only.

Commit cede3bb

Browse files
committed
set default icon, add document type name and description
1 parent ca05d07 commit cede3bb

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/Our.Umbraco.DocTypeGridEditor/Web/Controllers/DocTypeGridEditorApiController.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ public object GetContentType([ModelBinder] string contentTypeAlias)
9393
var contentType = Current.Services.ContentTypeService.Get(contentTypeAlias);
9494
return new
9595
{
96-
icon = contentType != null ? contentType.Icon : string.Empty
96+
icon = contentType != null ? contentType.Icon : "icon-item-arrangement",
97+
title = contentType != null ? contentType.Name : "Doc Type",
98+
description = contentType != null ? contentType.Description : string.Empty
9799
};
98100
}
99101

src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Js/doctypegrideditor.controllers.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
overlayOptions.titles.selectContentType = data[2];
3535
overlayOptions.titles.selectBlueprint = data[3];
3636
});
37-
38-
$scope.title = overlayOptions.titles.selectContentType;
3937

4038
$scope.setValue = function (data, callback) {
4139
$scope.control.value = data;
@@ -49,9 +47,7 @@
4947
dtgeResources.getContentType($scope.control.value.dtgeContentTypeAlias).then(function (data2) {
5048
$scope.title = data2.title;
5149
$scope.description = data2.description;
52-
if (data2.icon) {
53-
$scope.icon = data2.icon;
54-
}
50+
$scope.icon = data2.icon;
5551
});
5652
}
5753
if (callback)

src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Js/doctypegrideditor.resources.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
);
2222
},
2323
getContentType: function (contentTypeAlias) {
24-
var url = umbRequestHelper.convertVirtualToAbsolutePath("~/umbraco/backoffice/DocTypeGridEditorApi/DocTypeGridEditorApi/GetContentTypeIcon?contentTypeAlias=" + contentTypeAlias);
24+
var url = umbRequestHelper.convertVirtualToAbsolutePath("~/umbraco/backoffice/DocTypeGridEditorApi/DocTypeGridEditorApi/GetContentType?contentTypeAlias=" + contentTypeAlias);
2525
return umbRequestHelper.resourcePromise(
2626
$http.get(url),
2727
'Failed to retrieve content type icon'

0 commit comments

Comments
 (0)