Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streamlined the management of products/categories #106

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions screen/SimpleScreens/Catalog/Category/EditCategory.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ along with this software (see the LICENSE.md file). If not, see

<transition name="createProductCategoryRollup"><service-call name="create#mantle.product.category.ProductCategoryRollup"
in-map="context + [productCategoryId:childProductCategoryId]"/><default-response url="."/></transition>
<transition name="createProductCategoryAndRollup"><actions>
<service-call name="create#mantle.product.category.ProductCategory" in-map="context" out-map="context"/>
<service-call name="create#mantle.product.category.ProductCategoryRollup" in-map="context" />
<!-- avoid transitioning to the newly created child category -->
<set field="productCategoryId" from="parentProductCategoryId" />
</actions><default-response url="."/></transition>
<transition name="updateProductCategoryRollup"><service-call name="update#mantle.product.category.ProductCategoryRollup"
in-map="context + [productCategoryId:childProductCategoryId]"/><default-response url="."/></transition>
<transition name="deleteProductCategoryRollup"><service-call name="delete#mantle.product.category.ProductCategoryRollup"
Expand Down Expand Up @@ -81,6 +87,33 @@ along with this software (see the LICENSE.md file). If not, see
<field name="submitButton"><default-field title="Add"><submit/></default-field></field>
</form-single>
</container-dialog>
<container-dialog id="CreateChildDialog" button-text="Create Child Category">
<form-single name="CreateChild" transition="createProductCategoryAndRollup">
<field name="parentProductCategoryId" from="curProductCategoryId"><default-field><hidden/></default-field></field>
<field name="categoryName"><default-field title="Name"><text-line/></default-field></field>
<field name="productCategoryTypeEnumId"><default-field title="Category Type">
<widget-template-include location="component://webroot/template/screen/BasicWidgetTemplates.xml#enumDropDown">
<set field="enumTypeId" value="ProductCategoryType"/>
<set field="noCurrentSelectedKey" from="category.productCategoryTypeEnumId"/>
</widget-template-include>
</default-field></field>
<field name="ownerPartyId" from="category.ownerPartyId"><default-field title="Owner Party">
<drop-down>
<option key="_NA_" text="N/A"/>
<entity-options key="${partyId}" text="PartyNameTemplate">
<entity-find entity-name="mantle.party.PartyDetailAndRole">
<econdition field-name="partyId" from="activeOrgId" ignore="!activeOrgId"/>
<econdition field-name="roleTypeId" value="OrgInternal"/>
<econdition field-name="disabled" value="N" or-null="true"/>
<order-by field-name="organizationName"/></entity-find>
</entity-options>
</drop-down>
</default-field></field>
<field name="fromDate" from="ec.user.nowTimestamp"><default-field><date-time/></default-field></field>
<field name="thruDate"><default-field><date-time/></default-field></field>
<field name="submitButton"><default-field title="Add"><submit/></default-field></field>
</form-single>
</container-dialog>
</box-toolbar><box-body-nopad>
<form-list name="ChildCategoriesForm" list="pccList" transition="updateProductCategoryRollup">
<entity-find entity-name="mantle.product.category.ProductCategoryChildren" list="pccList">
Expand Down
36 changes: 36 additions & 0 deletions screen/SimpleScreens/Catalog/Category/EditProducts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ along with this software (see the LICENSE.md file). If not, see

<transition-include name="getProductList" location="component://SimpleScreens/template/product/ProductTransitions.xml"/>

<!-- create a new product and add it as a member of this category -->
<transition name="createAndAddProduct"><actions>
<service-call name="create#mantle.product.Product" in-map="context" out-map="context"/>
<service-call name="create#mantle.product.category.ProductCategoryMember" in-map="context"/>
</actions><default-response url="."/></transition>
<actions>
<entity-find-one entity-name="mantle.product.category.ProductCategory" value-field="category" cache="false"/>
</actions>
<widgets>
<container-dialog id="AddProductDialog" button-text="Add Product">
<form-single name="AddProductForm" transition="createProductCategoryMember">
Expand All @@ -42,6 +50,34 @@ along with this software (see the LICENSE.md file). If not, see
<field name="submitButton"><default-field title="Add"><submit/></default-field></field>
</form-single>
</container-dialog>
<container-dialog id="CreateAddProductDialog" button-text="Create and Add Product">
<form-single name="CreateAddProductForm" transition="createAndAddProduct">
<field name="productCategoryId"><default-field><hidden/></default-field></field>
<!-- new product fields -->
<field name="productName"><default-field><text-line/></default-field></field>
<field name="productTypeEnumId"><default-field title="Product Type">
<widget-template-include location="component://webroot/template/screen/BasicWidgetTemplates.xml#enumDropDown">
<set field="enumTypeId" value="ProductType"/><set field="noCurrentSelectedKey" value="PtVirtual"/>
</widget-template-include>
</default-field></field>
<field name="ownerPartyId"><default-field title="Owned By Org">
<drop-down no-current-selected-key="${category.ownerPartyId}">
<option key="_NA_" text="N/A"/>
<entity-options key="${partyId}" text="PartyNameTemplate">
<entity-find entity-name="mantle.party.PartyDetailAndRole">
<econdition field-name="roleTypeId" value="OrgInternal"/>
<econdition field-name="disabled" value="N" or-null="true"/>
<order-by field-name="organizationName"/>
</entity-find>
</entity-options>
</drop-down>
</default-field></field>
<!-- assoc type fields -->
<field name="fromDate" from="ec.user.nowTimestamp"><default-field>
<date-time/></default-field></field>
<field name="submitButton"><default-field title="Add"><submit/></default-field></field>
</form-single>
</container-dialog>
<form-list name="ProductsForm" list="pcmpList" transition="updateProductCategoryMember" header-dialog="true">
<entity-find entity-name="mantle.product.category.ProductCategoryMemberProduct" list="pcmpList">
<search-form-inputs default-order-by="sequenceNum,pseudoId"/>
Expand Down
44 changes: 44 additions & 0 deletions screen/SimpleScreens/Catalog/Product/EditAssocs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ along with this software (see the LICENSE.md file). If not, see

<transition name="createProductAssoc"><service-call name="create#mantle.product.ProductAssoc"/>
<default-response url="."/></transition>
<!-- create a new product and associate it with this one -->
<transition name="createAssocProduct"><actions>
<service-call name="create#mantle.product.Product" in-map="context" out-map="newProduct"/>
<set field="productId" from="currProductId" />
<set field="toProductId" from="newProduct.productId" />
<service-call name="create#mantle.product.ProductAssoc" in-map="context"/>
</actions><default-response url="."/></transition>
<transition name="updateProductAssoc"><service-call name="update#mantle.product.ProductAssoc"/>
<default-response url="."/></transition>
<transition name="createVariants"><service-call name="mantle.product.ProductServices.create#VariantProducts"/>
Expand All @@ -46,6 +53,7 @@ along with this software (see the LICENSE.md file). If not, see
</entity-find>
<entity-find entity-name="ProductAssocAndFrom" list="paafList" limit="20">
<date-filter/><econdition field-name="toProductId" from="productId"/></entity-find>
<entity-find-one entity-name="mantle.product.Product" value-field="product" cache="false"/>
</actions>
<widgets>
<container-row><row-col lg="7">
Expand All @@ -69,6 +77,42 @@ along with this software (see the LICENSE.md file). If not, see
<field name="submitButton"><default-field title="Add"><submit/></default-field></field>
</form-single>
</container-dialog>
<container-dialog id="CreateAssocProductDialog" button-text="Create Assoc Product">
<form-single name="CreateAssocProductForm" transition="createAssocProduct">
<field name="currProductId" from="productId"><default-field><hidden/></default-field></field>
<!-- new product fields -->
<field name="productName"><default-field><text-line/></default-field></field>
<field name="productTypeEnumId"><default-field title="Product Type">
<widget-template-include location="component://webroot/template/screen/BasicWidgetTemplates.xml#enumDropDown">
<set field="enumTypeId" value="ProductType"/><set field="noCurrentSelectedKey" value="PtAsset"/>
</widget-template-include>
</default-field></field>
<field name="ownerPartyId"><default-field title="Owned By Org">
<drop-down no-current-selected-key="${product.ownerPartyId}">
<option key="_NA_" text="N/A"/>
<entity-options key="${partyId}" text="PartyNameTemplate">
<entity-find entity-name="mantle.party.PartyDetailAndRole">
<econdition field-name="roleTypeId" value="OrgInternal"/>
<econdition field-name="disabled" value="N" or-null="true"/>
<order-by field-name="organizationName"/>
</entity-find>
</entity-options>
</drop-down>
</default-field></field>
<!-- assoc type fields -->
<field name="productAssocTypeEnumId"><default-field title="Assoc. Type">
<drop-down no-current-selected-key="PatVariant">
<entity-options key="${enumId}" text="${description}">
<entity-find entity-name="moqui.basic.Enumeration">
<econdition field-name="enumTypeId" value="ProductAssocType"/>
<order-by field-name="description"/></entity-find></entity-options>
</drop-down>
</default-field></field>
<field name="quantity"><default-field><text-line size="10"/></default-field></field>
<field name="fromDate" from="ec.user.nowTimestamp"><default-field><hidden/></default-field></field>
<field name="submitButton"><default-field title="Add"><submit/></default-field></field>
</form-single>
</container-dialog>
</box-toolbar><box-body>
<form-list name="AssocToListForm" list="paatList" transition="updateProductAssoc" paginate="true">
<field name="productId"><default-field><hidden/></default-field></field>
Expand Down
46 changes: 44 additions & 2 deletions screen/SimpleScreens/ProductStore/FindProductStoreCategory.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ along with this software (see the LICENSE.md file). If not, see

<transition name="createStoreCategory"><service-call name="create#mantle.product.store.ProductStoreCategory"/>
<default-response url="."/></transition>

<transition name="createCategoryAddStore">
<actions>
<service-call name="create#mantle.product.category.ProductCategory" in-map="context" out-map="context"/>
<service-call name="create#mantle.product.store.ProductStoreCategory" in-map="context"/>
</actions>
<default-response url="."/>
</transition>

<transition name="updateStoreCategory"><service-call name="update#mantle.product.store.ProductStoreCategory"/>
<default-response url="."/></transition>
<transition name="deleteStoreCategory"><service-call name="delete#mantle.product.store.ProductStoreCategory"/>
Expand All @@ -28,8 +37,8 @@ along with this software (see the LICENSE.md file). If not, see
<transition-include name="getCategoryList" location="component://SimpleScreens/template/product/ProductTransitions.xml"/>

<widgets>
<container-dialog id="NewStoreCategoryDialog" button-text="Add Store Category">
<form-single name="NewStoreCategoryForm" transition="createStoreCategory">
<container-dialog id="AddStoreCategoryDialog" button-text="Add Store Category">
<form-single name="AddStoreCategoryForm" transition="createStoreCategory">
<field name="productStoreId"><default-field><hidden/></default-field></field>
<field name="productCategoryId"><default-field title="Category"><drop-down>
<dynamic-options transition="getCategoryList" server-search="true" min-length="0"/></drop-down></default-field></field>
Expand All @@ -46,6 +55,39 @@ along with this software (see the LICENSE.md file). If not, see
</form-single>
</container-dialog>

<container-dialog id="CreateCategoryDialog" button-text="Create Store Category">
<form-single name="CreateCategoryForm" transition="createCategoryAddStore">
<field name="productStoreId"><default-field><hidden/></default-field></field>
<field name="categoryName"><default-field><text-line/></default-field></field>
<field name="productCategoryTypeEnumId"><default-field title="Category Type">
<widget-template-include location="component://webroot/template/screen/BasicWidgetTemplates.xml#enumDropDown">
<set field="enumTypeId" value="ProductCategoryType"/></widget-template-include>
</default-field></field>
<field name="ownerPartyId"><default-field title="Owner Party">
<drop-down>
<option key="_NA_" text="N/A"/>
<entity-options key="${partyId}" text="PartyNameTemplate">
<entity-find entity-name="mantle.party.PartyDetailAndRole">
<econdition field-name="partyId" from="activeOrgId" ignore="!activeOrgId"/>
<econdition field-name="roleTypeId" value="OrgInternal"/>
<econdition field-name="disabled" value="N" or-null="true"/>
<order-by field-name="organizationName"/></entity-find>
</entity-options>
</drop-down>
</default-field></field>
<field name="storeCategoryTypeEnumId"><default-field title="Store Category Type">
<drop-down><entity-options key="${enumId}" text="${description ?: ''}">
<entity-find entity-name="moqui.basic.Enumeration">
<econdition field-name="enumTypeId" value="ProductStoreCategoryType"/>
<order-by field-name="description"/>
</entity-find>
</entity-options></drop-down>
</default-field></field>
<field name="fromDate"><default-field><date-time type="date-time"/></default-field></field>
<field name="submitButton"><default-field title="Create"><submit/></default-field></field>
</form-single>
</container-dialog>

<form-list name="StoreCategoriesForm" list="storeCategories" header-dialog="true" transition="updateStoreCategory">
<entity-find entity-name="mantle.product.store.ProductStoreCategory" list="storeCategories">
<search-form-inputs default-order-by="productCategoryId"/>
Expand Down