diff --git a/app.log b/app.log index 6cd8a36f..d730f558 100644 --- a/app.log +++ b/app.log @@ -1,4 +1,36 @@ -Exception on /store/products [GET] +Server Error: 500 Internal Server Error: The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application. +Request: 127.0.0.1 GET http /login_callback?code=JMmHntUooZqn-PHB_xXhxkzf0lBMA6CcFQC1whmN23xUb&state=%2F Host: 127.0.0.1:5000 +Connection: keep-alive +Pragma: no-cache +Cache-Control: no-cache +Dnt: 1 +Upgrade-Insecure-Requests: 1 +User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 +Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 +Sec-Fetch-Site: cross-site +Sec-Fetch-Mode: navigate +Sec-Fetch-User: ?1 +Sec-Fetch-Dest: document +Sec-Ch-Ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128" +Sec-Ch-Ua-Mobile: ?0 +Sec-Ch-Ua-Platform: "Windows" +Accept-Encoding: gzip, deflate, br, zstd +Accept-Language: en-GB,en-US;q=0.9,en;q=0.8 +Cookie: session=.eJxtkG1rwjAQx79LwL7R9SG2aVooww2cCJvMMX1ZYnq10ZrUND5M2XdfKmNsMHLhwt3_cj_-V5S3hhnI2cFUfu6h9IoKZliXpZIcUIoeJrMZDquFv6mO7-PqeCrDCA2QhkJo4CY_aGFVlTFN6nkBjl3fniCNfN_3arUWMuesrleMb-3UQdff4taqCzjeyRPbYp8QKElFxVm6h9a90bhc7bzupbS4wL2GtlGyhdx8NJBxVYDDawHS5KLI1k-bD7N_eV4-Vm_ivJ_FeP56WUyWIwbT6WUunN-0Wbe-Nxz18NjGD7GtdMy29JfaabmyG-2Voug3WpWihj7smKidm3mZHXFubmX_evU5QHBuUBrEmETJMKSBGyUUUxLaDm91mRu1BWl9CUpK4pWPCcEkLjEDUuAoSRJKOUkIJauSch7E9ssvTeiOWA.ZumruQ.WqTz2NgZC14EQFnfvllT6CC2T3U + + +Request data: b'' +Traceback: Traceback (most recent call last): + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\routing\user.py", line 91, in login_callback + users, errors = datastore_user.get_many_user(user_filters, user) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\datastores\datastore_user.py", line 134, in get_many_user + guid = Helper_DB_MySQL.create_guid() + ^^^^^^^^^^^^^^^ +NameError: name 'Helper_DB_MySQL' is not defined + +During handling of the above exception, another exception occurred: + Traceback (most recent call last): File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 1473, in wsgi_app response = self.full_dispatch_request() @@ -15,55 +47,10 @@ Traceback (most recent call last): File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 865, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\routing\store\product.py", line 40, in products - filters.is_not_empty = filters.is_not_empty if arg_filter_is_not_empty is None else av.input_bool(arg_filter_is_not_empty, 'is_not_empty', 'filter') - ^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\pydantic\main.py", line 828, in __getattr__ - raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}') -AttributeError: 'Filters_Product' object has no attribute 'is_not_empty' -Server Error: 500 Internal Server Error: The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application. -Request: 127.0.0.1 GET http /store/products? Host: 127.0.0.1:5000 -Connection: keep-alive -Pragma: no-cache -Cache-Control: no-cache -Sec-Ch-Ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128" -Sec-Ch-Ua-Mobile: ?0 -Sec-Ch-Ua-Platform: "Windows" -Upgrade-Insecure-Requests: 1 -Dnt: 1 -User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 -Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 -Sec-Fetch-Site: same-origin -Sec-Fetch-Mode: navigate -Sec-Fetch-User: ?1 -Sec-Fetch-Dest: document -Referer: http://127.0.0.1:5000/store/products -Accept-Encoding: gzip, deflate, br, zstd -Accept-Language: en-GB,en-US;q=0.9,en;q=0.8 -Cookie: session=.eJytVlmvqzgS_iutSN1PnXPB7EdqzWQFcgJJSFhfIseGYLYQlgTovv99TM6de_uhZ5NGCsF2FVVfudbfJ7Bt4ltF6hDbdVhN3n-fIFicIc5Jca6bWxVO3puqDX_903H7Yvw8DXNIssn7JMRPWOG3nGCchc2tqHPSxH-_jtQ3dMsnv04iUtVNAXMqcHIKMe7pGcFn1FZVWKD-jMMItlkzeS_aLHuRqvBKbsVfED4BsN_X59EIhsp9vf8QBRlcFAHJioAZBUrMBbJMFEajwvr8Qnx-hBWJSIgn7xHM6vBFIQXKWhziszM7_dD6aScl121JVf3Z-Lqtvhlk_NPu6XE0fPKV3lddRefmloYFpQMlwgoQsYKlSxRCSQKcKCGJh5iHUBIVXpAlxIkshdh-cwNEKKzr7xLCfhNfVER2ZJNCTyfbxSa75Ma4nxuJDSzGNHXyJNAzBz25EahZDNIMcdsraeD5zaXAMRz0p5kEWZAEt52a8RcisKgXYuxZN2MhJBfAPPSCeXvze4tKEYTwmU3D5zp7c4SZLjNFgfY8-gjvHnuYabF2nJVyG-RcftMz42oEkvshrnMju1PU_bkqJC3z5i1MdprqYeuYRPLixBtp1xIQA8Xp-dapiMF2q3XBR7DyhLpr0E7Wc0U_SbVnFpqqM4_iHkBj734cVW7rFlwjHLzNw_WZM75Ws6WzUE6mVZ8f25PTbk9q90xdrdib7sbkhZnk5Iv1dGb46v1cwKMpbhqIV7t-Olsqnn44cz2zFstD_vHs9oqg9OFB2HN8L2SsxXe4q4fkYzhraz0Jmfn8ZkgztLA0rXkmDNsN-5pM8-3DkvIti_VcXnv3_rhke1GlydQaInPyuhvjMqudLekflrk8V7IVgT1bK9usW5sw3byFSz-WpuG534rKND3C3f3jsZjRMAi7klRhfYY0BFkJ8JLCA4n7cU5oUMgizzCvLPiLKDnag86aRK_1whLQQhf1tPScBd3nTRmM-8J5hF5gWynPX5LNI9CurJOut8Y6Zq1-o7xRYS10zeqSr5vgSD_InRSDdR8shAa6VnpRHeYChOHiZgx8CRbii2uPyrNAwzHKDy2lpYHaZVhVWgTYEqvxLABsDN1n6wOlGUMWqVmCNaf_1BEzWJsPOyI_aGgWKF8D37NiRD7D0_eCGKvrfjvYQ7A0cyM5MMYSp-aJGgt83lT93gRmbCwRbw4WCZY-s-cMxVxen5tCV5CK8mDJ3rBmPVFvD4ej3VuEPrmZ0nT4cypkRkp15WvG9zbD5rRRA_fQIlUoRszYm6cUVxaslRiPl5noT4qlMZbXxkgC20hWojHQ56S3u6XRu6Mjcqfx3awe0zNwLY7KTbc5WwaqVQee9bgUZgOp_oOKX3zb3Hxcjj--87ggQ3mWQ9dJ9aTMfbcbguP_IeWpPb43yqS4GHwPPas7pax3APEJenF3GuhNZWvRSWPv4K6zY1qKdp6OJaj0vQPZJSuO2s593rkx4uXHgDNOqDeXiDGGK2f01M-cQ0YdVBcDl3PZTGzeyHXBdA1-d3JSY5nF5jAn_mn1DHInf8UGyF64fC4GFpupgeM8Ajue23lTBKqwN_Ly6J7i1k07YKhKYuSrEVdL4zJ5xVNyYEM1digtDoY5H6hpb3M4NtR4NZa62lxb5-BKHJ-5qoVdajZnlPuzVazqW-MRdyezCjSVVfjQFnay2OaaKUXA6QU9AF2xVze7JPUUwlv2gLj99n7XpG2UwvlSjqMqR_gBBj9sTZNfzbIbK88Jm8b6ScmwLboPgDwP28vzAe6Jve-rbLbWzdPUkjeLsJLSSJ0zRGkS3lxZ9rXNHd2XzMtuhYDdAbT1uzTxC6yWxqoaem56MUV1WGhXJlJMf1668VTeldou1ARNP2ERHmc7jdSYd4J0teM6Ge27w95p5_e5EIG2STucgGNM7BLuNGjNHwuwmw5G0JRbrduLW8VAZ24mrKKj5YNl1qvk3q8ObHe_xayr6i6u4xKtMCPx7JXWrxrdyrEz0v-C4J_K6haRLPzpc174dfIqWOemf_HMQ1jRpvfZ-0gR3V79r6XNeXJVk765m4a7iI-ku-8kYB0GR3NnMNxsaH5P_pcR5F-0flpSv9VYnpPHGku-F11G-jyoa6ogbpqyfv_yBYePafGEKWBEMYzEWCZd8dbWb6_pY1T1her6Nhj8Z1AFQem_Yx5ZbgUa6bzQxTZzg1emwwQcn5CJl5RcEtS046D2HWH9dq3gAzawesH5XH4ROMxFgOcZCQtAkCKZj4CE4Ggjf8Ei_7f6N15mfql-K6-_4N9esn7mZj-DNf0hXPywj-4_RdZ0FeK3snh5nIwOQ91D9dehfQu1mZVecbEDieXLRbB9MDcE4MjYXv6bWa0tMWzoNDY6YwIYwE8ZeQrEE2DfOfadBW8yB4LJ169f_wFsnZ0r.Zsz0IQ.CsqbE-G2jF9oYmUiZKS36HfeRw4 - - -Request data: b'' -Traceback: Traceback (most recent call last): - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 1473, in wsgi_app - response = self.full_dispatch_request() - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request - rv = self.handle_user_exception(e) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask_cors\extension.py", line 178, in wrapped_function - return cors_after_request(app.make_response(f(*args, **kwargs))) - ^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request - rv = self.dispatch_request() - ^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 865, in dispatch_request - return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\routing\store\product.py", line 40, in products - filters.is_not_empty = filters.is_not_empty if arg_filter_is_not_empty is None else av.input_bool(arg_filter_is_not_empty, 'is_not_empty', 'filter') - ^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\pydantic\main.py", line 828, in __getattr__ - raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}') -AttributeError: 'Filters_Product' object has no attribute 'is_not_empty' + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\routing\user.py", line 120, in login_callback + return jsonify({Model_View_Base.FLAG_STATUS: Model_View_Base.STATUS_FAILURE, Model_View_Base.FLAG_MESSAGE: f'Controller error.\n{e}'}) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\pydantic\_internal\_model_construction.py", line 237, in __getattr__ + raise AttributeError(item) +AttributeError: STATUS_FAILURE diff --git a/app.log.1 b/app.log.1 new file mode 100644 index 00000000..dcc9f9e2 --- /dev/null +++ b/app.log.1 @@ -0,0 +1,103 @@ +Exception on /store/products [GET] +Traceback (most recent call last): + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 1473, in wsgi_app + response = self.full_dispatch_request() + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request + rv = self.handle_user_exception(e) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask_cors\extension.py", line 178, in wrapped_function + return cors_after_request(app.make_response(f(*args, **kwargs))) + ^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request + rv = self.dispatch_request() + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 865, in dispatch_request + return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\routing\store\product.py", line 40, in products + filters.is_not_empty = filters.is_not_empty if arg_filter_is_not_empty is None else av.input_bool(arg_filter_is_not_empty, 'is_not_empty', 'filter') + ^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\pydantic\main.py", line 828, in __getattr__ + raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}') +AttributeError: 'Filters_Product' object has no attribute 'is_not_empty' +Server Error: 500 Internal Server Error: The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application. +Request: 127.0.0.1 GET http /store/products? Host: 127.0.0.1:5000 +Connection: keep-alive +Pragma: no-cache +Cache-Control: no-cache +Sec-Ch-Ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128" +Sec-Ch-Ua-Mobile: ?0 +Sec-Ch-Ua-Platform: "Windows" +Upgrade-Insecure-Requests: 1 +Dnt: 1 +User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 +Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 +Sec-Fetch-Site: same-origin +Sec-Fetch-Mode: navigate +Sec-Fetch-User: ?1 +Sec-Fetch-Dest: document +Referer: http://127.0.0.1:5000/store/products +Accept-Encoding: gzip, deflate, br, zstd +Accept-Language: en-GB,en-US;q=0.9,en;q=0.8 +Cookie: session=.eJytVlmvqzgS_iutSN1PnXPB7EdqzWQFcgJJSFhfIseGYLYQlgTovv99TM6de_uhZ5NGCsF2FVVfudbfJ7Bt4ltF6hDbdVhN3n-fIFicIc5Jca6bWxVO3puqDX_903H7Yvw8DXNIssn7JMRPWOG3nGCchc2tqHPSxH-_jtQ3dMsnv04iUtVNAXMqcHIKMe7pGcFn1FZVWKD-jMMItlkzeS_aLHuRqvBKbsVfED4BsN_X59EIhsp9vf8QBRlcFAHJioAZBUrMBbJMFEajwvr8Qnx-hBWJSIgn7xHM6vBFIQXKWhziszM7_dD6aScl121JVf3Z-Lqtvhlk_NPu6XE0fPKV3lddRefmloYFpQMlwgoQsYKlSxRCSQKcKCGJh5iHUBIVXpAlxIkshdh-cwNEKKzr7xLCfhNfVER2ZJNCTyfbxSa75Ma4nxuJDSzGNHXyJNAzBz25EahZDNIMcdsraeD5zaXAMRz0p5kEWZAEt52a8RcisKgXYuxZN2MhJBfAPPSCeXvze4tKEYTwmU3D5zp7c4SZLjNFgfY8-gjvHnuYabF2nJVyG-RcftMz42oEkvshrnMju1PU_bkqJC3z5i1MdprqYeuYRPLixBtp1xIQA8Xp-dapiMF2q3XBR7DyhLpr0E7Wc0U_SbVnFpqqM4_iHkBj734cVW7rFlwjHLzNw_WZM75Ws6WzUE6mVZ8f25PTbk9q90xdrdib7sbkhZnk5Iv1dGb46v1cwKMpbhqIV7t-Olsqnn44cz2zFstD_vHs9oqg9OFB2HN8L2SsxXe4q4fkYzhraz0Jmfn8ZkgztLA0rXkmDNsN-5pM8-3DkvIti_VcXnv3_rhke1GlydQaInPyuhvjMqudLekflrk8V7IVgT1bK9usW5sw3byFSz-WpuG534rKND3C3f3jsZjRMAi7klRhfYY0BFkJ8JLCA4n7cU5oUMgizzCvLPiLKDnag86aRK_1whLQQhf1tPScBd3nTRmM-8J5hF5gWynPX5LNI9CurJOut8Y6Zq1-o7xRYS10zeqSr5vgSD_InRSDdR8shAa6VnpRHeYChOHiZgx8CRbii2uPyrNAwzHKDy2lpYHaZVhVWgTYEqvxLABsDN1n6wOlGUMWqVmCNaf_1BEzWJsPOyI_aGgWKF8D37NiRD7D0_eCGKvrfjvYQ7A0cyM5MMYSp-aJGgt83lT93gRmbCwRbw4WCZY-s-cMxVxen5tCV5CK8mDJ3rBmPVFvD4ej3VuEPrmZ0nT4cypkRkp15WvG9zbD5rRRA_fQIlUoRszYm6cUVxaslRiPl5noT4qlMZbXxkgC20hWojHQ56S3u6XRu6Mjcqfx3awe0zNwLY7KTbc5WwaqVQee9bgUZgOp_oOKX3zb3Hxcjj--87ggQ3mWQ9dJ9aTMfbcbguP_IeWpPb43yqS4GHwPPas7pax3APEJenF3GuhNZWvRSWPv4K6zY1qKdp6OJaj0vQPZJSuO2s593rkx4uXHgDNOqDeXiDGGK2f01M-cQ0YdVBcDl3PZTGzeyHXBdA1-d3JSY5nF5jAn_mn1DHInf8UGyF64fC4GFpupgeM8Ajue23lTBKqwN_Ly6J7i1k07YKhKYuSrEVdL4zJ5xVNyYEM1digtDoY5H6hpb3M4NtR4NZa62lxb5-BKHJ-5qoVdajZnlPuzVazqW-MRdyezCjSVVfjQFnay2OaaKUXA6QU9AF2xVze7JPUUwlv2gLj99n7XpG2UwvlSjqMqR_gBBj9sTZNfzbIbK88Jm8b6ScmwLboPgDwP28vzAe6Jve-rbLbWzdPUkjeLsJLSSJ0zRGkS3lxZ9rXNHd2XzMtuhYDdAbT1uzTxC6yWxqoaem56MUV1WGhXJlJMf1668VTeldou1ARNP2ERHmc7jdSYd4J0teM6Ge27w95p5_e5EIG2STucgGNM7BLuNGjNHwuwmw5G0JRbrduLW8VAZ24mrKKj5YNl1qvk3q8ObHe_xayr6i6u4xKtMCPx7JXWrxrdyrEz0v-C4J_K6haRLPzpc174dfIqWOemf_HMQ1jRpvfZ-0gR3V79r6XNeXJVk765m4a7iI-ku-8kYB0GR3NnMNxsaH5P_pcR5F-0flpSv9VYnpPHGku-F11G-jyoa6ogbpqyfv_yBYePafGEKWBEMYzEWCZd8dbWb6_pY1T1her6Nhj8Z1AFQem_Yx5ZbgUa6bzQxTZzg1emwwQcn5CJl5RcEtS046D2HWH9dq3gAzawesH5XH4ROMxFgOcZCQtAkCKZj4CE4Ggjf8Ei_7f6N15mfql-K6-_4N9esn7mZj-DNf0hXPywj-4_RdZ0FeK3snh5nIwOQ91D9dehfQu1mZVecbEDieXLRbB9MDcE4MjYXv6bWa0tMWzoNDY6YwIYwE8ZeQrEE2DfOfadBW8yB4LJ169f_wFsnZ0r.Zsz0IQ.CsqbE-G2jF9oYmUiZKS36HfeRw4 + + +Request data: b'' +Traceback: Traceback (most recent call last): + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 1473, in wsgi_app + response = self.full_dispatch_request() + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request + rv = self.handle_user_exception(e) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask_cors\extension.py", line 178, in wrapped_function + return cors_after_request(app.make_response(f(*args, **kwargs))) + ^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request + rv = self.dispatch_request() + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 865, in dispatch_request + return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\routing\store\product.py", line 40, in products + filters.is_not_empty = filters.is_not_empty if arg_filter_is_not_empty is None else av.input_bool(arg_filter_is_not_empty, 'is_not_empty', 'filter') + ^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\pydantic\main.py", line 828, in __getattr__ + raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}') +AttributeError: 'Filters_Product' object has no attribute 'is_not_empty' + +Exception on /login_callback [GET] +Traceback (most recent call last): + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\routing\user.py", line 91, in login_callback + users, errors = datastore_user.get_many_user(user_filters, user) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\datastores\datastore_user.py", line 134, in get_many_user + guid = Helper_DB_MySQL.create_guid() + ^^^^^^^^^^^^^^^ +NameError: name 'Helper_DB_MySQL' is not defined + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 1473, in wsgi_app + response = self.full_dispatch_request() + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request + rv = self.handle_user_exception(e) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask_cors\extension.py", line 178, in wrapped_function + return cors_after_request(app.make_response(f(*args, **kwargs))) + ^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request + rv = self.dispatch_request() + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 865, in dispatch_request + return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\routing\user.py", line 120, in login_callback + return jsonify({Model_View_Base.FLAG_STATUS: Model_View_Base.STATUS_FAILURE, Model_View_Base.FLAG_MESSAGE: f'Controller error.\n{e}'}) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\pydantic\_internal\_model_construction.py", line 237, in __getattr__ + raise AttributeError(item) +AttributeError: STATUS_FAILURE diff --git a/datastores/__pycache__/datastore_user.cpython-312.pyc b/datastores/__pycache__/datastore_user.cpython-312.pyc index 4835f896..7abc9606 100644 Binary files a/datastores/__pycache__/datastore_user.cpython-312.pyc and b/datastores/__pycache__/datastore_user.cpython-312.pyc differ diff --git a/datastores/datastore_user.py b/datastores/datastore_user.py index 39fe4c0f..afbfe550 100644 --- a/datastores/datastore_user.py +++ b/datastores/datastore_user.py @@ -27,7 +27,7 @@ from business_objects.store.stock_item import Stock_Item, Stock_Item_Filters 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_List from datastores.datastore_base import DataStore_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 extensions import db # external diff --git a/static/dist/js/main.bundle.js b/static/dist/js/main.bundle.js index 383449d8..f99376f3 100644 --- a/static/dist/js/main.bundle.js +++ b/static/dist/js/main.bundle.js @@ -1,2 +1,2 @@ /*! For license information please see main.bundle.js.LICENSE.txt */ -(()=>{"use strict";(()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){for(var n=0;n0)if(r)t=!1;else if("string"!=typeof e[0])t=!1;else for(var n=0;n0)}},{key:"getDataContentType",value:function(t){var r=null,n="";return e.isEmpty(t)||("string"==typeof t?(r=t,n="application/x-www-form-urlencoded; charset=UTF-8"):(r=JSON.stringify(t),n="application/json; charset=UTF-8")),{Data:r,ContentType:n}}},{key:"arrayContainsItem",value:function(t,r){var n=!1;if(!e.isEmpty(t)&&!e.isEmpty(r))if(t[0]instanceof jQuery){for(var o=0;o=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:D(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function m(e,t,r,n,o,i,a){try{var l=e[i](a),u=l.value}catch(e){return void r(e)}l.done?t(u):Promise.resolve(u).then(n,o)}function b(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){m(i,n,o,a,l,"next",e)}function l(e){m(i,n,o,a,l,"throw",e)}a(void 0)}))}}function S(e,t){for(var r=0;r1&&void 0!==c[1]?c[1]:"GET",o=c.length>2&&void 0!==c[2]?c[2]:null,i=c.length>3&&void 0!==c[3]?c[3]:null,a=e.getUrlFromHash(r,i),l={method:n,headers:{"Content-Type":"application/json","X-CSRFToken":e.getCsrfToken()}},!o||"POST"!==n&&"PUT"!==n&&"PATCH"!==n||(l.body=JSON.stringify(o)),console.log("API request:",n,a,o),t.prev=7,t.next=10,fetch(a,l);case 10:if((u=t.sent).ok){t.next=13;break}throw new Error("HTTP error! status: ".concat(u.status));case 13:return t.next=15,u.json();case 15:return t.abrupt("return",t.sent);case 18:throw t.prev=18,t.t0=t.catch(7),console.error("API request failed:",t.t0),t.t0;case 22:case"end":return t.stop()}}),t,null,[[7,18]])}))),function(e){return u.apply(this,arguments)})},{key:"getUrlFromHash",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;null==e&&(e=hashPageHome),console.log("getUrlFromHash:"),console.log("base url: "+_pathHost+"\nhash: "+e+"\nparams: "+t);var r=_pathHost+e;return t&&(r+="?"+new URLSearchParams(t).toString()),console.log("url: "+r),r}},{key:"goToUrl",value:function(e){window.location.href=e}},{key:"goToHash",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.getUrlFromHash(t,r);e.goToUrl(n)}},{key:"loginUser",value:(a=b(g().mark((function t(){var r;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(r={})[keyCallback]=l.getHashPageCurrent(),t.next=4,e.request(hashPageUserLogin,"POST",r);case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)}))),function(){return a.apply(this,arguments)})},{key:"getCategories",value:(i=b(g().mark((function t(){return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.request(hashGetStoreProductCategory);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)}))),function(){return i.apply(this,arguments)})},{key:"getCategoriesByFilters",value:(o=b(g().mark((function t(r){return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.goToHash(hashPageStoreProductCategories,r);case 1:case"end":return t.stop()}}),t)}))),function(e){return o.apply(this,arguments)})},{key:"saveCategories",value:(n=b(g().mark((function t(r,n,o){var i;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(i={})[flagFormFilters]=l.convertForm2JSON(n),i[flagCategory]=r,i[flagComment]=o,t.next=6,e.request(hashSaveStoreProductCategory,"POST",i);case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)}))),function(e,t,r){return n.apply(this,arguments)})}],r&&S(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,n,o,i,a,u}();function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}function E(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;null==t&&(t=document.querySelector("form."+flagFilter+" button."+flagSave)),null==r&&(r=document.querySelector("form."+flagFilter+" button."+flagCancel)),e?(r.classList.remove(flagCollapsed),t.classList.remove(flagCollapsed)):(r.classList.add(flagCollapsed),t.classList.add(flagCollapsed))}}],n=[{key:"isDirtyFilter",value:function(e){var t=l.isElementDirty(e);return t&&document.querySelectorAll(idTableMain+" tbody tr").remove(),t}}],r&&E(t.prototype,r),n&&E(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,n}();function L(e){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},L(e)}function j(e,t){for(var r=0;r at "+r[keyPostcode]+"",document.querySelectorAll(idOverlayInfoBilling).css("display","none"),document.querySelectorAll(idOverlayInfoBilling).querySelector("form").classList.add(flagSubmitted)}else document.querySelectorAll(idContainerInfoDelivery).querySelector("div").innerHTML=""+r[keyNameFull]+" at "+r[keyPostcode]+"",document.querySelectorAll(idOverlayInfoDelivery).css("display","none"),document.querySelectorAll(idOverlayInfoDelivery).querySelector("form").classList.add(flagSubmitted)}},{key:"convertFormBilling2JSON",value:function(e,t){var r;r=document.querySelectorAll(t).querySelector("form"),r=document.querySelectorAll(idOverlayInfoDelivery).querySelector("form"),console.log("converting billing form to json\nform ID: "+r.id),e[keyForm]=convertForm2JSON(r);var n=[keyNameFull,keyPhoneNumber,keyPostcode,keyAddress1,keyAddress2,keyCity,keyCounty];for(var o in console.log("ajaxData:"),console.log(e),e[keyForm][keyInfoIdentical]=getElementCurrentValue(r.querySelector("#"+keyInfoIdentical)),n)t==idOverlayInfoBilling&&e[keyForm][keyInfoIdentical]?e[keyForm][n[o]]=getElementCurrentValue((void 0).querySelector("#"+n[o])):e[keyForm][n[o]]=getElementCurrentValue(r.querySelector("#"+n[o]));return console.log("ajaxData:"),console.log(e),e}},{key:"hookupButtonCheckoutSession",value:function(){var e=document.querySelectorAll(idButtonCheckout);e.classList.remove(flagInitialised),f.initialiseEventHandler(idButtonCheckout,flagInitialised,(function(){e.removeEventListener("click"),e.addEventListener("click",(function(e){var t=v.getLocalStorage(keyBasket),r={};r[keyBasket]=t,r=convertFormBilling2JSON(r,idOverlayInfoDelivery),(r=convertFormBilling2JSON(r,idOverlayInfoBilling))[key_code_currency]=getCurrencySelected(),ajaxJSONData("checkout session",mapHashToController(hashPageStoreCheckout),r,handleResponseCheckout,!1)}))}))}},{key:"handleResponseCheckout",value:function(e){window.location.href=e.data[keyUrlCheckout]}},{key:"hookupButtonFormBillingCopy",value:function(){f.initialiseEventHandler(idButtonFormBillingCopy,flagInitialised,(function(){document.querySelectorAll(idButtonFormBillingCopy).addEventListener("click",(function(e){var t=[keyNameFull,keyPhoneNumber,keyPostcode,keyAddress1,keyAddress2,keyCity,keyCounty],r=document.querySelectorAll(idOverlayInfoBilling).querySelector("form"),n=document.querySelectorAll(idOverlayInfoDelivery).querySelector("form");for(var o in t)r.querySelector("#"+t[o]).value=getElementCurrentValue(n.querySelector("#"+t[o]))}))}))}},{key:"leave",value:function(){!function(e,t,r){var n=Qe(ze(e.prototype),"leave",r);return"function"==typeof n?function(e){return n.apply(r,e)}:n}(t,0,this)([])}}])}(C);function Ke(e){return Ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ke(e)}function Xe(e,t){for(var r=0;r0&&void 0!==arguments[0]&&arguments[0];if(this.constructor===t)throw new Error("Must implement initialize() method.");if(r){var o=this.getLocalStoragePage()[flagFormFilters],i=this.getFormFilters(),a=l.convertForm2JSON(i);n.areEqualDicts(o,a)}else this.sharedInitialize(),this.hookupFilters(),this.hookupButtonsAddSaveCancel(),this.hookupTableMain(),hookupOverlayConfirm((function(){e.leave(),e.saveRecordsTableDirty()}))}},{key:"hookupFilters",value:function(){if(this.constructor===t)throw new Error("Subclass of TableBasePage must implement method hookupFilters().");this.hookupButtonApplyFilters()}},{key:"hookupFilterActive",value:function(){f.initialiseEventHandler(idFormFilters+"."+flagActive,flagInitialised,(function(e){e.addEventListener("change",(function(r){t.isDirtyFilter(e)}))}))}},{key:"hookupButtonApplyFilters",value:function(){var e=this;f.initialiseEventHandler(idButtonApplyFilters,flagInitialised,(function(t){t.addEventListener("click",(function(t){t.stopPropagation(),e.getAndLoadFilteredTableContent()}))}))}},{key:"getAndLoadFilteredTableContent",value:function(){var e=this.getFormFilters(),t=l.convertForm2JSON(e);this.callFilterTableContent(t).catch((function(e){return console.error("Error:",e)}))}},{key:"getFormFilters",value:function(){return document.querySelector(idFormFilters)}},{key:"callbackLoadTableContent",value:function(e){this.getTableMain().querySelector("tbody").querySelectorAll("tr").forEach((function(e){e.remove()}));var t=e.data[flagRows];!n.isEmpty(t)&&t.every((function(e){return e.hasOwnProperty("display_order")}))&&(t=t.sort((function(e,t){return e.display_order-t.display_order}))),t.forEach(this.loadRowTable.bind(this)),this.hookupTableMain()}},{key:"getTableMain",value:function(){return document.querySelector(idTableMain)}},{key:"loadRowTable",value:function(e){throw new Error("Subclass of TableBasePage must implement method loadRowTable().")}},{key:"hookupButtonsAddSaveCancel",value:function(){this.hookupButtonSave(),this.hookupButtonCancel(),this.hookupButtonAddRowTable()}},{key:"saveRecordsTableDirty",value:function(){var e=this,t=this.getTableRecords(!0);if(0!=t.length){var r=this.getFormFilters(),n=l.getElementValueCurrent(document.querySelector(idTextareaConfirm));this.callSaveTableContent(t,r,n).then((function(t){t[flagStatus]==flagSuccess?(console.log("Data received:",t),e.callbackLoadTableContent(t),console.log("Records saved!")):showOverlayError(t[flagMessage])})).catch((function(e){return console.error("Error:",e)}))}else showOverlayError("No records to save")}},{key:"getTableRecords",value:function(){var e,t=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.getTableMain(),o=[];return n.querySelectorAll("tbody tr").forEach((function(n){r&&!n.classList.contains(flagDirty)||(e=t.getJsonRow(n),o.push(e))})),o}},{key:"getJsonRow",value:function(e){throw new Error("Subclass of TableBasePage must implement method getJsonRow().")}},{key:"hookupButtonCancel",value:function(){f.initialiseEventHandler(idFormFilters+" button."+flagCancel,flagInitialised,(function(e){e.addEventListener("click",(function(e){e.stopPropagation(),getAndLoadFilteredTableContent()})),e.classList.add(flagCollapsed)}))}},{key:"hookupButtonAddRowTable",value:function(){var e=this;f.initialiseEventHandler(idFormFilters+" button."+flagAdd,flagInitialised,(function(t){t.addEventListener("click",(function(t){t.stopPropagation();var r=document.querySelector(idTableMain+" tbody"),n=_rowBlank.cloneNode(!0);n.classList.remove(flagInitialised),n.querySelectorAll("."+flagInitialised).forEach((function(e){e.classList.remove(flagInitialised)}));var o=parseInt(r.querySelector("tr:last-child").querySelector("td."+flagDisplayOrder+" ."+flagSlider).getAttribute(attrValueCurrent))+1;r.appendChild(n);var i=r.querySelector("tr:last-child").querySelector("td."+flagDisplayOrder+" ."+flagSlider);i&&(i.setAttribute(attrValueCurrent,o),i.setAttribute(attrValuePrevious,o)),e.hookupTableMain()}))}))}},{key:"hookupTableMain",value:function(){if(this.constructor===t)throw new Error("Must implement hookupTableMain() method.");null==_rowBlank&&this.cacheRowBlank()}},{key:"cacheRowBlank",value:function(){var e=idTableMain+" tbody tr."+flagRowNew,t=document.querySelector(e);console.log("row blank temp: ",t),_rowBlank=t.cloneNode(!0),document.querySelectorAll(e).forEach((function(e){e.remove()}))}},{key:"hookupSlidersDisplayOrderTable",value:function(){var e=this,t=idTableMain+" tbody tr td."+flagDisplayOrder+" input."+flagSlider+"."+flagDisplayOrder;f.initialiseEventHandler(t,flagInitialised,(function(t){t.addEventListener("change",(function(r){console.log("slider change event"),e.handleChangeElementCellTable(t)}))}))}},{key:"hookupTextareasCodeTable",value:function(){var e=this,t=idTableMain+" tbody tr td."+flagCode+" textarea";f.initialiseEventHandler(t,flagInitialised,(function(t){t.addEventListener("change",(function(r){console.log("textarea change event"),e.handleChangeElementCellTable(t)}))}))}},{key:"handleChangeElementCellTable",value:function(e){var t=l.getRowFromElement(e),r=l.getCellFromElement(e);console.log("td: ",r);var n=this.isDirtyRow(t),o=e.classList.contains(flagDirty),i=l.isElementDirty(e);if(console.log("isDirtyElement: ",i),console.log("wasDirtyElement: ",o),i!=o){l.handleDirtyElement(r,i);var a=this.isDirtyRow(t);if(console.log("isNowDirtyRow: ",a),console.log("wasDirtyRow: ",n),a!=n){l.handleDirtyElement(t,a);var u=this.getTableRecords(!0),c=u.length>0;console.log("dirty records:",u),console.log("existsDirtyRecord:",c),this.toggleShowButtonsSaveCancel(c)}}}},{key:"isDirtyRow",value:function(e){throw new Error("Subclass of TableBasePage must implement method isDirtyRow().")}},{key:"toggleShowButtonsSaveCancel",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;null==t&&(t=document.querySelector(idFormFilters+" button."+flagSave)),null==r&&(r=document.querySelector(idFormFilters+" button."+flagCancel)),e?(r.classList.remove(flagCollapsed),t.classList.remove(flagCollapsed)):(r.classList.add(flagCollapsed),t.classList.add(flagCollapsed))}},{key:"handleChangeSelectCellTable",value:function(e){var t=l.getRowFromElement(e),r=l.getCellFromElement(e);console.log("td: ",r);var n=this.isDirtyRow(t),o=e.classList.contains(flagDirty),i=l.isElementDirty(e);if(console.log("isDirtyElement: ",i),console.log("wasDirtyElement: ",o),i!=o){l.handleDirtyElement(r,i);var a=e.options[e.selectedIndex];r.setAttribute(attrIdAccessLevel,a.value),r.setAttribute(flagAccessLevelRequired,a.textcontent);var u=this.isDirtyRow(t);if(console.log("isNowDirtyRow: ",u),console.log("wasDirtyRow: ",n),u!=n){l.handleDirtyElement(t,u);var c=this.getTableRecords(!0),s=c.length>0;console.log("dirty records:",c),console.log("existsDirtyRecord:",s),this.toggleShowButtonsSaveCancel(s)}}}},{key:"hookupTextareasNameTable",value:function(){var e=this,t=idTableMain+" tbody tr td."+flagName+" textarea";f.initialiseEventHandler(t,flagInitialised,(function(t){t.addEventListener("change",(function(r){console.log("textarea change event"),e.handleChangeElementCellTable(t)}))}))}},{key:"hookupTextareasDescriptionTable",value:function(){var e=this,t=idTableMain+" tbody tr td."+flagDescription+" textarea";f.initialiseEventHandler(t,flagInitialised,(function(t){t.addEventListener("change",(function(r){console.log("textarea change event"),e.handleChangeElementCellTable(t)}))}))}},{key:"hookupInputsActiveTable",value:function(){var e=this,t=idTableMain+" tbody tr td."+flagActive+' input[type="checkbox"]';f.initialiseEventHandler(t,flagInitialised,(function(t){t.addEventListener("change",(function(r){console.log("input change event"),e.handleChangeElementCellTable(t)}))}))}},{key:"hookupTdsAccessLevel",value:function(){var e=this;f.initialiseEventHandler(idTableMain+" tbody td."+flagAccessLevel,flagInitialised,(function(t){t.addEventListener("click",(function(t){e.handleClickTdAccessLevel(t)}))}))}},{key:"handleClickTdAccessLevel",value:function(e){console.log("tdAccessLevel clicked"),e.stopPropagation();var t=l.getCellFromElement(e.target);console.log("tdAccessLevel: ",t);var r=l.getRowFromElement(t),n=t.querySelector("div."+flagAccessLevel).getAttribute(attrIdAccessLevel),o=document.createElement("select");o.classList.add(flagAccessLevel),o.setAttribute(attrValueCurrent,n),o.setAttribute(attrValuePrevious,n),optionsAccessLevel.forEach((function(e){var t=document.createElement("option");t.value=e.value,t.textContent=e.text,e.value==n&&(t.selected=!0),o.appendChild(t)}));var i=t.cloneNode(!0);i.innerHTML="",i.appendChild(o),r.replaceChild(i,t),this.hookupDdlsAccessLevelTable()}},{key:"hookupDdlsAccessLevelTable",value:function(){var e=this;f.initialiseEventHandler(idTableMain+" tbody select."+flagAccessLevel,flagInitialised,(function(t){t.addEventListener("change",(function(r){r.stopPropagation(),e.handleChangeDdlAccessLevelTable(t)}))}))}},{key:"handleChangeDdlAccessLevelTable",value:function(e){var t=l.getRowFromElement(e),r=l.getCellFromElement(e);console.log("td: ",r);var n=this.isDirtyRow(t),o=e.classList.contains(flagDirty),i=l.isElementDirty(e);if(console.log("isDirtyElement: ",i),console.log("wasDirtyElement: ",o),i!=o){l.handleDirtyElement(r,i);var a=e.options[e.selectedIndex];r.setAttribute(attrIdAccessLevel,a.value),r.setAttribute(flagAccessLevelRequired,a.textcontent);var u=this.isDirtyRow(t);if(console.log("isNowDirtyRow: ",u),console.log("wasDirtyRow: ",n),u!=n){l.handleDirtyElement(t,u);var c=this.getTableRecords(!0),s=c.length>0;console.log("dirty records:",c),console.log("existsDirtyRecord:",s),this.toggleShowButtonsSaveCancel(s)}}}},{key:"leave",value:function(){if(this.constructor===t)throw new Error("Must implement leave() method.");!function(e,t,r){var n=ut(ct(e.prototype),"leave",r);return"function"==typeof n?function(e){return n.apply(r,e)}:n}(t,0,this)([]);var e=this.getFormFilters(),r={};r[flagFormFilters]=l.convertForm2JSON(e),this.setLocalStoragePage(r),_rowBlank=null}}],[{key:"isDirtyFilter",value:function(e){var t=l.isElementDirty(e);if(t){var r=document.querySelector(idTableMain+" tbody");r.querySelectorAll("tr").remove(),r.appendChild(document.createElement('
Press "Apply Filters" to refresh the table.
'))}return t}}])}(C);function yt(e){return yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yt(e)}function dt(e,t){for(var r=0;r",t))})),e.addEventListener("change",(function(e){loadPermutations()}))})),f.initialiseEventHandler(idFilterIsOutOfStock,flagInitialised,(function(e){e.addEventListener("change",(function(e){loadPermutations()}))})),f.initialiseEventHandler(idFilterQuantityMin,flagInitialised,(function(e){e.addEventListener("change",(function(e){loadPermutations()}))})),f.initialiseEventHandler(idFilterQuantityMax,flagInitialised,(function(e){e.addEventListener("change",(function(e){loadPermutations()}))}))}},{key:"loadPermutations",value:function(){var e=document.querySelectorAll(idFormFiltersPermutations),t={};t[keyForm]=convertForm2JSON(e),t.csrf_token=t[keyForm].csrf_token,console.log("ajaxData:"),console.log(t),ajaxJSONData("permutations",mapHashToController(hashPageStorePermutationsPost),t,callbackLoadPermutations,!1,{"X-CSRFToken":t.csrf_token})}},{key:"callbackLoadPermutations",value:function(e){console.log("ajax:"),console.log(e.data);var t,r,n,o=document.querySelectorAll(idTableMain);(t=o.querySelector("tbody")).querySelector("tr").remove(),e.data.forEach((function(e){r=_rowBlank.cloneNode(!0),(r=document.querySelectorAll(r)).classList.remove(flagRowNew),console.log("applying data row: ",e),r.querySelector("td."+flagCategory+" select").value=e[attrIdCategory],n=r.querySelector("td."+flagProduct+" select"),listProducts.forEach((function(t){t[attrIdCategory]==e[attrIdCategory]&&n.appendChild(document.createElement("