Feat: Product Variations page get, filter, and save. \n Fix: Active column changed to Add / Delete / Undelete column - this change has only been applied to Product Variations page
This commit is contained in:
2
app.py
2
app.py
@@ -43,6 +43,7 @@ from controllers.store.manufacturing_purchase_order import routes_store_manufact
|
|||||||
from controllers.store.product import routes_store_product
|
from controllers.store.product import routes_store_product
|
||||||
from controllers.store.product_category import routes_store_product_category
|
from controllers.store.product_category import routes_store_product_category
|
||||||
from controllers.store.product_permutation import routes_store_product_permutation
|
from controllers.store.product_permutation import routes_store_product_permutation
|
||||||
|
from controllers.store.product_variation import routes_store_product_variation
|
||||||
from controllers.store.stock_item import routes_store_stock_item
|
from controllers.store.stock_item import routes_store_stock_item
|
||||||
from controllers.store.supplier import routes_store_supplier
|
from controllers.store.supplier import routes_store_supplier
|
||||||
from controllers.store.supplier_purchase_order import routes_store_supplier_purchase_order
|
from controllers.store.supplier_purchase_order import routes_store_supplier_purchase_order
|
||||||
@@ -137,6 +138,7 @@ app.register_blueprint(routes_store_manufacturing_purchase_order)
|
|||||||
app.register_blueprint(routes_store_product)
|
app.register_blueprint(routes_store_product)
|
||||||
app.register_blueprint(routes_store_product_category)
|
app.register_blueprint(routes_store_product_category)
|
||||||
app.register_blueprint(routes_store_product_permutation)
|
app.register_blueprint(routes_store_product_permutation)
|
||||||
|
app.register_blueprint(routes_store_product_variation)
|
||||||
app.register_blueprint(routes_store_stock_item)
|
app.register_blueprint(routes_store_stock_item)
|
||||||
app.register_blueprint(routes_store_supplier)
|
app.register_blueprint(routes_store_supplier)
|
||||||
app.register_blueprint(routes_store_supplier_purchase_order)
|
app.register_blueprint(routes_store_supplier_purchase_order)
|
||||||
|
|||||||
Binary file not shown.
@@ -69,6 +69,9 @@ class Base():
|
|||||||
NAME_ATTR_OPTION_TEXT: ClassVar[str] = 'name-attribute-option-text'
|
NAME_ATTR_OPTION_TEXT: ClassVar[str] = 'name-attribute-option-text'
|
||||||
NAME_ATTR_OPTION_VALUE: ClassVar[str] = 'name-attribute-option-value'
|
NAME_ATTR_OPTION_VALUE: ClassVar[str] = 'name-attribute-option-value'
|
||||||
"""
|
"""
|
||||||
|
def __repr__(self):
|
||||||
|
attrs = '\n'.join(f'{k}={v!r}' for k, v in self.__dict__.items())
|
||||||
|
return f'<{self.__class__.__name__}(\n{attrs}\n)>'
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def output_bool(cls, value):
|
def output_bool(cls, value):
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -119,8 +119,6 @@ class Product_Permutation(db.Model, Store_Base):
|
|||||||
# variation_tree
|
# variation_tree
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.variations = []
|
|
||||||
self.variation_index = {}
|
|
||||||
self.prices = []
|
self.prices = []
|
||||||
self.price_index = {}
|
self.price_index = {}
|
||||||
self.images = []
|
self.images = []
|
||||||
@@ -139,6 +137,7 @@ class Product_Permutation(db.Model, Store_Base):
|
|||||||
self.is_unavailable_in_currency_or_region = False
|
self.is_unavailable_in_currency_or_region = False
|
||||||
# self.is_available = False
|
# self.is_available = False
|
||||||
self.variation_tree = None
|
self.variation_tree = None
|
||||||
|
# self.variations = []
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_DB_get_many_product_catalogue(cls, query_row):
|
def from_DB_get_many_product_catalogue(cls, query_row):
|
||||||
_m = f'{cls.__name__}.from_DB_get_many_product_catalogue'
|
_m = f'{cls.__name__}.from_DB_get_many_product_catalogue'
|
||||||
@@ -303,7 +302,7 @@ class Product_Permutation(db.Model, Store_Base):
|
|||||||
self.FLAG_CAN_VIEW: self.can_view,
|
self.FLAG_CAN_VIEW: self.can_view,
|
||||||
self.FLAG_CAN_EDIT: self.can_edit,
|
self.FLAG_CAN_EDIT: self.can_edit,
|
||||||
self.FLAG_CAN_ADMIN: self.can_admin,
|
self.FLAG_CAN_ADMIN: self.can_admin,
|
||||||
self.FLAG_PRODUCT_VARIATION: [variation.to_json() for variation in self.variations],
|
self.FLAG_PRODUCT_VARIATIONS: [variation_type.to_json() for variation_type in self.variation_tree.get_product_variation_types()],
|
||||||
self.FLAG_PRODUCT_IMAGE: [image.to_json() for image in self.images],
|
self.FLAG_PRODUCT_IMAGE: [image.to_json() for image in self.images],
|
||||||
self.FLAG_DELIVERY_OPTION: [option.to_json() for option in self.delivery_options],
|
self.FLAG_DELIVERY_OPTION: [option.to_json() for option in self.delivery_options],
|
||||||
self.FLAG_PRODUCT_PRICE: [price.to_json() for price in self.prices],
|
self.FLAG_PRODUCT_PRICE: [price.to_json() for price in self.prices],
|
||||||
@@ -341,13 +340,13 @@ class Product_Permutation(db.Model, Store_Base):
|
|||||||
return f'{price.symbol_currency} {locale.format_string("%d", price.value_local_VAT_incl, grouping=True)}'
|
return f'{price.symbol_currency} {locale.format_string("%d", price.value_local_VAT_incl, grouping=True)}'
|
||||||
else:
|
else:
|
||||||
return f'{price.symbol_currency} {locale.format_string("%d", price.value_local_VAT_excl, grouping=True)}'
|
return f'{price.symbol_currency} {locale.format_string("%d", price.value_local_VAT_excl, grouping=True)}'
|
||||||
"""
|
|
||||||
def output_variations(self):
|
def output_variations(self):
|
||||||
if not self.has_variations: return ''
|
if not self.has_variations: return ''
|
||||||
return '\n'.join([f'{variation.name_variation_type}: {variation.name_variation}' for variation in self.variations])
|
return '\n'.join([f'{variation.name_variation_type}: {variation.name_variation}' for variation in self.variations])
|
||||||
def output_variations_jsonify(self):
|
def output_variations_jsonify(self):
|
||||||
if not self.has_variations: return ''
|
if not self.has_variations: return ''
|
||||||
return ','.join([f'{variation.id_type}: {variation.id_variation}' for variation in self.variations])
|
return ','.join([f'{variation.id_type}: {variation.id_variation}' for variation in self.variations])
|
||||||
|
"""
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return f'''Product_Permutation
|
return f'''Product_Permutation
|
||||||
@@ -387,7 +386,7 @@ class Product_Permutation(db.Model, Store_Base):
|
|||||||
can_view: {self.can_view}
|
can_view: {self.can_view}
|
||||||
can_edit: {self.can_edit}
|
can_edit: {self.can_edit}
|
||||||
can_admin: {self.can_admin}
|
can_admin: {self.can_admin}
|
||||||
variations: {self.variations}
|
variation tree: {self.variation_tree}
|
||||||
images: {self.images}
|
images: {self.images}
|
||||||
delivery_options: {self.delivery_options}
|
delivery_options: {self.delivery_options}
|
||||||
prices: {self.prices}
|
prices: {self.prices}
|
||||||
|
|||||||
@@ -18,8 +18,9 @@ Business object for product variation
|
|||||||
# IMPORTS
|
# IMPORTS
|
||||||
# internal
|
# internal
|
||||||
import lib.argument_validation as av
|
import lib.argument_validation as av
|
||||||
|
from business_objects.db_base import Get_Many_Parameters_Base
|
||||||
from business_objects.store.store_base import Store_Base
|
from business_objects.store.store_base import Store_Base
|
||||||
from business_objects.store.product_variation_type import Product_Variation_Type
|
# from business_objects.store.product_variation_type import Product_Variation_Type
|
||||||
from extensions import db
|
from extensions import db
|
||||||
from helpers.helper_app import Helper_App
|
from helpers.helper_app import Helper_App
|
||||||
# external
|
# external
|
||||||
@@ -55,7 +56,7 @@ class Product_Variation(db.Model, Store_Base):
|
|||||||
variation.id_product = query_row[11]
|
variation.id_product = query_row[11]
|
||||||
variation.id_permutation = query_row[12]
|
variation.id_permutation = query_row[12]
|
||||||
variation.id_category = query_row[13]
|
variation.id_category = query_row[13]
|
||||||
variation.variation_type = Product_Variation_Type.from_DB_get_many_product_catalogue(query_row)
|
# variation.variation_type = Product_Variation_Type.from_DB_get_many_product_catalogue(query_row)
|
||||||
return variation
|
return variation
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -73,13 +74,14 @@ class Product_Variation(db.Model, Store_Base):
|
|||||||
def from_json(cls, json):
|
def from_json(cls, json):
|
||||||
variation = cls()
|
variation = cls()
|
||||||
variation.id_variation = json[cls.ATTR_ID_PRODUCT_VARIATION]
|
variation.id_variation = json[cls.ATTR_ID_PRODUCT_VARIATION]
|
||||||
|
variation.id_type = json[cls.ATTR_ID_PRODUCT_VARIATION_TYPE]
|
||||||
variation.code = json[cls.FLAG_CODE]
|
variation.code = json[cls.FLAG_CODE]
|
||||||
variation.name = json[cls.FLAG_NAME]
|
variation.name = json[cls.FLAG_NAME]
|
||||||
variation.display_order = json[cls.FLAG_DISPLAY_ORDER]
|
variation.display_order = json[cls.FLAG_DISPLAY_ORDER]
|
||||||
variation.active = json[cls.FLAG_ACTIVE]
|
variation.active = 1 if av.input_bool(json[cls.FLAG_ACTIVE], cls.FLAG_ACTIVE, f'{cls.__name__}.from_json') else 0
|
||||||
variation.id_permutation = json[cls.ATTR_ID_PRODUCT_PERMUTATION]
|
variation.id_permutation = json.get(cls.ATTR_ID_PRODUCT_PERMUTATION, None)
|
||||||
variation.id_product = json[cls.ATTR_ID_PRODUCT]
|
variation.id_product = json.get(cls.ATTR_ID_PRODUCT, None)
|
||||||
variation.id_category = json[cls.ATTR_ID_PRODUCT_CATEGORY]
|
variation.id_category = json.get(cls.ATTR_ID_PRODUCT_CATEGORY, None)
|
||||||
return variation
|
return variation
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
@@ -116,7 +118,7 @@ class Product_Variation(db.Model, Store_Base):
|
|||||||
'text': self.name
|
'text': self.name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"""
|
||||||
@dataclass
|
@dataclass
|
||||||
class Product_Variation_Filters():
|
class Product_Variation_Filters():
|
||||||
get_all_variation_type: bool
|
get_all_variation_type: bool
|
||||||
@@ -140,7 +142,7 @@ class Product_Variation_Filters():
|
|||||||
'a_ids_variation': self.ids_variation,
|
'a_ids_variation': self.ids_variation,
|
||||||
|
|
||||||
}
|
}
|
||||||
"""
|
""
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def from_form(form):
|
def from_form(form):
|
||||||
av.val_instance(form, 'form', 'User_Filters.from_form', Filters_Product_Variation)
|
av.val_instance(form, 'form', 'User_Filters.from_form', Filters_Product_Variation)
|
||||||
@@ -164,7 +166,7 @@ class Product_Variation_Filters():
|
|||||||
ids_user = user.id_user,
|
ids_user = user.id_user,
|
||||||
ids_user_auth0 = user.id_user_auth0,
|
ids_user_auth0 = user.id_user_auth0,
|
||||||
)
|
)
|
||||||
"""
|
""
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_default():
|
def get_default():
|
||||||
@@ -178,8 +180,35 @@ class Product_Variation_Filters():
|
|||||||
# get_first_variation = False,
|
# get_first_variation = False,
|
||||||
ids_variation = ''
|
ids_variation = ''
|
||||||
)
|
)
|
||||||
|
"""
|
||||||
|
class Parameters_Product_Variation(Get_Many_Parameters_Base):
|
||||||
|
a_get_all_variation_type: bool
|
||||||
|
a_get_inactive_variation_type: bool
|
||||||
|
a_ids_variation_type: str
|
||||||
|
a_get_all_variation: bool
|
||||||
|
a_get_inactive_variation: bool
|
||||||
|
a_ids_variation: str
|
||||||
|
def __init__(self, **kwargs):
|
||||||
|
super().__init__(**kwargs)
|
||||||
|
@classmethod
|
||||||
|
def get_default(cls):
|
||||||
|
return cls(
|
||||||
|
a_get_all_variation_type = True,
|
||||||
|
a_get_inactive_variation_type = False,
|
||||||
|
a_ids_variation_type = '',
|
||||||
|
a_get_all_variation = True,
|
||||||
|
a_get_inactive_variation = False,
|
||||||
|
a_ids_variation = ''
|
||||||
|
)
|
||||||
|
@classmethod
|
||||||
|
def from_filters_product_variation(cls, form):
|
||||||
|
parameters = cls.get_default()
|
||||||
|
get_inactive = not form.active.data
|
||||||
|
parameters.a_get_inactive_variation_type = get_inactive
|
||||||
|
parameters.a_get_inactive_variation = get_inactive
|
||||||
|
return parameters
|
||||||
|
|
||||||
|
"""
|
||||||
class Product_Variation_Container(BaseModel):
|
class Product_Variation_Container(BaseModel):
|
||||||
variation_types: list = []
|
variation_types: list = []
|
||||||
variations: list = []
|
variations: list = []
|
||||||
@@ -209,4 +238,43 @@ class Product_Variation_Container(BaseModel):
|
|||||||
for variation_type in self.variation_types:
|
for variation_type in self.variation_types:
|
||||||
list_variation_types.append(variation_type.to_json_option())
|
list_variation_types.append(variation_type.to_json_option())
|
||||||
return list_variation_types
|
return list_variation_types
|
||||||
|
"""
|
||||||
|
|
||||||
|
class Product_Variation_Temp(db.Model, Store_Base):
|
||||||
|
__tablename__ = 'Shop_Variation_Temp'
|
||||||
|
__table_args__ = { 'extend_existing': True }
|
||||||
|
id_temp: int = db.Column(db.Integer, primary_key=True, autoincrement=True)
|
||||||
|
id_variation: int = db.Column(db.Integer) # , primary_key=True)
|
||||||
|
id_type: int = db.Column(db.Integer, nullable=False)
|
||||||
|
code: str = db.Column(db.String(50))
|
||||||
|
name: str = db.Column(db.String(255))
|
||||||
|
active: bool = db.Column(db.Boolean)
|
||||||
|
display_order: int = db.Column(db.Integer)
|
||||||
|
guid: str = db.Column(db.String(36))
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
attrs = '\n'.join(f'{k}={v!r}' for k, v in self.__dict__.items())
|
||||||
|
return f'<{self.__class__.__name__}(\n{attrs}\n)>'
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self.id_temp = None
|
||||||
|
@classmethod
|
||||||
|
def from_product_variation(cls, product_variation):
|
||||||
|
row = cls()
|
||||||
|
row.id_variation = product_variation.id_variation
|
||||||
|
row.id_type = product_variation.id_type
|
||||||
|
row.code = product_variation.code
|
||||||
|
row.name = product_variation.name
|
||||||
|
row.active = 1 if av.input_bool(product_variation.active, cls.FLAG_ACTIVE, f'{cls.__name__}.to_json') else 0
|
||||||
|
row.display_order = product_variation.display_order
|
||||||
|
return row
|
||||||
|
def to_json(self):
|
||||||
|
return {
|
||||||
|
'id_variation': self.id_variation,
|
||||||
|
'id_type': self.id_type,
|
||||||
|
'code': self.code,
|
||||||
|
'name': self.name,
|
||||||
|
'active': self.active,
|
||||||
|
'display_order': self.display_order,
|
||||||
|
'guid': self.guid,
|
||||||
|
}
|
||||||
@@ -11,21 +11,21 @@ Business object for product
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
# internal
|
# internal
|
||||||
from business_objects.store.product_variation import Product_Variation
|
from business_objects.store.product_variation_type import Product_Variation_Type
|
||||||
from extensions import db
|
from extensions import db
|
||||||
from helpers.helper_app import Helper_App
|
from helpers.helper_app import Helper_App
|
||||||
# external
|
# external
|
||||||
|
|
||||||
|
|
||||||
class Product_Variation_Tree_Node():
|
class Product_Variation_Tree_Node():
|
||||||
variation: Product_Variation
|
variation_type: Product_Variation_Type
|
||||||
node_parent: None
|
node_parent: None
|
||||||
nodes_child: list
|
nodes_child: list
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.nodes_child = []
|
self.nodes_child = []
|
||||||
def from_variation_and_node_parent(variation, node_parent):
|
def from_variation_type_and_node_parent(variation_type, node_parent):
|
||||||
node = Product_Variation_Tree_Node()
|
node = Product_Variation_Tree_Node()
|
||||||
node.variation = variation
|
node.variation_type = variation_type
|
||||||
node.node_parent = node_parent
|
node.node_parent = node_parent
|
||||||
return node
|
return node
|
||||||
def from_node_parent(node_parent):
|
def from_node_parent(node_parent):
|
||||||
@@ -45,8 +45,8 @@ class Product_Variation_Tree():
|
|||||||
tree.node_root = node_root
|
tree.node_root = node_root
|
||||||
return tree
|
return tree
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_variation_root(cls, variation_root):
|
def from_variation_type_root(cls, variation_type_root):
|
||||||
node_root = Product_Variation_Tree_Node.from_variation_and_node_parent(variation_root, None)
|
node_root = Product_Variation_Tree_Node.from_variation_type_and_node_parent(variation_type_root, None)
|
||||||
return cls.from_node_root(node_root)
|
return cls.from_node_root(node_root)
|
||||||
def is_equal(self, tree):
|
def is_equal(self, tree):
|
||||||
my_type_list = self.get_product_variations()
|
my_type_list = self.get_product_variations()
|
||||||
@@ -56,53 +56,51 @@ class Product_Variation_Tree():
|
|||||||
is_equal = (sz_me == sz_other)
|
is_equal = (sz_me == sz_other)
|
||||||
if is_equal:
|
if is_equal:
|
||||||
for index_type in range(sz_me):
|
for index_type in range(sz_me):
|
||||||
if my_type_list[index_type] != other_type_list[index_type]:
|
my_variation_type = my_type_list[index_type]
|
||||||
|
other_variation_type = other_type_list[index_type]
|
||||||
|
if my_variation_type.id_type != other_variation_type.id_type:
|
||||||
|
is_equal = False
|
||||||
|
break
|
||||||
|
my_variation = my_variation_type.variations[0]
|
||||||
|
other_variation = other_variation_type.variations[0]
|
||||||
|
if my_variation.id_variation != other_variation.id_variation:
|
||||||
is_equal = False
|
is_equal = False
|
||||||
break
|
break
|
||||||
return is_equal
|
return is_equal
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_product_permutation(cls, product_permutation):
|
def from_product_permutation(cls, product_permutation):
|
||||||
depth_max = len(product_permutation.variations)
|
depth_max = len(product_permutation.variation_types)
|
||||||
node_root = Product_Variation_Tree_Node.from_variation_and_node_parent(product_permutation.variations[0], None)
|
node_root = Product_Variation_Tree_Node.from_variation_type_and_node_parent(product_permutation.variation_types[0], None)
|
||||||
node = node_root
|
node = node_root
|
||||||
for depth in range(depth_max - 1):
|
for depth in range(depth_max - 1):
|
||||||
node = Product_Variation_Tree_Node.from_variation_and_node_parent(product_permutation.variations[depth + 1], node)
|
node = Product_Variation_Tree_Node.from_variation_type_and_node_parent(product_permutation.variation_types[depth + 1], node)
|
||||||
return cls.from_node_root(node_root)
|
return cls.from_node_root(node_root)
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_product_variation(cls, product_variation):
|
def from_product_variation_type(cls, product_variation_type):
|
||||||
node_root = Product_Variation_Tree_Node.from_variation_and_node_parent(product_variation, None)
|
node_root = Product_Variation_Tree_Node.from_variation_type_and_node_parent(product_variation_type, None)
|
||||||
return cls.from_node_root(node_root)
|
return cls.from_node_root(node_root)
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_product_variations(cls, product_variations):
|
def from_product_variation_types(cls, product_variation_types):
|
||||||
node_root = Product_Variation_Tree_Node.from_variation_and_node_parent(product_variations[0], None)
|
node_root = Product_Variation_Tree_Node.from_variation_type_and_node_parent(product_variation_types[0], None)
|
||||||
tree = cls.from_node_root(node_root)
|
tree = cls.from_node_root(node_root)
|
||||||
if len(product_variations) > 1:
|
if len(product_variation_types) > 1:
|
||||||
for variation in product_variations[1:]:
|
for variation_type in product_variation_types[1:]:
|
||||||
tree.add_product_variation(variation)
|
tree.add_product_variation_type(variation_type)
|
||||||
return tree
|
return tree
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_json_str(cls, json_str):
|
def from_json_str(cls, json_str):
|
||||||
variations = []
|
variation_types = []
|
||||||
if json_str is None or json_str == '': return None
|
if json_str is None or json_str == '': return None
|
||||||
for json_variation in json_str.split(','):
|
for json_variation_type in json_str.split(','):
|
||||||
parts = json_variation.split(':')
|
parts = json_variation_type.split(':')
|
||||||
if len(parts) != 2: continue
|
if len(parts) != 2: continue
|
||||||
|
variation_type = Product_Variation_Type()
|
||||||
|
variation_type.id_type = parts[0]
|
||||||
variation = Product_Variation()
|
variation = Product_Variation()
|
||||||
variation.id_type = parts[0]
|
variation_type.id_variation = parts[1]
|
||||||
variation.id_variation = parts[1]
|
variation_type.variations = [variation]
|
||||||
variations.append(variation)
|
variation_types.append(variation_type)
|
||||||
return cls.from_product_variations(variations)
|
return cls.from_product_variation_types(variation_types)
|
||||||
"""
|
|
||||||
def get_name_variations(self):
|
|
||||||
node = self.node_root
|
|
||||||
name = node.variation.name_variation_type
|
|
||||||
at_leaf_node = node.is_leaf()
|
|
||||||
while not at_leaf_node:
|
|
||||||
node = node.nodes_child[0]
|
|
||||||
name += f', {node.variation.name_variation_type}'
|
|
||||||
at_leaf_node = node.is_leaf()
|
|
||||||
return name
|
|
||||||
"""
|
|
||||||
def get_node_leaf(self):
|
def get_node_leaf(self):
|
||||||
node = self.node_root
|
node = self.node_root
|
||||||
at_leaf_node = node.is_leaf()
|
at_leaf_node = node.is_leaf()
|
||||||
@@ -110,19 +108,20 @@ class Product_Variation_Tree():
|
|||||||
node = node.nodes_child[0]
|
node = node.nodes_child[0]
|
||||||
at_leaf_node = node.is_leaf()
|
at_leaf_node = node.is_leaf()
|
||||||
return node
|
return node
|
||||||
def add_product_variation(self, variation):
|
def add_product_variation_type(self, variation_type):
|
||||||
node_leaf = self.get_node_leaf()
|
node_leaf = self.get_node_leaf()
|
||||||
node_new = Product_Variation_Tree_Node.from_variation_and_node_parent(variation, node_leaf)
|
node_new = Product_Variation_Tree_Node.from_variation_type_and_node_parent(variation_type, node_leaf)
|
||||||
node_leaf.add_child(node_new)
|
node_leaf.add_child(node_new)
|
||||||
def get_product_variation_types(self):
|
def get_product_variation_types(self):
|
||||||
types = []
|
types = []
|
||||||
node = self.node_root
|
node = self.node_root
|
||||||
at_leaf_node = node.is_leaf()
|
at_leaf_node = node.is_leaf()
|
||||||
while not at_leaf_node:
|
while not at_leaf_node:
|
||||||
types.append(node.variation.name_variation_type)
|
types.append(node.variation_type)
|
||||||
node = node.nodes_child[0]
|
node = node.nodes_child[0]
|
||||||
at_leaf_node = node.is_leaf()
|
at_leaf_node = node.is_leaf()
|
||||||
return types
|
return types
|
||||||
|
"""
|
||||||
def get_product_variations(self):
|
def get_product_variations(self):
|
||||||
variations = []
|
variations = []
|
||||||
node = self.node_root
|
node = self.node_root
|
||||||
@@ -133,58 +132,28 @@ class Product_Variation_Tree():
|
|||||||
at_leaf_node = node.is_leaf()
|
at_leaf_node = node.is_leaf()
|
||||||
variations.append(node.variation)
|
variations.append(node.variation)
|
||||||
return variations
|
return variations
|
||||||
|
"""
|
||||||
def to_preview_str(self):
|
def to_preview_str(self):
|
||||||
Helper_App.console_log(f'Product_Variation_Tree.to_preview_str')
|
Helper_App.console_log(f'Product_Variation_Tree.to_preview_str')
|
||||||
variations = self.get_product_variations()
|
variation_types = self.get_product_variation_types()
|
||||||
Helper_App.console_log(f'variations: {variations}')
|
Helper_App.console_log(f'variation_types: {variation_types}')
|
||||||
preview_str = ''
|
preview_str = ''
|
||||||
for variation in variations:
|
for variation_type in variation_types:
|
||||||
is_first = (preview_str == '')
|
is_first = (preview_str == '')
|
||||||
preview_str += f'{variation.variation_type.name_singular}: {variation.name}'
|
preview_str += f'{variation_type.name}: {variation_type.variations[0].name}'
|
||||||
if is_first:
|
if is_first:
|
||||||
preview_str += '\n'
|
preview_str += '\n'
|
||||||
Helper_App.console_log(f'preview_str: {preview_str}')
|
Helper_App.console_log(f'preview_str: {preview_str}')
|
||||||
return preview_str
|
return preview_str
|
||||||
def to_json(self):
|
def to_json(self):
|
||||||
variations = self.get_product_variations()
|
variation_types = self.get_product_variation_types()
|
||||||
json_variations = []
|
json_variation_types = []
|
||||||
for variation in variations:
|
for variation_type in variation_types:
|
||||||
json_variations.append(variation.to_json())
|
json_variation_types.append(variation_type.to_json())
|
||||||
return json_variations
|
return json_variation_types
|
||||||
def to_variation_id_pairs_str(self):
|
def to_variation_id_pairs_str(self):
|
||||||
variations = self.get_product_variations()
|
variation_types = self.get_product_variation_types()
|
||||||
pairs_str = ''
|
pairs_str = ''
|
||||||
for variation in variations:
|
for variation_type in variation_types:
|
||||||
pairs_str += f'{variation.id_type}:{variation.id_variation},'
|
pairs_str += f'{variation_type.id_type}:{variation_type.variations[0].id_variation},'
|
||||||
return pairs_str
|
return pairs_str
|
||||||
"""
|
|
||||||
class Product_Variation_Container(BaseModel):
|
|
||||||
variation_types: list = []
|
|
||||||
variations: list = []
|
|
||||||
|
|
||||||
def add_product_variation_type(self, variation_type):
|
|
||||||
av.val_instance(variation_type, 'variation_type', 'Product_Variation_Container.add_product_variation_type', Product_Variation_Type)
|
|
||||||
self.variations.append(variation_type)
|
|
||||||
def add_product_variation(self, variation):
|
|
||||||
av.val_instance(variation, 'variation', 'Product_Variation_Container.add_product_variation', Product_Variation)
|
|
||||||
if variation.variation_type is None:
|
|
||||||
variation_type = next(filterfalse(lambda x: x.id_type != variation.id_type, self.variation_types), None)
|
|
||||||
if variation_type is not None:
|
|
||||||
variation.variation_type = variation_type
|
|
||||||
self.variations.append(variation)
|
|
||||||
|
|
||||||
def __repr__(self):
|
|
||||||
return f'Product_Variation_Container:\nvariations_types: {self.variation_types}\nvariations: {self.variations}'
|
|
||||||
|
|
||||||
def to_list_variation_options(self):
|
|
||||||
list_variations = []
|
|
||||||
for variation in self.variations:
|
|
||||||
list_variations.append(variation.to_json_option())
|
|
||||||
Helper_App.console_log(f'list_variations: {list_variations}')
|
|
||||||
return list_variations
|
|
||||||
def to_list_variation_type_options(self):
|
|
||||||
list_variation_types = []
|
|
||||||
for variation_type in self.variation_types:
|
|
||||||
list_variation_types.append(variation_type.to_json_option())
|
|
||||||
return list_variation_types
|
|
||||||
"""
|
|
||||||
@@ -18,6 +18,7 @@ Business object for product variation
|
|||||||
# IMPORTS
|
# IMPORTS
|
||||||
# internal
|
# internal
|
||||||
import lib.argument_validation as av
|
import lib.argument_validation as av
|
||||||
|
from business_objects.store.product_variation import Product_Variation
|
||||||
from business_objects.store.store_base import Store_Base
|
from business_objects.store.store_base import Store_Base
|
||||||
from extensions import db
|
from extensions import db
|
||||||
# external
|
# external
|
||||||
@@ -40,6 +41,7 @@ class Product_Variation_Type(db.Model, Store_Base):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
self.variations = []
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_DB_get_many_product_catalogue(cls, query_row):
|
def from_DB_get_many_product_catalogue(cls, query_row):
|
||||||
@@ -50,6 +52,7 @@ class Product_Variation_Type(db.Model, Store_Base):
|
|||||||
variation_type.name_plural = query_row[8]
|
variation_type.name_plural = query_row[8]
|
||||||
variation_type.display_order = query_row[9]
|
variation_type.display_order = query_row[9]
|
||||||
variation_type.active = av.input_bool(query_row[10], cls.FLAG_ACTIVE, f'{cls.__name__}.from_DB_get_many_product_catalogue')
|
variation_type.active = av.input_bool(query_row[10], cls.FLAG_ACTIVE, f'{cls.__name__}.from_DB_get_many_product_catalogue')
|
||||||
|
variation_type.variations = [Product_Variation.from_DB_get_many_product_catalogue(query_row)]
|
||||||
return variation_type
|
return variation_type
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -68,10 +71,13 @@ class Product_Variation_Type(db.Model, Store_Base):
|
|||||||
variation_type = cls()
|
variation_type = cls()
|
||||||
variation_type.id_type = json[cls.ATTR_ID_PRODUCT_VARIATION_TYPE]
|
variation_type.id_type = json[cls.ATTR_ID_PRODUCT_VARIATION_TYPE]
|
||||||
variation_type.code = json[cls.FLAG_CODE]
|
variation_type.code = json[cls.FLAG_CODE]
|
||||||
variation_type.name_singular = json[cls.FLAG_NAME_SINGULAR]
|
variation_type.name_singular = json.get(cls.FLAG_NAME_SINGULAR, json.get(cls.FLAG_NAME, ''))
|
||||||
variation_type.name_plural = json[cls.FLAG_NAME_PLURAL]
|
variation_type.name_plural = json[cls.FLAG_NAME_PLURAL]
|
||||||
variation_type.display_order = json[cls.FLAG_DISPLAY_ORDER]
|
variation_type.display_order = json[cls.FLAG_DISPLAY_ORDER]
|
||||||
variation_type.active = json[cls.FLAG_ACTIVE]
|
variation_type.active = json[cls.FLAG_ACTIVE]
|
||||||
|
variations = json.get(cls.FLAG_PRODUCT_VARIATIONS, [])
|
||||||
|
if variations is not None and len(variations) > 0:
|
||||||
|
variation_type.variations = [Product_Variation.from_json(variation) for variation in variations]
|
||||||
return variation_type
|
return variation_type
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
@@ -90,14 +96,74 @@ class Product_Variation_Type(db.Model, Store_Base):
|
|||||||
**self.get_shared_json_attributes(self),
|
**self.get_shared_json_attributes(self),
|
||||||
self.ATTR_ID_PRODUCT_VARIATION_TYPE: self.id_type,
|
self.ATTR_ID_PRODUCT_VARIATION_TYPE: self.id_type,
|
||||||
self.FLAG_CODE: self.code,
|
self.FLAG_CODE: self.code,
|
||||||
self.FLAG_NAME_SINGULAR: self.name_singular,
|
self.FLAG_NAME: self.name_singular,
|
||||||
self.FLAG_NAME_PLURAL: self.name_plural,
|
self.FLAG_NAME_PLURAL: self.name_plural,
|
||||||
self.FLAG_DISPLAY_ORDER: self.display_order,
|
self.FLAG_DISPLAY_ORDER: self.display_order,
|
||||||
self.FLAG_ACTIVE: self.active,
|
self.FLAG_ACTIVE: self.active,
|
||||||
|
self.FLAG_PRODUCT_VARIATIONS: [variation.to_json() for variation in self.variations]
|
||||||
}
|
}
|
||||||
def to_json_option(self):
|
def to_json_option(self):
|
||||||
return {
|
return {
|
||||||
'value': self.id_type,
|
'value': self.id_type,
|
||||||
'text': self.name_singular
|
'text': self.name_singular
|
||||||
}
|
}
|
||||||
|
"""
|
||||||
|
def get_preview_variations(self):
|
||||||
|
preview = ''
|
||||||
|
if len(self.variations) > 0:
|
||||||
|
# preview = '\n'.join([variation.name for variation in self.variations])
|
||||||
|
preview = '<p>' + '</p><p>'.join([variation.name for variation in self.variations]) + '</p>'
|
||||||
|
return preview
|
||||||
|
def get_str_list_ids_variation(self):
|
||||||
|
if self.variations is None or len(self.variations) == 0:
|
||||||
|
return ''
|
||||||
|
return ','.join([str(variation.id_variation) for variation in self.variations])
|
||||||
|
"""
|
||||||
|
|
||||||
|
class Product_Variation_Type_Temp(db.Model, Store_Base):
|
||||||
|
__tablename__ = 'Shop_Variation_Type_Temp'
|
||||||
|
__table_args__ = { 'extend_existing': True }
|
||||||
|
id_temp: int = db.Column(db.Integer, primary_key=True, autoincrement=True)
|
||||||
|
id_type: int = db.Column(db.Integer)
|
||||||
|
code: str = db.Column(db.String(50))
|
||||||
|
name: str = db.Column(db.String(255))
|
||||||
|
name_plural: str = db.Column(db.String(256))
|
||||||
|
active: bool = db.Column(db.Boolean)
|
||||||
|
display_order: int = db.Column(db.Integer)
|
||||||
|
guid: str = db.Column(db.String(36))
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self.id_temp = None
|
||||||
|
@classmethod
|
||||||
|
def from_product_variation_type(cls, product_variation_type):
|
||||||
|
row = cls()
|
||||||
|
row.id_type = product_variation_type.id_type
|
||||||
|
row.code = product_variation_type.code
|
||||||
|
row.name = product_variation_type.name_singular
|
||||||
|
row.name_plural = product_variation_type.name_plural
|
||||||
|
row.active = 1 if av.input_bool(product_variation_type.active, cls.FLAG_ACTIVE, f'{cls.__name__}.from_product_variation_type') else 0
|
||||||
|
row.display_order = product_variation_type.display_order
|
||||||
|
return row
|
||||||
|
def to_json(self):
|
||||||
|
return {
|
||||||
|
'id_type': self.id_type,
|
||||||
|
'code': self.code,
|
||||||
|
'name': self.name,
|
||||||
|
'name_plural': self.name_plural,
|
||||||
|
'active': self.active,
|
||||||
|
'display_order': self.display_order,
|
||||||
|
'guid': self.guid,
|
||||||
|
}
|
||||||
|
def __repr__(self):
|
||||||
|
return f'''
|
||||||
|
{self.__class__.__name__}
|
||||||
|
id_temp: {self.id_temp}
|
||||||
|
id_type: {self.id_type}
|
||||||
|
code: {self.code}
|
||||||
|
name: {self.name}
|
||||||
|
name_plural: {self.name_plural}
|
||||||
|
active: {self.active}
|
||||||
|
display_order: {self.display_order}
|
||||||
|
guid: {self.guid}
|
||||||
|
'''
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -126,7 +126,7 @@ def filter_product():
|
|||||||
Model_View_Store_Product.FLAG_STATUS: Model_View_Store_Product.FLAG_FAILURE,
|
Model_View_Store_Product.FLAG_STATUS: Model_View_Store_Product.FLAG_FAILURE,
|
||||||
Model_View_Store_Product.FLAG_MESSAGE: f'Form invalid.\n{form_filters.errors}'
|
Model_View_Store_Product.FLAG_MESSAGE: f'Form invalid.\n{form_filters.errors}'
|
||||||
})
|
})
|
||||||
model = Model_View_Store_Product(form_filters = form_filters)
|
model = Model_View_Store_Product(form_filters_old = form_filters)
|
||||||
if not model.is_user_logged_in:
|
if not model.is_user_logged_in:
|
||||||
raise Exception('User not logged in')
|
raise Exception('User not logged in')
|
||||||
return jsonify({
|
return jsonify({
|
||||||
@@ -165,7 +165,7 @@ def save_product():
|
|||||||
Helper_App.console_log(f'objsProduct={objsProduct}')
|
Helper_App.console_log(f'objsProduct={objsProduct}')
|
||||||
save_errors = Model_View_Store_Product.save_products(data.get('comment', 'No comment'), objsProduct)
|
save_errors = Model_View_Store_Product.save_products(data.get('comment', 'No comment'), objsProduct)
|
||||||
|
|
||||||
model_return = Model_View_Store_Product(form_filters=form_filters)
|
model_return = Model_View_Store_Product(form_filters_old=form_filters)
|
||||||
if not model_return.is_user_logged_in:
|
if not model_return.is_user_logged_in:
|
||||||
raise Exception('User not logged in')
|
raise Exception('User not logged in')
|
||||||
Helper_App.console_log('nips')
|
Helper_App.console_log('nips')
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ def filter_category():
|
|||||||
})
|
})
|
||||||
# ToDo: manually validate category, product
|
# ToDo: manually validate category, product
|
||||||
# filters_form = Filters_Product_Category.from_form(form_filters)
|
# filters_form = Filters_Product_Category.from_form(form_filters)
|
||||||
model = Model_View_Store_Product_Category(form_filters = form_filters)
|
model = Model_View_Store_Product_Category(form_filters_old = form_filters)
|
||||||
if not model.is_user_logged_in:
|
if not model.is_user_logged_in:
|
||||||
raise Exception('User not logged in')
|
raise Exception('User not logged in')
|
||||||
return jsonify({
|
return jsonify({
|
||||||
@@ -110,7 +110,7 @@ def save_category():
|
|||||||
Helper_App.console_log(f'objsCategory={objsCategory}')
|
Helper_App.console_log(f'objsCategory={objsCategory}')
|
||||||
Model_View_Store_Product_Category.save_categories(data.get('comment', 'No comment'), objsCategory)
|
Model_View_Store_Product_Category.save_categories(data.get('comment', 'No comment'), objsCategory)
|
||||||
|
|
||||||
model_return = Model_View_Store_Product_Category(form_filters=form_filters)
|
model_return = Model_View_Store_Product_Category(form_filters_old=form_filters)
|
||||||
if not model_return.is_user_logged_in:
|
if not model_return.is_user_logged_in:
|
||||||
raise Exception('User not logged in')
|
raise Exception('User not logged in')
|
||||||
return jsonify({
|
return jsonify({
|
||||||
|
|||||||
@@ -29,68 +29,13 @@ from urllib.parse import quote, urlparse, parse_qs
|
|||||||
|
|
||||||
|
|
||||||
routes_store_product_permutation = Blueprint('routes_store_product_permutation', __name__)
|
routes_store_product_permutation = Blueprint('routes_store_product_permutation', __name__)
|
||||||
"""
|
|
||||||
|
|
||||||
@routes_store_product_permutation.route('/store/permutations', methods=['GET'])
|
|
||||||
def permutation():
|
|
||||||
filters = Parameters_Product.get_default()
|
|
||||||
model = Model_View_Store_Product_Permutation(filters_product=filters)
|
|
||||||
return render_template('pages/store/_product_permutations.html', model = model)
|
|
||||||
|
|
||||||
@routes_store_product_permutation.route('/store/permutation_filter', methods=['POST'])
|
|
||||||
def permutation_filter():
|
|
||||||
data = Helper_App.get_request_data(request)
|
|
||||||
form_filters = None
|
|
||||||
try:
|
|
||||||
form_filters = get_Form_Filters_Permutation(data)
|
|
||||||
if not form_filters.validate_on_submit():
|
|
||||||
return jsonify({Model_View_Base.FLAG_STATUS: Model_View_Base.FLAG_FAILURE, Model_View_Base.FLAG_MESSAGE: f'Form invalid.\n{form_filters.errors}'})
|
|
||||||
# ToDo: manually validate category, product
|
|
||||||
filters_form = Parameters_Product.from_form(form_filters)
|
|
||||||
model = Model_View_Store_Product_Permutation(filters_product=filters_form)
|
|
||||||
return jsonify({Model_View_Base.FLAG_STATUS: Model_View_Base.FLAG_SUCCESS, 'Success': True, Model_View_Base.FLAG_DATA: model.category_list.to_permutation_row_list()})
|
|
||||||
except Exception as e:
|
|
||||||
return jsonify({Model_View_Base.FLAG_STATUS: Model_View_Base.FLAG_FAILURE, Model_View_Base.FLAG_MESSAGE: f'Bad data received by controller.\n{e}'})
|
|
||||||
|
|
||||||
def get_Form_Filters_Permutation(data_request):
|
|
||||||
data_form = data_request[Model_View_Store_Product_Permutation.FLAG_FORM]
|
|
||||||
form_filters = Filters_Product_Permutation(**data_form)
|
|
||||||
form_filters.is_out_of_stock.data = av.input_bool(data_form['is_out_of_stock'], 'is_out_of_stock', 'permutations_post')
|
|
||||||
return form_filters
|
|
||||||
|
|
||||||
@routes_store_product_permutation.route('/store/permutation_save', methods=['POST'])
|
|
||||||
def permutation_save():
|
|
||||||
data = Helper_App.get_request_data(request)
|
|
||||||
form_filters = None
|
|
||||||
try:
|
|
||||||
form_filters = get_Form_Filters_Permutation(data)
|
|
||||||
if not form_filters.validate_on_submit():
|
|
||||||
return jsonify({Model_View_Base.FLAG_STATUS: Model_View_Base.FLAG_FAILURE, Model_View_Base.FLAG_MESSAGE: f'Filters form invalid.\n{form_filters.errors}'})
|
|
||||||
|
|
||||||
permutations = data[Model_View_Store_Product_Permutation.FLAG_PRODUCT_PERMUTATION]
|
|
||||||
if len(permutations) == 0:
|
|
||||||
return jsonify({Model_View_Base.FLAG_STATUS: Model_View_Base.FLAG_FAILURE, Model_View_Base.FLAG_MESSAGE: f'No permutations.'})
|
|
||||||
objsPermutation = []
|
|
||||||
for permutation in permutations:
|
|
||||||
objsPermutation.append(Product_Permutation.from_json(permutation))
|
|
||||||
|
|
||||||
# ToDo: manually validate category, product
|
|
||||||
filters_form = Parameters_Product.from_form(form_filters)
|
|
||||||
model_save = Model_View_Store_Product_Permutation(filters_product=filters_form)
|
|
||||||
model_save.save_permutations(data.comment, objsPermutation)
|
|
||||||
|
|
||||||
model_return = Model_View_Store_Product_Permutation(filters_product=filters_form)
|
|
||||||
return jsonify({Model_View_Base.FLAG_STATUS: Model_View_Base.FLAG_SUCCESS, 'Success': True, Model_View_Base.FLAG_DATA: model_return.category_list.to_permutation_row_list()})
|
|
||||||
except Exception as e:
|
|
||||||
return jsonify({Model_View_Base.FLAG_STATUS: Model_View_Base.FLAG_FAILURE, Model_View_Base.FLAG_MESSAGE: f'Bad data received by controller.\n{e}'})
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
@routes_store_product_permutation.route(Model_View_Store_Product_Permutation.HASH_PAGE_STORE_PRODUCT_PERMUTATIONS, methods=['GET'])
|
@routes_store_product_permutation.route(Model_View_Store_Product_Permutation.HASH_PAGE_STORE_PRODUCT_PERMUTATIONS, methods=['GET'])
|
||||||
def permutations():
|
def permutations():
|
||||||
Helper_App.console_log('permutations')
|
Helper_App.console_log('permutations')
|
||||||
|
data = Helper_App.get_request_data(request)
|
||||||
try:
|
try:
|
||||||
form_filters = Filters_Product_Permutation.from_json(request.args)
|
form_filters = Filters_Product_Permutation.from_json(data)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
Helper_App.console_log(f'Error: {e}')
|
Helper_App.console_log(f'Error: {e}')
|
||||||
form_filters = Filters_Product_Permutation()
|
form_filters = Filters_Product_Permutation()
|
||||||
@@ -111,7 +56,7 @@ def filter_permutation():
|
|||||||
Model_View_Store_Product_Permutation.FLAG_STATUS: Model_View_Store_Product_Permutation.FLAG_FAILURE,
|
Model_View_Store_Product_Permutation.FLAG_STATUS: Model_View_Store_Product_Permutation.FLAG_FAILURE,
|
||||||
Model_View_Store_Product_Permutation.FLAG_MESSAGE: f'Form invalid.\n{form_filters.errors}'
|
Model_View_Store_Product_Permutation.FLAG_MESSAGE: f'Form invalid.\n{form_filters.errors}'
|
||||||
})
|
})
|
||||||
model = Model_View_Store_Product_Permutation(form_filters = form_filters)
|
model = Model_View_Store_Product_Permutation(form_filters_old = form_filters)
|
||||||
if not model.is_user_logged_in:
|
if not model.is_user_logged_in:
|
||||||
raise Exception('User not logged in')
|
raise Exception('User not logged in')
|
||||||
return jsonify({
|
return jsonify({
|
||||||
@@ -150,7 +95,7 @@ def save_permutation():
|
|||||||
Helper_App.console_log(f'objsPermutation={objsPermutation}')
|
Helper_App.console_log(f'objsPermutation={objsPermutation}')
|
||||||
Model_View_Store_Product_Permutation.save_permutations(data.get('comment', 'No comment'), objsPermutation)
|
Model_View_Store_Product_Permutation.save_permutations(data.get('comment', 'No comment'), objsPermutation)
|
||||||
|
|
||||||
model_return = Model_View_Store_Product_Permutation(form_filters=form_filters)
|
model_return = Model_View_Store_Product_Permutation(form_filters_old=form_filters)
|
||||||
if not model_return.is_user_logged_in:
|
if not model_return.is_user_logged_in:
|
||||||
raise Exception('User not logged in')
|
raise Exception('User not logged in')
|
||||||
Helper_App.console_log('nips')
|
Helper_App.console_log('nips')
|
||||||
|
|||||||
109
controllers/store/product_variation.py
Normal file
109
controllers/store/product_variation.py
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
"""
|
||||||
|
Project: PARTS Website
|
||||||
|
Author: Edward Middleton-Smith
|
||||||
|
Precision And Research Technology Systems Limited
|
||||||
|
|
||||||
|
Technology: App Routing
|
||||||
|
Feature: Store Product Variation Routes
|
||||||
|
|
||||||
|
Description:
|
||||||
|
Initializes the Flask application, sets the configuration based on the environment, and defines two routes (/ and /about) that render templates with the specified titles.
|
||||||
|
"""
|
||||||
|
|
||||||
|
# internal
|
||||||
|
from business_objects.store.product_variation import Product_Variation, Parameters_Product_Variation
|
||||||
|
from business_objects.store.product_variation_type import Product_Variation_Type
|
||||||
|
from datastores.datastore_store_product_variation import DataStore_Store_Product_Variation
|
||||||
|
from forms.store.product_variation import Filters_Product_Variation
|
||||||
|
from models.model_view_store_product_variation import Model_View_Store_Product_Variation
|
||||||
|
from helpers.helper_app import Helper_App
|
||||||
|
import lib.argument_validation as av
|
||||||
|
# external
|
||||||
|
from flask import Flask, render_template, jsonify, request, render_template_string, send_from_directory, redirect, url_for, session, Blueprint, current_app
|
||||||
|
from extensions import db, oauth
|
||||||
|
from urllib.parse import quote_plus, urlencode
|
||||||
|
from authlib.integrations.flask_client import OAuth
|
||||||
|
from authlib.integrations.base_client import OAuthError
|
||||||
|
from urllib.parse import quote, urlparse, parse_qs
|
||||||
|
|
||||||
|
|
||||||
|
routes_store_product_variation = Blueprint('routes_store_product_variation', __name__)
|
||||||
|
|
||||||
|
|
||||||
|
@routes_store_product_variation.route(Model_View_Store_Product_Variation.HASH_PAGE_STORE_PRODUCT_VARIATIONS, methods=['GET'])
|
||||||
|
def product_variations():
|
||||||
|
Helper_App.console_log('product_variations')
|
||||||
|
try:
|
||||||
|
form_filters = Filters_Product_Variation.from_json(request.args)
|
||||||
|
except Exception as e:
|
||||||
|
Helper_App.console_log(f'Error: {e}')
|
||||||
|
form_filters = Filters_Product_Variation()
|
||||||
|
Helper_App.console_log(f'form_filters={form_filters}')
|
||||||
|
model = Model_View_Store_Product_Variation(form_filters)
|
||||||
|
if not model.is_user_logged_in:
|
||||||
|
return redirect(url_for('routes_core.home'))
|
||||||
|
return render_template('pages/store/_product_variations.html', model = model)
|
||||||
|
|
||||||
|
@routes_store_product_variation.route(Model_View_Store_Product_Variation.HASH_GET_STORE_PRODUCT_VARIATION, methods=['POST'])
|
||||||
|
def filter_product_variation():
|
||||||
|
data = Helper_App.get_request_data(request)
|
||||||
|
try:
|
||||||
|
form_filters = Filters_Product_Variation.from_json(data)
|
||||||
|
if not form_filters.validate_on_submit():
|
||||||
|
return jsonify({
|
||||||
|
Model_View_Store_Product_Variation.FLAG_STATUS: Model_View_Store_Product_Variation.FLAG_FAILURE,
|
||||||
|
Model_View_Store_Product_Variation.FLAG_MESSAGE: f'Form invalid.\n{form_filters.errors}'
|
||||||
|
})
|
||||||
|
model = Model_View_Store_Product_Variation(form_filters_old = form_filters)
|
||||||
|
if not model.is_user_logged_in:
|
||||||
|
raise Exception('User not logged in')
|
||||||
|
return jsonify({
|
||||||
|
Model_View_Store_Product_Variation.FLAG_STATUS: Model_View_Store_Product_Variation.FLAG_SUCCESS,
|
||||||
|
Model_View_Store_Product_Variation.FLAG_DATA: model.convert_list_objects_to_json(model.variation_types)
|
||||||
|
})
|
||||||
|
except Exception as e:
|
||||||
|
return jsonify({
|
||||||
|
Model_View_Store_Product_Variation.FLAG_STATUS: Model_View_Store_Product_Variation.FLAG_FAILURE,
|
||||||
|
Model_View_Store_Product_Variation.FLAG_MESSAGE: f'Bad data received by controller.\n{e}'
|
||||||
|
})
|
||||||
|
|
||||||
|
@routes_store_product_variation.route(Model_View_Store_Product_Variation.HASH_SAVE_STORE_PRODUCT_VARIATION, methods=['POST'])
|
||||||
|
def save_product_variation():
|
||||||
|
data = Helper_App.get_request_data(request)
|
||||||
|
try:
|
||||||
|
form_filters = Filters_Product_Variation.from_json(data[Model_View_Store_Product_Variation.FLAG_FORM_FILTERS])
|
||||||
|
if not form_filters.validate_on_submit():
|
||||||
|
return jsonify({
|
||||||
|
Model_View_Store_Product_Variation.FLAG_STATUS: Model_View_Store_Product_Variation.FLAG_FAILURE,
|
||||||
|
Model_View_Store_Product_Variation.FLAG_MESSAGE: f'Filters form invalid.\n{form_filters.errors}'
|
||||||
|
})
|
||||||
|
# filters_form = Filters_Product_Variation.from_form(form_filters)
|
||||||
|
Helper_App.console_log(f'form_filters: {form_filters}')
|
||||||
|
|
||||||
|
product_variation_types = data[Model_View_Store_Product_Variation.FLAG_PRODUCT_VARIATION_TYPE]
|
||||||
|
if len(product_variation_types) == 0:
|
||||||
|
return jsonify({
|
||||||
|
Model_View_Store_Product_Variation.FLAG_STATUS: Model_View_Store_Product_Variation.FLAG_FAILURE,
|
||||||
|
Model_View_Store_Product_Variation.FLAG_MESSAGE: f'No Product Variations.'
|
||||||
|
})
|
||||||
|
objs_product_variation_type = []
|
||||||
|
for product_variation_type in product_variation_types:
|
||||||
|
objs_product_variation_type.append(Product_Variation_Type.from_json(product_variation_type))
|
||||||
|
# model_save = Model_View_Store_Product_Variation() # filters_product_variation=filters_form)
|
||||||
|
Helper_App.console_log(f'objs_product_variation_type={objs_product_variation_type}')
|
||||||
|
save_errors = Model_View_Store_Product_Variation.save_product_variations(data.get('comment', 'No comment'), objs_product_variation_type)
|
||||||
|
|
||||||
|
model_return = Model_View_Store_Product_Variation(form_filters_old = form_filters)
|
||||||
|
if not model_return.is_user_logged_in:
|
||||||
|
raise Exception('User not logged in')
|
||||||
|
Helper_App.console_log('nips')
|
||||||
|
return jsonify({
|
||||||
|
Model_View_Store_Product_Variation.FLAG_STATUS: Model_View_Store_Product_Variation.FLAG_SUCCESS,
|
||||||
|
Model_View_Store_Product_Variation.FLAG_DATA: model_return.convert_list_objects_to_json(model_return.variation_types)
|
||||||
|
})
|
||||||
|
except Exception as e:
|
||||||
|
return jsonify({
|
||||||
|
Model_View_Store_Product_Variation.FLAG_STATUS: Model_View_Store_Product_Variation.FLAG_FAILURE,
|
||||||
|
Model_View_Store_Product_Variation.FLAG_MESSAGE: f'Bad data received by controller.\n{e}'
|
||||||
|
})
|
||||||
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -29,7 +29,6 @@ from business_objects.sql_error import SQL_Error
|
|||||||
from business_objects.store.stock_item import Stock_Item
|
from business_objects.store.stock_item import Stock_Item
|
||||||
from business_objects.unit_measurement import Unit_Measurement
|
from business_objects.unit_measurement import Unit_Measurement
|
||||||
from business_objects.user import User, User_Filters, User_Permission_Evaluation
|
from business_objects.user import User, User_Filters, User_Permission_Evaluation
|
||||||
# from business_objects.store.product_variation import Product_Variation, Product_Variation_Filters, Product_Variation_Container
|
|
||||||
# from helpers.helper_db_mysql import Helper_DB_MySQL
|
# from helpers.helper_db_mysql import Helper_DB_MySQL
|
||||||
# from models.model_view_store_checkout import Model_View_Store_Checkout # circular!
|
# from models.model_view_store_checkout import Model_View_Store_Checkout # circular!
|
||||||
from extensions import db
|
from extensions import db
|
||||||
@@ -189,7 +188,6 @@ class DataStore_Base(BaseModel):
|
|||||||
else:
|
else:
|
||||||
expected_columns = set(column.name for column in db.inspect(table_object).columns)
|
expected_columns = set(column.name for column in db.inspect(table_object).columns)
|
||||||
Helper_App.console_log(f'expected_columns: {expected_columns}')
|
Helper_App.console_log(f'expected_columns: {expected_columns}')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
for i in range(0, len(records), batch_size):
|
for i in range(0, len(records), batch_size):
|
||||||
batch = records[i:i+batch_size]
|
batch = records[i:i+batch_size]
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ from business_objects.store.product import Product, Product_Permutation, Paramet
|
|||||||
from business_objects.sql_error import SQL_Error
|
from business_objects.sql_error import SQL_Error
|
||||||
from business_objects.store.stock_item import Stock_Item
|
from business_objects.store.stock_item import Stock_Item
|
||||||
from business_objects.user import User, User_Filters, User_Permission_Evaluation
|
from business_objects.user import User, User_Filters, User_Permission_Evaluation
|
||||||
from business_objects.store.product_variation import Product_Variation_Type, Product_Variation, Product_Variation_Filters, Product_Variation_Container
|
from business_objects.store.product_variation import Product_Variation, Parameters_Product_Variation
|
||||||
|
from business_objects.store.product_variation_type import Product_Variation_Type
|
||||||
from datastores.datastore_base import DataStore_Base
|
from datastores.datastore_base import DataStore_Base
|
||||||
from extensions import db
|
from extensions import db
|
||||||
from helpers.helper_app import Helper_App
|
from helpers.helper_app import Helper_App
|
||||||
@@ -255,7 +256,7 @@ class DataStore_Store_Base(DataStore_Base):
|
|||||||
def get_many_product_variation(cls, variation_filters):
|
def get_many_product_variation(cls, variation_filters):
|
||||||
_m = 'DataStore_Store_Base.get_many_product_variation'
|
_m = 'DataStore_Store_Base.get_many_product_variation'
|
||||||
Helper_App.console_log(_m)
|
Helper_App.console_log(_m)
|
||||||
av.val_instance(variation_filters, 'variation_filters', _m, Product_Variation_Filters)
|
av.val_instance(variation_filters, 'variation_filters', _m, Parameters_Product_Variation)
|
||||||
|
|
||||||
guid = Helper_DB_MySQL.create_guid()
|
guid = Helper_DB_MySQL.create_guid()
|
||||||
# now = datetime.now()
|
# now = datetime.now()
|
||||||
@@ -284,14 +285,14 @@ class DataStore_Store_Base(DataStore_Base):
|
|||||||
# Product_Variation Types
|
# Product_Variation Types
|
||||||
# variation_container = Product_Variation_Container()
|
# variation_container = Product_Variation_Container()
|
||||||
variation_types = []
|
variation_types = []
|
||||||
variation_types_dict = {}
|
index_variation_type = {}
|
||||||
for row in result_set_vt:
|
for row in result_set_vt:
|
||||||
new_variation_type = Product_Variation_Type.from_DB_get_many_product_variation(row)
|
new_variation_type = Product_Variation_Type.from_DB_get_many_product_variation(row)
|
||||||
# variation_container.add_product_variation_type(new_variation_type)
|
# variation_container.add_product_variation_type(new_variation_type)
|
||||||
|
index_variation_type[new_variation_type.id_type] = len(variation_types)
|
||||||
variation_types.append(new_variation_type)
|
variation_types.append(new_variation_type)
|
||||||
variation_types_dict[new_variation_type.id_type] = new_variation_type
|
|
||||||
|
|
||||||
Helper_App.console_log(f'variation_types_dict: {variation_types_dict}')
|
Helper_App.console_log(f'index_variation_type: {index_variation_type}')
|
||||||
|
|
||||||
# Product_Variations
|
# Product_Variations
|
||||||
cursor.nextset()
|
cursor.nextset()
|
||||||
@@ -300,8 +301,9 @@ class DataStore_Store_Base(DataStore_Base):
|
|||||||
variations = []
|
variations = []
|
||||||
for row in result_set_v:
|
for row in result_set_v:
|
||||||
new_variation = Product_Variation.from_DB_get_many_product_variation(row)
|
new_variation = Product_Variation.from_DB_get_many_product_variation(row)
|
||||||
new_variation.variation_type = variation_types_dict[new_variation.id_type]
|
# new_variation.variation_type = variation_types_dict[new_variation.id_type]
|
||||||
# variation_container.add_product_variation(new_variation)
|
# variation_container.add_product_variation(new_variation)
|
||||||
|
variation_types[index_variation_type[new_variation.id_type]].variations.append(new_variation)
|
||||||
variations.append(new_variation)
|
variations.append(new_variation)
|
||||||
|
|
||||||
errors = []
|
errors = []
|
||||||
|
|||||||
@@ -14,18 +14,7 @@ Datastore for Store Baskets
|
|||||||
# from routes import bp_home
|
# from routes import bp_home
|
||||||
import lib.argument_validation as av
|
import lib.argument_validation as av
|
||||||
from business_objects.store.basket import Basket, Basket_Item
|
from business_objects.store.basket import Basket, Basket_Item
|
||||||
from business_objects.store.product_category import Product_Category_Container, Product_Category
|
|
||||||
from business_objects.currency import Currency
|
|
||||||
from business_objects.store.image import Image
|
|
||||||
from business_objects.store.delivery_option import Delivery_Option
|
|
||||||
from business_objects.region import Region
|
|
||||||
from business_objects.store.discount import Discount
|
|
||||||
from business_objects.store.order import Order
|
|
||||||
from business_objects.store.product import Product, Product_Permutation, Product_Price, Parameters_Product
|
|
||||||
from business_objects.sql_error import SQL_Error
|
from business_objects.sql_error import SQL_Error
|
||||||
from business_objects.store.stock_item import Stock_Item
|
|
||||||
from business_objects.user import User, User_Filters, User_Permission_Evaluation
|
|
||||||
from business_objects.store.product_variation import Product_Variation, Product_Variation_Filters, Product_Variation_Container
|
|
||||||
from datastores.datastore_store_base import DataStore_Store_Base
|
from datastores.datastore_store_base import DataStore_Store_Base
|
||||||
from helpers.helper_app import Helper_App
|
from helpers.helper_app import Helper_App
|
||||||
# from helpers.helper_db_mysql import Helper_DB_MySQL
|
# from helpers.helper_db_mysql import Helper_DB_MySQL
|
||||||
|
|||||||
@@ -12,19 +12,8 @@ Datastore for Store Product Categories
|
|||||||
|
|
||||||
# internal
|
# internal
|
||||||
import lib.argument_validation as av
|
import lib.argument_validation as av
|
||||||
from business_objects.store.basket import Basket, Basket_Item
|
|
||||||
from business_objects.store.product_category import Product_Category_Container, Product_Category, Product_Category_Temp
|
from business_objects.store.product_category import Product_Category_Container, Product_Category, Product_Category_Temp
|
||||||
from business_objects.currency import Currency
|
|
||||||
from business_objects.store.image import Image
|
|
||||||
from business_objects.store.delivery_option import Delivery_Option
|
|
||||||
from business_objects.region import Region
|
|
||||||
from business_objects.store.discount import Discount
|
|
||||||
from business_objects.store.order import Order
|
|
||||||
from business_objects.store.product import Product, Product_Permutation, Product_Price, Parameters_Product
|
|
||||||
from business_objects.sql_error import SQL_Error
|
from business_objects.sql_error import SQL_Error
|
||||||
from business_objects.store.stock_item import Stock_Item
|
|
||||||
from business_objects.user import User, User_Filters, User_Permission_Evaluation
|
|
||||||
from business_objects.store.product_variation import Product_Variation, Product_Variation_Filters, Product_Variation_Container
|
|
||||||
# from datastores.datastore_base import Table_Shop_Product_Category, Table_Shop_Product_Category_Temp
|
# from datastores.datastore_base import Table_Shop_Product_Category, Table_Shop_Product_Category_Temp
|
||||||
from datastores.datastore_store_base import DataStore_Store_Base
|
from datastores.datastore_store_base import DataStore_Store_Base
|
||||||
from helpers.helper_app import Helper_App
|
from helpers.helper_app import Helper_App
|
||||||
|
|||||||
@@ -13,20 +13,10 @@ Datastore for Store Product Variations
|
|||||||
# internal
|
# internal
|
||||||
# from routes import bp_home
|
# from routes import bp_home
|
||||||
import lib.argument_validation as av
|
import lib.argument_validation as av
|
||||||
from business_objects.store.basket import Basket, Basket_Item
|
from business_objects.store.product_variation import Product_Variation, Parameters_Product_Variation, Product_Variation_Temp
|
||||||
from business_objects.store.product_category import Product_Category_Container, Product_Category
|
from business_objects.store.product_variation_type import Product_Variation_Type, Product_Variation_Type_Temp
|
||||||
from business_objects.currency import Currency
|
|
||||||
from business_objects.store.image import Image
|
|
||||||
from business_objects.store.delivery_option import Delivery_Option
|
|
||||||
from business_objects.region import Region
|
|
||||||
from business_objects.store.discount import Discount
|
|
||||||
from business_objects.store.order import Order
|
|
||||||
from business_objects.store.product import Product, Product_Permutation, Product_Price, Parameters_Product
|
|
||||||
from business_objects.sql_error import SQL_Error
|
|
||||||
from business_objects.store.stock_item import Stock_Item
|
|
||||||
from business_objects.user import User, User_Filters, User_Permission_Evaluation
|
|
||||||
from business_objects.store.product_variation import Product_Variation, Product_Variation_Filters, Product_Variation_Container
|
|
||||||
from datastores.datastore_store_base import DataStore_Store_Base
|
from datastores.datastore_store_base import DataStore_Store_Base
|
||||||
|
from helpers.helper_app import Helper_App
|
||||||
from helpers.helper_db_mysql import Helper_DB_MySQL
|
from helpers.helper_db_mysql import Helper_DB_MySQL
|
||||||
# from models.model_view_store_checkout import Model_View_Store_Checkout # circular!
|
# from models.model_view_store_checkout import Model_View_Store_Checkout # circular!
|
||||||
from extensions import db
|
from extensions import db
|
||||||
@@ -47,3 +37,41 @@ class DataStore_Store_Product_Variation(DataStore_Store_Base):
|
|||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
super().__init__(**kwargs)
|
super().__init__(**kwargs)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def save_product_variations(cls, comment, variation_types):
|
||||||
|
_m = f'{cls.__class__}.save_product_variations'
|
||||||
|
av.val_str(comment, 'comment', _m)
|
||||||
|
|
||||||
|
guid = Helper_DB_MySQL.create_guid_str()
|
||||||
|
user = cls.get_user_session()
|
||||||
|
rows = []
|
||||||
|
for variation_type in variation_types:
|
||||||
|
row = Product_Variation_Type_Temp.from_product_variation_type(variation_type)
|
||||||
|
row.guid = guid
|
||||||
|
rows.append(row)
|
||||||
|
Helper_App.console_log(f'rows: {rows}')
|
||||||
|
|
||||||
|
DataStore_Store_Base.upload_bulk(Product_Variation_Type_Temp.__tablename__, rows, 1000)
|
||||||
|
Helper_App.console_log('bulk uploaded product variation types')
|
||||||
|
|
||||||
|
rows = []
|
||||||
|
for variation_type in variation_types:
|
||||||
|
if variation_type.variations is not None:
|
||||||
|
for variation in variation_type.variations:
|
||||||
|
row = Product_Variation_Temp.from_product_variation(variation)
|
||||||
|
row.guid = guid
|
||||||
|
rows.append(row)
|
||||||
|
Helper_App.console_log(f'rows: {rows}')
|
||||||
|
|
||||||
|
DataStore_Store_Base.upload_bulk(Product_Variation_Temp.__tablename__, rows, 1000)
|
||||||
|
Helper_App.console_log('bulk uploaded product variations')
|
||||||
|
|
||||||
|
argument_dict_list = {
|
||||||
|
'a_comment': comment,
|
||||||
|
'a_guid': guid,
|
||||||
|
'a_id_user': user.id_user,
|
||||||
|
'a_debug': 0,
|
||||||
|
}
|
||||||
|
cls.db_procedure_execute('p_shop_save_product_variation', argument_dict_list)
|
||||||
|
Helper_App.console_log('saved product variations')
|
||||||
|
|||||||
@@ -14,18 +14,8 @@ Datastore for Store Stripe service
|
|||||||
# from routes import bp_home
|
# from routes import bp_home
|
||||||
import lib.argument_validation as av
|
import lib.argument_validation as av
|
||||||
from business_objects.store.basket import Basket, Basket_Item
|
from business_objects.store.basket import Basket, Basket_Item
|
||||||
from business_objects.store.product_category import Product_Category_Container, Product_Category
|
|
||||||
from business_objects.currency import Currency
|
|
||||||
from business_objects.store.image import Image
|
|
||||||
from business_objects.store.delivery_option import Delivery_Option
|
|
||||||
from business_objects.region import Region
|
|
||||||
from business_objects.store.discount import Discount
|
|
||||||
from business_objects.store.order import Order
|
|
||||||
from business_objects.store.product import Product, Product_Permutation, Product_Price, Parameters_Product
|
from business_objects.store.product import Product, Product_Permutation, Product_Price, Parameters_Product
|
||||||
from business_objects.sql_error import SQL_Error
|
from business_objects.sql_error import SQL_Error
|
||||||
from business_objects.store.stock_item import Stock_Item
|
|
||||||
from business_objects.user import User, User_Filters, User_Permission_Evaluation
|
|
||||||
from business_objects.store.product_variation import Product_Variation, Product_Variation_Filters, Product_Variation_Container
|
|
||||||
from datastores.datastore_store_base import DataStore_Store_Base
|
from datastores.datastore_store_base import DataStore_Store_Base
|
||||||
# from helpers.helper_db_mysql import Helper_DB_MySQL
|
# from helpers.helper_db_mysql import Helper_DB_MySQL
|
||||||
# from models.model_view_store_checkout import Model_View_Store_Checkout # circular!
|
# from models.model_view_store_checkout import Model_View_Store_Checkout # circular!
|
||||||
|
|||||||
38
forms/store/product_variation.py
Normal file
38
forms/store/product_variation.py
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
"""
|
||||||
|
Project: PARTS Website
|
||||||
|
Author: Edward Middleton-Smith
|
||||||
|
Precision And Research Technology Systems Limited
|
||||||
|
|
||||||
|
Technology: Backend
|
||||||
|
Feature: Forms - Product Variation Filters data input
|
||||||
|
|
||||||
|
Description:
|
||||||
|
Defines Flask-WTF forms for handling product variation filter input.
|
||||||
|
"""
|
||||||
|
|
||||||
|
# internal
|
||||||
|
from business_objects.store.store_base import Store_Base
|
||||||
|
from forms.base import Form_Base
|
||||||
|
from helpers.helper_app import Helper_App
|
||||||
|
import lib.argument_validation as av
|
||||||
|
# external
|
||||||
|
from flask_wtf import FlaskForm
|
||||||
|
from wtforms import StringField, TextAreaField, SubmitField, BooleanField, IntegerField, SelectField, FloatField, DateField
|
||||||
|
from wtforms.validators import InputRequired, NumberRange, Regexp, DataRequired, Optional
|
||||||
|
from flask_wtf.recaptcha import RecaptchaField
|
||||||
|
from abc import ABCMeta, abstractmethod
|
||||||
|
|
||||||
|
|
||||||
|
class Filters_Product_Variation(Form_Base):
|
||||||
|
is_not_empty = BooleanField('Not empty only?')
|
||||||
|
active = BooleanField("Active only?", default = True)
|
||||||
|
def __repr__(self):
|
||||||
|
return f'Filters_Product_Variation(is_not_empty={self.is_not_empty.data}, active={self.active.data})'
|
||||||
|
@classmethod
|
||||||
|
def from_json(cls, json):
|
||||||
|
_m = f'{cls.__name__}.from_json'
|
||||||
|
Helper_App.console_log(f'{_m}\njson={json}')
|
||||||
|
form = cls()
|
||||||
|
form.is_not_empty.data = av.input_bool(json[Store_Base.FLAG_IS_NOT_EMPTY], Store_Base.FLAG_IS_NOT_EMPTY, _m)
|
||||||
|
form.active.data = av.input_bool(json[Store_Base.FLAG_ACTIVE], Store_Base.FLAG_ACTIVE, _m)
|
||||||
|
return form
|
||||||
Binary file not shown.
@@ -447,13 +447,13 @@ def input_bool(v_input, v_name, method, suppress_errors = False, suppress_consol
|
|||||||
# v_arg_type
|
# v_arg_type
|
||||||
if not val_str(v_arg_type, 'v_arg_type', my_f, 1, -1, suppress_errors, suppress_console_outputs): return None
|
if not val_str(v_arg_type, 'v_arg_type', my_f, 1, -1, suppress_errors, suppress_console_outputs): return None
|
||||||
# METHODS
|
# METHODS
|
||||||
if not val_bool(v_input, v_name, my_f, True, suppress_console_outputs):
|
if not val_bool(v_input, v_name, my_f, True, True):
|
||||||
if not val_int(v_input, v_name, my_f, 0, 1, True, suppress_console_outputs):
|
if not val_int(v_input, v_name, my_f, 0, 1, True, True):
|
||||||
# if str(type(v_input)) == "<class 'bytes'>":
|
# if str(type(v_input)) == "<class 'bytes'>":
|
||||||
# return bool(v_input)
|
# return bool(v_input)
|
||||||
v_input = str(v_input)
|
v_input = str(v_input)
|
||||||
error_msg = error_msg_str(v_input, v_name, method, "<class 'bool'>", suppress_errors, suppress_console_outputs, v_arg_type)
|
error_msg = error_msg_str(v_input, v_name, method, "<class 'bool'>", suppress_errors, suppress_console_outputs, v_arg_type)
|
||||||
if not val_str(v_input, v_name, my_f, suppress_errors=True, suppress_console_outputs=suppress_console_outputs):
|
if not val_str(v_input, v_name, my_f, suppress_errors=True, suppress_console_outputs=True):
|
||||||
if suppress_errors:
|
if suppress_errors:
|
||||||
if not suppress_console_outputs:
|
if not suppress_console_outputs:
|
||||||
print(error_msg)
|
print(error_msg)
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -99,6 +99,7 @@ class Model_View_Base(BaseModel, ABC):
|
|||||||
FLAG_NAME: ClassVar[str] = Base.FLAG_NAME
|
FLAG_NAME: ClassVar[str] = Base.FLAG_NAME
|
||||||
FLAG_NAME_ATTR_OPTION_TEXT: ClassVar[str] = Base.FLAG_NAME_ATTR_OPTION_TEXT
|
FLAG_NAME_ATTR_OPTION_TEXT: ClassVar[str] = Base.FLAG_NAME_ATTR_OPTION_TEXT
|
||||||
FLAG_NAME_ATTR_OPTION_VALUE: ClassVar[str] = Base.FLAG_NAME_ATTR_OPTION_VALUE
|
FLAG_NAME_ATTR_OPTION_VALUE: ClassVar[str] = Base.FLAG_NAME_ATTR_OPTION_VALUE
|
||||||
|
FLAG_NAME_PLURAL: ClassVar[str] = Base.FLAG_NAME_PLURAL
|
||||||
FLAG_NAV_ADMIN_HOME: ClassVar[str] = 'navAdminHome'
|
FLAG_NAV_ADMIN_HOME: ClassVar[str] = 'navAdminHome'
|
||||||
FLAG_NAV_ADMIN_STORE_STRIPE_PRICES: ClassVar[str] = 'navAdminStoreStripePrices'
|
FLAG_NAV_ADMIN_STORE_STRIPE_PRICES: ClassVar[str] = 'navAdminStoreStripePrices'
|
||||||
FLAG_NAV_ADMIN_STORE_STRIPE_PRODUCTS: ClassVar[str] = 'navAdminStoreStripeProducts'
|
FLAG_NAV_ADMIN_STORE_STRIPE_PRODUCTS: ClassVar[str] = 'navAdminStoreStripeProducts'
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ from business_objects.store.product import Product, Parameters_Product, Product_
|
|||||||
from business_objects.store.image import Resolution_Level_Enum
|
from business_objects.store.image import Resolution_Level_Enum
|
||||||
from business_objects.store.basket import Basket_Item, Basket
|
from business_objects.store.basket import Basket_Item, Basket
|
||||||
from business_objects.store.product_category import Product_Category
|
from business_objects.store.product_category import Product_Category
|
||||||
from business_objects.store.product_variation import Product_Variation_Filters, Product_Variation
|
from business_objects.store.product_variation import Product_Variation, Parameters_Product_Variation
|
||||||
from business_objects.store.stock_item import Stock_Item
|
from business_objects.store.stock_item import Stock_Item
|
||||||
from datastores.datastore_store_base import DataStore_Store_Base
|
from datastores.datastore_store_base import DataStore_Store_Base
|
||||||
from datastores.datastore_user import DataStore_User
|
from datastores.datastore_user import DataStore_User
|
||||||
@@ -148,6 +148,7 @@ class Model_View_Store(Model_View_Base):
|
|||||||
HASH_GET_STORE_PRODUCT: ClassVar[str] = '/store/product_get'
|
HASH_GET_STORE_PRODUCT: ClassVar[str] = '/store/product_get'
|
||||||
HASH_GET_STORE_PRODUCT_CATEGORY: ClassVar[str] = '/store/category_get'
|
HASH_GET_STORE_PRODUCT_CATEGORY: ClassVar[str] = '/store/category_get'
|
||||||
HASH_GET_STORE_PRODUCT_PERMUTATION: ClassVar[str] = '/store/permutation_get'
|
HASH_GET_STORE_PRODUCT_PERMUTATION: ClassVar[str] = '/store/permutation_get'
|
||||||
|
HASH_GET_STORE_PRODUCT_VARIATION: ClassVar[str] = '/store/product_variation_get'
|
||||||
HASH_GET_STORE_STOCK_ITEM: ClassVar[str] = '/store/stock_item_get'
|
HASH_GET_STORE_STOCK_ITEM: ClassVar[str] = '/store/stock_item_get'
|
||||||
HASH_GET_STORE_SUPPLIER: ClassVar[str] = '/store/supplier_get'
|
HASH_GET_STORE_SUPPLIER: ClassVar[str] = '/store/supplier_get'
|
||||||
HASH_GET_STORE_SUPPLIER_PURCHASE_ORDER: ClassVar[str] = '/store/supplier_purchase_order_get'
|
HASH_GET_STORE_SUPPLIER_PURCHASE_ORDER: ClassVar[str] = '/store/supplier_purchase_order_get'
|
||||||
@@ -157,6 +158,7 @@ class Model_View_Store(Model_View_Base):
|
|||||||
HASH_SAVE_STORE_PRODUCT: ClassVar[str] = '/store/save_product'
|
HASH_SAVE_STORE_PRODUCT: ClassVar[str] = '/store/save_product'
|
||||||
HASH_SAVE_STORE_PRODUCT_CATEGORY: ClassVar[str] = '/store/save_category'
|
HASH_SAVE_STORE_PRODUCT_CATEGORY: ClassVar[str] = '/store/save_category'
|
||||||
HASH_SAVE_STORE_PRODUCT_PERMUTATION: ClassVar[str] = '/store/save_permutation'
|
HASH_SAVE_STORE_PRODUCT_PERMUTATION: ClassVar[str] = '/store/save_permutation'
|
||||||
|
HASH_SAVE_STORE_PRODUCT_VARIATION: ClassVar[str] = '/store/save_product_variation'
|
||||||
HASH_SAVE_STORE_STOCK_ITEM: ClassVar[str] = '/store/save_stock_item'
|
HASH_SAVE_STORE_STOCK_ITEM: ClassVar[str] = '/store/save_stock_item'
|
||||||
HASH_SAVE_STORE_SUPPLIER: ClassVar[str] = '/store/save_supplier'
|
HASH_SAVE_STORE_SUPPLIER: ClassVar[str] = '/store/save_supplier'
|
||||||
HASH_SAVE_STORE_SUPPLIER_PURCHASE_ORDER: ClassVar[str] = '/store/save_supplier_purchase_order'
|
HASH_SAVE_STORE_SUPPLIER_PURCHASE_ORDER: ClassVar[str] = '/store/save_supplier_purchase_order'
|
||||||
@@ -502,6 +504,6 @@ class Model_View_Store(Model_View_Base):
|
|||||||
|
|
||||||
def get_many_product_variation(self, variation_filters = None):
|
def get_many_product_variation(self, variation_filters = None):
|
||||||
if variation_filters is None:
|
if variation_filters is None:
|
||||||
variation_filters = Product_Variation_Filters.get_default()
|
variation_filters = Parameters_Product_Variation.get_default()
|
||||||
variation_types, variations, errors = DataStore_Store_Base().get_many_product_variation(variation_filters)
|
variation_types, variations, errors = DataStore_Store_Base().get_many_product_variation(variation_filters)
|
||||||
return variation_types, variations, errors
|
return variation_types, variations, errors
|
||||||
@@ -79,7 +79,6 @@ class Model_View_Store_Product(Model_View_Store):
|
|||||||
# product_blank: Product = None
|
# product_blank: Product = None
|
||||||
units_measurement: list = None
|
units_measurement: list = None
|
||||||
units_measurement_time: list = None
|
units_measurement_time: list = None
|
||||||
# variation_container: Product_Variation_Container = None
|
|
||||||
variations: list = None
|
variations: list = None
|
||||||
variation_types: list = None
|
variation_types: list = None
|
||||||
|
|
||||||
|
|||||||
@@ -14,13 +14,12 @@ Data model for store permutations view
|
|||||||
from models.model_view_store import Model_View_Store
|
from models.model_view_store import Model_View_Store
|
||||||
# from datastores.datastore_store_base import DataStore_Store_Base
|
# from datastores.datastore_store_base import DataStore_Store_Base
|
||||||
from datastores.datastore_store_product_category import DataStore_Store_Product_Category
|
from datastores.datastore_store_product_category import DataStore_Store_Product_Category
|
||||||
|
from business_objects.store.product import Parameters_Product
|
||||||
from business_objects.store.product_category import Product_Category_Container # , Filters_Product_Category
|
from business_objects.store.product_category import Product_Category_Container # , Filters_Product_Category
|
||||||
from forms.access_level import Filters_Access_Level
|
from forms.access_level import Filters_Access_Level
|
||||||
# from forms.store.product_permutation import Filters_Product_Permutation
|
# from forms.store.product_permutation import Filters_Product_Permutation
|
||||||
from forms.store.product_category import Filters_Product_Category
|
from forms.store.product_category import Filters_Product_Category
|
||||||
# from routes import bp_home
|
# from routes import bp_home
|
||||||
from business_objects.store.product import Product, Parameters_Product, Product_Permutation
|
|
||||||
from business_objects.store.product_variation import Product_Variation_Container
|
|
||||||
from helpers.helper_app import Helper_App
|
from helpers.helper_app import Helper_App
|
||||||
import lib.argument_validation as av
|
import lib.argument_validation as av
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ from business_objects.store.product_category import Product_Category_Container
|
|||||||
from forms.store.product_permutation import Filters_Product_Permutation
|
from forms.store.product_permutation import Filters_Product_Permutation
|
||||||
# from routes import bp_home
|
# from routes import bp_home
|
||||||
from business_objects.store.product import Product, Parameters_Product, Product_Permutation
|
from business_objects.store.product import Product, Parameters_Product, Product_Permutation
|
||||||
from business_objects.store.product_variation import Product_Variation_Container
|
|
||||||
from helpers.helper_app import Helper_App
|
from helpers.helper_app import Helper_App
|
||||||
import lib.argument_validation as av
|
import lib.argument_validation as av
|
||||||
|
|
||||||
@@ -35,7 +34,6 @@ class Model_View_Store_Product_Permutation(Model_View_Store):
|
|||||||
list_options_product: list = None
|
list_options_product: list = None
|
||||||
units_measurement: list = None
|
units_measurement: list = None
|
||||||
units_measurement_time: list = None
|
units_measurement_time: list = None
|
||||||
# variation_container: Product_Variation_Container = None
|
|
||||||
variations: list = None
|
variations: list = None
|
||||||
variation_types: list = None
|
variation_types: list = None
|
||||||
|
|
||||||
|
|||||||
54
models/model_view_store_product_variation.py
Normal file
54
models/model_view_store_product_variation.py
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
"""
|
||||||
|
Project: PARTS Website
|
||||||
|
Author: Edward Middleton-Smith
|
||||||
|
Precision And Research Technology Systems Limited
|
||||||
|
|
||||||
|
Technology: View Models
|
||||||
|
Feature: Store Product View Model
|
||||||
|
|
||||||
|
Description:
|
||||||
|
Data model for store product view
|
||||||
|
"""
|
||||||
|
|
||||||
|
# IMPORTS
|
||||||
|
# VARIABLE INSTANTIATION
|
||||||
|
# METHODS
|
||||||
|
|
||||||
|
# IMPORTS
|
||||||
|
# internal
|
||||||
|
from business_objects.store.product_variation import Product_Variation, Parameters_Product_Variation
|
||||||
|
from business_objects.store.product_category import Product_Category_Container
|
||||||
|
from datastores.datastore_store_product_variation import DataStore_Store_Product_Variation
|
||||||
|
from forms.access_level import Filters_Access_Level
|
||||||
|
from forms.store.product_variation import Filters_Product_Variation
|
||||||
|
from helpers.helper_app import Helper_App
|
||||||
|
from models.model_view_store import Model_View_Store
|
||||||
|
# from routes import bp_home
|
||||||
|
import lib.argument_validation as av
|
||||||
|
# external
|
||||||
|
from typing import ClassVar
|
||||||
|
|
||||||
|
|
||||||
|
class Model_View_Store_Product_Variation(Model_View_Store):
|
||||||
|
form_filters: Filters_Product_Variation = None
|
||||||
|
form_filters_old: Filters_Product_Variation
|
||||||
|
variation_types: list = None
|
||||||
|
variations: list = None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def title(self):
|
||||||
|
return 'Store Product Variation'
|
||||||
|
|
||||||
|
def __init__(self, form_filters_old, hash_page_current=Model_View_Store.HASH_PAGE_STORE_PRODUCT_VARIATIONS):
|
||||||
|
_m = 'Model_View_Store_Product_Variation.__init__'
|
||||||
|
Helper_App.console_log(f'{_m}\nstarting...')
|
||||||
|
super().__init__(hash_page_current = hash_page_current, form_filters_old = form_filters_old)
|
||||||
|
self.form_filters = form_filters_old
|
||||||
|
parameters_variation = Parameters_Product_Variation.from_filters_product_variation(self.form_filters)
|
||||||
|
datastore_variation = DataStore_Store_Product_Variation()
|
||||||
|
self.variation_types, self.variations, errors = datastore_variation.get_many_product_variation(parameters_variation)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def save_product_variations(cls, comment, list_orders):
|
||||||
|
_m = f'{cls.__name__}.save_product_variations'
|
||||||
|
return DataStore_Store_Product_Variation().save_product_variations(comment, list_orders)
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -168,13 +168,19 @@ DROP TABLE IF EXISTS Shop_Product_Variation_Link;
|
|||||||
DROP TABLE IF EXISTS Shop_Product_Permutation_Variation_Link_Audit;
|
DROP TABLE IF EXISTS Shop_Product_Permutation_Variation_Link_Audit;
|
||||||
DROP TABLE IF EXISTS Shop_Product_Permutation_Variation_Link;
|
DROP TABLE IF EXISTS Shop_Product_Permutation_Variation_Link;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS Shop_Variation_Temp;
|
||||||
DROP TABLE IF EXISTS Shop_Variation_Audit;
|
DROP TABLE IF EXISTS Shop_Variation_Audit;
|
||||||
DROP TABLE IF EXISTS Shop_Variation;
|
DROP TABLE IF EXISTS Shop_Variation;
|
||||||
DROP TABLE IF EXISTS Shop_Product_Variation_Type_Link_Audit;
|
DROP TABLE IF EXISTS Shop_Product_Variation_Type_Link_Audit;
|
||||||
DROP TABLE IF EXISTS Shop_Product_Variation_Type_Link;
|
DROP TABLE IF EXISTS Shop_Product_Variation_Type_Link;
|
||||||
|
DROP TABLE IF EXISTS Shop_Product_Variation_Temp;
|
||||||
|
DROP TABLE IF EXISTS Shop_Product_Variation;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS Shop_Variation_Type_Temp;
|
||||||
DROP TABLE IF EXISTS Shop_Variation_Type_Audit;
|
DROP TABLE IF EXISTS Shop_Variation_Type_Audit;
|
||||||
DROP TABLE IF EXISTS Shop_Variation_Type;
|
DROP TABLE IF EXISTS Shop_Variation_Type;
|
||||||
|
DROP TABLE IF EXISTS Shop_Product_Variation_Type_Temp;
|
||||||
|
DROP TABLE IF EXISTS Shop_Product_Variation_Type;
|
||||||
|
|
||||||
DROP TABLE IF EXISTS Shop_Product_Permutation_Temp;
|
DROP TABLE IF EXISTS Shop_Product_Permutation_Temp;
|
||||||
DROP TABLE IF EXISTS Shop_Product_Permutation_Audit;
|
DROP TABLE IF EXISTS Shop_Product_Permutation_Audit;
|
||||||
@@ -294,6 +300,8 @@ DROP PROCEDURE IF EXISTS p_shop_get_many_stripe_product_new;
|
|||||||
DROP PROCEDURE IF EXISTS p_shop_save_permutation;
|
DROP PROCEDURE IF EXISTS p_shop_save_permutation;
|
||||||
DROP PROCEDURE IF EXISTS p_shop_save_product_permutation;
|
DROP PROCEDURE IF EXISTS p_shop_save_product_permutation;
|
||||||
DROP PROCEDURE IF EXISTS p_shop_save_product_permutation_test;
|
DROP PROCEDURE IF EXISTS p_shop_save_product_permutation_test;
|
||||||
|
DROP PROCEDURE IF EXISTS p_shop_save_product_variation;
|
||||||
|
DROP PROCEDURE IF EXISTS p_shop_save_product_variation_test;
|
||||||
DROP PROCEDURE IF EXISTS p_shop_get_many_product_variation;
|
DROP PROCEDURE IF EXISTS p_shop_get_many_product_variation;
|
||||||
DROP FUNCTION IF EXISTS fn_shop_get_id_product_permutation_from_variation_csv_list;
|
DROP FUNCTION IF EXISTS fn_shop_get_id_product_permutation_from_variation_csv_list;
|
||||||
DROP PROCEDURE IF EXISTS p_shop_save_stock_item;
|
DROP PROCEDURE IF EXISTS p_shop_save_stock_item;
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ CREATE TABLE IF NOT EXISTS Shop_Product_Permutation_Temp (
|
|||||||
, latency_manufacture INT NOT NULL
|
, latency_manufacture INT NOT NULL
|
||||||
, id_unit_measurement_quantity INT NOT NULL
|
, id_unit_measurement_quantity INT NOT NULL
|
||||||
, count_unit_measurement_per_quantity_step FLOAT NOT NULL
|
, count_unit_measurement_per_quantity_step FLOAT NOT NULL
|
||||||
, quantity_min FLOAT NOT NULL
|
, quantity_min FLOAT NULL
|
||||||
, quantity_max FLOAT NOT NULL
|
, quantity_max FLOAT NULL
|
||||||
, quantity_stock FLOAT NULL
|
, quantity_stock FLOAT NULL
|
||||||
, is_subscription BIT NOT NULL
|
, is_subscription BIT NOT NULL
|
||||||
, id_unit_measurement_interval_recurrence INT
|
, id_unit_measurement_interval_recurrence INT
|
||||||
|
|||||||
@@ -6,16 +6,17 @@
|
|||||||
SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Variation_Type';
|
SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Variation_Type';
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS Shop_Variation_Type (
|
CREATE TABLE IF NOT EXISTS Shop_Variation_Type (
|
||||||
id_type INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
id_type INT NOT NULL AUTO_INCREMENT PRIMARY KEY
|
||||||
code VARCHAR(50),
|
, id_type_temp INT NULL
|
||||||
name VARCHAR(255),
|
, code VARCHAR(50)
|
||||||
name_plural VARCHAR(256),
|
, name VARCHAR(255)
|
||||||
active BIT NOT NULL DEFAULT 1,
|
, name_plural VARCHAR(256)
|
||||||
display_order INT NOT NULL,
|
, active BIT NOT NULL DEFAULT 1
|
||||||
created_on DATETIME,
|
, display_order INT NOT NULL
|
||||||
created_by INT,
|
, created_on DATETIME
|
||||||
id_change_set INT,
|
, created_by INT
|
||||||
CONSTRAINT FK_Shop_Variation_Type_id_change_set
|
, id_change_set INT
|
||||||
|
, CONSTRAINT FK_Shop_Variation_Type_id_change_set
|
||||||
FOREIGN KEY (id_change_set)
|
FOREIGN KEY (id_change_set)
|
||||||
REFERENCES Shop_Product_Change_Set(id_change_set)
|
REFERENCES Shop_Product_Change_Set(id_change_set)
|
||||||
);
|
);
|
||||||
20
static/MySQL/1211_tbl_Shop_Variation_Type_Temp.sql
Normal file
20
static/MySQL/1211_tbl_Shop_Variation_Type_Temp.sql
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
|
||||||
|
# Variation Types Temp
|
||||||
|
|
||||||
|
-- DROP TABLE partsltd_prod.Shop_Variation_Type_Temp;
|
||||||
|
|
||||||
|
SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Variation_Type_Temp';
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS Shop_Variation_Type_Temp (
|
||||||
|
id_temp INT NOT NULL PRIMARY KEY AUTO_INCREMENT
|
||||||
|
, id_type INT NOT NULL
|
||||||
|
-- , id_type_temp INT NOT NULL
|
||||||
|
, code VARCHAR(50)
|
||||||
|
, name VARCHAR(255)
|
||||||
|
, name_plural VARCHAR(256)
|
||||||
|
, active BIT NULL
|
||||||
|
, display_order INT NOT NULL
|
||||||
|
, created_on DATETIME
|
||||||
|
, created_by INT
|
||||||
|
, guid BINARY(36) NOT NULL
|
||||||
|
);
|
||||||
19
static/MySQL/1214_tbl_Shop_Variation_Temp.sql
Normal file
19
static/MySQL/1214_tbl_Shop_Variation_Temp.sql
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
|
||||||
|
# Variations Temp
|
||||||
|
|
||||||
|
-- DROP TABLE partsltd_prod.Shop_Variation_Temp;
|
||||||
|
|
||||||
|
SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Variation_Temp';
|
||||||
|
|
||||||
|
CREATE TABLE Shop_Variation_Temp (
|
||||||
|
id_temp INT NOT NULL PRIMARY KEY AUTO_INCREMENT
|
||||||
|
, id_variation INT NOT NULL
|
||||||
|
, id_type INT NOT NULL
|
||||||
|
, code VARCHAR(50)
|
||||||
|
, name VARCHAR(255)
|
||||||
|
, active BIT
|
||||||
|
, display_order INT NOT NULL
|
||||||
|
, created_on DATETIME
|
||||||
|
, created_by INT
|
||||||
|
, guid BINARY(36)
|
||||||
|
);
|
||||||
@@ -20,8 +20,8 @@ BEGIN
|
|||||||
ELSE '' END
|
ELSE '' END
|
||||||
)
|
)
|
||||||
FROM Shop_Product_Permutation PP
|
FROM Shop_Product_Permutation PP
|
||||||
INNER JOIN Shop_Product P ON PP.id_product = P.id_product
|
LEFT JOIN Shop_Product P ON PP.id_product = P.id_product
|
||||||
INNER JOIN Shop_Product_Category PC ON P.id_category = PC.id_category
|
LEFT JOIN Shop_Product_Category PC ON P.id_category = PC.id_category
|
||||||
LEFT JOIN Shop_Product_Permutation_Variation_Link PPVL ON PP.id_permutation = PPVL.id_permutation
|
LEFT JOIN Shop_Product_Permutation_Variation_Link PPVL ON PP.id_permutation = PPVL.id_permutation
|
||||||
LEFT JOIN Shop_Variation V ON PPVL.id_variation = V.id_variation
|
LEFT JOIN Shop_Variation V ON PPVL.id_variation = V.id_variation
|
||||||
LEFT JOIN Shop_Variation_Type VT ON V.id_type = VT.id_type
|
LEFT JOIN Shop_Variation_Type VT ON V.id_type = VT.id_type
|
||||||
|
|||||||
@@ -337,7 +337,8 @@ BEGIN
|
|||||||
PP.id_product,
|
PP.id_product,
|
||||||
P.id_category,
|
P.id_category,
|
||||||
PP.description,
|
PP.description,
|
||||||
PP.cost_local,
|
PP.cost_local_VAT_excl,
|
||||||
|
PP.cost_local_VAT_incl,
|
||||||
PP.id_currency_cost,
|
PP.id_currency_cost,
|
||||||
C.code AS code_currency_cost,
|
C.code AS code_currency_cost,
|
||||||
C.symbol AS symbol_currency_cost,
|
C.symbol AS symbol_currency_cost,
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ BEGIN
|
|||||||
/* Test 1 - Insert */
|
/* Test 1 - Insert */
|
||||||
(
|
(
|
||||||
-1 -- id_permutation
|
-1 -- id_permutation
|
||||||
, 8 -- id_product
|
, 5 -- id_product
|
||||||
, 'Hair clip' -- description
|
, 'Hair clip' -- description
|
||||||
, NULL -- cost_local_VAT_excl
|
, NULL -- cost_local_VAT_excl
|
||||||
, NULL -- cost_local_VAT_incl
|
, NULL -- cost_local_VAT_incl
|
||||||
@@ -112,7 +112,6 @@ BEGIN
|
|||||||
END //
|
END //
|
||||||
DELIMITER ;;
|
DELIMITER ;;
|
||||||
|
|
||||||
/*
|
|
||||||
CALL partsltd_prod.p_shop_save_product_permutation_test ();
|
CALL partsltd_prod.p_shop_save_product_permutation_test ();
|
||||||
|
|
||||||
DELETE FROM partsltd_prod.Shop_Product_Permutation_Temp;
|
DELETE FROM partsltd_prod.Shop_Product_Permutation_Temp;
|
||||||
@@ -120,5 +119,7 @@ DELETE FROM partsltd_prod.Shop_Product_Permutation_Temp;
|
|||||||
DROP TABLE IF EXISTS tmp_Msg_Error;
|
DROP TABLE IF EXISTS tmp_Msg_Error;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
SELECT * FROM partsltd_prod.Shop_Product
|
SELECT * FROM partsltd_prod.Shop_Product
|
||||||
|
Cannot add or update a child row: a foreign key constraint fails (`partsltd_prod`.`shop_product_permutation`, CONSTRAINT `FK_Shop_Product_Permutation_id_product` FOREIGN KEY (`id_product`) REFERENCES `shop_product` (`id_product`) ON UPDATE RESTRICT)
|
||||||
*/
|
*/
|
||||||
@@ -353,20 +353,20 @@ BEGIN
|
|||||||
END //
|
END //
|
||||||
DELIMITER ;;
|
DELIMITER ;;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
CALL p_shop_get_many_product_variation (
|
CALL p_shop_get_many_product_variation (
|
||||||
1 # 'auth0|6582b95c895d09a70ba10fef', # a_id_user
|
1 # 'auth0|6582b95c895d09a70ba10fef', # a_id_user
|
||||||
, 1 # a_get_all_variation_type
|
, 1 # a_get_all_variation_type
|
||||||
, 0 # a_get_inactive_variation_type
|
, 1 # a_get_inactive_variation_type
|
||||||
, '' # a_ids_variation_type
|
, '' # a_ids_variation_type
|
||||||
, 1 # a_get_all_variation
|
, 1 # a_get_all_variation
|
||||||
, 0 # a_get_inactive_variation
|
, 1 # a_get_inactive_variation
|
||||||
, '' # a_ids_variation
|
, '' # a_ids_variation
|
||||||
, 1 # a_debug
|
, 0 # a_debug
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
select * from TMP_MSG_ERROR;
|
select * from TMP_MSG_ERROR;
|
||||||
DROP TABLE TMP_MSG_ERROR;
|
DROP TABLE TMP_MSG_ERROR;
|
||||||
|
|
||||||
|
|||||||
546
static/MySQL/7212_p_shop_save_product_variation.sql
Normal file
546
static/MySQL/7212_p_shop_save_product_variation.sql
Normal file
@@ -0,0 +1,546 @@
|
|||||||
|
|
||||||
|
|
||||||
|
-- Clear previous proc
|
||||||
|
DROP PROCEDURE IF EXISTS p_shop_save_product_variation;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS tmp_Variation_Type;
|
||||||
|
DROP TABLE IF EXISTS tmp_Variation;
|
||||||
|
DROP TABLE IF EXISTS tmp_Msg_Error;
|
||||||
|
|
||||||
|
DELIMITER //
|
||||||
|
CREATE PROCEDURE p_shop_save_product_variation (
|
||||||
|
IN a_comment VARCHAR(500)
|
||||||
|
, IN a_guid BINARY(36)
|
||||||
|
, IN a_id_user INT
|
||||||
|
, IN a_debug BIT
|
||||||
|
)
|
||||||
|
BEGIN
|
||||||
|
DECLARE v_code_type_error_bad_data VARCHAR(50);
|
||||||
|
DECLARE v_code_type_error_no_permission VARCHAR(50);
|
||||||
|
DECLARE v_code_type_error_warning VARCHAR(50);
|
||||||
|
DECLARE v_id_access_level_edit INT;
|
||||||
|
DECLARE v_id_change_set INT;
|
||||||
|
DECLARE v_ids_permission_product_variation VARCHAR(100);
|
||||||
|
DECLARE v_id_type_error_bad_data INT;
|
||||||
|
DECLARE v_id_type_error_no_permission INT;
|
||||||
|
DECLARE v_id_type_error_warning INT;
|
||||||
|
DECLARE v_ids_product_permission TEXT;
|
||||||
|
DECLARE v_time_start TIMESTAMP(6);
|
||||||
|
|
||||||
|
DECLARE exit handler for SQLEXCEPTION
|
||||||
|
BEGIN
|
||||||
|
GET DIAGNOSTICS CONDITION 1
|
||||||
|
@sqlstate = RETURNED_SQLSTATE
|
||||||
|
, @errno = MYSQL_ERRNO
|
||||||
|
, @text = MESSAGE_TEXT
|
||||||
|
;
|
||||||
|
|
||||||
|
ROLLBACK;
|
||||||
|
|
||||||
|
CREATE TEMPORARY TABLE IF NOT EXISTS tmp_Msg_Error (
|
||||||
|
display_order INT NOT NULL PRIMARY KEY AUTO_INCREMENT
|
||||||
|
, id_type INT NULL
|
||||||
|
, code VARCHAR(50) NOT NULL
|
||||||
|
, msg VARCHAR(4000) NOT NULL
|
||||||
|
);
|
||||||
|
INSERT INTO tmp_Msg_Error (
|
||||||
|
id_type
|
||||||
|
, code
|
||||||
|
, msg
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
MET.id_type
|
||||||
|
, @errno
|
||||||
|
, @text
|
||||||
|
FROM partsltd_prod.Shop_Msg_Error_Type MET
|
||||||
|
WHERE code = 'MYSQL_ERROR'
|
||||||
|
LIMIT 1
|
||||||
|
;
|
||||||
|
SELECT *
|
||||||
|
FROM tmp_Msg_Error;
|
||||||
|
DROP TABLE IF EXISTS tmp_Msg_Error;
|
||||||
|
END;
|
||||||
|
|
||||||
|
SET v_time_start := CURRENT_TIMESTAMP(6);
|
||||||
|
SET v_code_type_error_bad_data := (SELECT code FROM partsltd_prod.Shop_Msg_Error_Type WHERE code = 'BAD_DATA' LIMIT 1);
|
||||||
|
SET v_id_type_error_bad_data := (SELECT id_type FROM partsltd_prod.Shop_Msg_Error_Type WHERE code = v_code_type_error_bad_data LIMIT 1);
|
||||||
|
SET v_code_type_error_no_permission := (SELECT code FROM partsltd_prod.Shop_Msg_Error_Type WHERE code = 'NO_PERMISSION' LIMIT 1);
|
||||||
|
SET v_id_type_error_no_permission := (SELECT id_type FROM partsltd_prod.Shop_Msg_Error_Type WHERE code = v_code_type_error_no_permission LIMIT 1);
|
||||||
|
SET v_code_type_error_warning := (SELECT code FROM partsltd_prod.Shop_Msg_Error_Type WHERE code = 'WARNING' LIMIT 1);
|
||||||
|
SET v_id_type_error_warning := (SELECT id_type FROM partsltd_prod.Shop_Msg_Error_Type WHERE code = v_code_type_error_warning LIMIT 1);
|
||||||
|
SET v_ids_permission_product_variation := (SELECT GROUP_CONCAT(id_permission SEPARATOR ',') FROM partsltd_prod.Shop_Permission WHERE code IN ('STORE_PRODUCT'));
|
||||||
|
SET v_id_access_level_edit := (SELECT id_access_level FROM partsltd_prod.Shop_Access_Level WHERE code = 'EDIT' LIMIT 1);
|
||||||
|
|
||||||
|
CALL p_validate_guid ( a_guid );
|
||||||
|
SET a_comment := TRIM(IFNULL(a_comment, ''));
|
||||||
|
|
||||||
|
DROP TEMPORARY TABLE IF EXISTS tmp_Variation_Type;
|
||||||
|
DROP TEMPORARY TABLE IF EXISTS tmp_Variation;
|
||||||
|
DROP TEMPORARY TABLE IF EXISTS tmp_Msg_Error;
|
||||||
|
|
||||||
|
-- Temporary tables
|
||||||
|
CREATE TEMPORARY TABLE tmp_Variation_Type (
|
||||||
|
id_type INT NOT NULL PRIMARY KEY
|
||||||
|
, id_type_temp INT NOT NULL
|
||||||
|
, code VARCHAR(50)
|
||||||
|
, name VARCHAR(255)
|
||||||
|
, name_plural VARCHAR(256)
|
||||||
|
, active BIT NULL
|
||||||
|
, display_order INT NOT NULL
|
||||||
|
, created_on DATETIME
|
||||||
|
, created_by INT
|
||||||
|
, is_new BIT NOT NULL
|
||||||
|
, name_error VARCHAR(1000) NOT NULL
|
||||||
|
);
|
||||||
|
-- CREATE TEMPORARY TABLE tmp_Variation_Type_Count
|
||||||
|
|
||||||
|
CREATE TEMPORARY TABLE tmp_Variation (
|
||||||
|
id_variation INT NOT NULL PRIMARY KEY
|
||||||
|
, id_type INT NOT NULL
|
||||||
|
, code VARCHAR(50)
|
||||||
|
, name VARCHAR(255)
|
||||||
|
, active BIT
|
||||||
|
, display_order INT NOT NULL
|
||||||
|
, created_on DATETIME
|
||||||
|
, created_by INT
|
||||||
|
, has_type BIT NULL
|
||||||
|
, is_new BIT NOT NULL
|
||||||
|
, name_error VARCHAR(1000) NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TEMPORARY TABLE IF NOT EXISTS tmp_Msg_Error (
|
||||||
|
display_order INT NOT NULL PRIMARY KEY AUTO_INCREMENT
|
||||||
|
, id_type INT NOT NULL
|
||||||
|
, code VARCHAR(50) NOT NULL
|
||||||
|
, msg VARCHAR(4000) NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO tmp_Variation_Type (
|
||||||
|
id_type
|
||||||
|
, id_type_temp
|
||||||
|
, code
|
||||||
|
, name
|
||||||
|
, name_plural
|
||||||
|
, active
|
||||||
|
, display_order
|
||||||
|
, created_on
|
||||||
|
, created_by
|
||||||
|
, is_new
|
||||||
|
, name_error
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
VT_T.id_type
|
||||||
|
, VT_T.id_type
|
||||||
|
, VT_T.code
|
||||||
|
, VT_T.name
|
||||||
|
, VT_T.name_plural
|
||||||
|
, VT_T.active
|
||||||
|
, VT_T.display_order
|
||||||
|
, IFNULL(VT_T.created_on, VT.created_on) AS created_on
|
||||||
|
, IFNULL(VT_T.created_by, VT.created_by) AS created_by
|
||||||
|
, IFNULL(VT_T.id_type, 0) < 1 AS is_new
|
||||||
|
, CASE WHEN IFNULL(VT_T.id_type, 0) < 1 THEN
|
||||||
|
CONCAT(
|
||||||
|
'New Variation Type: '
|
||||||
|
, VT_T.display_order
|
||||||
|
, ' - '
|
||||||
|
, IFNULL(VT_T.code, '(No Code)')
|
||||||
|
, ' - '
|
||||||
|
, IFNULL(VT_T.name, '(No Name)')
|
||||||
|
)
|
||||||
|
ELSE
|
||||||
|
CONCAT(
|
||||||
|
VT_T.display_order
|
||||||
|
, ' - '
|
||||||
|
, IFNULL(VT_T.code, '(No Code)')
|
||||||
|
, ' - '
|
||||||
|
, IFNULL(VT_T.name, '(No Name)')
|
||||||
|
)
|
||||||
|
END AS name_error
|
||||||
|
FROM partsltd_prod.Shop_Variation_Type_Temp VT_T
|
||||||
|
LEFT JOIN partsltd_prod.Shop_Variation_Type VT ON VT_T.id_type = VT.id_type
|
||||||
|
WHERE VT_T.GUID = a_guid
|
||||||
|
;
|
||||||
|
|
||||||
|
INSERT INTO tmp_Variation (
|
||||||
|
id_variation
|
||||||
|
, id_type
|
||||||
|
, code
|
||||||
|
, name
|
||||||
|
, active
|
||||||
|
, display_order
|
||||||
|
, created_on
|
||||||
|
, created_by
|
||||||
|
, has_type
|
||||||
|
, is_new
|
||||||
|
, name_error
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
V_T.id_variation
|
||||||
|
, IFNULL(V_T.id_type, V.id_type) AS id_type
|
||||||
|
, V_T.code
|
||||||
|
, V_T.name
|
||||||
|
, V_T.active
|
||||||
|
, V_T.display_order
|
||||||
|
, IFNULL(V_T.created_on, V.created_on) AS created_on
|
||||||
|
, IFNULL(V_T.created_by, V.created_by) AS created_by
|
||||||
|
, NOT ISNULL(t_VT.id_type) AS has_type
|
||||||
|
, IFNULL(V_T.id_variation, 0) < 1 AS is_new
|
||||||
|
, CASE WHEN IFNULL(V_T.id_variation, 0) < 1 THEN
|
||||||
|
CONCAT(
|
||||||
|
'New Variation: '
|
||||||
|
, V_T.display_order
|
||||||
|
, ' - '
|
||||||
|
, IFNULL(V_T.code, '(No Code)')
|
||||||
|
, ' - '
|
||||||
|
, IFNULL(V_T.name, '(No Name)')
|
||||||
|
)
|
||||||
|
ELSE
|
||||||
|
CONCAT(
|
||||||
|
V_T.display_order
|
||||||
|
, ' - '
|
||||||
|
, IFNULL(V_T.code, '(No Code)')
|
||||||
|
, ' - '
|
||||||
|
, IFNULL(V_T.name, '(No Name)')
|
||||||
|
)
|
||||||
|
END AS name_error
|
||||||
|
FROM partsltd_prod.Shop_Variation_Temp V_T
|
||||||
|
LEFT JOIN partsltd_prod.Shop_Variation V ON V_T.id_variation = V.id_variation
|
||||||
|
-- LEFT JOIN partsltd_prod.Shop_Variation_Type VT ON V_T.id_type = VT.id_type
|
||||||
|
LEFT JOIN tmp_Variation_Type t_VT ON V_T.id_type = t_VT.id_type
|
||||||
|
WHERE V_T.GUID = a_guid
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Insert missing order records
|
||||||
|
INSERT INTO tmp_Variation_Type (
|
||||||
|
id_type
|
||||||
|
, id_type_temp
|
||||||
|
, code
|
||||||
|
, name
|
||||||
|
, name_plural
|
||||||
|
, active
|
||||||
|
, display_order
|
||||||
|
, created_on
|
||||||
|
, created_by
|
||||||
|
, is_new
|
||||||
|
, name_error
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
VT.id_type
|
||||||
|
, VT.id_type
|
||||||
|
, VT.code
|
||||||
|
, VT.name
|
||||||
|
, VT.name_plural
|
||||||
|
, VT.active
|
||||||
|
, VT.display_order
|
||||||
|
, VT.created_on
|
||||||
|
, VT.created_by
|
||||||
|
, 0 AS is_new
|
||||||
|
, CONCAT(
|
||||||
|
VT.display_order
|
||||||
|
, ' - '
|
||||||
|
, IFNULL(VT.code, '(No Code)')
|
||||||
|
, ' - '
|
||||||
|
, IFNULL(VT.name, '(No Name)')
|
||||||
|
) AS name_error
|
||||||
|
FROM partsltd_prod.Shop_Variation_Type VT
|
||||||
|
INNER JOIN tmp_Variation t_V
|
||||||
|
ON VT.id_type = t_V.id_type
|
||||||
|
AND t_V.has_type = 0
|
||||||
|
AND NOT ISNULL(t_V.id_type)
|
||||||
|
;
|
||||||
|
|
||||||
|
UPDATE tmp_Variation t_V
|
||||||
|
INNER JOIN tmp_Variation_Type t_VT ON t_V.id_type = t_V.id_type
|
||||||
|
SET t_V.has_type = 1
|
||||||
|
WHERE t_V.has_type = 0
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Validation
|
||||||
|
-- Variation Type
|
||||||
|
# id_type
|
||||||
|
IF EXISTS (
|
||||||
|
SELECT *
|
||||||
|
FROM tmp_Variation_Type t_VT
|
||||||
|
INNER JOIN partsltd_prod.Shop_Variation_Type VT ON t_VT.id_type = VT.id_type
|
||||||
|
WHERE 1=1
|
||||||
|
AND t_VT.id_type > 0
|
||||||
|
AND ISNULL(VT.id_type)
|
||||||
|
LIMIT 1
|
||||||
|
) THEN
|
||||||
|
INSERT INTO tmp_Msg_Error (
|
||||||
|
id_type
|
||||||
|
, code
|
||||||
|
, msg
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
v_id_type_error_bad_data
|
||||||
|
, v_code_type_error_bad_data
|
||||||
|
, CONCAT(
|
||||||
|
'A valid ID is required for the following Product Variation Type(s): '
|
||||||
|
, GROUP_CONCAT(t_VT.name_error SEPARATOR ', ')
|
||||||
|
) AS msg
|
||||||
|
FROM tmp_Variation_Type t_VT
|
||||||
|
INNER JOIN partsltd_prod.Shop_Variation_Type VT ON t_VT.id_type = VT.id_type
|
||||||
|
WHERE 1=1
|
||||||
|
AND t_VT.id_type > 0
|
||||||
|
AND ISNULL(VT.id_type)
|
||||||
|
;
|
||||||
|
END IF;
|
||||||
|
-- Variation
|
||||||
|
# id_variation
|
||||||
|
IF EXISTS (
|
||||||
|
SELECT *
|
||||||
|
FROM tmp_Variation t_V
|
||||||
|
INNER JOIN partsltd_prod.Shop_Variation V ON t_V.id_variation = V.id_variation
|
||||||
|
WHERE 1=1
|
||||||
|
AND t_V.id_variation > 0
|
||||||
|
AND ISNULL(V.id_variation)
|
||||||
|
LIMIT 1
|
||||||
|
) THEN
|
||||||
|
INSERT INTO tmp_Msg_Error (
|
||||||
|
id_type
|
||||||
|
, code
|
||||||
|
, msg
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
v_id_type_error_bad_data
|
||||||
|
, v_code_type_error_bad_data
|
||||||
|
, CONCAT(
|
||||||
|
'A valid ID is required for the following Product Variation(s): '
|
||||||
|
, GROUP_CONCAT(t_V.name_error SEPARATOR ', ')
|
||||||
|
) AS msg
|
||||||
|
FROM tmp_Variation t_V
|
||||||
|
INNER JOIN partsltd_prod.Shop_Variation V ON t_V.id_variation = V.id_variation
|
||||||
|
WHERE 1=1
|
||||||
|
AND t_V.id_variation > 0
|
||||||
|
AND ISNULL(V.id_variation)
|
||||||
|
;
|
||||||
|
END IF;
|
||||||
|
# id_type
|
||||||
|
IF EXISTS ( SELECT * FROM tmp_Variation t_V WHERE t_V.has_type = 0 LIMIT 1 ) THEN
|
||||||
|
INSERT INTO tmp_Msg_Error (
|
||||||
|
id_type
|
||||||
|
, code
|
||||||
|
, msg
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
v_id_type_error_bad_data
|
||||||
|
, v_code_type_error_bad_data
|
||||||
|
, CONCAT(
|
||||||
|
'A valid ID is required for the following Product Variation(s): '
|
||||||
|
, GROUP_CONCAT(t_V.name_error SEPARATOR ', ')
|
||||||
|
) AS msg
|
||||||
|
FROM tmp_Variation t_V
|
||||||
|
WHERE t_V.has_type = 0
|
||||||
|
;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
-- Duplicate Variation Type Ids
|
||||||
|
-- Duplicate Variation Ids
|
||||||
|
-- Duplicate Variation Type Codes
|
||||||
|
-- Duplicate Variation Codes
|
||||||
|
|
||||||
|
-- Permissions
|
||||||
|
IF a_debug = 1 THEN
|
||||||
|
SELECT
|
||||||
|
a_guid
|
||||||
|
, a_id_user
|
||||||
|
, FALSE -- get inactive users
|
||||||
|
, v_ids_permission_product_variation
|
||||||
|
, v_id_access_level_edit
|
||||||
|
, NULL -- ids_product
|
||||||
|
, 0 -- a_debug
|
||||||
|
;
|
||||||
|
SELECT *
|
||||||
|
FROM partsltd_prod.Shop_Calc_User_Temp
|
||||||
|
WHERE GUID = a_guid
|
||||||
|
;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
CALL p_shop_calc_user(
|
||||||
|
a_guid
|
||||||
|
, a_id_user
|
||||||
|
, FALSE -- get inactive users
|
||||||
|
, v_ids_permission_product_variation
|
||||||
|
, v_id_access_level_edit
|
||||||
|
, NULL -- ids_product
|
||||||
|
, 0 -- a_debug
|
||||||
|
);
|
||||||
|
|
||||||
|
IF a_debug = 1 THEN
|
||||||
|
SELECT * from partsltd_prod.Shop_Calc_User_Temp WHERE GUID = a_guid;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
IF EXISTS (SELECT * FROM partsltd_prod.Shop_Calc_User_Temp UE_T WHERE UE_T.GUID = a_guid AND IFNULL(UE_T.can_view, 0) = 0) THEN
|
||||||
|
DELETE FROM tmp_Msg_Error;
|
||||||
|
|
||||||
|
INSERT INTO tmp_Msg_Error (
|
||||||
|
id_type
|
||||||
|
, code
|
||||||
|
, msg
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
v_id_type_error_no_permission
|
||||||
|
, v_code_type_error_no_permission
|
||||||
|
, CONCAT(
|
||||||
|
'You do not have edit permissions for '
|
||||||
|
, GROUP_CONCAT(name SEPARATOR ', ')
|
||||||
|
)
|
||||||
|
FROM partsltd_prod.Shop_Permission PERM
|
||||||
|
INNER JOIN partsltd_prod.Shop_Calc_User_Temp UE_T
|
||||||
|
ON PERM.id_permission = UE_T.id_permission
|
||||||
|
AND UE_T.GUID = a_guid
|
||||||
|
AND IFNULL(UE_T.can_view, 0) = 0
|
||||||
|
;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
CALL partsltd_prod.p_shop_clear_calc_user(
|
||||||
|
a_guid
|
||||||
|
, 0 -- a_debug
|
||||||
|
);
|
||||||
|
|
||||||
|
IF EXISTS ( SELECT * FROM tmp_Msg_Error WHERE id_type <> v_id_type_error_warning LIMIT 1 ) THEN
|
||||||
|
DELETE FROM tmp_Variation_Type;
|
||||||
|
DELETE FROM tmp_Variation;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
-- Transaction
|
||||||
|
IF NOT EXISTS (SELECT * FROM tmp_Msg_Error) THEN
|
||||||
|
START TRANSACTION;
|
||||||
|
INSERT INTO Shop_Product_Change_Set (
|
||||||
|
comment
|
||||||
|
, updated_last_by
|
||||||
|
, updated_last_on
|
||||||
|
)
|
||||||
|
VALUES (
|
||||||
|
a_comment
|
||||||
|
, a_id_user
|
||||||
|
, v_time_start
|
||||||
|
);
|
||||||
|
|
||||||
|
SET v_id_change_set := LAST_INSERT_ID();
|
||||||
|
|
||||||
|
INSERT INTO partsltd_prod.Shop_Variation_Type (
|
||||||
|
id_type_temp
|
||||||
|
, code
|
||||||
|
, name
|
||||||
|
, name_plural
|
||||||
|
, active
|
||||||
|
, display_order
|
||||||
|
, created_on
|
||||||
|
, created_by
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
t_VT.id_type
|
||||||
|
, t_VT.code
|
||||||
|
, t_VT.name
|
||||||
|
, t_VT.name_plural
|
||||||
|
, t_VT.active
|
||||||
|
, t_VT.display_order
|
||||||
|
, t_VT.created_on
|
||||||
|
, t_VT.created_by
|
||||||
|
FROM tmp_Variation_Type t_VT
|
||||||
|
WHERE t_VT.is_new = 1
|
||||||
|
;
|
||||||
|
|
||||||
|
UPDATE tmp_Variation_Type t_VT
|
||||||
|
INNER JOIN partsltd_prod.Shop_Variation_Type VT ON t_VT.id_type_temp = VT.id_type_temp
|
||||||
|
SET
|
||||||
|
t_VT.id_type = VT.id_type
|
||||||
|
WHERE t_VT.is_new = 1
|
||||||
|
;
|
||||||
|
|
||||||
|
UPDATE tmp_Variation t_V
|
||||||
|
INNER JOIN tmp_Variation_Type t_VT
|
||||||
|
ON t_V.id_type = t_VT.id_type_temp
|
||||||
|
AND t_VT.is_new = 1
|
||||||
|
SET
|
||||||
|
t_V.id_type = t_VT.id_type
|
||||||
|
;
|
||||||
|
|
||||||
|
INSERT INTO partsltd_prod.Shop_Variation (
|
||||||
|
id_type
|
||||||
|
, code
|
||||||
|
, name
|
||||||
|
, active
|
||||||
|
, display_order
|
||||||
|
, created_on
|
||||||
|
, created_by
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
t_V.id_type
|
||||||
|
, t_V.code
|
||||||
|
, t_V.name
|
||||||
|
, t_V.active
|
||||||
|
, t_V.display_order
|
||||||
|
, t_V.created_on
|
||||||
|
, t_V.created_by
|
||||||
|
FROM tmp_Variation t_V
|
||||||
|
WHERE t_V.is_new = 1
|
||||||
|
;
|
||||||
|
|
||||||
|
UPDATE partsltd_prod.Shop_Variation_Type VT
|
||||||
|
INNER JOIN tmp_Variation_Type t_VT
|
||||||
|
ON VT.id_type = t_VT.id_type
|
||||||
|
AND t_VT.is_new = 0
|
||||||
|
INNER JOIN tmp_Variation t_V ON t_VT.id_type = t_V.id_type
|
||||||
|
SET
|
||||||
|
VT.code = t_VT.code
|
||||||
|
, VT.name = t_VT.name
|
||||||
|
, VT.name_plural = t_VT.name_plural
|
||||||
|
, VT.active = t_VT.active
|
||||||
|
, VT.display_order = t_VT.display_order
|
||||||
|
, VT.created_on = t_VT.created_on
|
||||||
|
, VT.created_by = t_VT.created_by
|
||||||
|
, VT.id_change_set = v_id_change_set
|
||||||
|
;
|
||||||
|
|
||||||
|
UPDATE partsltd_prod.Shop_Variation V
|
||||||
|
INNER JOIN tmp_Variation t_V
|
||||||
|
ON V.id_variation = t_V.id_variation
|
||||||
|
AND t_V.is_new = 0
|
||||||
|
SET
|
||||||
|
V.code = t_V.code
|
||||||
|
, V.name = t_V.name
|
||||||
|
, V.active = t_V.active
|
||||||
|
, V.display_order = t_V.display_order
|
||||||
|
, V.created_on = t_V.created_on
|
||||||
|
, V.created_by = t_V.created_by
|
||||||
|
, V.id_change_set = v_id_change_set
|
||||||
|
;
|
||||||
|
|
||||||
|
DELETE VT_T
|
||||||
|
FROM partsltd_prod.Shop_Variation_Type_Temp VT_T
|
||||||
|
WHERE VT_T.GUID = a_guid
|
||||||
|
;
|
||||||
|
DELETE V_T
|
||||||
|
FROM partsltd_prod.Shop_Variation_Temp V_T
|
||||||
|
WHERE V_T.GUID = a_guid
|
||||||
|
;
|
||||||
|
|
||||||
|
COMMIT;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
# Errors
|
||||||
|
SELECT *
|
||||||
|
FROM tmp_Msg_Error t_ME
|
||||||
|
INNER JOIN partsltd_prod.Shop_Msg_Error_Type MET ON t_ME.id_type = MET.id_type
|
||||||
|
;
|
||||||
|
|
||||||
|
IF a_debug = 1 THEN
|
||||||
|
SELECT * from tmp_Variation_Type;
|
||||||
|
SELECT * from tmp_Variation;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
DROP TEMPORARY TABLE tmp_Variation_Type;
|
||||||
|
DROP TEMPORARY TABLE tmp_Variation;
|
||||||
|
DROP TEMPORARY TABLE tmp_Msg_Error;
|
||||||
|
|
||||||
|
IF a_debug = 1 THEN
|
||||||
|
CALL partsltd_prod.p_debug_timing_reporting ( v_time_start );
|
||||||
|
END IF;
|
||||||
|
END //
|
||||||
|
DELIMITER ;;
|
||||||
|
|
||||||
|
|
||||||
186
static/MySQL/7212_p_shop_save_product_variation_test.sql
Normal file
186
static/MySQL/7212_p_shop_save_product_variation_test.sql
Normal file
@@ -0,0 +1,186 @@
|
|||||||
|
|
||||||
|
|
||||||
|
-- Clear previous proc
|
||||||
|
DROP PROCEDURE IF EXISTS partsltd_prod.p_shop_save_product_variation_test;
|
||||||
|
|
||||||
|
|
||||||
|
DELIMITER //
|
||||||
|
CREATE PROCEDURE p_shop_save_product_variation_test ()
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
DECLARE v_guid BINARY(36);
|
||||||
|
DECLARE v_time_start TIMESTAMP(6);
|
||||||
|
|
||||||
|
SET v_time_start := CURRENT_TIMESTAMP(6);
|
||||||
|
SET v_guid := 'nips';
|
||||||
|
|
||||||
|
SELECT *
|
||||||
|
FROM partsltd_prod.Shop_Variation_Type
|
||||||
|
;
|
||||||
|
SELECT *
|
||||||
|
FROM partsltd_prod.Shop_Variation_Type_Temp
|
||||||
|
;
|
||||||
|
SELECT *
|
||||||
|
FROM partsltd_prod.Shop_Variation
|
||||||
|
;
|
||||||
|
SELECT *
|
||||||
|
FROM partsltd_prod.Shop_Variation_Temp
|
||||||
|
;
|
||||||
|
|
||||||
|
START TRANSACTION;
|
||||||
|
|
||||||
|
DELETE FROM partsltd_prod.Shop_Variation_Type_Temp;
|
||||||
|
DELETE FROM partsltd_prod.Shop_Variation_Temp;
|
||||||
|
|
||||||
|
INSERT INTO partsltd_prod.Shop_Variation_Type_Temp (
|
||||||
|
id_type
|
||||||
|
-- , id_type_temp
|
||||||
|
, code
|
||||||
|
, name
|
||||||
|
, name_plural
|
||||||
|
, display_order
|
||||||
|
, active
|
||||||
|
, GUID
|
||||||
|
)
|
||||||
|
/* Test 1 - Insert
|
||||||
|
VALUES (
|
||||||
|
-1
|
||||||
|
-- , -1
|
||||||
|
, 'SIZE'
|
||||||
|
, 'Size'
|
||||||
|
, 'Sizes'
|
||||||
|
, 2
|
||||||
|
, 1
|
||||||
|
, v_guid
|
||||||
|
)
|
||||||
|
*/
|
||||||
|
/* Test 2: Alter */
|
||||||
|
SELECT
|
||||||
|
id_type
|
||||||
|
-- , id_type AS id_type_temp
|
||||||
|
, code
|
||||||
|
, name
|
||||||
|
, name_plural
|
||||||
|
, display_order
|
||||||
|
, active
|
||||||
|
, v_guid AS GUID
|
||||||
|
FROM partsltd_prod.Shop_Variation_Type
|
||||||
|
WHERE id_type = 1
|
||||||
|
;
|
||||||
|
|
||||||
|
INSERT INTO partsltd_prod.Shop_Variation_Temp (
|
||||||
|
id_variation
|
||||||
|
, id_type
|
||||||
|
, code
|
||||||
|
, name
|
||||||
|
, display_order
|
||||||
|
, active
|
||||||
|
, GUID
|
||||||
|
)
|
||||||
|
/* Test 1 - Insert
|
||||||
|
VALUES (
|
||||||
|
-1 -- id_variation
|
||||||
|
, -1 -- id_type
|
||||||
|
, '300 mL' -- code
|
||||||
|
, '300 millilitres' -- name
|
||||||
|
, 1 -- display_order
|
||||||
|
, 1 -- active
|
||||||
|
, v_guid --
|
||||||
|
)
|
||||||
|
*/
|
||||||
|
/* Test 3 - Insert
|
||||||
|
VALUES (
|
||||||
|
-1 -- id_variation
|
||||||
|
, 1 -- id_type
|
||||||
|
, 'SILVER' -- code
|
||||||
|
, 'Silver' -- name
|
||||||
|
, 10 -- display_order
|
||||||
|
, 1 -- active
|
||||||
|
, 'NIPS' -- v_guid --
|
||||||
|
);
|
||||||
|
*/
|
||||||
|
/* Test 2: Alter */
|
||||||
|
SELECT
|
||||||
|
id_variation
|
||||||
|
, id_type
|
||||||
|
, code
|
||||||
|
, name
|
||||||
|
, display_order
|
||||||
|
, active
|
||||||
|
, v_guid AS GUID
|
||||||
|
FROM partsltd_prod.Shop_Variation
|
||||||
|
WHERE id_variation = 2
|
||||||
|
UNION
|
||||||
|
SELECT
|
||||||
|
-1 -- id_variation
|
||||||
|
, 1 -- id_type
|
||||||
|
, 'GREEN' -- code
|
||||||
|
, 'Green' -- name
|
||||||
|
, 3 -- display_order
|
||||||
|
, 1 -- active
|
||||||
|
, v_guid --
|
||||||
|
;
|
||||||
|
|
||||||
|
COMMIT;
|
||||||
|
|
||||||
|
SELECT *
|
||||||
|
FROM partsltd_prod.Shop_Variation_Type_Temp
|
||||||
|
WHERE GUID = v_guid
|
||||||
|
;
|
||||||
|
|
||||||
|
SELECT *
|
||||||
|
FROM partsltd_prod.Shop_Variation_Temp
|
||||||
|
WHERE GUID = v_guid
|
||||||
|
;
|
||||||
|
|
||||||
|
CALL partsltd_prod.p_shop_save_product_variation (
|
||||||
|
'Test save Variations - add + edit' -- comment
|
||||||
|
, v_guid -- guid
|
||||||
|
, 1 -- id_user
|
||||||
|
, 1 -- debug
|
||||||
|
);
|
||||||
|
|
||||||
|
SELECT *
|
||||||
|
FROM partsltd_prod.Shop_Variation_Type_Temp
|
||||||
|
;
|
||||||
|
SELECT *
|
||||||
|
FROM partsltd_prod.Shop_Variation_Temp
|
||||||
|
;
|
||||||
|
SELECT *
|
||||||
|
FROM partsltd_prod.Shop_Variation_Type
|
||||||
|
;
|
||||||
|
SELECT *
|
||||||
|
FROM partsltd_prod.Shop_Variation
|
||||||
|
;
|
||||||
|
|
||||||
|
CALL partsltd_prod.p_debug_timing_reporting ( v_time_start );
|
||||||
|
END //
|
||||||
|
DELIMITER ;;
|
||||||
|
|
||||||
|
CALL partsltd_prod.p_shop_save_product_variation_test ();
|
||||||
|
|
||||||
|
DELETE FROM partsltd_prod.Shop_Variation_Type_Temp;
|
||||||
|
DELETE FROM partsltd_prod.Shop_Variation_Temp;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS tmp_Msg_Error;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
delete from shop_variation_audit
|
||||||
|
where id_variation = 3
|
||||||
|
;
|
||||||
|
delete from shop_variation_audit
|
||||||
|
where id_variation = 3
|
||||||
|
;
|
||||||
|
delete from shop_variation_type_audit
|
||||||
|
where id_type = -1
|
||||||
|
;
|
||||||
|
delete
|
||||||
|
-- select *
|
||||||
|
from shop_variation_type
|
||||||
|
where id_type = -1
|
||||||
|
;
|
||||||
|
|
||||||
|
Cannot add or update a child row: a foreign key constraint fails (`partsltd_prod`.`shop_variation_type`, CONSTRAINT `FK_Shop_Variation_Type_id_change_set` FOREIGN KEY (`id_change_set`) REFERENCES `shop_product_change_set` (`id_change_set`))
|
||||||
|
|
||||||
|
*/
|
||||||
@@ -699,7 +699,7 @@ BEGIN
|
|||||||
v_id_type_error_no_permission
|
v_id_type_error_no_permission
|
||||||
, v_code_type_error_no_permission
|
, v_code_type_error_no_permission
|
||||||
, CONCAT(
|
, CONCAT(
|
||||||
'You do not have view permissions for '
|
'You do not have edit permissions for '
|
||||||
, GROUP_CONCAT(name SEPARATOR ', ')
|
, GROUP_CONCAT(name SEPARATOR ', ')
|
||||||
)
|
)
|
||||||
FROM partsltd_prod.Shop_Permission PERM
|
FROM partsltd_prod.Shop_Permission PERM
|
||||||
|
|||||||
@@ -51,8 +51,10 @@
|
|||||||
1208_tbl_Shop_Product_Permutation_Temp.sql
|
1208_tbl_Shop_Product_Permutation_Temp.sql
|
||||||
1209_tbl_Shop_Variation_Type.sql
|
1209_tbl_Shop_Variation_Type.sql
|
||||||
1210_tbl_Shop_Variation_Type_Audit.sql
|
1210_tbl_Shop_Variation_Type_Audit.sql
|
||||||
|
1211_tbl_Shop_Variation_Type_Temp.sql
|
||||||
1212_tbl_Shop_Variation.sql
|
1212_tbl_Shop_Variation.sql
|
||||||
1213_tbl_Shop_Variation_Audit.sql
|
1213_tbl_Shop_Variation_Audit.sql
|
||||||
|
1214_tbl_Shop_Variation_Temp.sql
|
||||||
1215_tbl_Shop_Product_Permutation_Variation_Link.sql
|
1215_tbl_Shop_Product_Permutation_Variation_Link.sql
|
||||||
1216_tbl_Shop_Product_Permutation_Variation_Link_Audit.sql
|
1216_tbl_Shop_Product_Permutation_Variation_Link_Audit.sql
|
||||||
1218_tbl_Shop_Stock_Item.sql
|
1218_tbl_Shop_Stock_Item.sql
|
||||||
@@ -189,6 +191,8 @@
|
|||||||
7206_p_shop_save_product_permutation.sql
|
7206_p_shop_save_product_permutation.sql
|
||||||
7206_p_shop_save_product_permutation_test.sql
|
7206_p_shop_save_product_permutation_test.sql
|
||||||
7210_p_shop_get_many_product_variation.sql
|
7210_p_shop_get_many_product_variation.sql
|
||||||
|
7212_p_shop_save_product_variation.sql
|
||||||
|
7212_p_shop_save_product_variation_test.sql
|
||||||
7219_p_shop_get_many_stock_item.sql
|
7219_p_shop_get_many_stock_item.sql
|
||||||
7220_p_shop_save_stock_item.sql
|
7220_p_shop_save_stock_item.sql
|
||||||
7220_p_shop_save_stock_item_test.sql
|
7220_p_shop_save_stock_item_test.sql
|
||||||
|
|||||||
@@ -48,16 +48,11 @@ tr {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
table textarea {
|
table textarea,
|
||||||
width: 95% !important;
|
table select,
|
||||||
}
|
|
||||||
|
|
||||||
table select {
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
table input {
|
table input {
|
||||||
width: 90% !important;
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
table button {
|
table button {
|
||||||
@@ -65,6 +60,10 @@ table button {
|
|||||||
padding: 0.5vh 1vh;
|
padding: 0.5vh 1vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
tr.delete {
|
table button.active {
|
||||||
|
background-color: var(--c_purple_pastel);
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.delete, tr.delete > td {
|
||||||
background-color: red;
|
background-color: red;
|
||||||
}
|
}
|
||||||
@@ -17,3 +17,6 @@ form.filter button.save, form.filter button.button-cancel {
|
|||||||
#formFilters .container-input.filter.active {
|
#formFilters .container-input.filter.active {
|
||||||
width: 8vh;
|
width: 8vh;
|
||||||
}
|
}
|
||||||
|
#formFilters .container-input.filter.is_not_empty {
|
||||||
|
width: 12vh;
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
#tableMain {
|
#tableMain {
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
padding: 1vh 2vh;
|
padding: 1vh;
|
||||||
max-width: 95vw; /* min(calc(1vh * 80), calc(1vw * 90)); */
|
max-width: 95vw; /* min(calc(1vh * 80), calc(1vw * 90)); */
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
margin: 1vh 2vh;
|
margin: 1vh 2vh;
|
||||||
|
|||||||
46
static/css/pages/store/product_variations.css
Normal file
46
static/css/pages/store/product_variations.css
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
#formFilters {
|
||||||
|
width: 50vh;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#tableMain:has(thead tr th.product_variations.collapsed) {
|
||||||
|
max-width: 66vh;
|
||||||
|
}
|
||||||
|
#tableMain {
|
||||||
|
max-width: 97vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
#tableMain tbody tr td.display_order, #tableMain thead tr th.display_order,
|
||||||
|
#tableMain tbody tr td.active, #tableMain thead tr th.active {
|
||||||
|
width: 6vh;
|
||||||
|
min-width: 6vh;
|
||||||
|
}
|
||||||
|
#tableMain tbody tr td.code, #tableMain thead tr th.code,
|
||||||
|
#tableMain tbody tr td.name, #tableMain thead tr th.name,
|
||||||
|
#tableMain tbody tr td.name_plural, #tableMain thead tr th.name_plural {
|
||||||
|
width: 12vh;
|
||||||
|
min-width: 12vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
#tableMain thead tr th.product_variations.collapsed, #tableMain tbody tr td.product_variations.collapsed {
|
||||||
|
width: 8vh;
|
||||||
|
min-width: 8vh;
|
||||||
|
}
|
||||||
|
#tableMain thead tr th.product_variations, #tableMain tbody tr td.product_variations {
|
||||||
|
width: 41vh;
|
||||||
|
min-width: 41vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
#tableMain tbody tr td.product_variations table thead tr th.code, #tableMain tbody tr td.product_variations table tbody tr td.code,
|
||||||
|
#tableMain tbody tr td.product_variations table thead tr th.name, #tableMain tbody tr td.product_variations table tbody tr td.name {
|
||||||
|
width: 12vh;
|
||||||
|
min-width: 12vh;
|
||||||
|
}
|
||||||
|
#tableMain tbody tr td.product_variations table thead tr th.display_order, #tableMain tbody tr td.product_variations table tbody tr td.display_order,
|
||||||
|
#tableMain tbody tr td.product_variations table thead tr th.active, #tableMain tbody tr td.product_variations table tbody tr td.active {
|
||||||
|
width: 6vh;
|
||||||
|
min-width: 6vh;
|
||||||
|
}
|
||||||
2
static/dist/css/core_admin_home.bundle.css
vendored
2
static/dist/css/core_admin_home.bundle.css
vendored
@@ -5,3 +5,5 @@
|
|||||||
.container.row {
|
.container.row {
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*# sourceMappingURL=core_admin_home.bundle.css.map*/
|
||||||
2
static/dist/css/core_contact.bundle.css
vendored
2
static/dist/css/core_contact.bundle.css
vendored
@@ -32,3 +32,5 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*# sourceMappingURL=core_contact.bundle.css.map*/
|
||||||
2
static/dist/css/core_home.bundle.css
vendored
2
static/dist/css/core_home.bundle.css
vendored
@@ -34,3 +34,5 @@ img {
|
|||||||
width: fit-content;
|
width: fit-content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*# sourceMappingURL=core_home.bundle.css.map*/
|
||||||
2
static/dist/css/core_services.bundle.css
vendored
2
static/dist/css/core_services.bundle.css
vendored
@@ -44,3 +44,5 @@ img {
|
|||||||
max-width: 10vw;
|
max-width: 10vw;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*# sourceMappingURL=core_services.bundle.css.map*/
|
||||||
2
static/dist/css/legal_license.bundle.css
vendored
2
static/dist/css/legal_license.bundle.css
vendored
@@ -6,3 +6,5 @@
|
|||||||
#pageBody > * :last-child {
|
#pageBody > * :last-child {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*# sourceMappingURL=legal_license.bundle.css.map*/
|
||||||
27
static/dist/css/main.bundle.css
vendored
27
static/dist/css/main.bundle.css
vendored
@@ -654,16 +654,11 @@ tr {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
table textarea {
|
table textarea,
|
||||||
width: 95% !important;
|
table select,
|
||||||
}
|
|
||||||
|
|
||||||
table select {
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
table input {
|
table input {
|
||||||
width: 90% !important;
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
table button {
|
table button {
|
||||||
@@ -671,11 +666,16 @@ table button {
|
|||||||
padding: 0.5vh 1vh;
|
padding: 0.5vh 1vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
tr.delete {
|
table button.active {
|
||||||
|
background-color: var(--c_purple_pastel);
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.delete, tr.delete > td {
|
||||||
background-color: red;
|
background-color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
button.collapsed {
|
button.collapsed {
|
||||||
display: block;
|
display: block;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
@@ -693,11 +693,14 @@ form.filter button.save, form.filter button.button-cancel {
|
|||||||
#formFilters .container-input.filter.active {
|
#formFilters .container-input.filter.active {
|
||||||
width: 8vh;
|
width: 8vh;
|
||||||
}
|
}
|
||||||
|
#formFilters .container-input.filter.is_not_empty {
|
||||||
|
width: 12vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#tableMain {
|
#tableMain {
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
padding: 1vh 2vh;
|
padding: 1vh;
|
||||||
max-width: 95vw; /* min(calc(1vh * 80), calc(1vw * 90)); */
|
max-width: 95vw; /* min(calc(1vh * 80), calc(1vw * 90)); */
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
margin: 1vh 2vh;
|
margin: 1vh 2vh;
|
||||||
@@ -767,3 +770,5 @@ form.filter button.save, form.filter button.button-cancel {
|
|||||||
--card-border: #dee2e6;
|
--card-border: #dee2e6;
|
||||||
--card-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
--card-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*# sourceMappingURL=main.bundle.css.map*/
|
||||||
2
static/dist/css/store_home.bundle.css
vendored
2
static/dist/css/store_home.bundle.css
vendored
@@ -56,3 +56,5 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*# sourceMappingURL=store_home.bundle.css.map*/
|
||||||
@@ -152,3 +152,5 @@ select.id_variation, select.id_variation_type {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*# sourceMappingURL=store_product_categories.bundle.css.map*/
|
||||||
@@ -188,3 +188,5 @@ select.id_variation, select.id_variation_type {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*# sourceMappingURL=store_product_permutations.bundle.css.map*/
|
||||||
2
static/dist/css/store_stock_items.bundle.css
vendored
2
static/dist/css/store_stock_items.bundle.css
vendored
@@ -138,3 +138,5 @@ th, td {
|
|||||||
width: 15vh;
|
width: 15vh;
|
||||||
min-width: 15vh;
|
min-width: 15vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*# sourceMappingURL=store_stock_items.bundle.css.map*/
|
||||||
154
static/dist/js/core_admin_home.bundle.js
vendored
154
static/dist/js/core_admin_home.bundle.js
vendored
@@ -1 +1,153 @@
|
|||||||
(()=>{"use strict";var r,e={497:()=>{},647:()=>{}},o={};function t(r){var a=o[r];if(void 0!==a)return a.exports;var n=o[r]={exports:{}};return e[r](n,n.exports,t),n.exports}t.m=e,r=[],t.O=(e,o,a,n)=>{if(!o){var i=1/0;for(f=0;f<r.length;f++){for(var[o,a,n]=r[f],p=!0,v=0;v<o.length;v++)(!1&n||i>=n)&&Object.keys(t.O).every((r=>t.O[r](o[v])))?o.splice(v--,1):(p=!1,n<i&&(i=n));if(p){r.splice(f--,1);var s=a();void 0!==s&&(e=s)}}return e}n=n||0;for(var f=r.length;f>0&&r[f-1][2]>n;f--)r[f]=r[f-1];r[f]=[o,a,n]},t.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),(()=>{var r={780:0,564:0};t.O.j=e=>0===r[e];var e=(e,o)=>{var a,n,[i,p,v]=o,s=0;if(i.some((e=>0!==r[e]))){for(a in p)t.o(p,a)&&(t.m[a]=p[a]);if(v)var f=v(t)}for(e&&e(o);s<i.length;s++)n=i[s],t.o(r,n)&&r[n]&&r[n][0](),r[n]=0;return t.O(f)},o=self.webpackChunkapp=self.webpackChunkapp||[];o.forEach(e.bind(null,0)),o.push=e.bind(null,o.push.bind(o))})(),t.O(void 0,[564],(()=>t(647)));var a=t.O(void 0,[564],(()=>t(497)));a=t.O(a)})();
|
/******/ (() => { // webpackBootstrap
|
||||||
|
/******/ "use strict";
|
||||||
|
/******/ var __webpack_modules__ = ({
|
||||||
|
|
||||||
|
/***/ 497:
|
||||||
|
/***/ (() => {
|
||||||
|
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 647:
|
||||||
|
/***/ (() => {
|
||||||
|
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var __webpack_module_cache__ = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||||
|
/******/ if (cachedModule !== undefined) {
|
||||||
|
/******/ return cachedModule.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||||
|
/******/ // no module.id needed
|
||||||
|
/******/ // no module.loaded needed
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = __webpack_modules__;
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ /* webpack/runtime/chunk loaded */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ var deferred = [];
|
||||||
|
/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
|
||||||
|
/******/ if(chunkIds) {
|
||||||
|
/******/ priority = priority || 0;
|
||||||
|
/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
|
||||||
|
/******/ deferred[i] = [chunkIds, fn, priority];
|
||||||
|
/******/ return;
|
||||||
|
/******/ }
|
||||||
|
/******/ var notFulfilled = Infinity;
|
||||||
|
/******/ for (var i = 0; i < deferred.length; i++) {
|
||||||
|
/******/ var [chunkIds, fn, priority] = deferred[i];
|
||||||
|
/******/ var fulfilled = true;
|
||||||
|
/******/ for (var j = 0; j < chunkIds.length; j++) {
|
||||||
|
/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
|
||||||
|
/******/ chunkIds.splice(j--, 1);
|
||||||
|
/******/ } else {
|
||||||
|
/******/ fulfilled = false;
|
||||||
|
/******/ if(priority < notFulfilled) notFulfilled = priority;
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(fulfilled) {
|
||||||
|
/******/ deferred.splice(i--, 1)
|
||||||
|
/******/ var r = fn();
|
||||||
|
/******/ if (r !== undefined) result = r;
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ return result;
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/jsonp chunk loading */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // no baseURI
|
||||||
|
/******/
|
||||||
|
/******/ // object to store loaded and loading chunks
|
||||||
|
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
||||||
|
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
||||||
|
/******/ var installedChunks = {
|
||||||
|
/******/ 780: 0,
|
||||||
|
/******/ 564: 0
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // no chunk on demand loading
|
||||||
|
/******/
|
||||||
|
/******/ // no prefetching
|
||||||
|
/******/
|
||||||
|
/******/ // no preloaded
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR manifest
|
||||||
|
/******/
|
||||||
|
/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
|
||||||
|
/******/
|
||||||
|
/******/ // install a JSONP callback for chunk loading
|
||||||
|
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
||||||
|
/******/ var [chunkIds, moreModules, runtime] = data;
|
||||||
|
/******/ // add "moreModules" to the modules object,
|
||||||
|
/******/ // then flag all "chunkIds" as loaded and fire callback
|
||||||
|
/******/ var moduleId, chunkId, i = 0;
|
||||||
|
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
||||||
|
/******/ for(moduleId in moreModules) {
|
||||||
|
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
||||||
|
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(runtime) var result = runtime(__webpack_require__);
|
||||||
|
/******/ }
|
||||||
|
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
||||||
|
/******/ for(;i < chunkIds.length; i++) {
|
||||||
|
/******/ chunkId = chunkIds[i];
|
||||||
|
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
||||||
|
/******/ installedChunks[chunkId][0]();
|
||||||
|
/******/ }
|
||||||
|
/******/ installedChunks[chunkId] = 0;
|
||||||
|
/******/ }
|
||||||
|
/******/ return __webpack_require__.O(result);
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/ var chunkLoadingGlobal = self["webpackChunkapp"] = self["webpackChunkapp"] || [];
|
||||||
|
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
||||||
|
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/
|
||||||
|
/******/ // startup
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ // This entry module depends on other loaded chunks and execution need to be delayed
|
||||||
|
/******/ __webpack_require__.O(undefined, [564], () => (__webpack_require__(647)))
|
||||||
|
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, [564], () => (__webpack_require__(497)))
|
||||||
|
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
||||||
|
/******/
|
||||||
|
/******/ })()
|
||||||
|
;
|
||||||
|
//# sourceMappingURL=core_admin_home.bundle.js.map
|
||||||
154
static/dist/js/core_contact.bundle.js
vendored
154
static/dist/js/core_contact.bundle.js
vendored
@@ -1 +1,153 @@
|
|||||||
(()=>{"use strict";var r,e={206:()=>{},647:()=>{}},o={};function t(r){var a=o[r];if(void 0!==a)return a.exports;var n=o[r]={exports:{}};return e[r](n,n.exports,t),n.exports}t.m=e,r=[],t.O=(e,o,a,n)=>{if(!o){var i=1/0;for(f=0;f<r.length;f++){for(var[o,a,n]=r[f],p=!0,v=0;v<o.length;v++)(!1&n||i>=n)&&Object.keys(t.O).every((r=>t.O[r](o[v])))?o.splice(v--,1):(p=!1,n<i&&(i=n));if(p){r.splice(f--,1);var s=a();void 0!==s&&(e=s)}}return e}n=n||0;for(var f=r.length;f>0&&r[f-1][2]>n;f--)r[f]=r[f-1];r[f]=[o,a,n]},t.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),(()=>{var r={775:0,564:0};t.O.j=e=>0===r[e];var e=(e,o)=>{var a,n,[i,p,v]=o,s=0;if(i.some((e=>0!==r[e]))){for(a in p)t.o(p,a)&&(t.m[a]=p[a]);if(v)var f=v(t)}for(e&&e(o);s<i.length;s++)n=i[s],t.o(r,n)&&r[n]&&r[n][0](),r[n]=0;return t.O(f)},o=self.webpackChunkapp=self.webpackChunkapp||[];o.forEach(e.bind(null,0)),o.push=e.bind(null,o.push.bind(o))})(),t.O(void 0,[564],(()=>t(647)));var a=t.O(void 0,[564],(()=>t(206)));a=t.O(a)})();
|
/******/ (() => { // webpackBootstrap
|
||||||
|
/******/ "use strict";
|
||||||
|
/******/ var __webpack_modules__ = ({
|
||||||
|
|
||||||
|
/***/ 206:
|
||||||
|
/***/ (() => {
|
||||||
|
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 647:
|
||||||
|
/***/ (() => {
|
||||||
|
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var __webpack_module_cache__ = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||||
|
/******/ if (cachedModule !== undefined) {
|
||||||
|
/******/ return cachedModule.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||||
|
/******/ // no module.id needed
|
||||||
|
/******/ // no module.loaded needed
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = __webpack_modules__;
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ /* webpack/runtime/chunk loaded */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ var deferred = [];
|
||||||
|
/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
|
||||||
|
/******/ if(chunkIds) {
|
||||||
|
/******/ priority = priority || 0;
|
||||||
|
/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
|
||||||
|
/******/ deferred[i] = [chunkIds, fn, priority];
|
||||||
|
/******/ return;
|
||||||
|
/******/ }
|
||||||
|
/******/ var notFulfilled = Infinity;
|
||||||
|
/******/ for (var i = 0; i < deferred.length; i++) {
|
||||||
|
/******/ var [chunkIds, fn, priority] = deferred[i];
|
||||||
|
/******/ var fulfilled = true;
|
||||||
|
/******/ for (var j = 0; j < chunkIds.length; j++) {
|
||||||
|
/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
|
||||||
|
/******/ chunkIds.splice(j--, 1);
|
||||||
|
/******/ } else {
|
||||||
|
/******/ fulfilled = false;
|
||||||
|
/******/ if(priority < notFulfilled) notFulfilled = priority;
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(fulfilled) {
|
||||||
|
/******/ deferred.splice(i--, 1)
|
||||||
|
/******/ var r = fn();
|
||||||
|
/******/ if (r !== undefined) result = r;
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ return result;
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/jsonp chunk loading */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // no baseURI
|
||||||
|
/******/
|
||||||
|
/******/ // object to store loaded and loading chunks
|
||||||
|
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
||||||
|
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
||||||
|
/******/ var installedChunks = {
|
||||||
|
/******/ 775: 0,
|
||||||
|
/******/ 564: 0
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // no chunk on demand loading
|
||||||
|
/******/
|
||||||
|
/******/ // no prefetching
|
||||||
|
/******/
|
||||||
|
/******/ // no preloaded
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR manifest
|
||||||
|
/******/
|
||||||
|
/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
|
||||||
|
/******/
|
||||||
|
/******/ // install a JSONP callback for chunk loading
|
||||||
|
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
||||||
|
/******/ var [chunkIds, moreModules, runtime] = data;
|
||||||
|
/******/ // add "moreModules" to the modules object,
|
||||||
|
/******/ // then flag all "chunkIds" as loaded and fire callback
|
||||||
|
/******/ var moduleId, chunkId, i = 0;
|
||||||
|
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
||||||
|
/******/ for(moduleId in moreModules) {
|
||||||
|
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
||||||
|
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(runtime) var result = runtime(__webpack_require__);
|
||||||
|
/******/ }
|
||||||
|
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
||||||
|
/******/ for(;i < chunkIds.length; i++) {
|
||||||
|
/******/ chunkId = chunkIds[i];
|
||||||
|
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
||||||
|
/******/ installedChunks[chunkId][0]();
|
||||||
|
/******/ }
|
||||||
|
/******/ installedChunks[chunkId] = 0;
|
||||||
|
/******/ }
|
||||||
|
/******/ return __webpack_require__.O(result);
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/ var chunkLoadingGlobal = self["webpackChunkapp"] = self["webpackChunkapp"] || [];
|
||||||
|
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
||||||
|
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/
|
||||||
|
/******/ // startup
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ // This entry module depends on other loaded chunks and execution need to be delayed
|
||||||
|
/******/ __webpack_require__.O(undefined, [564], () => (__webpack_require__(647)))
|
||||||
|
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, [564], () => (__webpack_require__(206)))
|
||||||
|
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
||||||
|
/******/
|
||||||
|
/******/ })()
|
||||||
|
;
|
||||||
|
//# sourceMappingURL=core_contact.bundle.js.map
|
||||||
154
static/dist/js/core_home.bundle.js
vendored
154
static/dist/js/core_home.bundle.js
vendored
@@ -1 +1,153 @@
|
|||||||
(()=>{"use strict";var r,e={469:()=>{},647:()=>{}},o={};function t(r){var a=o[r];if(void 0!==a)return a.exports;var n=o[r]={exports:{}};return e[r](n,n.exports,t),n.exports}t.m=e,r=[],t.O=(e,o,a,n)=>{if(!o){var i=1/0;for(f=0;f<r.length;f++){for(var[o,a,n]=r[f],p=!0,v=0;v<o.length;v++)(!1&n||i>=n)&&Object.keys(t.O).every((r=>t.O[r](o[v])))?o.splice(v--,1):(p=!1,n<i&&(i=n));if(p){r.splice(f--,1);var s=a();void 0!==s&&(e=s)}}return e}n=n||0;for(var f=r.length;f>0&&r[f-1][2]>n;f--)r[f]=r[f-1];r[f]=[o,a,n]},t.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),(()=>{var r={664:0,564:0};t.O.j=e=>0===r[e];var e=(e,o)=>{var a,n,[i,p,v]=o,s=0;if(i.some((e=>0!==r[e]))){for(a in p)t.o(p,a)&&(t.m[a]=p[a]);if(v)var f=v(t)}for(e&&e(o);s<i.length;s++)n=i[s],t.o(r,n)&&r[n]&&r[n][0](),r[n]=0;return t.O(f)},o=self.webpackChunkapp=self.webpackChunkapp||[];o.forEach(e.bind(null,0)),o.push=e.bind(null,o.push.bind(o))})(),t.O(void 0,[564],(()=>t(647)));var a=t.O(void 0,[564],(()=>t(469)));a=t.O(a)})();
|
/******/ (() => { // webpackBootstrap
|
||||||
|
/******/ "use strict";
|
||||||
|
/******/ var __webpack_modules__ = ({
|
||||||
|
|
||||||
|
/***/ 469:
|
||||||
|
/***/ (() => {
|
||||||
|
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 647:
|
||||||
|
/***/ (() => {
|
||||||
|
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var __webpack_module_cache__ = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||||
|
/******/ if (cachedModule !== undefined) {
|
||||||
|
/******/ return cachedModule.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||||
|
/******/ // no module.id needed
|
||||||
|
/******/ // no module.loaded needed
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = __webpack_modules__;
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ /* webpack/runtime/chunk loaded */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ var deferred = [];
|
||||||
|
/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
|
||||||
|
/******/ if(chunkIds) {
|
||||||
|
/******/ priority = priority || 0;
|
||||||
|
/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
|
||||||
|
/******/ deferred[i] = [chunkIds, fn, priority];
|
||||||
|
/******/ return;
|
||||||
|
/******/ }
|
||||||
|
/******/ var notFulfilled = Infinity;
|
||||||
|
/******/ for (var i = 0; i < deferred.length; i++) {
|
||||||
|
/******/ var [chunkIds, fn, priority] = deferred[i];
|
||||||
|
/******/ var fulfilled = true;
|
||||||
|
/******/ for (var j = 0; j < chunkIds.length; j++) {
|
||||||
|
/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
|
||||||
|
/******/ chunkIds.splice(j--, 1);
|
||||||
|
/******/ } else {
|
||||||
|
/******/ fulfilled = false;
|
||||||
|
/******/ if(priority < notFulfilled) notFulfilled = priority;
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(fulfilled) {
|
||||||
|
/******/ deferred.splice(i--, 1)
|
||||||
|
/******/ var r = fn();
|
||||||
|
/******/ if (r !== undefined) result = r;
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ return result;
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/jsonp chunk loading */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // no baseURI
|
||||||
|
/******/
|
||||||
|
/******/ // object to store loaded and loading chunks
|
||||||
|
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
||||||
|
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
||||||
|
/******/ var installedChunks = {
|
||||||
|
/******/ 664: 0,
|
||||||
|
/******/ 564: 0
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // no chunk on demand loading
|
||||||
|
/******/
|
||||||
|
/******/ // no prefetching
|
||||||
|
/******/
|
||||||
|
/******/ // no preloaded
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR manifest
|
||||||
|
/******/
|
||||||
|
/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
|
||||||
|
/******/
|
||||||
|
/******/ // install a JSONP callback for chunk loading
|
||||||
|
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
||||||
|
/******/ var [chunkIds, moreModules, runtime] = data;
|
||||||
|
/******/ // add "moreModules" to the modules object,
|
||||||
|
/******/ // then flag all "chunkIds" as loaded and fire callback
|
||||||
|
/******/ var moduleId, chunkId, i = 0;
|
||||||
|
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
||||||
|
/******/ for(moduleId in moreModules) {
|
||||||
|
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
||||||
|
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(runtime) var result = runtime(__webpack_require__);
|
||||||
|
/******/ }
|
||||||
|
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
||||||
|
/******/ for(;i < chunkIds.length; i++) {
|
||||||
|
/******/ chunkId = chunkIds[i];
|
||||||
|
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
||||||
|
/******/ installedChunks[chunkId][0]();
|
||||||
|
/******/ }
|
||||||
|
/******/ installedChunks[chunkId] = 0;
|
||||||
|
/******/ }
|
||||||
|
/******/ return __webpack_require__.O(result);
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/ var chunkLoadingGlobal = self["webpackChunkapp"] = self["webpackChunkapp"] || [];
|
||||||
|
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
||||||
|
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/
|
||||||
|
/******/ // startup
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ // This entry module depends on other loaded chunks and execution need to be delayed
|
||||||
|
/******/ __webpack_require__.O(undefined, [564], () => (__webpack_require__(647)))
|
||||||
|
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, [564], () => (__webpack_require__(469)))
|
||||||
|
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
||||||
|
/******/
|
||||||
|
/******/ })()
|
||||||
|
;
|
||||||
|
//# sourceMappingURL=core_home.bundle.js.map
|
||||||
154
static/dist/js/core_services.bundle.js
vendored
154
static/dist/js/core_services.bundle.js
vendored
@@ -1 +1,153 @@
|
|||||||
(()=>{"use strict";var r,e={396:()=>{},647:()=>{}},o={};function t(r){var a=o[r];if(void 0!==a)return a.exports;var n=o[r]={exports:{}};return e[r](n,n.exports,t),n.exports}t.m=e,r=[],t.O=(e,o,a,n)=>{if(!o){var i=1/0;for(f=0;f<r.length;f++){for(var[o,a,n]=r[f],p=!0,v=0;v<o.length;v++)(!1&n||i>=n)&&Object.keys(t.O).every((r=>t.O[r](o[v])))?o.splice(v--,1):(p=!1,n<i&&(i=n));if(p){r.splice(f--,1);var s=a();void 0!==s&&(e=s)}}return e}n=n||0;for(var f=r.length;f>0&&r[f-1][2]>n;f--)r[f]=r[f-1];r[f]=[o,a,n]},t.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),(()=>{var r={405:0,564:0};t.O.j=e=>0===r[e];var e=(e,o)=>{var a,n,[i,p,v]=o,s=0;if(i.some((e=>0!==r[e]))){for(a in p)t.o(p,a)&&(t.m[a]=p[a]);if(v)var f=v(t)}for(e&&e(o);s<i.length;s++)n=i[s],t.o(r,n)&&r[n]&&r[n][0](),r[n]=0;return t.O(f)},o=self.webpackChunkapp=self.webpackChunkapp||[];o.forEach(e.bind(null,0)),o.push=e.bind(null,o.push.bind(o))})(),t.O(void 0,[564],(()=>t(647)));var a=t.O(void 0,[564],(()=>t(396)));a=t.O(a)})();
|
/******/ (() => { // webpackBootstrap
|
||||||
|
/******/ "use strict";
|
||||||
|
/******/ var __webpack_modules__ = ({
|
||||||
|
|
||||||
|
/***/ 396:
|
||||||
|
/***/ (() => {
|
||||||
|
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 647:
|
||||||
|
/***/ (() => {
|
||||||
|
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var __webpack_module_cache__ = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||||
|
/******/ if (cachedModule !== undefined) {
|
||||||
|
/******/ return cachedModule.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||||
|
/******/ // no module.id needed
|
||||||
|
/******/ // no module.loaded needed
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = __webpack_modules__;
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ /* webpack/runtime/chunk loaded */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ var deferred = [];
|
||||||
|
/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
|
||||||
|
/******/ if(chunkIds) {
|
||||||
|
/******/ priority = priority || 0;
|
||||||
|
/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
|
||||||
|
/******/ deferred[i] = [chunkIds, fn, priority];
|
||||||
|
/******/ return;
|
||||||
|
/******/ }
|
||||||
|
/******/ var notFulfilled = Infinity;
|
||||||
|
/******/ for (var i = 0; i < deferred.length; i++) {
|
||||||
|
/******/ var [chunkIds, fn, priority] = deferred[i];
|
||||||
|
/******/ var fulfilled = true;
|
||||||
|
/******/ for (var j = 0; j < chunkIds.length; j++) {
|
||||||
|
/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
|
||||||
|
/******/ chunkIds.splice(j--, 1);
|
||||||
|
/******/ } else {
|
||||||
|
/******/ fulfilled = false;
|
||||||
|
/******/ if(priority < notFulfilled) notFulfilled = priority;
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(fulfilled) {
|
||||||
|
/******/ deferred.splice(i--, 1)
|
||||||
|
/******/ var r = fn();
|
||||||
|
/******/ if (r !== undefined) result = r;
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ return result;
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/jsonp chunk loading */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // no baseURI
|
||||||
|
/******/
|
||||||
|
/******/ // object to store loaded and loading chunks
|
||||||
|
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
||||||
|
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
||||||
|
/******/ var installedChunks = {
|
||||||
|
/******/ 405: 0,
|
||||||
|
/******/ 564: 0
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // no chunk on demand loading
|
||||||
|
/******/
|
||||||
|
/******/ // no prefetching
|
||||||
|
/******/
|
||||||
|
/******/ // no preloaded
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR manifest
|
||||||
|
/******/
|
||||||
|
/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
|
||||||
|
/******/
|
||||||
|
/******/ // install a JSONP callback for chunk loading
|
||||||
|
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
||||||
|
/******/ var [chunkIds, moreModules, runtime] = data;
|
||||||
|
/******/ // add "moreModules" to the modules object,
|
||||||
|
/******/ // then flag all "chunkIds" as loaded and fire callback
|
||||||
|
/******/ var moduleId, chunkId, i = 0;
|
||||||
|
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
||||||
|
/******/ for(moduleId in moreModules) {
|
||||||
|
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
||||||
|
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(runtime) var result = runtime(__webpack_require__);
|
||||||
|
/******/ }
|
||||||
|
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
||||||
|
/******/ for(;i < chunkIds.length; i++) {
|
||||||
|
/******/ chunkId = chunkIds[i];
|
||||||
|
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
||||||
|
/******/ installedChunks[chunkId][0]();
|
||||||
|
/******/ }
|
||||||
|
/******/ installedChunks[chunkId] = 0;
|
||||||
|
/******/ }
|
||||||
|
/******/ return __webpack_require__.O(result);
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/ var chunkLoadingGlobal = self["webpackChunkapp"] = self["webpackChunkapp"] || [];
|
||||||
|
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
||||||
|
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/
|
||||||
|
/******/ // startup
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ // This entry module depends on other loaded chunks and execution need to be delayed
|
||||||
|
/******/ __webpack_require__.O(undefined, [564], () => (__webpack_require__(647)))
|
||||||
|
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, [564], () => (__webpack_require__(396)))
|
||||||
|
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
||||||
|
/******/
|
||||||
|
/******/ })()
|
||||||
|
;
|
||||||
|
//# sourceMappingURL=core_services.bundle.js.map
|
||||||
@@ -1 +1,153 @@
|
|||||||
(()=>{"use strict";var r,e={132:()=>{},807:()=>{}},o={};function t(r){var a=o[r];if(void 0!==a)return a.exports;var n=o[r]={exports:{}};return e[r](n,n.exports,t),n.exports}t.m=e,r=[],t.O=(e,o,a,n)=>{if(!o){var i=1/0;for(f=0;f<r.length;f++){for(var[o,a,n]=r[f],p=!0,v=0;v<o.length;v++)(!1&n||i>=n)&&Object.keys(t.O).every((r=>t.O[r](o[v])))?o.splice(v--,1):(p=!1,n<i&&(i=n));if(p){r.splice(f--,1);var s=a();void 0!==s&&(e=s)}}return e}n=n||0;for(var f=r.length;f>0&&r[f-1][2]>n;f--)r[f]=r[f-1];r[f]=[o,a,n]},t.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),(()=>{var r={841:0,830:0};t.O.j=e=>0===r[e];var e=(e,o)=>{var a,n,[i,p,v]=o,s=0;if(i.some((e=>0!==r[e]))){for(a in p)t.o(p,a)&&(t.m[a]=p[a]);if(v)var f=v(t)}for(e&&e(o);s<i.length;s++)n=i[s],t.o(r,n)&&r[n]&&r[n][0](),r[n]=0;return t.O(f)},o=self.webpackChunkapp=self.webpackChunkapp||[];o.forEach(e.bind(null,0)),o.push=e.bind(null,o.push.bind(o))})(),t.O(void 0,[830],(()=>t(807)));var a=t.O(void 0,[830],(()=>t(132)));a=t.O(a)})();
|
/******/ (() => { // webpackBootstrap
|
||||||
|
/******/ "use strict";
|
||||||
|
/******/ var __webpack_modules__ = ({
|
||||||
|
|
||||||
|
/***/ 132:
|
||||||
|
/***/ (() => {
|
||||||
|
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 807:
|
||||||
|
/***/ (() => {
|
||||||
|
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var __webpack_module_cache__ = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||||
|
/******/ if (cachedModule !== undefined) {
|
||||||
|
/******/ return cachedModule.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||||
|
/******/ // no module.id needed
|
||||||
|
/******/ // no module.loaded needed
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = __webpack_modules__;
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ /* webpack/runtime/chunk loaded */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ var deferred = [];
|
||||||
|
/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
|
||||||
|
/******/ if(chunkIds) {
|
||||||
|
/******/ priority = priority || 0;
|
||||||
|
/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
|
||||||
|
/******/ deferred[i] = [chunkIds, fn, priority];
|
||||||
|
/******/ return;
|
||||||
|
/******/ }
|
||||||
|
/******/ var notFulfilled = Infinity;
|
||||||
|
/******/ for (var i = 0; i < deferred.length; i++) {
|
||||||
|
/******/ var [chunkIds, fn, priority] = deferred[i];
|
||||||
|
/******/ var fulfilled = true;
|
||||||
|
/******/ for (var j = 0; j < chunkIds.length; j++) {
|
||||||
|
/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
|
||||||
|
/******/ chunkIds.splice(j--, 1);
|
||||||
|
/******/ } else {
|
||||||
|
/******/ fulfilled = false;
|
||||||
|
/******/ if(priority < notFulfilled) notFulfilled = priority;
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(fulfilled) {
|
||||||
|
/******/ deferred.splice(i--, 1)
|
||||||
|
/******/ var r = fn();
|
||||||
|
/******/ if (r !== undefined) result = r;
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ return result;
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/jsonp chunk loading */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // no baseURI
|
||||||
|
/******/
|
||||||
|
/******/ // object to store loaded and loading chunks
|
||||||
|
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
||||||
|
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
||||||
|
/******/ var installedChunks = {
|
||||||
|
/******/ 841: 0,
|
||||||
|
/******/ 830: 0
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // no chunk on demand loading
|
||||||
|
/******/
|
||||||
|
/******/ // no prefetching
|
||||||
|
/******/
|
||||||
|
/******/ // no preloaded
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR manifest
|
||||||
|
/******/
|
||||||
|
/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
|
||||||
|
/******/
|
||||||
|
/******/ // install a JSONP callback for chunk loading
|
||||||
|
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
||||||
|
/******/ var [chunkIds, moreModules, runtime] = data;
|
||||||
|
/******/ // add "moreModules" to the modules object,
|
||||||
|
/******/ // then flag all "chunkIds" as loaded and fire callback
|
||||||
|
/******/ var moduleId, chunkId, i = 0;
|
||||||
|
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
||||||
|
/******/ for(moduleId in moreModules) {
|
||||||
|
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
||||||
|
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(runtime) var result = runtime(__webpack_require__);
|
||||||
|
/******/ }
|
||||||
|
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
||||||
|
/******/ for(;i < chunkIds.length; i++) {
|
||||||
|
/******/ chunkId = chunkIds[i];
|
||||||
|
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
||||||
|
/******/ installedChunks[chunkId][0]();
|
||||||
|
/******/ }
|
||||||
|
/******/ installedChunks[chunkId] = 0;
|
||||||
|
/******/ }
|
||||||
|
/******/ return __webpack_require__.O(result);
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/ var chunkLoadingGlobal = self["webpackChunkapp"] = self["webpackChunkapp"] || [];
|
||||||
|
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
||||||
|
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/
|
||||||
|
/******/ // startup
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ // This entry module depends on other loaded chunks and execution need to be delayed
|
||||||
|
/******/ __webpack_require__.O(undefined, [830], () => (__webpack_require__(807)))
|
||||||
|
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, [830], () => (__webpack_require__(132)))
|
||||||
|
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
||||||
|
/******/
|
||||||
|
/******/ })()
|
||||||
|
;
|
||||||
|
//# sourceMappingURL=legal_accessibility_statement.bundle.js.map
|
||||||
154
static/dist/js/legal_license.bundle.js
vendored
154
static/dist/js/legal_license.bundle.js
vendored
@@ -1 +1,153 @@
|
|||||||
(()=>{"use strict";var r,e={527:()=>{},807:()=>{}},o={};function t(r){var a=o[r];if(void 0!==a)return a.exports;var n=o[r]={exports:{}};return e[r](n,n.exports,t),n.exports}t.m=e,r=[],t.O=(e,o,a,n)=>{if(!o){var i=1/0;for(f=0;f<r.length;f++){for(var[o,a,n]=r[f],p=!0,v=0;v<o.length;v++)(!1&n||i>=n)&&Object.keys(t.O).every((r=>t.O[r](o[v])))?o.splice(v--,1):(p=!1,n<i&&(i=n));if(p){r.splice(f--,1);var s=a();void 0!==s&&(e=s)}}return e}n=n||0;for(var f=r.length;f>0&&r[f-1][2]>n;f--)r[f]=r[f-1];r[f]=[o,a,n]},t.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),(()=>{var r={690:0,830:0};t.O.j=e=>0===r[e];var e=(e,o)=>{var a,n,[i,p,v]=o,s=0;if(i.some((e=>0!==r[e]))){for(a in p)t.o(p,a)&&(t.m[a]=p[a]);if(v)var f=v(t)}for(e&&e(o);s<i.length;s++)n=i[s],t.o(r,n)&&r[n]&&r[n][0](),r[n]=0;return t.O(f)},o=self.webpackChunkapp=self.webpackChunkapp||[];o.forEach(e.bind(null,0)),o.push=e.bind(null,o.push.bind(o))})(),t.O(void 0,[830],(()=>t(807)));var a=t.O(void 0,[830],(()=>t(527)));a=t.O(a)})();
|
/******/ (() => { // webpackBootstrap
|
||||||
|
/******/ "use strict";
|
||||||
|
/******/ var __webpack_modules__ = ({
|
||||||
|
|
||||||
|
/***/ 527:
|
||||||
|
/***/ (() => {
|
||||||
|
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 807:
|
||||||
|
/***/ (() => {
|
||||||
|
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var __webpack_module_cache__ = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||||
|
/******/ if (cachedModule !== undefined) {
|
||||||
|
/******/ return cachedModule.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||||
|
/******/ // no module.id needed
|
||||||
|
/******/ // no module.loaded needed
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = __webpack_modules__;
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ /* webpack/runtime/chunk loaded */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ var deferred = [];
|
||||||
|
/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
|
||||||
|
/******/ if(chunkIds) {
|
||||||
|
/******/ priority = priority || 0;
|
||||||
|
/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
|
||||||
|
/******/ deferred[i] = [chunkIds, fn, priority];
|
||||||
|
/******/ return;
|
||||||
|
/******/ }
|
||||||
|
/******/ var notFulfilled = Infinity;
|
||||||
|
/******/ for (var i = 0; i < deferred.length; i++) {
|
||||||
|
/******/ var [chunkIds, fn, priority] = deferred[i];
|
||||||
|
/******/ var fulfilled = true;
|
||||||
|
/******/ for (var j = 0; j < chunkIds.length; j++) {
|
||||||
|
/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
|
||||||
|
/******/ chunkIds.splice(j--, 1);
|
||||||
|
/******/ } else {
|
||||||
|
/******/ fulfilled = false;
|
||||||
|
/******/ if(priority < notFulfilled) notFulfilled = priority;
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(fulfilled) {
|
||||||
|
/******/ deferred.splice(i--, 1)
|
||||||
|
/******/ var r = fn();
|
||||||
|
/******/ if (r !== undefined) result = r;
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ return result;
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/jsonp chunk loading */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // no baseURI
|
||||||
|
/******/
|
||||||
|
/******/ // object to store loaded and loading chunks
|
||||||
|
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
||||||
|
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
||||||
|
/******/ var installedChunks = {
|
||||||
|
/******/ 690: 0,
|
||||||
|
/******/ 830: 0
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // no chunk on demand loading
|
||||||
|
/******/
|
||||||
|
/******/ // no prefetching
|
||||||
|
/******/
|
||||||
|
/******/ // no preloaded
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR manifest
|
||||||
|
/******/
|
||||||
|
/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
|
||||||
|
/******/
|
||||||
|
/******/ // install a JSONP callback for chunk loading
|
||||||
|
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
||||||
|
/******/ var [chunkIds, moreModules, runtime] = data;
|
||||||
|
/******/ // add "moreModules" to the modules object,
|
||||||
|
/******/ // then flag all "chunkIds" as loaded and fire callback
|
||||||
|
/******/ var moduleId, chunkId, i = 0;
|
||||||
|
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
||||||
|
/******/ for(moduleId in moreModules) {
|
||||||
|
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
||||||
|
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(runtime) var result = runtime(__webpack_require__);
|
||||||
|
/******/ }
|
||||||
|
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
||||||
|
/******/ for(;i < chunkIds.length; i++) {
|
||||||
|
/******/ chunkId = chunkIds[i];
|
||||||
|
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
||||||
|
/******/ installedChunks[chunkId][0]();
|
||||||
|
/******/ }
|
||||||
|
/******/ installedChunks[chunkId] = 0;
|
||||||
|
/******/ }
|
||||||
|
/******/ return __webpack_require__.O(result);
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/ var chunkLoadingGlobal = self["webpackChunkapp"] = self["webpackChunkapp"] || [];
|
||||||
|
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
||||||
|
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/
|
||||||
|
/******/ // startup
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ // This entry module depends on other loaded chunks and execution need to be delayed
|
||||||
|
/******/ __webpack_require__.O(undefined, [830], () => (__webpack_require__(807)))
|
||||||
|
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, [830], () => (__webpack_require__(527)))
|
||||||
|
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
||||||
|
/******/
|
||||||
|
/******/ })()
|
||||||
|
;
|
||||||
|
//# sourceMappingURL=legal_license.bundle.js.map
|
||||||
154
static/dist/js/legal_privacy_policy.bundle.js
vendored
154
static/dist/js/legal_privacy_policy.bundle.js
vendored
@@ -1 +1,153 @@
|
|||||||
(()=>{"use strict";var r,e={649:()=>{},807:()=>{}},o={};function t(r){var a=o[r];if(void 0!==a)return a.exports;var n=o[r]={exports:{}};return e[r](n,n.exports,t),n.exports}t.m=e,r=[],t.O=(e,o,a,n)=>{if(!o){var i=1/0;for(f=0;f<r.length;f++){for(var[o,a,n]=r[f],p=!0,v=0;v<o.length;v++)(!1&n||i>=n)&&Object.keys(t.O).every((r=>t.O[r](o[v])))?o.splice(v--,1):(p=!1,n<i&&(i=n));if(p){r.splice(f--,1);var s=a();void 0!==s&&(e=s)}}return e}n=n||0;for(var f=r.length;f>0&&r[f-1][2]>n;f--)r[f]=r[f-1];r[f]=[o,a,n]},t.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),(()=>{var r={364:0,830:0};t.O.j=e=>0===r[e];var e=(e,o)=>{var a,n,[i,p,v]=o,s=0;if(i.some((e=>0!==r[e]))){for(a in p)t.o(p,a)&&(t.m[a]=p[a]);if(v)var f=v(t)}for(e&&e(o);s<i.length;s++)n=i[s],t.o(r,n)&&r[n]&&r[n][0](),r[n]=0;return t.O(f)},o=self.webpackChunkapp=self.webpackChunkapp||[];o.forEach(e.bind(null,0)),o.push=e.bind(null,o.push.bind(o))})(),t.O(void 0,[830],(()=>t(807)));var a=t.O(void 0,[830],(()=>t(649)));a=t.O(a)})();
|
/******/ (() => { // webpackBootstrap
|
||||||
|
/******/ "use strict";
|
||||||
|
/******/ var __webpack_modules__ = ({
|
||||||
|
|
||||||
|
/***/ 649:
|
||||||
|
/***/ (() => {
|
||||||
|
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 807:
|
||||||
|
/***/ (() => {
|
||||||
|
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var __webpack_module_cache__ = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||||
|
/******/ if (cachedModule !== undefined) {
|
||||||
|
/******/ return cachedModule.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||||
|
/******/ // no module.id needed
|
||||||
|
/******/ // no module.loaded needed
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = __webpack_modules__;
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ /* webpack/runtime/chunk loaded */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ var deferred = [];
|
||||||
|
/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
|
||||||
|
/******/ if(chunkIds) {
|
||||||
|
/******/ priority = priority || 0;
|
||||||
|
/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
|
||||||
|
/******/ deferred[i] = [chunkIds, fn, priority];
|
||||||
|
/******/ return;
|
||||||
|
/******/ }
|
||||||
|
/******/ var notFulfilled = Infinity;
|
||||||
|
/******/ for (var i = 0; i < deferred.length; i++) {
|
||||||
|
/******/ var [chunkIds, fn, priority] = deferred[i];
|
||||||
|
/******/ var fulfilled = true;
|
||||||
|
/******/ for (var j = 0; j < chunkIds.length; j++) {
|
||||||
|
/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
|
||||||
|
/******/ chunkIds.splice(j--, 1);
|
||||||
|
/******/ } else {
|
||||||
|
/******/ fulfilled = false;
|
||||||
|
/******/ if(priority < notFulfilled) notFulfilled = priority;
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(fulfilled) {
|
||||||
|
/******/ deferred.splice(i--, 1)
|
||||||
|
/******/ var r = fn();
|
||||||
|
/******/ if (r !== undefined) result = r;
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ return result;
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/jsonp chunk loading */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // no baseURI
|
||||||
|
/******/
|
||||||
|
/******/ // object to store loaded and loading chunks
|
||||||
|
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
||||||
|
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
||||||
|
/******/ var installedChunks = {
|
||||||
|
/******/ 364: 0,
|
||||||
|
/******/ 830: 0
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // no chunk on demand loading
|
||||||
|
/******/
|
||||||
|
/******/ // no prefetching
|
||||||
|
/******/
|
||||||
|
/******/ // no preloaded
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR manifest
|
||||||
|
/******/
|
||||||
|
/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
|
||||||
|
/******/
|
||||||
|
/******/ // install a JSONP callback for chunk loading
|
||||||
|
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
||||||
|
/******/ var [chunkIds, moreModules, runtime] = data;
|
||||||
|
/******/ // add "moreModules" to the modules object,
|
||||||
|
/******/ // then flag all "chunkIds" as loaded and fire callback
|
||||||
|
/******/ var moduleId, chunkId, i = 0;
|
||||||
|
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
||||||
|
/******/ for(moduleId in moreModules) {
|
||||||
|
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
||||||
|
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(runtime) var result = runtime(__webpack_require__);
|
||||||
|
/******/ }
|
||||||
|
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
||||||
|
/******/ for(;i < chunkIds.length; i++) {
|
||||||
|
/******/ chunkId = chunkIds[i];
|
||||||
|
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
||||||
|
/******/ installedChunks[chunkId][0]();
|
||||||
|
/******/ }
|
||||||
|
/******/ installedChunks[chunkId] = 0;
|
||||||
|
/******/ }
|
||||||
|
/******/ return __webpack_require__.O(result);
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/ var chunkLoadingGlobal = self["webpackChunkapp"] = self["webpackChunkapp"] || [];
|
||||||
|
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
||||||
|
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/
|
||||||
|
/******/ // startup
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ // This entry module depends on other loaded chunks and execution need to be delayed
|
||||||
|
/******/ __webpack_require__.O(undefined, [830], () => (__webpack_require__(807)))
|
||||||
|
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, [830], () => (__webpack_require__(649)))
|
||||||
|
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
||||||
|
/******/
|
||||||
|
/******/ })()
|
||||||
|
;
|
||||||
|
//# sourceMappingURL=legal_privacy_policy.bundle.js.map
|
||||||
154
static/dist/js/legal_retention_schedule.bundle.js
vendored
154
static/dist/js/legal_retention_schedule.bundle.js
vendored
@@ -1 +1,153 @@
|
|||||||
(()=>{"use strict";var r,e={954:()=>{},807:()=>{}},o={};function t(r){var a=o[r];if(void 0!==a)return a.exports;var n=o[r]={exports:{}};return e[r](n,n.exports,t),n.exports}t.m=e,r=[],t.O=(e,o,a,n)=>{if(!o){var i=1/0;for(f=0;f<r.length;f++){for(var[o,a,n]=r[f],p=!0,v=0;v<o.length;v++)(!1&n||i>=n)&&Object.keys(t.O).every((r=>t.O[r](o[v])))?o.splice(v--,1):(p=!1,n<i&&(i=n));if(p){r.splice(f--,1);var s=a();void 0!==s&&(e=s)}}return e}n=n||0;for(var f=r.length;f>0&&r[f-1][2]>n;f--)r[f]=r[f-1];r[f]=[o,a,n]},t.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),(()=>{var r={607:0,830:0};t.O.j=e=>0===r[e];var e=(e,o)=>{var a,n,[i,p,v]=o,s=0;if(i.some((e=>0!==r[e]))){for(a in p)t.o(p,a)&&(t.m[a]=p[a]);if(v)var f=v(t)}for(e&&e(o);s<i.length;s++)n=i[s],t.o(r,n)&&r[n]&&r[n][0](),r[n]=0;return t.O(f)},o=self.webpackChunkapp=self.webpackChunkapp||[];o.forEach(e.bind(null,0)),o.push=e.bind(null,o.push.bind(o))})(),t.O(void 0,[830],(()=>t(807)));var a=t.O(void 0,[830],(()=>t(954)));a=t.O(a)})();
|
/******/ (() => { // webpackBootstrap
|
||||||
|
/******/ "use strict";
|
||||||
|
/******/ var __webpack_modules__ = ({
|
||||||
|
|
||||||
|
/***/ 954:
|
||||||
|
/***/ (() => {
|
||||||
|
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 807:
|
||||||
|
/***/ (() => {
|
||||||
|
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
/******/ });
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var __webpack_module_cache__ = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||||
|
/******/ if (cachedModule !== undefined) {
|
||||||
|
/******/ return cachedModule.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||||
|
/******/ // no module.id needed
|
||||||
|
/******/ // no module.loaded needed
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = __webpack_modules__;
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ /* webpack/runtime/chunk loaded */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ var deferred = [];
|
||||||
|
/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
|
||||||
|
/******/ if(chunkIds) {
|
||||||
|
/******/ priority = priority || 0;
|
||||||
|
/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
|
||||||
|
/******/ deferred[i] = [chunkIds, fn, priority];
|
||||||
|
/******/ return;
|
||||||
|
/******/ }
|
||||||
|
/******/ var notFulfilled = Infinity;
|
||||||
|
/******/ for (var i = 0; i < deferred.length; i++) {
|
||||||
|
/******/ var [chunkIds, fn, priority] = deferred[i];
|
||||||
|
/******/ var fulfilled = true;
|
||||||
|
/******/ for (var j = 0; j < chunkIds.length; j++) {
|
||||||
|
/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
|
||||||
|
/******/ chunkIds.splice(j--, 1);
|
||||||
|
/******/ } else {
|
||||||
|
/******/ fulfilled = false;
|
||||||
|
/******/ if(priority < notFulfilled) notFulfilled = priority;
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(fulfilled) {
|
||||||
|
/******/ deferred.splice(i--, 1)
|
||||||
|
/******/ var r = fn();
|
||||||
|
/******/ if (r !== undefined) result = r;
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ return result;
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/jsonp chunk loading */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // no baseURI
|
||||||
|
/******/
|
||||||
|
/******/ // object to store loaded and loading chunks
|
||||||
|
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
||||||
|
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
||||||
|
/******/ var installedChunks = {
|
||||||
|
/******/ 607: 0,
|
||||||
|
/******/ 830: 0
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // no chunk on demand loading
|
||||||
|
/******/
|
||||||
|
/******/ // no prefetching
|
||||||
|
/******/
|
||||||
|
/******/ // no preloaded
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR manifest
|
||||||
|
/******/
|
||||||
|
/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
|
||||||
|
/******/
|
||||||
|
/******/ // install a JSONP callback for chunk loading
|
||||||
|
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
||||||
|
/******/ var [chunkIds, moreModules, runtime] = data;
|
||||||
|
/******/ // add "moreModules" to the modules object,
|
||||||
|
/******/ // then flag all "chunkIds" as loaded and fire callback
|
||||||
|
/******/ var moduleId, chunkId, i = 0;
|
||||||
|
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
||||||
|
/******/ for(moduleId in moreModules) {
|
||||||
|
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
||||||
|
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(runtime) var result = runtime(__webpack_require__);
|
||||||
|
/******/ }
|
||||||
|
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
||||||
|
/******/ for(;i < chunkIds.length; i++) {
|
||||||
|
/******/ chunkId = chunkIds[i];
|
||||||
|
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
||||||
|
/******/ installedChunks[chunkId][0]();
|
||||||
|
/******/ }
|
||||||
|
/******/ installedChunks[chunkId] = 0;
|
||||||
|
/******/ }
|
||||||
|
/******/ return __webpack_require__.O(result);
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/ var chunkLoadingGlobal = self["webpackChunkapp"] = self["webpackChunkapp"] || [];
|
||||||
|
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
||||||
|
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
|
/******/
|
||||||
|
/******/ // startup
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ // This entry module depends on other loaded chunks and execution need to be delayed
|
||||||
|
/******/ __webpack_require__.O(undefined, [830], () => (__webpack_require__(807)))
|
||||||
|
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, [830], () => (__webpack_require__(954)))
|
||||||
|
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
||||||
|
/******/
|
||||||
|
/******/ })()
|
||||||
|
;
|
||||||
|
//# sourceMappingURL=legal_retention_schedule.bundle.js.map
|
||||||
7864
static/dist/js/main.bundle.js
vendored
7864
static/dist/js/main.bundle.js
vendored
File diff suppressed because one or more lines are too long
17
static/dist/js/store_home.bundle.js
vendored
17
static/dist/js/store_home.bundle.js
vendored
@@ -0,0 +1,17 @@
|
|||||||
|
/******/ (() => { // webpackBootstrap
|
||||||
|
/******/ "use strict";
|
||||||
|
// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules.
|
||||||
|
(() => {
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
||||||
|
// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules.
|
||||||
|
(() => {
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
||||||
|
/******/ })()
|
||||||
|
;
|
||||||
|
//# sourceMappingURL=store_home.bundle.js.map
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
/******/ (() => { // webpackBootstrap
|
||||||
|
/******/ "use strict";
|
||||||
|
// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules.
|
||||||
|
(() => {
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
||||||
|
// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules.
|
||||||
|
(() => {
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
||||||
|
/******/ })()
|
||||||
|
;
|
||||||
|
//# sourceMappingURL=store_product_categories.bundle.js.map
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
/******/ (() => { // webpackBootstrap
|
||||||
|
/******/ "use strict";
|
||||||
|
// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules.
|
||||||
|
(() => {
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
||||||
|
// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules.
|
||||||
|
(() => {
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
||||||
|
/******/ })()
|
||||||
|
;
|
||||||
|
//# sourceMappingURL=store_product_permutations.bundle.js.map
|
||||||
17
static/dist/js/store_stock_items.bundle.js
vendored
17
static/dist/js/store_stock_items.bundle.js
vendored
@@ -0,0 +1,17 @@
|
|||||||
|
/******/ (() => { // webpackBootstrap
|
||||||
|
/******/ "use strict";
|
||||||
|
// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules.
|
||||||
|
(() => {
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
||||||
|
// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules.
|
||||||
|
(() => {
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
||||||
|
/******/ })()
|
||||||
|
;
|
||||||
|
//# sourceMappingURL=store_stock_items.bundle.js.map
|
||||||
@@ -120,6 +120,21 @@ export default class API {
|
|||||||
return await API.request(hashSaveStoreProductPermutation, 'POST', dataRequest);
|
return await API.request(hashSaveStoreProductPermutation, 'POST', dataRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// product variations
|
||||||
|
static async getProductVariations() {
|
||||||
|
return await API.request(hashGetStoreProductVariation);
|
||||||
|
}
|
||||||
|
static async getProductVariationsByFilters(filtersJson) {
|
||||||
|
API.goToHash(hashPageStoreProductVariations, filtersJson);
|
||||||
|
}
|
||||||
|
static async saveProductVariations(variationTypes, formFilters, comment) {
|
||||||
|
let dataRequest = {};
|
||||||
|
dataRequest[flagFormFilters] = DOM.convertForm2JSON(formFilters);
|
||||||
|
dataRequest[flagProductVariationType] = variationTypes;
|
||||||
|
dataRequest[flagComment] = comment;
|
||||||
|
return await API.request(hashSaveStoreProductVariation, 'POST', dataRequest);
|
||||||
|
}
|
||||||
|
|
||||||
// stock items
|
// stock items
|
||||||
static async getStockItems() {
|
static async getStockItems() {
|
||||||
return await API.request(hashGetStoreStockItem);
|
return await API.request(hashGetStoreStockItem);
|
||||||
|
|||||||
@@ -101,8 +101,8 @@ export default class DOM {
|
|||||||
return container.querySelector('.' + flagDirty) != null;
|
return container.querySelector('.' + flagDirty) != null;
|
||||||
}
|
}
|
||||||
static hasDirtyChildrenNotDeletedContainer(container) {
|
static hasDirtyChildrenNotDeletedContainer(container) {
|
||||||
if (container == null) return false;
|
if (container == null || container.classList.contains(flagDelete)) return false;
|
||||||
return container.querySelector('.' + flagDirty + ':not(.' + flagDelete + ')') != null;
|
return container.querySelector('.' + flagDirty + ':not(.' + flagDelete + ', .' + flagDelete + ' *)') != null;
|
||||||
}
|
}
|
||||||
static getElementValueCurrent(element) {
|
static getElementValueCurrent(element) {
|
||||||
let returnVal = '';
|
let returnVal = '';
|
||||||
@@ -120,6 +120,9 @@ export default class DOM {
|
|||||||
else if (element.tagName === 'INPUT' || element.tagName === 'TEXTAREA' || element.tagName === 'SELECT') {
|
else if (element.tagName === 'INPUT' || element.tagName === 'TEXTAREA' || element.tagName === 'SELECT') {
|
||||||
returnVal = element.value;
|
returnVal = element.value;
|
||||||
}
|
}
|
||||||
|
else if (element.tagName === 'BUTTON' && element.classList.contains(flagActive)) {
|
||||||
|
returnVal = element.classList.contains(flagDelete);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
returnVal = element.textContent;
|
returnVal = element.textContent;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,4 +24,12 @@ export default class BusinessObjects {
|
|||||||
static getObjectText(objectJson) {
|
static getObjectText(objectJson) {
|
||||||
return objectJson[objectJson[flagNameAttrOptionText]];
|
return objectJson[objectJson[flagNameAttrOptionText]];
|
||||||
}
|
}
|
||||||
|
static getListObjectsFromIdDictAndCsv(idDict, idCsv) {
|
||||||
|
let listObjects = [];
|
||||||
|
let ids = idCsv.split(',');
|
||||||
|
for (let id of ids) {
|
||||||
|
listObjects.push(idDict[id]);
|
||||||
|
}
|
||||||
|
return listObjects;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -174,7 +174,7 @@ export default class TableBasePage extends BasePage {
|
|||||||
let records = [];
|
let records = [];
|
||||||
let record;
|
let record;
|
||||||
document.querySelectorAll(idTableMain + ' > tbody > tr').forEach((row) => {
|
document.querySelectorAll(idTableMain + ' > tbody > tr').forEach((row) => {
|
||||||
if (dirtyOnly && !row.classList.contains(flagDirty)) return;
|
if (dirtyOnly && !DOM.hasDirtyChildrenContainer(row)) return;
|
||||||
record = this.getJsonRow(row);
|
record = this.getJsonRow(row);
|
||||||
records.push(record);
|
records.push(record);
|
||||||
});
|
});
|
||||||
@@ -217,28 +217,22 @@ export default class TableBasePage extends BasePage {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
hookupButtonAddRowTable() {
|
hookupButtonAddRowTable() {
|
||||||
this.hookupEventHandler("click", idFormFilters + ' button.' + flagAdd, (event, button) => {
|
this.hookupEventHandler("click", idFormFilters + ' button.' + flagAdd, (event, button) => { this.handleClickAddRowTable(event, button); });
|
||||||
event.stopPropagation();
|
}
|
||||||
let tbody = document.querySelector(idTableMain + ' tbody');
|
handleClickAddRowTable(event, button) {
|
||||||
let row = _rowBlank.cloneNode(true);
|
event.stopPropagation();
|
||||||
row.classList.remove(flagInitialised);
|
_rowBlank.setAttribute(this.constructor.attrIdRowObject, -1 - _rowBlank.getAttribute(this.constructor.attrIdRowObject));
|
||||||
row.querySelectorAll('.' + flagInitialised).forEach(function(element) {
|
let tbody = document.querySelector(idTableMain + ' tbody');
|
||||||
element.classList.remove(flagInitialised);
|
let row = _rowBlank.cloneNode(true);
|
||||||
});
|
row.classList.remove(flagInitialised);
|
||||||
let countRows = document.querySelectorAll(idTableMain + ' > tbody > tr').length;
|
row.querySelectorAll('.' + flagInitialised).forEach(function(element) {
|
||||||
row.setAttribute(this.constructor.attrIdRowObject, -1 - countRows);
|
element.classList.remove(flagInitialised);
|
||||||
/* Shared nethods
|
|
||||||
let newDisplayOrder = parseInt(tbody.querySelector('tr:last-child').querySelector('td.' + flagDisplayOrder + ' .' + flagSlider).getAttribute(attrValueCurrent)) + 1;
|
|
||||||
let slider = tbody.querySelector('tr:last-child').querySelector('td.' + flagDisplayOrder + ' .' + flagSlider);
|
|
||||||
if (slider) {
|
|
||||||
slider.setAttribute(attrValueCurrent, newDisplayOrder);
|
|
||||||
slider.setAttribute(attrValuePrevious, newDisplayOrder);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
this.initialiseRowNew(row);
|
|
||||||
tbody.appendChild(row);
|
|
||||||
this.hookupTableMain();
|
|
||||||
});
|
});
|
||||||
|
let countRows = document.querySelectorAll(idTableMain + ' > tbody > tr').length;
|
||||||
|
row.setAttribute(this.constructor.attrIdRowObject, -1 - countRows);
|
||||||
|
this.initialiseRowNew(row);
|
||||||
|
tbody.appendChild(row);
|
||||||
|
this.hookupTableMain();
|
||||||
}
|
}
|
||||||
initialiseRowNew(row) {
|
initialiseRowNew(row) {
|
||||||
if (this.constructor === TableBasePage) {
|
if (this.constructor === TableBasePage) {
|
||||||
@@ -260,10 +254,12 @@ export default class TableBasePage extends BasePage {
|
|||||||
let selectorRowNew = idTableMain + ' tbody tr.' + flagRowNew;
|
let selectorRowNew = idTableMain + ' tbody tr.' + flagRowNew;
|
||||||
let rowBlankTemp = document.querySelector(selectorRowNew);
|
let rowBlankTemp = document.querySelector(selectorRowNew);
|
||||||
if (_verbose) { console.log("row blank temp: ", rowBlankTemp); }
|
if (_verbose) { console.log("row blank temp: ", rowBlankTemp); }
|
||||||
|
let countRows = document.querySelectorAll(idTableMain + ' > tbody > tr').length;
|
||||||
_rowBlank = rowBlankTemp.cloneNode(true);
|
_rowBlank = rowBlankTemp.cloneNode(true);
|
||||||
document.querySelectorAll(selectorRowNew).forEach(function(row) {
|
document.querySelectorAll(selectorRowNew).forEach(function(row) {
|
||||||
row.remove();
|
row.remove();
|
||||||
});
|
});
|
||||||
|
_rowBlank.setAttribute(this.constructor.attrIdRowObject, -1 - countRows);
|
||||||
}
|
}
|
||||||
hookupSlidersDisplayOrderTable() {
|
hookupSlidersDisplayOrderTable() {
|
||||||
let selectorDisplayOrder = idTableMain + ' tbody tr td.' + flagDisplayOrder + ' input.' + flagSlider + '.' + flagDisplayOrder;
|
let selectorDisplayOrder = idTableMain + ' tbody tr td.' + flagDisplayOrder + ' input.' + flagSlider + '.' + flagDisplayOrder;
|
||||||
@@ -299,12 +295,12 @@ export default class TableBasePage extends BasePage {
|
|||||||
handleChangeElementCellTable(event, element) {
|
handleChangeElementCellTable(event, element) {
|
||||||
let row = DOM.getRowFromElement(element);
|
let row = DOM.getRowFromElement(element);
|
||||||
let td = DOM.getCellFromElement(element);
|
let td = DOM.getCellFromElement(element);
|
||||||
let wasDirtyRow = DOM.hasDirtyChildrenNotDeletedContainer(row);
|
let wasDirtyRow = DOM.hasDirtyChildrenContainer(row);
|
||||||
let wasDirtyElement = element.classList.contains(flagDirty);
|
let wasDirtyElement = element.classList.contains(flagDirty);
|
||||||
let isDirtyElement = DOM.updateAndCheckIsElementDirty(element);
|
let isDirtyElement = DOM.updateAndCheckIsElementDirty(element);
|
||||||
if (isDirtyElement != wasDirtyElement) {
|
if (isDirtyElement != wasDirtyElement) {
|
||||||
DOM.handleDirtyElement(td, isDirtyElement);
|
DOM.handleDirtyElement(td, isDirtyElement);
|
||||||
let isNowDirtyRow = DOM.hasDirtyChildrenNotDeletedContainer(row);
|
let isNowDirtyRow = DOM.hasDirtyChildrenContainer(row);
|
||||||
if (isNowDirtyRow != wasDirtyRow) {
|
if (isNowDirtyRow != wasDirtyRow) {
|
||||||
DOM.handleDirtyElement(row, isNowDirtyRow);
|
DOM.handleDirtyElement(row, isNowDirtyRow);
|
||||||
let rows = this.getTableRecords(true);
|
let rows = this.getTableRecords(true);
|
||||||
@@ -326,12 +322,12 @@ export default class TableBasePage extends BasePage {
|
|||||||
}
|
}
|
||||||
let row = DOM.getRowFromElement(element);
|
let row = DOM.getRowFromElement(element);
|
||||||
let td = DOM.getCellFromElement(element);
|
let td = DOM.getCellFromElement(element);
|
||||||
let wasDirtyRow = DOM.hasDirtyChildrenNotDeletedContainer(row);
|
let wasDirtyRow = DOM.hasDirtyChildrenContainer(row);
|
||||||
let wasDirtyElement = element.classList.contains(flagDirty);
|
let wasDirtyElement = element.classList.contains(flagDirty);
|
||||||
let isDirtyElement = DOM.updateAndCheckIsElementDirty(element);
|
let isDirtyElement = DOM.updateAndCheckIsElementDirty(element);
|
||||||
if (isDirtyElement != wasDirtyElement) {
|
if (isDirtyElement != wasDirtyElement) {
|
||||||
DOM.handleDirtyElement(td, isDirtyElement);
|
DOM.handleDirtyElement(td, isDirtyElement);
|
||||||
let isNowDirtyRow = DOM.hasDirtyChildrenNotDeletedContainer(row);
|
let isNowDirtyRow = DOM.hasDirtyChildrenContainer(row);
|
||||||
if (isNowDirtyRow != wasDirtyRow) {
|
if (isNowDirtyRow != wasDirtyRow) {
|
||||||
DOM.handleDirtyElement(row, isNowDirtyRow);
|
DOM.handleDirtyElement(row, isNowDirtyRow);
|
||||||
let rows = this.getTableRecords(true);
|
let rows = this.getTableRecords(true);
|
||||||
@@ -345,18 +341,18 @@ export default class TableBasePage extends BasePage {
|
|||||||
let rowTable = rowSubtable.closest(idTableMain + ' > tbody > tr');
|
let rowTable = rowSubtable.closest(idTableMain + ' > tbody > tr');
|
||||||
let td = DOM.getCellFromElement(element);
|
let td = DOM.getCellFromElement(element);
|
||||||
// let tdSubtable = td.closest('td.' + flagFieldSubtable);
|
// let tdSubtable = td.closest('td.' + flagFieldSubtable);
|
||||||
let wasDirtyRowSubtable = DOM.hasDirtyChildrenNotDeletedContainer(rowSubtable);
|
let wasDirtyRowSubtable = DOM.hasDirtyChildrenContainer(rowSubtable);
|
||||||
let wasDirtyRowTable = DOM.hasDirtyChildrenNotDeletedContainer(rowTable);
|
let wasDirtyRowTable = DOM.hasDirtyChildrenContainer(rowTable);
|
||||||
let wasDirtyElement = element.classList.contains(flagDirty);
|
let wasDirtyElement = element.classList.contains(flagDirty);
|
||||||
let isDirtyElement = DOM.updateAndCheckIsElementDirty(element);
|
let isDirtyElement = DOM.updateAndCheckIsElementDirty(element);
|
||||||
console.log({isDirtyElement, wasDirtyElement});
|
console.log({isDirtyElement, wasDirtyElement});
|
||||||
if (isDirtyElement != wasDirtyElement) {
|
if (isDirtyElement != wasDirtyElement) {
|
||||||
DOM.handleDirtyElement(td, isDirtyElement);
|
DOM.handleDirtyElement(td, isDirtyElement);
|
||||||
let isNowDirtyRowSubtable = DOM.hasDirtyChildrenNotDeletedContainer(rowSubtable);
|
let isNowDirtyRowSubtable = DOM.hasDirtyChildrenContainer(rowSubtable);
|
||||||
console.log({isNowDirtyRowSubtable, wasDirtyRowSubtable});
|
console.log({isNowDirtyRowSubtable, wasDirtyRowSubtable});
|
||||||
if (isNowDirtyRowSubtable != wasDirtyRowSubtable) {
|
if (isNowDirtyRowSubtable != wasDirtyRowSubtable) {
|
||||||
DOM.handleDirtyElement(rowSubtable, isNowDirtyRowSubtable);
|
DOM.handleDirtyElement(rowSubtable, isNowDirtyRowSubtable);
|
||||||
let isNowDirtyRowTable = DOM.hasDirtyChildrenNotDeletedContainer(rowTable);
|
let isNowDirtyRowTable = DOM.hasDirtyChildrenContainer(rowTable);
|
||||||
console.log({isNowDirtyRowTable, wasDirtyRowTable});
|
console.log({isNowDirtyRowTable, wasDirtyRowTable});
|
||||||
if (isNowDirtyRowTable != wasDirtyRowTable) {
|
if (isNowDirtyRowTable != wasDirtyRowTable) {
|
||||||
DOM.handleDirtyElement(rowTable, isNowDirtyRowTable);
|
DOM.handleDirtyElement(rowTable, isNowDirtyRowTable);
|
||||||
@@ -370,13 +366,14 @@ export default class TableBasePage extends BasePage {
|
|||||||
*/
|
*/
|
||||||
handleChangeNestedElementCellTable(event, element) {
|
handleChangeNestedElementCellTable(event, element) {
|
||||||
let wasDirtyParentRows = this.getAllIsDirtyRowsInParentTree(element);
|
let wasDirtyParentRows = this.getAllIsDirtyRowsInParentTree(element);
|
||||||
let wasDirtyElement = element.classList.contains(flagDirty);
|
let wasDirtyElement = DOM.isElementDirty(element);
|
||||||
let isDirtyElement = DOM.updateAndCheckIsElementDirty(element);
|
let isDirtyElement = DOM.updateAndCheckIsElementDirty(element);
|
||||||
if (_verbose) { console.log({isDirtyElement, wasDirtyElement, wasDirtyParentRows}); }
|
if (_verbose) { console.log({isDirtyElement, wasDirtyElement, wasDirtyParentRows}); }
|
||||||
if (isDirtyElement != wasDirtyElement) {
|
if (isDirtyElement != wasDirtyElement) {
|
||||||
let td = DOM.getCellFromElement(element);
|
let td = DOM.getCellFromElement(element);
|
||||||
DOM.setElementAttributeValueCurrent(td, DOM.getElementAttributeValueCurrent(element));
|
DOM.setElementAttributeValueCurrent(td, DOM.getElementAttributeValueCurrent(element));
|
||||||
this.toggleShowButtonsSaveCancel(isDirtyElement);
|
DOM.handleDirtyElement(td, isDirtyElement);
|
||||||
|
this.updateAndToggleShowButtonsSaveCancel();
|
||||||
this.cascadeChangedIsDirtyNestedElementCellTable(element, isDirtyElement, wasDirtyParentRows);
|
this.cascadeChangedIsDirtyNestedElementCellTable(element, isDirtyElement, wasDirtyParentRows);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -396,15 +393,15 @@ export default class TableBasePage extends BasePage {
|
|||||||
cascadeChangedIsDirtyNestedElementCellTable(element, isDirtyElement, wasDirtyParentRows) {
|
cascadeChangedIsDirtyNestedElementCellTable(element, isDirtyElement, wasDirtyParentRows) {
|
||||||
if (Validation.isEmpty(wasDirtyParentRows)) return;
|
if (Validation.isEmpty(wasDirtyParentRows)) return;
|
||||||
let td = DOM.getCellFromElement(element);
|
let td = DOM.getCellFromElement(element);
|
||||||
let isDirtyTd = isDirtyElement || DOM.hasDirtyChildrenNotDeletedContainer(tr);
|
let isDirtyTd = isDirtyElement || DOM.hasDirtyChildrenContainer(tr);
|
||||||
DOM.handleDirtyElement(td, isDirtyTd);
|
DOM.handleDirtyElement(td, isDirtyTd);
|
||||||
let tr = DOM.getRowFromElement(td);
|
let tr = DOM.getRowFromElement(td);
|
||||||
let isDirtyRow = isDirtyTd || DOM.hasDirtyChildrenNotDeletedContainer(tr);
|
let isDirtyRow = isDirtyTd || DOM.hasDirtyChildrenContainer(tr);
|
||||||
let wasDirtyRow = wasDirtyParentRows.pop();
|
let wasDirtyRow = wasDirtyParentRows.shift();
|
||||||
if (_verbose) { console.log({isDirtyRow, wasDirtyRow}); }
|
if (_verbose) { console.log({isDirtyRow, wasDirtyRow}); }
|
||||||
if (isDirtyRow != wasDirtyRow) {
|
if (isDirtyRow != wasDirtyRow) {
|
||||||
DOM.handleDirtyElement(tr, isDirtyRow);
|
DOM.handleDirtyElement(tr, isDirtyRow);
|
||||||
this.toggleShowButtonsSaveCancel(isDirtyRow);
|
this.updateAndToggleShowButtonsSaveCancel();
|
||||||
this.cascadeChangedIsDirtyNestedElementCellTable(tr.parentElement, isDirtyRow, wasDirtyParentRows);
|
this.cascadeChangedIsDirtyNestedElementCellTable(tr.parentElement, isDirtyRow, wasDirtyParentRows);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -480,8 +477,18 @@ export default class TableBasePage extends BasePage {
|
|||||||
hookupTextareasDescriptionTable() {
|
hookupTextareasDescriptionTable() {
|
||||||
this.hookupChangeHandlerTableCells(idTableMain + ' tbody tr td.' + flagDescription + ' textarea');
|
this.hookupChangeHandlerTableCells(idTableMain + ' tbody tr td.' + flagDescription + ' textarea');
|
||||||
}
|
}
|
||||||
hookupInputsActiveTable() {
|
hookupFieldsActive(flagTable = '', handleClickRowNew = (event, element) => { this.handleClickAddRowTable(event, element); }) {
|
||||||
this.hookupChangeHandlerTableCells(idTableMain + ' > tbody > tr > td.' + flagActive + ' input[type="checkbox"]');
|
let selectorButton = 'table' + (Validation.isEmpty(flagTable) ? '' : '.' + flagTable) + ' > tbody > tr > td.' + flagActive + ' button';
|
||||||
|
let selectorButtonDelete = selectorButton + '.' + flagDelete;
|
||||||
|
let selectorButtonUndelete = selectorButton + ':not(.' + flagDelete + ')';
|
||||||
|
console.log("hookupFieldsActive: ", selectorButtonDelete, selectorButtonUndelete);
|
||||||
|
this.hookupButtonsRowDelete(selectorButtonDelete, selectorButtonUndelete);
|
||||||
|
this.hookupButtonsRowUndelete(selectorButtonDelete, selectorButtonUndelete);
|
||||||
|
this.hookupEventHandler(
|
||||||
|
"click"
|
||||||
|
, 'table' + (Validation.isEmpty(flagTable) ? '' : '.' + flagTable) + ' > thead > tr > th.' + flagActive + ' button'
|
||||||
|
, (event, button) => { handleClickRowNew(event, button); }
|
||||||
|
);
|
||||||
}
|
}
|
||||||
hookupButtonsRowDelete(selectorButtonDelete, selectorButtonUndelete) {
|
hookupButtonsRowDelete(selectorButtonDelete, selectorButtonUndelete) {
|
||||||
this.hookupEventHandler("click", selectorButtonDelete, (event, element) => {
|
this.hookupEventHandler("click", selectorButtonDelete, (event, element) => {
|
||||||
@@ -489,14 +496,18 @@ export default class TableBasePage extends BasePage {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
handleClickButtonRowDelete(event, element, selectorButtonDelete, selectorButtonUndelete) {
|
handleClickButtonRowDelete(event, element, selectorButtonDelete, selectorButtonUndelete) {
|
||||||
let row = DOM.getRowFromElement(element);
|
// let row = DOM.getRowFromElement(element);
|
||||||
row.classList.add(flagDelete);
|
// row.classList.add(flagDelete);
|
||||||
|
let buttonAdd = element.cloneNode(false); // document.createElement("button");
|
||||||
let buttonAdd = document.createElement("button");
|
buttonAdd.classList.remove(flagInitialised);
|
||||||
|
buttonAdd.classList.remove(flagDelete);
|
||||||
buttonAdd.classList.add(flagAdd);
|
buttonAdd.classList.add(flagAdd);
|
||||||
buttonAdd.textContent = '+';
|
buttonAdd.textContent = '+';
|
||||||
|
// DOM.setElementAttributeValueCurrent(buttonAdd, false);
|
||||||
element.replaceWith(buttonAdd);
|
element.replaceWith(buttonAdd);
|
||||||
|
this.handleChangeNestedElementCellTable(null, buttonAdd);
|
||||||
this.hookupButtonsRowUndelete(selectorButtonDelete, selectorButtonUndelete);
|
this.hookupButtonsRowUndelete(selectorButtonDelete, selectorButtonUndelete);
|
||||||
|
this.updateAndToggleShowButtonsSaveCancel();
|
||||||
}
|
}
|
||||||
hookupButtonsRowUndelete(selectorButtonDelete, selectorButtonUndelete) {
|
hookupButtonsRowUndelete(selectorButtonDelete, selectorButtonUndelete) {
|
||||||
this.hookupEventHandler("click", selectorButtonUndelete, (event, element) => {
|
this.hookupEventHandler("click", selectorButtonUndelete, (event, element) => {
|
||||||
@@ -504,14 +515,18 @@ export default class TableBasePage extends BasePage {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
handleClickButtonRowUndelete(event, element, selectorButtonDelete, selectorButtonUndelete) {
|
handleClickButtonRowUndelete(event, element, selectorButtonDelete, selectorButtonUndelete) {
|
||||||
let row = DOM.getRowFromElement(element);
|
// let row = DOM.getRowFromElement(element);
|
||||||
row.classList.add(flagDelete);
|
// row.classList.remove(flagDelete);
|
||||||
|
let buttonDelete = element.cloneNode(false); // document.createElement("button");
|
||||||
let buttonAdd = document.createElement("button");
|
buttonDelete.classList.remove(flagInitialised);
|
||||||
buttonAdd.classList.add(flagAdd);
|
buttonDelete.classList.remove(flagAdd);
|
||||||
buttonAdd.textContent = '+';
|
buttonDelete.classList.add(flagDelete);
|
||||||
element.replaceWith(buttonAdd);
|
buttonDelete.textContent = 'x';
|
||||||
|
// DOM.setElementAttributeValueCurrent(buttonDelete, true);
|
||||||
|
element.replaceWith(buttonDelete);
|
||||||
|
this.handleChangeNestedElementCellTable(null, buttonDelete);
|
||||||
this.hookupButtonsRowDelete(selectorButtonDelete, selectorButtonUndelete);
|
this.hookupButtonsRowDelete(selectorButtonDelete, selectorButtonUndelete);
|
||||||
|
this.updateAndToggleShowButtonsSaveCancel();
|
||||||
}
|
}
|
||||||
hookupTdsAccessLevel() {
|
hookupTdsAccessLevel() {
|
||||||
let cellSelector = idTableMain + ' tbody td.' + flagAccessLevel;
|
let cellSelector = idTableMain + ' tbody td.' + flagAccessLevel;
|
||||||
@@ -571,7 +586,7 @@ export default class TableBasePage extends BasePage {
|
|||||||
let row = DOM.getRowFromElement(ddl);
|
let row = DOM.getRowFromElement(ddl);
|
||||||
let td = DOM.getCellFromElement(ddl);
|
let td = DOM.getCellFromElement(ddl);
|
||||||
console.log("td: ", td);
|
console.log("td: ", td);
|
||||||
let wasDirtyRow = DOM.hasDirtyChildrenNotDeletedContainer(row);
|
let wasDirtyRow = DOM.hasDirtyChildrenContainer(row);
|
||||||
let wasDirtyElement = ddl.classList.contains(flagDirty);
|
let wasDirtyElement = ddl.classList.contains(flagDirty);
|
||||||
let isDirtyElement = DOM.updateAndCheckIsElementDirty(ddl);
|
let isDirtyElement = DOM.updateAndCheckIsElementDirty(ddl);
|
||||||
console.log("isDirtyElement: ", isDirtyElement);
|
console.log("isDirtyElement: ", isDirtyElement);
|
||||||
@@ -580,7 +595,7 @@ export default class TableBasePage extends BasePage {
|
|||||||
DOM.handleDirtyElement(td, isDirtyElement);
|
DOM.handleDirtyElement(td, isDirtyElement);
|
||||||
let optionSelected = ddl.options[ddl.selectedIndex];
|
let optionSelected = ddl.options[ddl.selectedIndex];
|
||||||
DOM.setElementAttributeValueCurrent(td, optionSelected.value);
|
DOM.setElementAttributeValueCurrent(td, optionSelected.value);
|
||||||
let isNowDirtyRow = DOM.hasDirtyChildrenNotDeletedContainer(row);
|
let isNowDirtyRow = DOM.hasDirtyChildrenContainer(row);
|
||||||
console.log("isNowDirtyRow: ", isNowDirtyRow);
|
console.log("isNowDirtyRow: ", isNowDirtyRow);
|
||||||
console.log("wasDirtyRow: ", wasDirtyRow);
|
console.log("wasDirtyRow: ", wasDirtyRow);
|
||||||
if (isNowDirtyRow != wasDirtyRow) {
|
if (isNowDirtyRow != wasDirtyRow) {
|
||||||
@@ -885,16 +900,24 @@ export default class TableBasePage extends BasePage {
|
|||||||
let columnThHasFlag = columnTh.classList.contains(classnameFlag);
|
let columnThHasFlag = columnTh.classList.contains(classnameFlag);
|
||||||
if (isRequiredFlag == columnThHasFlag) return;
|
if (isRequiredFlag == columnThHasFlag) return;
|
||||||
DOM.toggleElementHasClassnameFlag(columnTh, isRequiredFlag, classnameFlag);
|
DOM.toggleElementHasClassnameFlag(columnTh, isRequiredFlag, classnameFlag);
|
||||||
|
/*
|
||||||
let columnTds = table.querySelectorAll('td.' + columnFlag);
|
let columnTds = table.querySelectorAll('td.' + columnFlag);
|
||||||
columnTds.forEach((columnTd) => {
|
columnTds.forEach((columnTd) => {
|
||||||
DOM.toggleElementHasClassnameFlag(columnTd, isRequiredFlag, classnameFlag);
|
DOM.toggleElementHasClassnameFlag(columnTd, isRequiredFlag, classnameFlag);
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
toggleColumnHeaderHasClassnameFlag(columnFlag, isRequiredFlag, classnameFlag) {
|
toggleColumnHeaderHasClassnameFlag(columnFlag, isRequiredFlag, classnameFlag) {
|
||||||
let table = TableBasePage.getTableMain();
|
let table = TableBasePage.getTableMain();
|
||||||
let columnTh = table.querySelector('th.' + columnFlag);
|
let columnTh = table.querySelector('th.' + columnFlag);
|
||||||
DOM.toggleElementHasClassnameFlag(columnTh, isRequiredFlag, classnameFlag);
|
DOM.toggleElementHasClassnameFlag(columnTh, isRequiredFlag, classnameFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateAndToggleShowButtonsSaveCancel() {
|
||||||
|
let records = this.getTableRecords(true);
|
||||||
|
let existsDirtyRecord = records.length > 0;
|
||||||
|
this.toggleShowButtonsSaveCancel(existsDirtyRecord);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ export default class PageStoreManufacturingPurchaseOrders extends TableBasePage
|
|||||||
this.hookupCurrencyFields();
|
this.hookupCurrencyFields();
|
||||||
this.hookupCostAndPriceInputs();
|
this.hookupCostAndPriceInputs();
|
||||||
this.hookupOrderItemsFields();
|
this.hookupOrderItemsFields();
|
||||||
this.hookupInputsActiveTable();
|
this.hookupFieldsActive();
|
||||||
}
|
}
|
||||||
hookupCostAndPriceInputs() {
|
hookupCostAndPriceInputs() {
|
||||||
this.hookupChangeHandlerTableCells(idTableMain + ' td.' + flagCostTotalLocalVatExcl + ' input');
|
this.hookupChangeHandlerTableCells(idTableMain + ' td.' + flagCostTotalLocalVatExcl + ' input');
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ export default class PageStoreProductCategories extends TableBasePage {
|
|||||||
this.hookupTextareasNameTable();
|
this.hookupTextareasNameTable();
|
||||||
this.hookupTextareasDescriptionTable();
|
this.hookupTextareasDescriptionTable();
|
||||||
this.hookupTdsAccessLevel();
|
this.hookupTdsAccessLevel();
|
||||||
this.hookupInputsActiveTable();
|
this.hookupFieldsActive();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
245
static/js/pages/store/product_variations.js
Normal file
245
static/js/pages/store/product_variations.js
Normal file
@@ -0,0 +1,245 @@
|
|||||||
|
|
||||||
|
import API from "../../api.js";
|
||||||
|
import BusinessObjects from "../../lib/business_objects/business_objects.js";
|
||||||
|
import DOM from "../../dom.js";
|
||||||
|
import Events from "../../lib/events.js";
|
||||||
|
import TableBasePage from "../base_table.js";
|
||||||
|
import Utils from "../../lib/utils.js";
|
||||||
|
import Validation from "../../lib/validation.js";
|
||||||
|
import StoreTableMixinPage from "./mixin_table.js";
|
||||||
|
|
||||||
|
export default class PageStoreProductVariations extends TableBasePage {
|
||||||
|
static hash = hashPageStoreProductVariations;
|
||||||
|
static attrIdRowObject = attrIdProductVariation;
|
||||||
|
callFilterTableContent = API.getProductVariationsByFilters;
|
||||||
|
callSaveTableContent = API.saveProductVariations;
|
||||||
|
|
||||||
|
constructor(router) {
|
||||||
|
super(router);
|
||||||
|
this.storeMixin = new StoreTableMixinPage(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
initialize() {
|
||||||
|
this.sharedInitialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
hookupFilters() {
|
||||||
|
this.sharedHookupFilters();
|
||||||
|
this.hookupFilterActive();
|
||||||
|
this.hookupFilterIsNotEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
loadRowTable(rowJson) {
|
||||||
|
}
|
||||||
|
getJsonRow(row) {
|
||||||
|
if (row == null) return;
|
||||||
|
let inputDisplayOrder = row.querySelector('td.' + flagDisplayOrder + ' input');
|
||||||
|
let textareaCode = row.querySelector('td.' + flagCode + ' textarea');
|
||||||
|
let textareaName = row.querySelector('td.' + flagName + ' textarea');
|
||||||
|
let textareaNamePlural = row.querySelector('td.' + flagNamePlural + ' textarea');
|
||||||
|
let tdProductVariations = row.querySelector('td.' + flagProductVariations);
|
||||||
|
let buttonActive = row.querySelector('td.' + flagActive + ' button');
|
||||||
|
|
||||||
|
let jsonRow = {};
|
||||||
|
jsonRow[attrIdProductVariationType] = row.getAttribute(attrIdProductVariationType);
|
||||||
|
if (Validation.isEmpty(jsonRow[attrIdProductVariationType])) jsonRow[attrIdProductVariationType] = -1;
|
||||||
|
jsonRow[flagDisplayOrder] = DOM.getElementAttributeValueCurrent(inputDisplayOrder);
|
||||||
|
jsonRow[flagCode] = DOM.getElementAttributeValueCurrent(textareaCode);
|
||||||
|
jsonRow[flagName] = DOM.getElementAttributeValueCurrent(textareaName);
|
||||||
|
jsonRow[flagNamePlural] = DOM.getElementAttributeValueCurrent(textareaNamePlural);
|
||||||
|
|
||||||
|
let variations = [];
|
||||||
|
if (tdProductVariations.classList.contains(flagDirty)) {
|
||||||
|
let trsProductVariation = tdProductVariations.querySelectorAll('tr.' + flagProductVariation + '.' + flagDirty);
|
||||||
|
if (trsProductVariation != null) {
|
||||||
|
trsProductVariation.forEach((tr, indexRow) => {
|
||||||
|
variations.push(this.getJsonRowProductVariation(tr, indexRow));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// variations = BusinessObjects.getListObjectsFromIdDictAndCsv(productVariationTypes, DOM.getElementAttributeValueCurrent(tdProductVariations));
|
||||||
|
}
|
||||||
|
jsonRow[flagProductVariations] = variations;
|
||||||
|
jsonRow[flagActive] = buttonActive.classList.contains(flagDelete);
|
||||||
|
return jsonRow;
|
||||||
|
}
|
||||||
|
getJsonRowProductVariation(tr, indexRow) {
|
||||||
|
let inputDisplayOrder = tr.querySelector('td.' + flagDisplayOrder + ' input');
|
||||||
|
let textareaCode = tr.querySelector('td.' + flagCode + ' textarea');
|
||||||
|
let textareaName = tr.querySelector('td.' + flagName + ' textarea');
|
||||||
|
// let checkboxActive = tr.querySelector('td.' + flagActive + ' input');
|
||||||
|
let buttonActive = tr.querySelector('td.' + flagActive + ' button');
|
||||||
|
|
||||||
|
let jsonRow = {};
|
||||||
|
jsonRow[attrIdProductVariation] = tr.getAttribute(attrIdProductVariation);
|
||||||
|
if (Validation.isEmpty(jsonRow[attrIdProductVariation])) jsonRow[attrIdProductVariation] = -1 - indexRow;
|
||||||
|
jsonRow[attrIdProductVariationType] = tr.getAttribute(attrIdProductVariationType);
|
||||||
|
jsonRow[flagDisplayOrder] = DOM.getElementAttributeValueCurrent(inputDisplayOrder);
|
||||||
|
jsonRow[flagCode] = DOM.getElementAttributeValueCurrent(textareaCode);
|
||||||
|
jsonRow[flagName] = DOM.getElementAttributeValueCurrent(textareaName);
|
||||||
|
jsonRow[flagActive] = buttonActive.classList.contains(flagDelete);
|
||||||
|
|
||||||
|
return jsonRow;
|
||||||
|
}
|
||||||
|
initialiseRowNew(row) {
|
||||||
|
super.initialiseRowNew(row);
|
||||||
|
}
|
||||||
|
|
||||||
|
hookupTableMain() {
|
||||||
|
super.hookupTableMain();
|
||||||
|
this.hookupSlidersDisplayOrderTable();
|
||||||
|
this.hookupTextareasCodeTable();
|
||||||
|
this.hookupTextareasNameTable();
|
||||||
|
this.hookupTextareasNamePluralTable();
|
||||||
|
this.hookupFieldsProductVariation();
|
||||||
|
this.hookupFieldsActive();
|
||||||
|
}
|
||||||
|
hookupTextareasNamePluralTable() {
|
||||||
|
this.hookupChangeHandlerTableCells(idTableMain + ' tbody tr td.' + flagNamePlural + ' textarea');
|
||||||
|
}
|
||||||
|
hookupFieldsProductVariation() {
|
||||||
|
this.hookupProductVariationsPreviews();
|
||||||
|
this.hookupFieldsProductVariationDisplayOrder();
|
||||||
|
this.hookupFieldsProductVariationCode();
|
||||||
|
this.hookupFieldsProductVariationName();
|
||||||
|
this.hookupFieldsProductVariationActive();
|
||||||
|
}
|
||||||
|
hookupProductVariationsPreviews() {
|
||||||
|
this.hookupEventHandler("click", idTableMain + ' td.' + flagProductVariations, (event, td) => {
|
||||||
|
if (!td.classList.contains(flagCollapsed)) return;
|
||||||
|
this.handleClickProductVariationsPreview(event, td);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
handleClickProductVariationsPreview(event, element) {
|
||||||
|
if (_verbose) { console.log("click order items preview"); }
|
||||||
|
this.toggleColumnHeaderCollapsed(flagProductVariations, false);
|
||||||
|
element.classList.remove(flagCollapsed);
|
||||||
|
|
||||||
|
let row = DOM.getRowFromElement(element);
|
||||||
|
let idProductVariationType = row.getAttribute(attrIdProductVariationType);
|
||||||
|
if (idProductVariationType == null || idProductVariationType < 1) return;
|
||||||
|
let productVariationType = productVariationTypes[idProductVariationType];
|
||||||
|
let tblProductVariations = document.createElement("table");
|
||||||
|
tblProductVariations.classList.add(flagProductVariations);
|
||||||
|
let thead = document.createElement("thead");
|
||||||
|
let tr = document.createElement("tr");
|
||||||
|
|
||||||
|
let thDisplayOrder = document.createElement("th");
|
||||||
|
thDisplayOrder.classList.add(flagDisplayOrder);
|
||||||
|
thDisplayOrder.textContent = 'Display Order';
|
||||||
|
let thCode = document.createElement("th");
|
||||||
|
thCode.classList.add(flagCode);
|
||||||
|
thCode.textContent = 'Code';
|
||||||
|
let thName = document.createElement("th");
|
||||||
|
thName.classList.add(flagName);
|
||||||
|
thName.textContent = 'Name';
|
||||||
|
let thActive = document.createElement("th");
|
||||||
|
thActive.classList.add(flagActive);
|
||||||
|
// thActive.textContent = 'Active';
|
||||||
|
let buttonAdd = document.createElement("button");
|
||||||
|
buttonAdd.classList.add(flagActive);
|
||||||
|
buttonAdd.classList.add(flagAdd);
|
||||||
|
buttonAdd.textContent = '+';
|
||||||
|
thActive.appendChild(buttonAdd);
|
||||||
|
|
||||||
|
tr.appendChild(thDisplayOrder);
|
||||||
|
tr.appendChild(thCode);
|
||||||
|
tr.appendChild(thName);
|
||||||
|
tr.appendChild(thActive);
|
||||||
|
thead.appendChild(tr);
|
||||||
|
tblProductVariations.appendChild(thead);
|
||||||
|
|
||||||
|
let tbody = document.createElement("tbody");
|
||||||
|
productVariationType[flagProductVariations].forEach((productVariation, index) => {
|
||||||
|
this.addRowProductVariation(tbody, productVariation);
|
||||||
|
});
|
||||||
|
tblProductVariations.appendChild(tbody);
|
||||||
|
|
||||||
|
let cell = DOM.getCellFromElement(element);
|
||||||
|
let cellNew = cell.cloneNode(false);
|
||||||
|
cellNew.appendChild(tblProductVariations);
|
||||||
|
row.replaceChild(cellNew, cell);
|
||||||
|
if (_verbose) { console.log("tblProductVariations: ", tblProductVariations); }
|
||||||
|
this.hookupFieldsProductVariation();
|
||||||
|
}
|
||||||
|
addRowProductVariation(tbody, productVariation) {
|
||||||
|
if (_verbose) { console.log("addRowProductVariation: ", productVariation); }
|
||||||
|
|
||||||
|
let tdDisplayOrder = document.createElement("td");
|
||||||
|
tdDisplayOrder.classList.add(flagDisplayOrder);
|
||||||
|
let inputDisplayOrder = document.createElement("input");
|
||||||
|
inputDisplayOrder.classList.add(flagDisplayOrder);
|
||||||
|
inputDisplayOrder.type = 'number';
|
||||||
|
inputDisplayOrder.step = 1;
|
||||||
|
DOM.setElementValuesCurrentAndPrevious(inputDisplayOrder, productVariation[flagDisplayOrder]);
|
||||||
|
tdDisplayOrder.appendChild(inputDisplayOrder);
|
||||||
|
|
||||||
|
let tdCode = document.createElement("td");
|
||||||
|
tdCode.classList.add(flagCode);
|
||||||
|
let textareaCode = document.createElement("textarea");
|
||||||
|
textareaCode.classList.add(flagCode);
|
||||||
|
DOM.setElementValuesCurrentAndPrevious(textareaCode, productVariation[flagCode]);
|
||||||
|
tdCode.appendChild(textareaCode);
|
||||||
|
|
||||||
|
let tdName = document.createElement("td");
|
||||||
|
tdName.classList.add(flagName);
|
||||||
|
let textareaName = document.createElement("textarea");
|
||||||
|
textareaName.classList.add(flagName);
|
||||||
|
DOM.setElementValuesCurrentAndPrevious(textareaName, productVariation[flagName]);
|
||||||
|
tdName.appendChild(textareaName);
|
||||||
|
|
||||||
|
let tdActive = document.createElement("td");
|
||||||
|
tdActive.classList.add(flagActive);
|
||||||
|
let buttonActive = document.createElement("button");
|
||||||
|
buttonActive.classList.add(flagActive);
|
||||||
|
buttonActive.classList.add(productVariation[flagActive] ? flagDelete : flagAdd);
|
||||||
|
buttonActive.textContent = productVariation[flagActive] ? 'x' : '+';
|
||||||
|
DOM.setElementAttributesValuesCurrentAndPrevious(buttonActive, productVariation[flagActive]);
|
||||||
|
tdActive.appendChild(buttonActive);
|
||||||
|
|
||||||
|
let tr = document.createElement("tr");
|
||||||
|
tr.classList.add(flagProductVariation);
|
||||||
|
tr.setAttribute(attrIdProductVariationType, productVariation[attrIdProductVariationType]);
|
||||||
|
tr.setAttribute(attrIdProductVariation, productVariation[attrIdProductVariation]);
|
||||||
|
tr.appendChild(tdDisplayOrder);
|
||||||
|
tr.appendChild(tdCode);
|
||||||
|
tr.appendChild(tdName);
|
||||||
|
tr.appendChild(tdActive);
|
||||||
|
tbody.appendChild(tr);
|
||||||
|
}
|
||||||
|
hookupFieldsProductVariationDisplayOrder() {
|
||||||
|
this.hookupChangeHandlerTableCells(idTableMain + ' td.' + flagProductVariations + ' td.' + flagDisplayOrder + ' input');
|
||||||
|
}
|
||||||
|
hookupFieldsProductVariationCode() {
|
||||||
|
this.hookupChangeHandlerTableCells(idTableMain + ' td.' + flagProductVariations + ' textarea.' + flagCode);
|
||||||
|
}
|
||||||
|
hookupFieldsProductVariationName() {
|
||||||
|
this.hookupChangeHandlerTableCells(idTableMain + ' td.' + flagProductVariations + ' textarea.' + flagName);
|
||||||
|
}
|
||||||
|
hookupFieldsProductVariationActive() {
|
||||||
|
this.hookupFieldsActive(flagProductVariations, (event, element) => { this.hookupButtonsProductVariationAdd(event, element); });
|
||||||
|
}
|
||||||
|
hookupButtonsProductVariationAdd(event, element) {
|
||||||
|
let row = element.closest(idTableMain + ' > tbody > tr');
|
||||||
|
let idProductVariationType = row.getAttribute(attrIdProductVariationType);
|
||||||
|
let idProductVariation = row.getAttribute(attrIdProductVariation);
|
||||||
|
let countProductVariations = row.querySelectorAll('td.' + flagProductVariations + ' tr').length;
|
||||||
|
let productVariation = {
|
||||||
|
[attrIdProductVariationType]: idProductVariationType,
|
||||||
|
[attrIdProductVariation]: idProductVariation,
|
||||||
|
[flagCode]: '',
|
||||||
|
[flagName]: '',
|
||||||
|
[flagDisplayOrder]: countProductVariations,
|
||||||
|
[flagActive]: true,
|
||||||
|
};
|
||||||
|
let tbody = row.querySelector('td.' + flagProductVariations + ' table tbody');
|
||||||
|
this.addRowProductVariation(tbody, productVariation);
|
||||||
|
this.hookupFieldsProductVariation();
|
||||||
|
}
|
||||||
|
|
||||||
|
leave() {
|
||||||
|
super.leave();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ export default class PageStoreProducts extends TableBasePage {
|
|||||||
this.hookupTextareasNameTable();
|
this.hookupTextareasNameTable();
|
||||||
this.hookupInputsHasVariationsTable();
|
this.hookupInputsHasVariationsTable();
|
||||||
this.hookupTdsAccessLevel();
|
this.hookupTdsAccessLevel();
|
||||||
this.hookupInputsActiveTable();
|
this.hookupFieldsActive();
|
||||||
}
|
}
|
||||||
hookupTdsProductCategory() {
|
hookupTdsProductCategory() {
|
||||||
let cellSelector = idTableMain + ' tbody td.' + flagProductCategory;
|
let cellSelector = idTableMain + ' tbody td.' + flagProductCategory;
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ export default class PageStoreSupplierPurchaseOrders extends TableBasePage {
|
|||||||
this.hookupCurrencyFields();
|
this.hookupCurrencyFields();
|
||||||
this.hookupCostInputs();
|
this.hookupCostInputs();
|
||||||
this.hookupOrderItemsFields();
|
this.hookupOrderItemsFields();
|
||||||
this.hookupInputsActiveTable();
|
this.hookupFieldsActive();
|
||||||
}
|
}
|
||||||
hookupSupplierFields() {
|
hookupSupplierFields() {
|
||||||
this.hookupTableCellDdlPreviews(idTableMain + ' td.' + flagSupplier, Utils.getListFromDict(suppliers));
|
this.hookupTableCellDdlPreviews(idTableMain + ' td.' + flagSupplier, Utils.getListFromDict(suppliers));
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ export default class PageStoreSuppliers extends TableBasePage {
|
|||||||
this.hookupEmailInputs();
|
this.hookupEmailInputs();
|
||||||
this.hookupWebsiteInputs();
|
this.hookupWebsiteInputs();
|
||||||
this.hookupCurrencyFields();
|
this.hookupCurrencyFields();
|
||||||
this.hookupInputsActiveTable();
|
this.hookupFieldsActive();
|
||||||
}
|
}
|
||||||
hookupNameCompanyInputs() {
|
hookupNameCompanyInputs() {
|
||||||
this.hookupChangeHandlerTableCells(idTableMain + ' td.' + flagNameCompany + ' textarea');
|
this.hookupChangeHandlerTableCells(idTableMain + ' td.' + flagNameCompany + ' textarea');
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import PageStoreProductCategories from './pages/store/product_categories.js';
|
|||||||
import PageStoreProductPermutations from './pages/store/product_permutations.js';
|
import PageStoreProductPermutations from './pages/store/product_permutations.js';
|
||||||
// import PageStoreProductPrices from './pages/store/product_prices.js';
|
// import PageStoreProductPrices from './pages/store/product_prices.js';
|
||||||
import PageStoreProducts from './pages/store/products.js';
|
import PageStoreProducts from './pages/store/products.js';
|
||||||
// import PageStoreProductVariations from './pages/store/product_variations.js';
|
import PageStoreProductVariations from './pages/store/product_variations.js';
|
||||||
import PageStoreStockItems from './pages/store/stock_items.js';
|
import PageStoreStockItems from './pages/store/stock_items.js';
|
||||||
import PageStoreSuppliers from './pages/store/suppliers.js';
|
import PageStoreSuppliers from './pages/store/suppliers.js';
|
||||||
import PageStoreSupplierPurchaseOrders from './pages/store/supplier_purchase_orders.js';
|
import PageStoreSupplierPurchaseOrders from './pages/store/supplier_purchase_orders.js';
|
||||||
@@ -85,7 +85,7 @@ export default class Router {
|
|||||||
this.pages[hashPageStoreProductPermutations] = { name: 'PageStoreProductPermutations', module: PageStoreProductPermutations }; // pathModule: './pages/store/product_permutations.js' };
|
this.pages[hashPageStoreProductPermutations] = { name: 'PageStoreProductPermutations', module: PageStoreProductPermutations }; // pathModule: './pages/store/product_permutations.js' };
|
||||||
// this.pages[hashPageStoreProductPrices] = { name: 'PageStoreProductPrices', module: PageStoreProductPrices }; // pathModule: './pages/store/product_prices.js' };
|
// this.pages[hashPageStoreProductPrices] = { name: 'PageStoreProductPrices', module: PageStoreProductPrices }; // pathModule: './pages/store/product_prices.js' };
|
||||||
this.pages[hashPageStoreProducts] = { name: 'PageStoreProducts', module: PageStoreProducts }; // pathModule: './pages/store/products.js' };
|
this.pages[hashPageStoreProducts] = { name: 'PageStoreProducts', module: PageStoreProducts }; // pathModule: './pages/store/products.js' };
|
||||||
// this.pages[hashPageStoreProductVariations] = { name: 'PageStoreProductVariations', module: PageStoreProductVariations }; // pathModule: './pages/store/product_variations.js' };
|
this.pages[hashPageStoreProductVariations] = { name: 'PageStoreProductVariations', module: PageStoreProductVariations }; // pathModule: './pages/store/product_variations.js' };
|
||||||
this.pages[hashPageStoreStockItems] = { name: 'PageStoreStockItems', module: PageStoreStockItems };
|
this.pages[hashPageStoreStockItems] = { name: 'PageStoreStockItems', module: PageStoreStockItems };
|
||||||
this.pages[hashPageStoreSuppliers] = { name: 'PageStoreSuppliers', module: PageStoreSuppliers };
|
this.pages[hashPageStoreSuppliers] = { name: 'PageStoreSuppliers', module: PageStoreSuppliers };
|
||||||
this.pages[hashPageStoreSupplierPurchaseOrders] = { name: 'PageSupplierPurchaseOrders', module: PageStoreSupplierPurchaseOrders };
|
this.pages[hashPageStoreSupplierPurchaseOrders] = { name: 'PageSupplierPurchaseOrders', module: PageStoreSupplierPurchaseOrders };
|
||||||
@@ -112,7 +112,7 @@ export default class Router {
|
|||||||
this.routes[hashPageStoreProductPermutations] = (isPopState = false) => this.navigateToHash(hashPageStoreProductPermutations, isPopState);
|
this.routes[hashPageStoreProductPermutations] = (isPopState = false) => this.navigateToHash(hashPageStoreProductPermutations, isPopState);
|
||||||
// this.routes[hashPageStoreProductPrices] = (isPopState = false) => this.navigateToHash(hashPageStoreProductPrices, isPopState);
|
// this.routes[hashPageStoreProductPrices] = (isPopState = false) => this.navigateToHash(hashPageStoreProductPrices, isPopState);
|
||||||
this.routes[hashPageStoreProducts] = (isPopState = false) => this.navigateToHash(hashPageStoreProducts, isPopState);
|
this.routes[hashPageStoreProducts] = (isPopState = false) => this.navigateToHash(hashPageStoreProducts, isPopState);
|
||||||
// this.routes[hashPageStoreProductVariations] = (isPopState = false) => this.navigateToHash(hashPageStoreProductVariations, isPopState);
|
this.routes[hashPageStoreProductVariations] = (isPopState = false) => this.navigateToHash(hashPageStoreProductVariations, isPopState);
|
||||||
this.routes[hashPageStoreStockItems] = (isPopState = false) => this.navigateToHash(hashPageStoreStockItems, isPopState);
|
this.routes[hashPageStoreStockItems] = (isPopState = false) => this.navigateToHash(hashPageStoreStockItems, isPopState);
|
||||||
this.routes[hashPageStoreSuppliers] = (isPopState = false) => this.navigateToHash(hashPageStoreSuppliers, isPopState);
|
this.routes[hashPageStoreSuppliers] = (isPopState = false) => this.navigateToHash(hashPageStoreSuppliers, isPopState);
|
||||||
this.routes[hashPageStoreSupplierPurchaseOrders] = (isPopState = false) => this.navigateToHash(hashPageStoreSupplierPurchaseOrders, isPopState);
|
this.routes[hashPageStoreSupplierPurchaseOrders] = (isPopState = false) => this.navigateToHash(hashPageStoreSupplierPurchaseOrders, isPopState);
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
{% with _is_blank_row = (is_blank_row or variation_type is not defined or variation_type.variations is none or variation_type.variations == [] or is_blank_row is not defined) %}
|
||||||
|
{% if not _is_blank_row %}
|
||||||
|
{# {% set ids_variation = variation_type.get_str_list_ids_variation() %} #}
|
||||||
|
<div class="{{ model.FLAG_PRODUCT_VARIATIONS }}"
|
||||||
|
{#
|
||||||
|
{{ model.ATTR_VALUE_CURRENT }}="{{ ids_variation }}"
|
||||||
|
{{ model.ATTR_VALUE_PREVIOUS }}="{{ ids_variation }}"
|
||||||
|
#}
|
||||||
|
>
|
||||||
|
{#
|
||||||
|
{{ variation_type.get_preview_variations() }}
|
||||||
|
#}
|
||||||
|
{% for variation in variation_type.variations %}
|
||||||
|
{{ variation.name }}<br>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
<div class="{{ model.FLAG_PRODUCT_VARIATIONS }}"></div>
|
||||||
|
{% endif %}
|
||||||
|
{% endwith %}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
{% with _is_blank_row = (is_blank_row or variation_tree is not defined or is_blank_row is not defined) %}
|
{% with _is_blank_row = (is_blank_row or variation_tree is not defined or is_blank_row is not defined) %}
|
||||||
{% if not is_blank_row %}
|
{% if not _is_blank_row %}
|
||||||
{# % set json_str_variation_types = product.get_json_str_types_variation_trees() % #}
|
{# % set json_str_variation_types = product.get_json_str_types_variation_trees() % #}
|
||||||
{% set names_variation_type = product.get_variation_types_unique() %}
|
{% set names_variation_type = product.get_variation_types_unique() %}
|
||||||
{% set json_str_variation_types = jsonify(names_variation_type) %}
|
{% set json_str_variation_types = jsonify(names_variation_type) %}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{% if is_blank_row %}
|
{% if is_blank_row %}
|
||||||
<tr class="{{ model.FLAG_ROW_NEW }} {{ model.FLAG_PRODUCT }}" {{ model.ATTR_ID_PRODUCT_CATEGORY }}>
|
<tr class="{{ model.FLAG_ROW_NEW }} {{ model.FLAG_PRODUCT }}" {{ model.ATTR_ID_PRODUCT }}>
|
||||||
<td class="{{ model.FLAG_DISPLAY_ORDER }}">
|
<td class="{{ model.FLAG_DISPLAY_ORDER }}">
|
||||||
{% include 'components/common/buttons/_slider_display_order.html' %}
|
{% include 'components/common/buttons/_slider_display_order.html' %}
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
65
templates/components/store/_row_product_variation_type.html
Normal file
65
templates/components/store/_row_product_variation_type.html
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
{% if is_blank_row %}
|
||||||
|
<tr class="{{ model.FLAG_ROW_NEW }} {{ model.FLAG_PRODUCT_VARIATION_TYPE }}" {{ model.ATTR_ID_PRODUCT_VARIATION_TYPE }}>
|
||||||
|
<td class="{{ model.FLAG_DISPLAY_ORDER }}">
|
||||||
|
{% include 'components/common/buttons/_slider_display_order.html' %}
|
||||||
|
</td>
|
||||||
|
<td class="{{ model.FLAG_CODE }}">
|
||||||
|
<textarea class="{{ model.FLAG_CODE }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
|
||||||
|
</td>
|
||||||
|
<td class="{{ model.FLAG_NAME }}">
|
||||||
|
<textarea class="{{ model.FLAG_NAME }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
|
||||||
|
</td>
|
||||||
|
<td class="{{ model.FLAG_NAME_PLURAL }}">
|
||||||
|
<textarea class="{{ model.FLAG_NAME_PLURAL }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
|
||||||
|
</td>
|
||||||
|
<td class="{{ model.FLAG_PRODUCT_VARIATIONS}} {{ model.FLAG_COLLAPSED }}">
|
||||||
|
{% include 'components/store/_preview_product_variation_type_variations.html' %}
|
||||||
|
</td>
|
||||||
|
<td class="{{ model.FLAG_ACTIVE }}">
|
||||||
|
{#
|
||||||
|
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" checked {{ model.ATTR_VALUE_CURRENT }}="{{ model.FLAG_BOOL_TRUE }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ model.FLAG_BOOL_TRUE }}">
|
||||||
|
#}
|
||||||
|
<button type="button" class="{{ model.FLAG_ACTIVE }} {{ model.FLAG_DELETE }}"
|
||||||
|
{{ model.ATTR_VALUE_CURRENT }}="{{ model.FLAG_BOOL_TRUE }}"
|
||||||
|
{{ model.ATTR_VALUE_PREVIOUS }}="{{ model.FLAG_BOOL_TRUE }}"
|
||||||
|
>x</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% else %}
|
||||||
|
<tr class="{{ model.FLAG_PRODUCT_VARIATION_TYPE }}" {{ model.ATTR_ID_PRODUCT_VARIATION_TYPE }}="{{ variation_type.id_type }}">
|
||||||
|
<td class="{{ model.FLAG_DISPLAY_ORDER }}">
|
||||||
|
{% set display_order = variation_type.display_order %}
|
||||||
|
{% include 'components/common/buttons/_slider_display_order.html' %}
|
||||||
|
</td>
|
||||||
|
<td class="{{ model.FLAG_CODE }}">
|
||||||
|
<textarea class="{{ model.FLAG_CODE }}"
|
||||||
|
{{ model.ATTR_VALUE_CURRENT }}="{{ variation_type.code }}"
|
||||||
|
{{ model.ATTR_VALUE_PREVIOUS }}="{{ variation_type.code }}"
|
||||||
|
>{{ variation_type.code }}</textarea>
|
||||||
|
</td>
|
||||||
|
<td class="{{ model.FLAG_NAME }}">
|
||||||
|
<textarea class="{{ model.FLAG_NAME }}"
|
||||||
|
{{ model.ATTR_VALUE_CURRENT }}="{{ variation_type.name_singular }}"
|
||||||
|
{{ model.ATTR_VALUE_PREVIOUS }}="{{ variation_type.name_singular }}"
|
||||||
|
>{{ variation_type.name_singular }}</textarea>
|
||||||
|
</td>
|
||||||
|
<td class="{{ model.FLAG_NAME_PLURAL }}">
|
||||||
|
<textarea class="{{ model.FLAG_NAME_PLURAL }}"
|
||||||
|
{{ model.ATTR_VALUE_CURRENT }}="{{ variation_type.name_plural }}"
|
||||||
|
{{ model.ATTR_VALUE_PREVIOUS }}="{{ variation_type.name_plural }}"
|
||||||
|
>{{ variation_type.name_plural }}</textarea>
|
||||||
|
</td>
|
||||||
|
<td class="{{ model.FLAG_PRODUCT_VARIATIONS}} {{ model.FLAG_COLLAPSED }}">
|
||||||
|
{% include 'components/store/_preview_product_variation_type_variations.html' %}
|
||||||
|
</td>
|
||||||
|
<td class="{{ model.FLAG_ACTIVE }}">
|
||||||
|
{#
|
||||||
|
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" {% if variation_type.active %}checked{% endif %} {{ model.ATTR_VALUE_CURRENT }}="{{ variation_type.active | lower }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ variation_type.active | lower }}">
|
||||||
|
#}
|
||||||
|
<button type="button" class="{{ model.FLAG_ACTIVE }} {% if variation_type.active %}{{ model.FLAG_DELETE }}{% endif %}"
|
||||||
|
{{ model.ATTR_VALUE_CURRENT }}="{{ variation_type.active | lower }}"
|
||||||
|
{{ model.ATTR_VALUE_PREVIOUS }}="{{ variation_type.active | lower }}"
|
||||||
|
>{% if variation_type.active %}x{% else %}+{% endif %}</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
@@ -108,6 +108,7 @@ var hashGetStoreManufacturingPurchaseOrder = "{{ model.HASH_GET_STORE_MANUFACTUR
|
|||||||
var hashGetStoreProduct = "{{ model.HASH_GET_STORE_PRODUCT }}";
|
var hashGetStoreProduct = "{{ model.HASH_GET_STORE_PRODUCT }}";
|
||||||
var hashGetStoreProductCategory = "{{ model.HASH_GET_STORE_PRODUCT_CATEGORY }}";
|
var hashGetStoreProductCategory = "{{ model.HASH_GET_STORE_PRODUCT_CATEGORY }}";
|
||||||
var hashGetStoreProductPermutation = "{{ model.HASH_GET_STORE_PRODUCT_PERMUTATION }}";
|
var hashGetStoreProductPermutation = "{{ model.HASH_GET_STORE_PRODUCT_PERMUTATION }}";
|
||||||
|
var hashGetStoreProductVariation = "{{ model.HASH_GET_STORE_PRODUCT_VARIATION }}";
|
||||||
var hashGetStoreStockItem = "{{ model.HASH_GET_STORE_STOCK_ITEM }}";
|
var hashGetStoreStockItem = "{{ model.HASH_GET_STORE_STOCK_ITEM }}";
|
||||||
var hashGetStoreSupplier = "{{ model.HASH_GET_STORE_SUPPLIER }}";
|
var hashGetStoreSupplier = "{{ model.HASH_GET_STORE_SUPPLIER }}";
|
||||||
var hashGetStoreSupplierPurchaseOrder = "{{ model.HASH_GET_STORE_SUPPLIER_PURCHASE_ORDER }}";
|
var hashGetStoreSupplierPurchaseOrder = "{{ model.HASH_GET_STORE_SUPPLIER_PURCHASE_ORDER }}";
|
||||||
@@ -116,6 +117,7 @@ var hashSaveStoreManufacturingPurchaseOrder = "{{ model.HASH_SAVE_STORE_MANUFACT
|
|||||||
var hashSaveStoreProduct = "{{ model.HASH_SAVE_STORE_PRODUCT }}";
|
var hashSaveStoreProduct = "{{ model.HASH_SAVE_STORE_PRODUCT }}";
|
||||||
var hashSaveStoreProductCategory = "{{ model.HASH_SAVE_STORE_PRODUCT_CATEGORY }}";
|
var hashSaveStoreProductCategory = "{{ model.HASH_SAVE_STORE_PRODUCT_CATEGORY }}";
|
||||||
var hashSaveStoreProductPermutation = "{{ model.HASH_SAVE_STORE_PRODUCT_PERMUTATION }}";
|
var hashSaveStoreProductPermutation = "{{ model.HASH_SAVE_STORE_PRODUCT_PERMUTATION }}";
|
||||||
|
var hashSaveStoreProductVariation = "{{ model.HASH_SAVE_STORE_PRODUCT_VARIATION }}";
|
||||||
var hashSaveStoreStockItem = "{{ model.HASH_SAVE_STORE_STOCK_ITEM }}";
|
var hashSaveStoreStockItem = "{{ model.HASH_SAVE_STORE_STOCK_ITEM }}";
|
||||||
var hashSaveStoreSupplier = "{{ model.HASH_SAVE_STORE_SUPPLIER }}";
|
var hashSaveStoreSupplier = "{{ model.HASH_SAVE_STORE_SUPPLIER }}";
|
||||||
var hashSaveStoreSupplierPurchaseOrder = "{{ model.HASH_SAVE_STORE_SUPPLIER_PURCHASE_ORDER }}";
|
var hashSaveStoreSupplierPurchaseOrder = "{{ model.HASH_SAVE_STORE_SUPPLIER_PURCHASE_ORDER }}";
|
||||||
|
|||||||
@@ -126,6 +126,7 @@
|
|||||||
var flagName = "{{ model.FLAG_NAME }}";
|
var flagName = "{{ model.FLAG_NAME }}";
|
||||||
var flagNameAttrOptionText = "{{ model.FLAG_NAME_ATTR_OPTION_TEXT}}";
|
var flagNameAttrOptionText = "{{ model.FLAG_NAME_ATTR_OPTION_TEXT}}";
|
||||||
var flagNameAttrOptionValue = "{{ model.FLAG_NAME_ATTR_OPTION_VALUE }}";
|
var flagNameAttrOptionValue = "{{ model.FLAG_NAME_ATTR_OPTION_VALUE }}";
|
||||||
|
var flagNamePlural = "{{ model.FLAG_NAME_PLURAL }}";
|
||||||
var flagNavAdminHome = "{{ model.FLAG_NAV_ADMIN_HOME }}";
|
var flagNavAdminHome = "{{ model.FLAG_NAV_ADMIN_HOME }}";
|
||||||
var flagNavAdminStoreStripePrices = "{{ model.FLAG_NAV_ADMIN_STORE_STRIPE_PRICES }}";
|
var flagNavAdminStoreStripePrices = "{{ model.FLAG_NAV_ADMIN_STORE_STRIPE_PRICES }}";
|
||||||
var flagNavAdminStoreStripeProducts = "{{ model.FLAG_NAV_ADMIN_STORE_STRIPE_PRODUCTS }}";
|
var flagNavAdminStoreStripeProducts = "{{ model.FLAG_NAV_ADMIN_STORE_STRIPE_PRODUCTS }}";
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user