Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a633e45b44 | |||
| 63b58dcd09 | |||
| 76a0c6c39f | |||
| 37d2203de1 | |||
| 858156bab2 | |||
| 2ae96f3810 | |||
| a5f689385a | |||
| 1607e51270 | |||
| 044b43f6e1 | |||
| c59a226d56 | |||
| 0c25c36af0 |
@@ -637,4 +637,4 @@ namespace Umbraco.Core.Services
|
||||
public static event TypedEventHandler<IDataTypeService, MoveEventArgs<IDataTypeDefinition>> Moved;
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp50</s:String></wpf:ResourceDictionary>
|
||||
+589
-669
File diff suppressed because it is too large
Load Diff
@@ -357,37 +357,16 @@ function dataTypeResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
"PostCreateContainer",
|
||||
{ parentId: parentId, name: name })),
|
||||
'Failed to create a folder under parent id ' + parentId);
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
renameContainer: function (id, name) {
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.post
|
||||
(umbRequestHelper.getApiUrl(
|
||||
$http.post
|
||||
(umbRequestHelper.getApiUrl(
|
||||
"dataTypeApiBaseUrl",
|
||||
"PostRenameContainer",
|
||||
{ id: id, name: name })),
|
||||
"Failed to rename the folder with id " + id);
|
||||
},
|
||||
|
||||
getContainer: function (name) {
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.get(
|
||||
umbRequestHelper.getApiUrl(
|
||||
"dataTypeApiBaseUrl",
|
||||
"GetContainer",
|
||||
{ name: name })),
|
||||
'No container found with name: ' + name);
|
||||
|
||||
},
|
||||
|
||||
containerExist: function (name) {
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.get(
|
||||
umbRequestHelper.getApiUrl(
|
||||
"dataTypeApiBaseUrl",
|
||||
"ContainerExist",
|
||||
{ name: name })));
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -223,14 +223,16 @@ input.umb-group-builder__group-title-input {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.umb-group-builder__property-meta .umb-locked-field__input {
|
||||
font-size: 12px !important;
|
||||
word-break: break-word;
|
||||
margin-bottom: 2px !important;
|
||||
.umb-group-builder__property-meta-alias {
|
||||
font-size: 10px;
|
||||
color: @gray-3;
|
||||
word-break: break-word;
|
||||
line-height: 1.5;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.umb-group-builder__property-meta-label textarea {
|
||||
font-size: 16px;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 0;
|
||||
color: @gray-1;
|
||||
|
||||
+23
-51
@@ -7,7 +7,7 @@
|
||||
* The controller for the content type editor property dialog
|
||||
*/
|
||||
|
||||
(function () {
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
function EditorPickerOverlay($scope, dataTypeResource, dataTypeHelper, contentTypeResource, localizationService) {
|
||||
@@ -24,7 +24,6 @@
|
||||
vm.typesAndEditors = [];
|
||||
vm.userConfigured = [];
|
||||
vm.loading = false;
|
||||
vm.property = $scope.model.property;
|
||||
vm.tabs = [{
|
||||
active: true,
|
||||
id: 1,
|
||||
@@ -56,7 +55,7 @@
|
||||
|
||||
vm.loading = true;
|
||||
|
||||
dataTypeResource.getGroupedPropertyEditors().then(function (data) {
|
||||
dataTypeResource.getGroupedPropertyEditors().then(function(data) {
|
||||
vm.tabs[0].typesAndEditors = data;
|
||||
vm.typesAndEditors = data;
|
||||
vm.tabsLoaded = vm.tabsLoaded + 1;
|
||||
@@ -69,7 +68,7 @@
|
||||
|
||||
vm.loading = true;
|
||||
|
||||
dataTypeResource.getGroupedDataTypes().then(function (data) {
|
||||
dataTypeResource.getGroupedDataTypes().then(function(data) {
|
||||
vm.tabs[1].userConfigured = data;
|
||||
vm.userConfigured = data;
|
||||
vm.tabsLoaded = vm.tabsLoaded + 1;
|
||||
@@ -117,7 +116,7 @@
|
||||
|
||||
var parentId = -1;
|
||||
|
||||
dataTypeResource.getScaffold(parentId).then(function (dataType) {
|
||||
dataTypeResource.getScaffold(parentId).then(function(dataType) {
|
||||
|
||||
// set alias
|
||||
dataType.selectedEditor = editor.alias;
|
||||
@@ -125,11 +124,7 @@
|
||||
// set name
|
||||
var nameArray = [];
|
||||
|
||||
// content type name (if you add properties before filling out a name for the content type, we need a temp name)
|
||||
var contentTypeName = "Unnamed Content Type";
|
||||
|
||||
if ($scope.model.contentTypeName) {
|
||||
contentTypeName = $scope.model.contentTypeName;
|
||||
nameArray.push($scope.model.contentTypeName);
|
||||
}
|
||||
|
||||
@@ -143,48 +138,13 @@
|
||||
|
||||
// make name
|
||||
dataType.name = nameArray.join(" - ");
|
||||
dataType.containerName = contentTypeName;
|
||||
|
||||
// get pre values
|
||||
dataTypeResource.getPreValues(dataType.selectedEditor).then(function (preValues) {
|
||||
// if there's any configuration settings then open the dialog, else just save the editor immediately
|
||||
if (preValues.length > 0) {
|
||||
dataType.preValues = preValues;
|
||||
openEditorSettingsOverlay(dataType, true);
|
||||
} else {
|
||||
saveDataTypeWithContainerCheck(dataType.containerName, dataType, preValues, true);
|
||||
}
|
||||
});
|
||||
dataTypeResource.getPreValues(dataType.selectedEditor).then(function(preValues) {
|
||||
|
||||
});
|
||||
dataType.preValues = preValues;
|
||||
|
||||
}
|
||||
|
||||
function saveDataTypeWithContainerCheck(containerName, dataType, preValues, isNew) {
|
||||
// check if a container for the doctype already exist
|
||||
dataTypeResource.containerExist(containerName).then(function (container) {
|
||||
if (container == "true") {
|
||||
dataTypeResource.getContainer(containerName).then(
|
||||
function (container) {
|
||||
dataType.parentId = container.Id;
|
||||
saveDataType(dataType, preValues, isNew);
|
||||
});
|
||||
} else {
|
||||
dataTypeResource.createContainer(-1, containerName).then(
|
||||
function (container) {
|
||||
dataType.parentId = container.Entity.Id;
|
||||
saveDataType(dataType, preValues, isNew);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function saveDataType(dataType, preValues, isNew) {
|
||||
dataTypeResource.save(dataType, preValues, isNew).then(function (newDataType) {
|
||||
|
||||
contentTypeResource.getPropertyTypeScaffold(newDataType.id).then(function (propertyType) {
|
||||
|
||||
submitOverlay(newDataType, propertyType, true);
|
||||
openEditorSettingsOverlay(dataType, true);
|
||||
|
||||
});
|
||||
|
||||
@@ -194,8 +154,8 @@
|
||||
|
||||
function pickDataType(selectedDataType) {
|
||||
|
||||
dataTypeResource.getById(selectedDataType.id).then(function (dataType) {
|
||||
contentTypeResource.getPropertyTypeScaffold(dataType.id).then(function (propertyType) {
|
||||
dataTypeResource.getById(selectedDataType.id).then(function(dataType) {
|
||||
contentTypeResource.getPropertyTypeScaffold(dataType.id).then(function(propertyType) {
|
||||
submitOverlay(dataType, propertyType, false);
|
||||
});
|
||||
});
|
||||
@@ -208,9 +168,21 @@
|
||||
dataType: dataType,
|
||||
view: "views/common/overlays/contenttypeeditor/editorsettings/editorsettings.html",
|
||||
show: true,
|
||||
submit: function (model) {
|
||||
submit: function(model) {
|
||||
var preValues = dataTypeHelper.createPreValueProps(model.dataType.preValues);
|
||||
saveDataTypeWithContainerCheck(dataType.containerName, dataType, preValues, isNew);
|
||||
|
||||
dataTypeResource.save(model.dataType, preValues, isNew).then(function(newDataType) {
|
||||
|
||||
contentTypeResource.getPropertyTypeScaffold(newDataType.id).then(function(propertyType) {
|
||||
|
||||
submitOverlay(newDataType, propertyType, true);
|
||||
|
||||
vm.editorSettingsOverlay.show = false;
|
||||
vm.editorSettingsOverlay = null;
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+12
-1
@@ -4,7 +4,18 @@
|
||||
<i class="icon-alert red"></i>
|
||||
<strong class="red"><localize key="contentTypeEditor_allDocumentTypes"></localize></strong> using this editor will get updated with the new settings.
|
||||
</div>
|
||||
|
||||
|
||||
<div class="control-group umb-control-group">
|
||||
<div class="umb-el-wrap">
|
||||
<label class="control-label" for="dataTypeName">
|
||||
<localize key="name"></localize>
|
||||
</label>
|
||||
<div class="controls">
|
||||
<input type="text" ng-model="model.dataType.name" class="umb-editor" umb-auto-focus focus-on-filled="true" required />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h5><localize key="contentTypeEditor_configuration"></localize></h5>
|
||||
|
||||
<umb-property property="preValue" ng-repeat="preValue in model.dataType.preValues">
|
||||
|
||||
+1
-5
@@ -110,10 +110,7 @@
|
||||
vm.editorSettingsOverlay.title = "Editor settings";
|
||||
vm.editorSettingsOverlay.view = "views/common/overlays/contenttypeeditor/editorsettings/editorsettings.html";
|
||||
vm.editorSettingsOverlay.dataType = dataType;
|
||||
|
||||
if (dataType.preValues.length > 0) {
|
||||
vm.editorSettingsOverlay.show = true;
|
||||
}
|
||||
vm.editorSettingsOverlay.show = true;
|
||||
|
||||
vm.editorSettingsOverlay.submit = function (model) {
|
||||
|
||||
@@ -153,7 +150,6 @@
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
function matchValidationType() {
|
||||
|
||||
|
||||
+21
@@ -1,5 +1,26 @@
|
||||
<div class="content-type-editor-dialog edit-property-settings" ng-controller="Umbraco.Overlay.PropertySettingsOverlay as vm">
|
||||
|
||||
<div class="umb-control-group" ng-if="!model.property.locked">
|
||||
<div class="control-group">
|
||||
<textarea class="editor-label"
|
||||
data-element="property-name"
|
||||
name="propertyLabel"
|
||||
ng-model="model.property.label"
|
||||
localize="placeholder"
|
||||
placeholder="@placeholders_entername"
|
||||
umb-auto-focus
|
||||
focus-on-filled="true"
|
||||
umb-auto-resize
|
||||
required
|
||||
overlay-submit-on-enter>
|
||||
</textarea>
|
||||
<div class="umb-validation-label" val-msg-for="propertyLabel" val-toggle-msg="required">Required label</div>
|
||||
</div>
|
||||
<div class="control-group -no-margin">
|
||||
<umb-generate-alias enable-lock="true" alias-from="model.property.label" alias="model.property.alias"></umb-generate-alias>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="umb-control-group control-group">
|
||||
<textarea
|
||||
data-element="property-description"
|
||||
|
||||
@@ -4,22 +4,24 @@
|
||||
|
||||
<umb-editor-sub-header-content-right>
|
||||
|
||||
<umb-button alias="compositions"
|
||||
ng-if="compositions !== false"
|
||||
type="button"
|
||||
button-style="link"
|
||||
label-key="contentTypeEditor_compositions"
|
||||
icon="icon-merge"
|
||||
action="openCompositionsDialog()">
|
||||
<umb-button
|
||||
alias="compositions"
|
||||
ng-if="compositions !== false"
|
||||
type="button"
|
||||
button-style="link"
|
||||
label-key="contentTypeEditor_compositions"
|
||||
icon="icon-merge"
|
||||
action="openCompositionsDialog()">
|
||||
</umb-button>
|
||||
|
||||
<umb-button alias="reorder"
|
||||
ng-if="sorting !== false"
|
||||
type="button"
|
||||
button-style="link"
|
||||
label-key="{{sortingButtonKey}}"
|
||||
icon="icon-navigation"
|
||||
action="toggleSortingMode();">
|
||||
<umb-button
|
||||
alias="reorder"
|
||||
ng-if="sorting !== false"
|
||||
type="button"
|
||||
button-style="link"
|
||||
label-key="{{sortingButtonKey}}"
|
||||
icon="icon-navigation"
|
||||
action="toggleSortingMode();">
|
||||
</umb-button>
|
||||
|
||||
</umb-editor-sub-header-content-right>
|
||||
@@ -38,7 +40,7 @@
|
||||
<a href="" class="umb-group-builder__group -placeholder" hotkey="alt+shift+t" ng-click="addGroup(tab)" ng-if="tab.tabState=='init' && !sortingMode" data-element="group-add">
|
||||
|
||||
<div class="umb-group-builder__group-title-wrapper -placeholder">
|
||||
<div class="umb-group-builder__group-title -placeholder"></div>
|
||||
<div class="umb-group-builder__group-title -placeholder"></div>
|
||||
</div>
|
||||
|
||||
<localize ng-if="model.groups.length === 1" key="contentTypeEditor_addNewTab"></localize>
|
||||
@@ -51,10 +53,11 @@
|
||||
|
||||
<div class="umb-group-builder__group-remove" ng-if="!sortingMode && tab.properties.length <= 1">
|
||||
<i class="icon-trash" ng-click="togglePrompt(tab)"></i>
|
||||
<umb-confirm-action ng-if="tab.deletePrompt"
|
||||
direction="left"
|
||||
on-confirm="removeGroup($index)"
|
||||
on-cancel="hidePrompt(tab)">
|
||||
<umb-confirm-action
|
||||
ng-if="tab.deletePrompt"
|
||||
direction="left"
|
||||
on-confirm="removeGroup($index)"
|
||||
on-cancel="hidePrompt(tab)">
|
||||
</umb-confirm-action>
|
||||
</div>
|
||||
|
||||
@@ -111,15 +114,15 @@
|
||||
|
||||
<!-- Init property / Property placeholder / add new property -->
|
||||
<a href=""
|
||||
data-element="property-add"
|
||||
class="umb-group-builder__property -placeholder"
|
||||
ng-if="property.propertyState=='init' && !sortingMode"
|
||||
ng-class="{'-placeholder': property.propertyState=='init'}"
|
||||
hotkey="alt+shift+p"
|
||||
hotkey-when="{{tab.tabState === 'active' && property.propertyState=='init'}}"
|
||||
ng-click="addProperty(property, tab)"
|
||||
on-focus="activateGroup(tab)"
|
||||
focus-when="{{property.focus}}">
|
||||
data-element="property-add"
|
||||
class="umb-group-builder__property -placeholder"
|
||||
ng-if="property.propertyState=='init' && !sortingMode"
|
||||
ng-class="{'-placeholder': property.propertyState=='init'}"
|
||||
hotkey="alt+shift+p"
|
||||
hotkey-when="{{tab.tabState === 'active' && property.propertyState=='init'}}"
|
||||
ng-click="addProperty(property, tab)"
|
||||
on-focus="activateGroup(tab)"
|
||||
focus-when="{{property.focus}}">
|
||||
|
||||
<div class="umb-group-builder__property-meta">
|
||||
<div class="umb-group-builder__placeholder-box -input-small"></div>
|
||||
@@ -148,25 +151,24 @@
|
||||
<div class="control-group -no-margin" ng-if="!sortingMode">
|
||||
|
||||
<div class="umb-group-builder__property-meta-alias" ng-if="property.inherited || property.locked">{{ property.alias }}</div>
|
||||
<umb-locked-field ng-if="!property.inherited && !property.locked"
|
||||
locked="locked"
|
||||
ng-model="property.alias"
|
||||
placeholder-text="'Alias...'"
|
||||
server-validation-field="{{'Groups[' + $parent.$parent.$parent.$parent.$index + '].Properties[' + $index + '].Alias'}}">
|
||||
<umb-locked-field
|
||||
ng-if="!property.inherited && !property.locked"
|
||||
locked="locked"
|
||||
ng-model="property.alias"
|
||||
placeholder-text="'Alias...'"
|
||||
server-validation-field="{{'Groups[' + $parent.$parent.$parent.$parent.$index + '].Properties[' + $index + '].Alias'}}">
|
||||
</umb-locked-field>
|
||||
|
||||
<div class="umb-group-builder__property-meta-label">
|
||||
<textarea localize="placeholder"
|
||||
placeholder="@placeholders_label"
|
||||
ng-model="property.label"
|
||||
ng-disabled="property.inherited || property.locked"
|
||||
name="groupName"
|
||||
ng-change="updateAlias(property)"
|
||||
umb-auto-resize
|
||||
select-on-focus
|
||||
umb-select-when="{{property.tempAlias}}"
|
||||
required
|
||||
val-server-field="{{'Groups[' + $parent.$parent.$parent.$parent.$index + '].Properties[' + $index + '].Label'}}">
|
||||
<textarea
|
||||
localize="placeholder"
|
||||
placeholder="@placeholders_label"
|
||||
ng-model="property.label"
|
||||
ng-disabled="property.inherited || property.locked"
|
||||
name="groupName"
|
||||
umb-auto-resize
|
||||
required
|
||||
val-server-field="{{'Groups[' + $parent.$parent.$parent.$parent.$index + '].Properties[' + $index + '].Label'}}">
|
||||
</textarea>
|
||||
|
||||
<div class="umb-validation-label" val-msg-for="groupName" val-toggle-msg="valServerField"></div>
|
||||
@@ -174,11 +176,12 @@
|
||||
</div>
|
||||
|
||||
<div class="umb-group-builder__property-meta-description">
|
||||
<textarea localize="placeholder"
|
||||
placeholder="@placeholders_enterDescription"
|
||||
ng-model="property.description"
|
||||
ng-disabled="property.inherited || property.locked"
|
||||
umb-auto-resize>
|
||||
<textarea
|
||||
localize="placeholder"
|
||||
placeholder="@placeholders_enterDescription"
|
||||
ng-model="property.description"
|
||||
ng-disabled="property.inherited || property.locked"
|
||||
umb-auto-resize>
|
||||
</textarea>
|
||||
</div>
|
||||
</div>
|
||||
@@ -241,9 +244,10 @@
|
||||
</div>
|
||||
|
||||
<ng-form name="propertyEditorPreviewForm" umb-disable-form-validation>
|
||||
<umb-property-editor ng-if="property.view !== undefined"
|
||||
model="property"
|
||||
preview="true">
|
||||
<umb-property-editor
|
||||
ng-if="property.view !== undefined"
|
||||
model="property"
|
||||
preview="true">
|
||||
</umb-property-editor>
|
||||
</ng-form>
|
||||
|
||||
@@ -262,10 +266,11 @@
|
||||
<!-- delete property -->
|
||||
<div ng-if="!property.locked" class="umb-group-builder__property-action">
|
||||
<i class="icon-trash" ng-click="togglePrompt(property)"></i>
|
||||
<umb-confirm-action ng-if="property.deletePrompt"
|
||||
direction="left"
|
||||
on-confirm="deleteProperty(tab, $index)"
|
||||
on-cancel="hidePrompt(property)">
|
||||
<umb-confirm-action
|
||||
ng-if="property.deletePrompt"
|
||||
direction="left"
|
||||
on-confirm="deleteProperty(tab, $index)"
|
||||
on-cancel="hidePrompt(property)">
|
||||
</umb-confirm-action>
|
||||
</div>
|
||||
|
||||
@@ -287,25 +292,20 @@
|
||||
|
||||
</ul>
|
||||
|
||||
<umb-overlay data-element="overlay-compositions"
|
||||
ng-if="compositionsDialogModel.show"
|
||||
model="compositionsDialogModel"
|
||||
position="right"
|
||||
view="compositionsDialogModel.view">
|
||||
<umb-overlay
|
||||
data-element="overlay-compositions"
|
||||
ng-if="compositionsDialogModel.show"
|
||||
model="compositionsDialogModel"
|
||||
position="right"
|
||||
view="compositionsDialogModel.view">
|
||||
</umb-overlay>
|
||||
|
||||
<umb-overlay data-element="overlay-property-settings"
|
||||
ng-if="propertySettingsDialogModel.show"
|
||||
model="propertySettingsDialogModel"
|
||||
position="right"
|
||||
view="propertySettingsDialogModel.view">
|
||||
</umb-overlay>
|
||||
|
||||
<umb-overlay data-element="overlay-editor-picker"
|
||||
ng-if="editorPickerOverlay.show"
|
||||
model="editorPickerOverlay"
|
||||
position="right"
|
||||
view="editorPickerOverlay.view">
|
||||
<umb-overlay
|
||||
data-element="overlay-property-settings"
|
||||
ng-if="propertySettingsDialogModel.show"
|
||||
model="propertySettingsDialogModel"
|
||||
position="right"
|
||||
view="propertySettingsDialogModel.view">
|
||||
</umb-overlay>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -188,23 +188,6 @@ namespace Umbraco.Web.Editors
|
||||
: Request.CreateNotificationValidationErrorResponse(result.Exception.Message);
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public bool ContainerExist(string name)
|
||||
{
|
||||
var result = Services.DataTypeService.GetContainers(name, 1);
|
||||
|
||||
return result.Any();
|
||||
}
|
||||
|
||||
public HttpResponseMessage GetContainer(string name)
|
||||
{
|
||||
var result = Services.DataTypeService.GetContainers(name, 1);
|
||||
|
||||
return result.Any()
|
||||
? Request.CreateResponse(HttpStatusCode.OK, result.First())
|
||||
: Request.CreateResponse(HttpStatusCode.NotFound);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Saves the data type
|
||||
/// </summary>
|
||||
|
||||
@@ -208,10 +208,6 @@ namespace Umbraco.Web.Search
|
||||
if (sb == null) throw new ArgumentNullException("sb");
|
||||
if (entityService == null) throw new ArgumentNullException("entityService");
|
||||
|
||||
Udi udi;
|
||||
Udi.TryParse(searchFrom, true, out udi);
|
||||
searchFrom = udi == null ? searchFrom : entityService.GetIdForUdi(udi).Result.ToString();
|
||||
|
||||
int searchFromId;
|
||||
var entityPath = int.TryParse(searchFrom, out searchFromId) && searchFromId > 0
|
||||
? entityService.GetAllPaths(objectType, searchFromId).FirstOrDefault()
|
||||
@@ -336,4 +332,4 @@ namespace Umbraco.Web.Search
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user