diff --git a/Directory.Packages.props b/Directory.Packages.props index 7279fa21c0..59b0f032a1 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -12,24 +12,24 @@ - - + + - - - - + + + + - + - - + + - + @@ -44,9 +44,9 @@ - - - + + + @@ -61,7 +61,7 @@ - + @@ -72,7 +72,7 @@ - + @@ -89,4 +89,4 @@ - + \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/common/services/blockeditormodelobject.service.js b/src/Umbraco.Web.UI.Client/src/common/services/blockeditormodelobject.service.js index 1367d58151..ab6c176c85 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/blockeditormodelobject.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/blockeditormodelobject.service.js @@ -367,7 +367,6 @@ * @name load * @methodOf umbraco.services.blockEditorModelObject * @description Load the scaffolding models for the given configuration, these are needed to provide useful models for each block. - * @param {Object} blockObject BlockObject to receive data values from. * @returns {Promise} A Promise object which resolves when all scaffold models are loaded. */ load: function () { @@ -398,9 +397,15 @@ scaffoldKeys = scaffoldKeys.filter((value, index, self) => self.indexOf(value) === index); if(scaffoldKeys.length > 0) { - var currentPage = editorState.getCurrent(); - var currentPageId = currentPage ? (currentPage.id > 0 ? currentPage.id : currentPage.parentId) : null || -20; + // We need to know if we are in the document type editor or content editor. + // If we are in the document type editor, we need to use -20 as the current page id. + // If we are in the content editor, we need to use the current page id or parent id if the current page is new. + // We can recognize a content editor context by checking if the current editor state has a contentTypeKey. + const currentEditorState = editorState.getCurrent(); + const currentPageId = currentEditorState.contentTypeKey ? currentEditorState.id || currentEditorState.parentId || -20 : -20; + // Load all scaffolds for the block types. + // The currentPageId is used to determine the access level for the current user. tasks.push(contentResource.getScaffoldByKeys(currentPageId, scaffoldKeys).then(scaffolds => { Object.values(scaffolds).forEach(scaffold => { // self.scaffolds might not exists anymore, this happens if this instance has been destroyed before the load is complete. diff --git a/src/Umbraco.Web.UI.Docs/.nvmrc b/src/Umbraco.Web.UI.Docs/.nvmrc new file mode 100644 index 0000000000..ec3053c8dc --- /dev/null +++ b/src/Umbraco.Web.UI.Docs/.nvmrc @@ -0,0 +1 @@ +10.15 diff --git a/src/Umbraco.Web.UI.Docs/README.md b/src/Umbraco.Web.UI.Docs/README.md index c6f3893e55..6a42c38915 100644 --- a/src/Umbraco.Web.UI.Docs/README.md +++ b/src/Umbraco.Web.UI.Docs/README.md @@ -1,14 +1,16 @@ # Umbraco Backoffice UI API Documentation -This project builds the documentation for the UI of the Umbraco backoffice, it is published on Our Umbraco in the "Reference" section of the documentation. +This project builds the documentation for the UI of the Umbraco backoffice, it is published on the Umbraco Docs in the "Reference" section of the documentation. + +All versions can be accessed through the https://apidocs.umbraco.com/vXX/ui/ url where XX is the major version number of Umbraco. In order to build the documentation, please follow the following two steps: ``` npm ci -npx gulp docs +npm start ``` After this, you should have an `api` directory which contains index.html. -In order to check if the documentation works properly, you would need to run the `api` directory in a webserver. On Windows, this can be accomplished by opening the `api` directory in [Visual Studio Code](https://code.visualstudio.com/) and running it with the [IIS Express plugin](https://marketplace.visualstudio.com/items?itemName=warren-buckley.iis-express). \ No newline at end of file +In order to check if the documentation works properly, you would need to run the `api` directory in a webserver. On Windows, this can be accomplished by opening the `api` directory in [Visual Studio Code](https://code.visualstudio.com/) and running it with the [IIS Express plugin](https://marketplace.visualstudio.com/items?itemName=warren-buckley.iis-express). diff --git a/src/Umbraco.Web.UI.Docs/gulpfile.js b/src/Umbraco.Web.UI.Docs/gulpfile.js index e595eabe5d..53f7f2cf8d 100644 --- a/src/Umbraco.Web.UI.Docs/gulpfile.js +++ b/src/Umbraco.Web.UI.Docs/gulpfile.js @@ -18,7 +18,7 @@ gulp.task('docs', [], function (cb) { var options = { html5Mode: false, startPage: '/api', - title: "Umbraco 12 Backoffice UI API Documentation", + title: "Umbraco 13 Backoffice UI API Documentation", dest: './api', styles: ['./umb-docs.css'], image: "https://our.umbraco.com/assets/images/logo.svg" diff --git a/tests/Directory.Packages.props b/tests/Directory.Packages.props index 1ecbee80a5..586469c2c8 100644 --- a/tests/Directory.Packages.props +++ b/tests/Directory.Packages.props @@ -4,8 +4,8 @@ - - + +