diff --git a/.gitignore b/.gitignore index 95e9639356c..b25a33fc130 100644 --- a/.gitignore +++ b/.gitignore @@ -8,15 +8,8 @@ /_site/ -/.* -!/.github -!/.github/** - -/*.yml -!/_config.yml -!/_config.prod.yml -!/_config.checks.yml -!/_config.stage.yml +_config.local.yml +.jekyll-metadata *.bat /tmp/ diff --git a/Docfile.yml b/Docfile.yml new file mode 100644 index 00000000000..40f8fc69ce6 --- /dev/null +++ b/Docfile.yml @@ -0,0 +1,26 @@ +content_map: +- + directory: guides/v2.0 + repository: magento/devdocs + branch: 2.0 + filter: false +- + directory: guides/m1x + repository: magento/devdocs-m1 + branch: master + filter: false +- + directory: mbi + repository: magento/devdocs-mbi + branch: master + filter: true +- + directory: mftf + repository: magento/magento2-functional-testing-framework + branch: develop + filter: true +- + directory: page-builder + repository: magento-devdocs/magento2-page-builder + branch: develop + filter: true diff --git a/Rakefile b/Rakefile index c100a40e52c..2ba8f224524 100644 --- a/Rakefile +++ b/Rakefile @@ -15,6 +15,7 @@ require 'colorator' require_relative 'rakelib/lib/link-checker.rb' require_relative 'rakelib/lib/converter.rb' require_relative 'rakelib/lib/double-slash-check.rb' +require_relative 'rakelib/lib/doc-config.rb' desc "Same as 'rake', 'rake preview'" task default: %w[preview] diff --git a/guides/v2.1/javascript-dev-guide/javascript/js_init.md b/guides/v2.1/javascript-dev-guide/javascript/js_init.md index ef84a0f7801..316389b2e72 100644 --- a/guides/v2.1/javascript-dev-guide/javascript/js_init.md +++ b/guides/v2.1/javascript-dev-guide/javascript/js_init.md @@ -10,7 +10,7 @@ redirect_from: This topic describes different ways to call and initialize JavaScript in Magento 2: -- Insert a [JavaScript component]({{ site.gdeurl }}javascript-dev-guide/bk-javascript-dev-guide.html#js_terms) in `.phtml` page templates. +- Insert a [JavaScript component]({{ page.baseurl }}/javascript-dev-guide/bk-javascript-dev-guide.html#js_terms) in `.phtml` page templates. - Call Javascript components that require initialization in Javascript (`.js`) files. We strongly recommend that you use the described approaches and do not add inline {% glossarytooltip 312b4baf-15f7-4968-944e-c814d53de218 %}JavaScript{% endglossarytooltip %}. @@ -128,7 +128,7 @@ require([ ## Calling JS components requiring initialization in JS files {#js_widget_init} -To call a widget in JS code, use a notation similar to the following ([accordion]({{ site.gdeurl }}frontend-dev-guide/javascript/widget_accordion.html) widget is intiialized on the `[data-role=example]` element as illustration): +To call a widget in JS code, use a notation similar to the following ([accordion]({{ page.baseurl }}/javascript-dev-guide/widgets/widget_accordion.html) widget is intiialized on the `[data-role=example]` element as illustration): ```javascript $('[data-role=example]').accordion(); diff --git a/guides/v2.3/graphql/reference/quote.md b/guides/v2.3/graphql/reference/quote.md index feac7f1fe04..3046ec6a89d 100644 --- a/guides/v2.3/graphql/reference/quote.md +++ b/guides/v2.3/graphql/reference/quote.md @@ -220,6 +220,82 @@ mutation { } ``` +### Adding simple product with customizable options to a cart + +If a product has a customizable option, the option's value can be specified in the add to cart request. + +**Request** + +``` text +mutation { + addSimpleProductsToCart (input: { + cart_id: "nu31JXR9DaqbdVqFDGnqjrMJmUnT3mzB" + cartItems: { + data: { + sku:"simple" + qty:1 + }, + customizable_options: [ + { + id: 121 + value: "field value" + } + ] + } + }) { + cart { + items { + product { + name + } + qty + + ... on SimpleCartItem { + customizable_options { + label + values { + value + } + } + } + } + } + } +} +``` + +**Response** + +```text +{ + "data": { + "addSimpleProductsToCart": { + "cart": { + "items": [ + { + "product": { + "name": "simple" + }, + "qty": 2, + "customizable_options": [ + { + "label": "Field Option", + "values": [ + { + "value": "field value" + } + ] + } + ] + } + ] + } + } + } +} +``` + + ### Updating billing and shipping information {:.no_toc} diff --git a/rakelib/lib/doc-config.rb b/rakelib/lib/doc-config.rb new file mode 100644 index 00000000000..361efe90a92 --- /dev/null +++ b/rakelib/lib/doc-config.rb @@ -0,0 +1,11 @@ +# Read Docfile file and get configuration data for adding subrepositories +class DocConfig + attr_reader :config + def initialize(config_file = 'Docfile.yml') + @config = YAML.load_file(config_file) + end + + def content_map + @config['content_map'] + end +end diff --git a/rakelib/multirepo.rake b/rakelib/multirepo.rake index 25f7587403a..bbdad0f39a3 100644 --- a/rakelib/multirepo.rake +++ b/rakelib/multirepo.rake @@ -1,14 +1,19 @@ namespace :multirepo do - desc 'Add content from external repositories' + desc 'Create a file tree for devdocs website and get all required content' task :init do - sh './scripts/docs-from-code.sh mbi git@github.com:magento/devdocs-mbi.git master' - sh './scripts/docs-from-code.sh page-builder git@github.com:magento-devdocs/magento2-page-builder.git develop' - sh './scripts/docs-from-code.sh mftf git@github.com:magento/magento2-functional-testing-framework.git develop' + ssh = 'git@github.com:' + https = 'https://${token}@github.com/' + protocol = + if ENV['token'] + https + else + ssh + end - # The last argument 'false' disables content filtering by sparse checkout. - # It covers cases when we need entire repository, not only the '/docs/' directory. - sh './scripts/docs-from-code.sh guides/m1x git@github.com:magento/devdocs-m1.git master false' - sh './scripts/docs-from-code.sh guides/v2.0 git@github.com:magento/devdocs.git 2.0 false' + content_map = DocConfig.new.content_map + content_map.each do |subrepo| + sh "./scripts/docs-from-code.sh #{subrepo['directory']} #{protocol}#{subrepo['repository']}.git #{subrepo['branch']} #{subrepo['filter']}" + end end desc 'Add multirepo docs providing shell arguments "dir=", "repo=", "branch=", "filter=" ("true" by default) to 1) filter content if "true" or 2) add content from the entire repository if "false".'