Uploaded image for project: 'PUBLIC - Liferay Commerce'
  1. PUBLIC - Liferay Commerce
  2. COMMERCE-2943

Product Option Administration in Product/Options Needs Code Review Due Couple Issues

    Details

      Description

      1) have Minium based Site
      2) create couple SKU contributor options and assign values
      3) create new Product A and save as Draft
      4) got to Product/Options
      Expected:
      Add New Option panel is visible
      Headless API should return empty JSON Array if cpDefinition is in DRAFT state.
      Actual:
      Add New Panel is not visible
      Headless API returns nothing and it breaks JavaScript

      5) Publish product, go back to Options - now Add New Option Panel is Visible
      6) select one/two SKU Options and Verify Options are selected
      7) Publish Changes
      8) Go Back to Product A Options
      9) Click Edit one one of options
      10) Edit Values
      Expected:
      Value is Edited
      Actual:
      There is JSON printed in Panel

      Additionally it is not clear is it expected to see some UI controls to ADD New Option Value (there is java script function addNewItem)

      Source file

      src/main/resources/META-INF/resources/definition_option_rels.jsp
      

      defines this code block

      /getSelectedItems().then(
      				function(selectedItemsIds) {
      					itemFinder.default(
      						'itemFinder', 'item-finder-root',
      						{
      							apiUrl: '/o/headless-commerce-admin-catalog/v1.0/options',
      							createNewItemLabel: '<%= LanguageUtil.get(request, "create-new-option") %>',
      							itemsKey: 'id',
      							onItemCreated: addNewItem,
      							onItemSelected: selectItem,
      							pageSize: 10,
      							panelHeaderLabel: '<%= LanguageUtil.get(request, "add-new-option") %>',
      							schema: {
      								itemTitle: ['name', themeDisplay.getLanguageId()]
      							},
      							selectedItems: selectedItemsIds,
      							spritemap: '<%= themeDisplay.getPathThemeImages() %>/lexicon/icons.svg',
      							titleLabel: '<%= LanguageUtil.get(request, "select-an-existing-option") %>'
      						}
      					);
      				}
      			);
      

      -

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              igor.beslic Igor Beslic
              Reporter:
              igor.beslic Igor Beslic
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Packages

                  Version Package
                  2.1.0