Fixes: U4-7799 ModelsBuilder button in Content Type Editor should save the current content type

This commit is contained in:
Mads Rasmussen
2016-02-09 12:33:03 +01:00
committed by Shannon
parent b2cba310b9
commit c8faf17017
4 changed files with 123 additions and 60 deletions

View File

@@ -118,6 +118,7 @@
//Models builder mode:
vm.page.defaultButton = {
hotKey: "ctrl+s",
hotKeyWhenHidden: true,
labelKey: "buttons_save",
letter: "S",
type: "submit",
@@ -125,21 +126,38 @@
};
vm.page.subButtons = [{
hotKey: "ctrl+g",
labelKey: "buttons_generateModels",
hotKeyWhenHidden: true,
labelKey: "buttons_saveAndGenerateModels",
letter: "G",
handler: function () {
vm.page.saveButtonState = "busy";
notificationsService.info("Building models", "this can take abit of time, don't worry");
contentTypeHelper.generateModels().then(function (result) {
vm.page.saveButtonState = "init";
//clear and add success
notificationsService.success("Models Generated");
}, function () {
notificationsService.error("Models could not be generated");
vm.page.saveButtonState = "error";
vm.save().then(function (result) {
vm.page.saveButtonState = "busy";
localizationService.localize("modelsBuilder_buildingModels").then(function (headerValue) {
localizationService.localize("modelsBuilder_waitingMessage").then(function(msgValue) {
notificationsService.info(headerValue, msgValue);
});
});
contentTypeHelper.generateModels().then(function (result) {
vm.page.saveButtonState = "init";
//clear and add success
localizationService.localize("modelsBuilder_modelsGenerated").then(function(value) {
notificationsService.success(value);
});
}, function () {
localizationService.localize("modelsBuilder_modelsGeneratedError").then(function(value) {
notificationsService.error(value);
});
vm.page.saveButtonState = "error";
});
});
}
}];
}
@@ -264,7 +282,7 @@
}
function init(contentType) {
// set all tab to inactive
if (contentType.groups.length !== 0) {
angular.forEach(contentType.groups, function (group) {

View File

@@ -103,6 +103,7 @@
//Models builder mode:
vm.page.defaultButton = {
hotKey: "ctrl+s",
hotKeyWhenHidden: true,
labelKey: "buttons_save",
letter: "S",
type: "submit",
@@ -110,21 +111,38 @@
};
vm.page.subButtons = [{
hotKey: "ctrl+g",
labelKey: "buttons_generateModels",
hotKeyWhenHidden: true,
labelKey: "buttons_saveAndGenerateModels",
letter: "G",
handler: function () {
vm.page.saveButtonState = "busy";
notificationsService.info("Building models", "this can take abit of time, don't worry");
contentTypeHelper.generateModels().then(function(result) {
vm.page.saveButtonState = "init";
//clear and add success
notificationsService.success("Models Generated");
}, function() {
notificationsService.error("Models could not be generated");
vm.page.saveButtonState = "error";
vm.save().then(function (result) {
vm.page.saveButtonState = "busy";
localizationService.localize("modelsBuilder_buildingModels").then(function (headerValue) {
localizationService.localize("modelsBuilder_waitingMessage").then(function(msgValue) {
notificationsService.info(headerValue, msgValue);
});
});
contentTypeHelper.generateModels().then(function (result) {
vm.page.saveButtonState = "init";
//clear and add success
localizationService.localize("modelsBuilder_modelsGenerated").then(function(value) {
notificationsService.success(value);
});
}, function () {
localizationService.localize("modelsBuilder_modelsGeneratedError").then(function(value) {
notificationsService.error(value);
});
vm.page.saveButtonState = "error";
});
});
}
}];
}
@@ -243,7 +261,7 @@
}
function init(contentType) {
// set all tab to inactive
if (contentType.groups.length !== 0) {
angular.forEach(contentType.groups, function (group) {

View File

@@ -60,6 +60,7 @@
//Models builder mode:
vm.page.defaultButton = {
hotKey: "ctrl+s",
hotKeyWhenHidden: true,
labelKey: "buttons_save",
letter: "S",
type: "submit",
@@ -67,21 +68,39 @@
};
vm.page.subButtons = [{
hotKey: "ctrl+g",
labelKey: "buttons_generateModels",
hotKeyWhenHidden: true,
labelKey: "buttons_saveAndGenerateModels",
letter: "G",
handler: function () {
vm.page.saveButtonState = "busy";
notificationsService.info("Building models", "this can take abit of time, don't worry");
contentTypeHelper.generateModels().then(function (result) {
vm.page.saveButtonState = "init";
//clear and add success
notificationsService.success("Models Generated");
}, function () {
notificationsService.error("Models could not be generated");
vm.page.saveButtonState = "error";
vm.save().then(function (result) {
vm.page.saveButtonState = "busy";
localizationService.localize("modelsBuilder_buildingModels").then(function (headerValue) {
localizationService.localize("modelsBuilder_waitingMessage").then(function(msgValue) {
notificationsService.info(headerValue, msgValue);
});
});
contentTypeHelper.generateModels().then(function (result) {
vm.page.saveButtonState = "init";
//clear and add success
localizationService.localize("modelsBuilder_modelsGenerated").then(function(value) {
notificationsService.success(value);
});
}, function () {
localizationService.localize("modelsBuilder_modelsGeneratedError").then(function(value) {
notificationsService.error(value);
});
vm.page.saveButtonState = "error";
});
});
}
}];
}

View File

@@ -96,6 +96,7 @@
<key alias="styleShow">Show styles</key>
<key alias="tableInsert">Insert table</key>
<key alias="generateModels">Generate models</key>
<key alias="saveAndGenerateModels">Save and generate models</key>
</area>
<area alias="changeDocType">
<key alias="changeDocTypeInstruction">To change the document type for the selected content, first select from the list of valid types for this location.</key>
@@ -164,7 +165,7 @@
<key alias="uploadClear">Remove file(s)</key>
<key alias="urls">Link to document</key>
<key alias="memberof">Member of group(s)</key>
<key alias="notmemberof">Not a member of group(s)</key>
<key alias="notmemberof">Not a member of group(s)</key>
<key alias="childItems" version="7.0">Child items</key>
<key alias="target" version="7.0">Target</key>
</area>
@@ -245,18 +246,18 @@
<key alias="treepicker">Pick item</key>
<key alias="viewCacheItem">View Cache Item</key>
<key alias="createFolder">Create folder...</key>
<key alias="relateToOriginalLabel">Relate to original</key>
<key alias="theFriendliestCommunity">The friendliest community</key>
<key alias="linkToPage">Link to page</key>
<key alias="openInNewWindow">Opens the linked document in a new window or tab</key>
<key alias="openInFullBody">Opens the linked document in the full body of the window</key>
<key alias="openInParentFrame">Opens the linked document in the parent frame</key>
<key alias="linkToMedia">Link to media</key>
<key alias="selectMedia">Select media</key>
<key alias="selectIcon">Select icon</key>
<key alias="selectItem">Select item</key>
@@ -265,18 +266,18 @@
<key alias="selectContent">Select content</key>
<key alias="selectMember">Select member</key>
<key alias="selectMemberGroup">Select member group</key>
<key alias="noMacroParams">There are no parameters for this macro</key>
<key alias="externalLoginProviders">External login providers</key>
<key alias="exceptionDetail">Exception Details</key>
<key alias="stracktrace">Stacktrace</key>
<key alias="linkYour">Link your</key>
<key alias="unLinkYour">Un-Link your</key>
<key alias="account">account</key>
<key alias="selectEditor">Select editor</key>
</area>
<area alias="dictionaryItem">
@@ -352,7 +353,7 @@
<key alias="macroErrorLoadingCustomControl">Error loading customControl (Assembly: %0%, Type: '%1%')</key>
<key alias="macroErrorLoadingMacroEngineScript">Error loading MacroEngine script (file: %0%)</key>
<key alias="macroErrorParsingXSLTFile">"Error parsing XSLT file: %0%</key>
<key alias="macroErrorReadingXSLTFile">"Error reading XSLT file: %0%</key>
<key alias="macroErrorReadingXSLTFile">"Error reading XSLT file: %0%</key>
<key alias="missingTitle">Please enter a title</key>
<key alias="missingType">Please choose a type</key>
<key alias="pictureResizeBiggerThanOrg">You're about to make the picture larger than the original size. Are you sure that you want to proceed?</key>
@@ -498,14 +499,14 @@
<key alias="addTemplate">Add template</key>
<key alias="addChildNode">Add child node</key>
<key alias="addChild">Add child</key>
<key alias="editDataType">Edit data type</key>
<key alias="navigateSections">Navigate sections</key>
<key alias="shortcut">Shortcuts</key>
<key alias="showShortcuts">show shortcuts</key>
<key alias="toggleListView">Toggle list view</key>
<key alias="toggleAllowAsRoot">Toggle allow as root</key>
</area>
@@ -542,7 +543,7 @@
Press the <strong>upgrade</strong> button to upgrade your database to Umbraco %0%</p>
<p>
Don't worry - no content will be deleted and everything will continue working afterwards!
</p>
</p>
]]></key>
<key alias="databaseUpgradeDone">
<![CDATA[Your database has been upgraded to the final version %0%.<br/>Press <strong>Next</strong> to
@@ -554,7 +555,7 @@
<key alias="defaultUserPassChanged"><![CDATA[<strong>The Default user's password has been successfully changed since the installation!</strong></p><p>No further actions needs to be taken. Click <strong>Next</strong> to proceed.]]></key>
<key alias="defaultUserPasswordChanged">The password is changed!</key>
<key alias="defaultUserText">
<![CDATA[Umbraco creates a default user with a login <strong>('admin')</strong> and password <strong> ('default')</strong>. It's <strong>important</strong> that the password is changed to something unique.
<![CDATA[Umbraco creates a default user with a login <strong>('admin')</strong> and password <strong> ('default')</strong>. It's <strong>important</strong> that the password is changed to something unique.
]]></key>
<key alias="greatStart">Get a great start, watch our introduction videos</key>
<key alias="licenseText">By clicking the next button (or modifying the umbracoConfigurationStatus in web.config), you accept the license for this software as specified in the box below. Notice that this Umbraco distribution consists of two different licenses, the open source MIT license for the framework and the Umbraco freeware license that covers the UI.</key>
@@ -622,9 +623,9 @@ You installed Runway, so why not see how your new website looks.]]></key>
<key alias="theEndFurtherHelp"><![CDATA[<h3>Further help and information</h3>
Get help from our award winning community, browse the documentation or watch some free videos on how to build a simple site, how to use packages and a quick guide to the Umbraco terminology]]></key>
<key alias="theEndHeader">Umbraco %0% is installed and ready for use</key>
<key alias="theEndInstallFailed"><![CDATA[To finish the installation, you'll need to
<key alias="theEndInstallFailed"><![CDATA[To finish the installation, you'll need to
manually edit the <strong>/web.config file</strong> and update the AppSetting key <strong>UmbracoConfigurationStatus</strong> in the bottom to the value of <strong>'%0%'</strong>.]]></key>
<key alias="theEndInstallSuccess"><![CDATA[You can get <strong>started instantly</strong> by clicking the "Launch Umbraco" button below. <br />If you are <strong>new to Umbraco</strong>,
<key alias="theEndInstallSuccess"><![CDATA[You can get <strong>started instantly</strong> by clicking the "Launch Umbraco" button below. <br />If you are <strong>new to Umbraco</strong>,
you can find plenty of resources on our getting started pages.]]></key>
<key alias="theEndOpenUmbraco"><![CDATA[<h3>Launch Umbraco</h3>
To manage your website, simply open the Umbraco back office and start adding content, updating the templates and stylesheets or add new functionality]]></key>
@@ -654,7 +655,7 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="greeting6">Happy Caturday</key>
<key alias="instruction">Log in below</key>
<key alias="timeout">Session timed out</key>
<key alias="bottomText"><![CDATA[<p style="text-align:right;">&copy; 2001 - %0% <br /><a href="http://umbraco.com" style="text-decoration: none" target="_blank">Umbraco.com</a></p> ]]></key>
<key alias="bottomText"><![CDATA[<p style="text-align:right;">&copy; 2001 - %0% <br /><a href="http://umbraco.com" style="text-decoration: none" target="_blank">Umbraco.com</a></p> ]]></key>
</area>
<area alias="main">
<key alias="dashboard">Dashboard</key>
@@ -693,7 +694,7 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="mailBodyHtml">
<![CDATA[<p>Hi %0%</p>
<p>This is an automated mail to inform you that the task <strong>'%1%'</strong>
<p>This is an automated mail to inform you that the task <strong>'%1%'</strong>
has been performed on the page <a href="http://%4%/#/content/content/edit/%5%"><strong>'%2%'</strong></a>
by the user <strong>'%3%'</strong>
</p>
@@ -711,7 +712,7 @@ To manage your website, simply open the Umbraco back office and start adding con
<div style="margin: 8px 0; padding: 8px; display: block;">
<br />
<a style="color: white; font-weight: bold; background-color: #5372c3; text-decoration : none; margin-right: 20px; border: 8px solid #5372c3; width: 150px;" href="http://%4%/#/content/content/edit/%5%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EDIT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a> &nbsp;
<a style="color: white; font-weight: bold; background-color: #5372c3; text-decoration : none; margin-right: 20px; border: 8px solid #5372c3; width: 150px;" href="http://%4%/#/content/content/edit/%5%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EDIT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a> &nbsp;
<br />
</div>
@@ -785,7 +786,7 @@ To manage your website, simply open the Umbraco back office and start adding con
</key>
<key alias="contentPublishedFailedExpired"><![CDATA[
%0% could not be published because the item has expired.
]]></key>
]]></key>
<key alias="contentPublishedFailedInvalid"><![CDATA[
%0% could not be published because these properties: %1% did not pass validation rules.
]]></key>
@@ -884,8 +885,8 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="sortPleaseWait"><![CDATA[ Please wait. Items are being sorted, this can take a while.<br/> <br/> Do not close this window during sorting]]></key>
</area>
<area alias="speechBubbles">
<key alias="validationFailedHeader">Validation</key>
<key alias="validationFailedMessage">Validation errors must be fixed before the item can be saved</key>
<key alias="validationFailedHeader">Validation</key>
<key alias="validationFailedMessage">Validation errors must be fixed before the item can be saved</key>
<key alias="operationFailedHeader">Failed</key>
<key alias="invalidUserPermissionsText">Insufficient user permissions, could not complete the operation</key>
<key alias="operationCancelledHeader">Cancelled</key>
@@ -1023,10 +1024,10 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="inheritedFrom">Inherited from</key>
<key alias="addProperty">Add property</key>
<key alias="requiredLabel">Required label</key>
<key alias="enableListViewHeading">Enable list view</key>
<key alias="enableListViewDescription">Configures the content item to show a sortable and searchable list of its children, the children will not be shown in the tree</key>
<key alias="allowedTemplatesHeading">Allowed Templates</key>
<key alias="allowedTemplatesDescription">Choose which templates editors are allowed to use on content of this type</key>
<key alias="allowAsRootHeading">Allow as root</key>
@@ -1072,6 +1073,13 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="tabHasNoSortOrder">tab has no sort order</key>
</area>
<area alias="modelsBuilder">
<key alias="buildingModels">Building models</key>
<key alias="waitingMessage">this can take abit of time, don't worry</key>
<key alias="modelsGenerated">Models generated</key>
<key alias="modelsGeneratedError">Models could not be generated</key>
</area>
<area alias="templateEditor">
<key alias="alternativeField">Alternative field</key>
<key alias="alternativeText">Alternative Text</key>
@@ -1104,7 +1112,7 @@ To manage your website, simply open the Umbraco back office and start adding con
</area>
<area alias="translation">
<key alias="assignedTasks">Tasks assigned to you</key>
<key alias="assignedTasksHelp"><![CDATA[ The list below shows translation tasks <strong>assigned to you</strong>. To see a detailed view including comments, click on "Details" or just the page name.
<key alias="assignedTasksHelp"><![CDATA[ The list below shows translation tasks <strong>assigned to you</strong>. To see a detailed view including comments, click on "Details" or just the page name.
You can also download the page as XML directly by clicking the "Download Xml" link. <br/>
To close a translation task, please go to the Details view and click the "Close" button.
]]></key>
@@ -1133,8 +1141,8 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="mailSubject">[%0%] Translation task for %1%</key>
<key alias="noTranslators">No translator users found. Please create a translator user before you start sending content to translation</key>
<key alias="ownedTasks">Tasks created by you</key>
<key alias="ownedTasksHelp"><![CDATA[ The list below shows pages <strong>created by you</strong>. To see a detailed view including comments,
click on "Details" or just the page name. You can also download the page as XML directly by clicking the "Download Xml" link.
<key alias="ownedTasksHelp"><![CDATA[ The list below shows pages <strong>created by you</strong>. To see a detailed view including comments,
click on "Details" or just the page name. You can also download the page as XML directly by clicking the "Download Xml" link.
To close a translation task, please go to the Details view and click the "Close" button.
]]></key>
<key alias="pageHasBeenSendToTranslation">The page '%0%' has been send to translation</key>