Feat(SQL): Location Get Many and Calc Stored Procedures created with logic using Location Link table.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -14,5 +14,10 @@ CREATE TABLE IF NOT EXISTS parts.DOG_Location_Temp (
|
||||
, code VARCHAR(100)
|
||||
, name VARCHAR(250)
|
||||
, active BIT
|
||||
|
||||
, does_meet_id_filters BIT
|
||||
, does_meet_non_id_filters BIT
|
||||
, csv_id_locations_parent TEXT
|
||||
|
||||
, guid BINARY(36)
|
||||
);
|
||||
|
||||
@@ -14,5 +14,9 @@ CREATE TABLE IF NOT EXISTS parts.DOG_Location_Link_Temp (
|
||||
, id_location_parent INT
|
||||
, id_location_child INT
|
||||
, active BIT
|
||||
|
||||
, does_meet_id_filters BIT
|
||||
, does_meet_non_id_filters BIT
|
||||
|
||||
, guid BINARY(36)
|
||||
);
|
||||
|
||||
@@ -17,15 +17,15 @@ BEGIN
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
DELETE COMMAND_CATEGORY_T
|
||||
FROM parts.DOG_Command_Category_Temp COMMAND_CATEGORY_T
|
||||
WHERE COMMAND_CATEGORY_T.GUID = a_guid
|
||||
;
|
||||
|
||||
DELETE COMMAND_T
|
||||
FROM parts.DOG_Command_Temp COMMAND_T
|
||||
WHERE COMMAND_T.GUID = a_guid
|
||||
;
|
||||
|
||||
DELETE COMMAND_CATEGORY_T
|
||||
FROM parts.DOG_Command_Category_Temp COMMAND_CATEGORY_T
|
||||
WHERE COMMAND_CATEGORY_T.GUID = a_guid
|
||||
;
|
||||
|
||||
COMMIT;
|
||||
|
||||
|
||||
723
static/MySQL/71200_p_dog_calc_location.sql
Normal file
723
static/MySQL/71200_p_dog_calc_location.sql
Normal file
@@ -0,0 +1,723 @@
|
||||
|
||||
USE parts;
|
||||
|
||||
DROP PROCEDURE IF EXISTS parts.p_dog_calc_location;
|
||||
|
||||
DELIMITER //
|
||||
CREATE PROCEDURE parts.p_dog_calc_location (
|
||||
IN a_guid BINARY(36)
|
||||
, IN a_id_user INT
|
||||
, IN a_get_all_location BIT
|
||||
, IN a_get_inactive_location BIT
|
||||
, IN a_ids_location TEXT
|
||||
, IN a_names_location TEXT
|
||||
, IN a_require_all_id_search_filters_met BIT
|
||||
, IN a_require_any_id_search_filters_met BIT
|
||||
, IN a_require_all_non_id_search_filters_met BIT
|
||||
, IN a_require_any_non_id_search_filters_met BIT
|
||||
, IN a_show_errors BIT
|
||||
, IN a_debug BIT
|
||||
)
|
||||
BEGIN
|
||||
DECLARE v_can_view BIT;
|
||||
DECLARE v_code_type_error_bad_data VARCHAR(100);
|
||||
DECLARE v_code_type_error_no_permission VARCHAR(100);
|
||||
DECLARE v_has_filter_location_id BIT;
|
||||
DECLARE v_has_filter_location_name BIT;
|
||||
DECLARE v_id_access_level_view INT;
|
||||
DECLARE v_id_minimum INT;
|
||||
DECLARE v_id_permission_dog_view INT;
|
||||
DECLARE v_id_type_error_bad_data INT;
|
||||
DECLARE v_id_type_error_no_permission INT;
|
||||
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_Calc_Location (
|
||||
id_error INT NOT NULL PRIMARY KEY AUTO_INCREMENT
|
||||
, id_type INT NULL
|
||||
, code VARCHAR(100) NOT NULL
|
||||
, msg TEXT NOT NULL
|
||||
);
|
||||
|
||||
INSERT INTO tmp_Msg_Error_Calc_Location (
|
||||
id_type
|
||||
, code
|
||||
, msg
|
||||
)
|
||||
SELECT
|
||||
MET.id_type
|
||||
, @errno
|
||||
, @text
|
||||
FROM parts.CORE_Msg_Error_Type MET
|
||||
WHERE MET.code = 'MYSQL_ERROR'
|
||||
;
|
||||
|
||||
SELECT
|
||||
t_ERROR.id_error
|
||||
, t_ERROR.id_type
|
||||
, t_ERROR.code
|
||||
, ERROR_TYPE.name
|
||||
, ERROR_TYPE.description
|
||||
, ERROR_TYPE.is_breaking_error
|
||||
, ERROR_TYPE.background_colour
|
||||
, ERROR_TYPE.text_colour
|
||||
, t_ERROR.msg
|
||||
FROM tmp_Msg_Error_Calc_Location t_ERROR
|
||||
INNER JOIN parts.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type
|
||||
;
|
||||
|
||||
DROP TABLE IF EXISTS tmp_Msg_Error_Calc_Location;
|
||||
END;
|
||||
|
||||
SET v_time_start := CURRENT_TIMESTAMP(6);
|
||||
SET v_code_type_error_bad_data := 'BAD_DATA';
|
||||
SET v_code_type_error_no_permission := 'NO_PERMISSION';
|
||||
SET v_id_type_error_bad_data := (SELECT ERROR_TYPE.id_type FROM parts.CORE_Msg_Error_Type ERROR_TYPE WHERE ERROR_TYPE.code = v_code_type_error_bad_data LIMIT 1);
|
||||
SET v_id_type_error_no_permission := (SELECT ERROR_TYPE.id_type FROM parts.CORE_Msg_Error_Type ERROR_TYPE WHERE ERROR_TYPE.code = v_code_type_error_no_permission LIMIT 1);
|
||||
SET v_id_permission_dog_view := (SELECT PERMISSION.id_permission FROM parts.DOG_Permission PERMISSION WHERE PERMISSION.code = 'DOG_VIEW' LIMIT 1);
|
||||
SET v_id_access_level_view := (SELECT ACCESS_LEVEL.id_access_level FROM parts.DOG_Access_Level ACCESS_LEVEL WHERE ACCESS_LEVEL.code = 'VIEW' LIMIT 1);
|
||||
|
||||
|
||||
CALL parts.p_core_validate_guid ( a_guid );
|
||||
|
||||
SET a_id_user := IFNULL(a_id_user, 0);
|
||||
SET a_get_all_location := IFNULL(a_get_all_location, 0);
|
||||
SET a_get_inactive_location := IFNULL(a_get_inactive_location, 0);
|
||||
SET a_ids_location := TRIM(IFNULL(a_ids_location, ''));
|
||||
SET a_names_location := TRIM(IFNULL(a_names_location, ''));
|
||||
SET a_require_all_id_search_filters_met := IFNULL(a_require_all_id_search_filters_met, 1);
|
||||
SET a_require_any_id_search_filters_met := IFNULL(a_require_any_id_search_filters_met, 1);
|
||||
SET a_require_all_non_id_search_filters_met := IFNULL(a_require_all_non_id_search_filters_met, 0);
|
||||
SET a_require_any_non_id_search_filters_met := IFNULL(a_require_any_non_id_search_filters_met, 1);
|
||||
SET a_show_errors := IFNULL(a_show_errors, 0);
|
||||
SET a_debug := IFNULL(a_debug, 0);
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
SELECT
|
||||
a_guid
|
||||
, a_id_user
|
||||
, a_get_all_location
|
||||
, a_get_inactive_location
|
||||
, a_ids_location
|
||||
, a_names_location
|
||||
, a_require_all_id_search_filters_met
|
||||
, a_require_any_id_search_filters_met
|
||||
, a_require_all_non_id_search_filters_met
|
||||
, a_require_any_non_id_search_filters_met
|
||||
, a_show_errors
|
||||
, a_debug
|
||||
;
|
||||
|
||||
SELECT
|
||||
v_id_type_error_bad_data
|
||||
, v_id_type_error_no_permission
|
||||
, v_id_permission_dog_view
|
||||
, v_time_start
|
||||
;
|
||||
END IF;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Split_Name_Calc_Location;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Split_Id_Calc_Location;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Msg_Error_Calc_Location;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Location_Link_Calc_Location;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Location_Calc_Location;
|
||||
|
||||
CREATE TEMPORARY TABLE tmp_Location_Calc_Location (
|
||||
id_location INT NOT NULL
|
||||
, does_meet_id_filters BIT NOT NULL
|
||||
, does_meet_non_id_filters BIT NOT NULL
|
||||
, csv_id_locations_parent TEXT
|
||||
);
|
||||
|
||||
CREATE TEMPORARY TABLE tmp_Location_Link_Calc_Location (
|
||||
id_link INT NOT NULL
|
||||
, id_location_parent INT
|
||||
, id_location_child INT
|
||||
, does_meet_id_filters BIT
|
||||
, does_meet_non_id_filters BIT
|
||||
);
|
||||
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS tmp_Msg_Error_Calc_Location (
|
||||
id_error INT NOT NULL PRIMARY KEY AUTO_INCREMENT
|
||||
, id_type INT NULL
|
||||
, code VARCHAR(100) NOT NULL
|
||||
, msg TEXT NOT NULL
|
||||
);
|
||||
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS tmp_Split_Id_Calc_Location (
|
||||
substring VARCHAR(4000) NOT NULL
|
||||
, as_int INT NULL
|
||||
);
|
||||
DELETE FROM tmp_Split_Id_Calc_Location;
|
||||
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS tmp_Split_Name_Calc_Location (
|
||||
substring VARCHAR(4000) NOT NULL
|
||||
, as_int INT NULL
|
||||
);
|
||||
DELETE FROM tmp_Split_Name_Calc_Location;
|
||||
|
||||
SET v_has_filter_location_id = CASE WHEN a_ids_location <> '' THEN 1 ELSE 0 END;
|
||||
SET v_has_filter_location_name = CASE WHEN a_names_location <> '' THEN 1 ELSE 0 END;
|
||||
|
||||
-- Locations
|
||||
IF v_has_filter_location_id = 1 THEN
|
||||
CALL parts.p_core_split(a_guid, a_ids_location, ',', a_debug);
|
||||
|
||||
SET sql_mode = '';
|
||||
|
||||
INSERT INTO tmp_Split_Id_Calc_Location (
|
||||
substring
|
||||
, as_int
|
||||
)
|
||||
SELECT
|
||||
SPLIT_T.substring
|
||||
, CAST(SPLIT_T.substring AS DECIMAL(10,0)) AS as_int
|
||||
FROM parts.CORE_Split_Temp SPLIT_T
|
||||
WHERE
|
||||
SPLIT_T.GUID = a_guid
|
||||
AND IFNULL(SPLIT_T.substring, '') <> ''
|
||||
;
|
||||
|
||||
CALL parts.p_core_clear_split( a_guid );
|
||||
END IF;
|
||||
|
||||
IF v_has_filter_location_name = 1 THEN
|
||||
CALL parts.p_core_split(a_guid, a_names_location, ',', a_debug);
|
||||
|
||||
SET sql_mode = '';
|
||||
|
||||
INSERT INTO tmp_Split_Name_Calc_Location (
|
||||
substring
|
||||
, as_int
|
||||
)
|
||||
SELECT
|
||||
SPLIT_T.substring
|
||||
, CAST(SPLIT_T.substring AS DECIMAL(10,0)) AS as_int
|
||||
FROM parts.CORE_Split_Temp SPLIT_T
|
||||
WHERE
|
||||
SPLIT_T.GUID = a_guid
|
||||
AND IFNULL(SPLIT_T.substring, '') <> ''
|
||||
;
|
||||
|
||||
CALL parts.p_core_clear_split( a_guid );
|
||||
END IF;
|
||||
|
||||
IF NOT EXISTS (SELECT * FROM tmp_Msg_Error_Calc_Location t_ERROR INNER JOIN parts.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type WHERE ERROR_TYPE.is_breaking_error = 1 LIMIT 1) THEN
|
||||
IF EXISTS (
|
||||
SELECT *
|
||||
FROM tmp_Split_Id_Calc_Location t_SPLIT_ID
|
||||
LEFT JOIN parts.DOG_Location LOCATIONS ON t_SPLIT_ID.as_int = LOCATIONS.id_location
|
||||
WHERE
|
||||
ISNULL(t_SPLIT_ID.as_int)
|
||||
OR ISNULL(LOCATIONS.id_location)
|
||||
OR (
|
||||
LOCATIONS.active = 0
|
||||
AND a_get_inactive_location = 0
|
||||
)
|
||||
) THEN
|
||||
INSERT INTO tmp_Msg_Error_Calc_Location (
|
||||
id_type
|
||||
, code
|
||||
, msg
|
||||
)
|
||||
SELECT
|
||||
v_id_type_error_bad_data
|
||||
, v_code_type_error_bad_data
|
||||
, CONCAT('Invalid or inactive Location IDs: ', IFNULL(GROUP_CONCAT(t_SPLIT_ID.substring SEPARATOR ', '), 'NULL'))
|
||||
FROM tmp_Split_Id_Calc_Location t_SPLIT_ID
|
||||
LEFT JOIN parts.DOG_Location LOCATIONS ON t_SPLIT_ID.as_int = LOCATIONS.id_location
|
||||
WHERE
|
||||
ISNULL(t_SPLIT_ID.as_int)
|
||||
OR ISNULL(LOCATIONS.id_location)
|
||||
OR (
|
||||
LOCATIONS.active = 0
|
||||
AND a_get_inactive_location = 0
|
||||
)
|
||||
;
|
||||
/* Don't error on names, hand signals, or notes not found
|
||||
ELSEIF EXISTS ()
|
||||
*/
|
||||
ELSE
|
||||
IF a_debug = 1 THEN
|
||||
SELECT 'Location Filters';
|
||||
WITH
|
||||
Location_Id_Filter AS (
|
||||
SELECT LOCATIONS.id_location
|
||||
FROM tmp_Split_Id_Calc_Location t_SPLIT_ID
|
||||
INNER JOIN parts.DOG_Location LOCATIONS ON t_SPLIT_ID.as_int = LOCATIONS.id_location
|
||||
)
|
||||
, Location_Name_Filter AS (
|
||||
SELECT LOCATIONS.id_location
|
||||
FROM tmp_Split_Name_Calc_Location t_SPLIT_NAME
|
||||
INNER JOIN parts.DOG_Location LOCATIONS ON LOCATIONS.name LIKE CONCAT('%', t_SPLIT_NAME.substring, '%')
|
||||
WHERE NULLIF(t_SPLIT_NAME.substring, '') IS NOT NULL
|
||||
)
|
||||
, Location_Filters AS (
|
||||
SELECT
|
||||
LOCATIONS_COMBINED.id_location
|
||||
, MAX(LOCATIONS_COMBINED.does_meet_id_filter) AS does_meet_id_filter
|
||||
, MAX(LOCATIONS_COMBINED.does_meet_name_filter) AS does_meet_name_filter
|
||||
FROM (
|
||||
SELECT
|
||||
LOCATIONS_ID_FILTER.id_location
|
||||
, 1 AS does_meet_id_filter
|
||||
, 0 AS does_meet_name_filter
|
||||
FROM Location_Id_Filter LOCATIONS_ID_FILTER
|
||||
UNION
|
||||
SELECT
|
||||
LOCATIONS_NAME_FILTER.id_location
|
||||
, 0 AS does_meet_id_filter
|
||||
, 1 AS does_meet_name_filter
|
||||
FROM Location_Name_Filter LOCATIONS_NAME_FILTER
|
||||
) LOCATIONS_COMBINED
|
||||
GROUP BY LOCATIONS_COMBINED.id_location
|
||||
)
|
||||
SELECT
|
||||
LOCATIONS.id_location
|
||||
, CASE WHEN
|
||||
v_has_filter_location_id = 0
|
||||
OR LOCATIONS_FILTERS.does_meet_id_filter = 1
|
||||
THEN 1 ELSE 0 END AS does_meet_non_id_filters
|
||||
, CASE WHEN
|
||||
(
|
||||
v_has_filter_location_name = 0
|
||||
)
|
||||
OR LOCATIONS_FILTERS.does_meet_name_filter = 1
|
||||
THEN 1 ELSE 0 END AS does_meet_id_filters
|
||||
FROM parts.DOG_Location LOCATIONS
|
||||
LEFT JOIN Location_Filters LOCATIONS_FILTERS ON LOCATIONS.id_location = LOCATIONS_FILTERS.id_location
|
||||
WHERE
|
||||
(
|
||||
a_get_all_location = 1
|
||||
OR (
|
||||
v_has_filter_location_id = 1
|
||||
AND LOCATIONS_FILTERS.does_meet_id_filter = 1
|
||||
)
|
||||
OR (
|
||||
v_has_filter_location_name = 1
|
||||
AND LOCATIONS_FILTERS.does_meet_name_filter = 1
|
||||
)
|
||||
)
|
||||
AND (
|
||||
a_get_inactive_location = 1
|
||||
OR LOCATIONS.active = 1
|
||||
)
|
||||
;
|
||||
END IF;
|
||||
INSERT INTO tmp_Location_Calc_Location (
|
||||
id_location
|
||||
, does_meet_id_filters
|
||||
, does_meet_non_id_filters
|
||||
)
|
||||
WITH
|
||||
Location_Id_Filter AS (
|
||||
SELECT LOCATIONS.id_location
|
||||
FROM tmp_Split_Id_Calc_Location t_SPLIT_ID
|
||||
INNER JOIN parts.DOG_Location LOCATIONS ON t_SPLIT_ID.as_int = LOCATIONS.id_location
|
||||
)
|
||||
, Location_Name_Filter AS (
|
||||
SELECT LOCATIONS.id_location
|
||||
FROM tmp_Split_Name_Calc_Location t_SPLIT_NAME
|
||||
INNER JOIN parts.DOG_Location LOCATIONS ON LOCATIONS.name LIKE CONCAT('%', t_SPLIT_NAME.substring, '%')
|
||||
WHERE
|
||||
t_SPLIT_NAME.substring IS NOT NULL
|
||||
AND t_SPLIT_NAME.substring <> ''
|
||||
)
|
||||
, Location_Filters AS (
|
||||
SELECT
|
||||
LOCATIONS_COMBINED.id_location
|
||||
, MAX(LOCATIONS_COMBINED.does_meet_id_filter) AS does_meet_id_filter
|
||||
, MAX(LOCATIONS_COMBINED.does_meet_name_filter) AS does_meet_name_filter
|
||||
FROM (
|
||||
SELECT
|
||||
LOCATIONS_ID_FILTER.id_location
|
||||
, 1 AS does_meet_id_filter
|
||||
, 0 AS does_meet_name_filter
|
||||
FROM Location_Id_Filter LOCATIONS_ID_FILTER
|
||||
UNION
|
||||
SELECT
|
||||
LOCATIONS_NAME_FILTER.id_location
|
||||
, 0 AS does_meet_id_filter
|
||||
, 1 AS does_meet_name_filter
|
||||
FROM Location_Name_Filter LOCATIONS_NAME_FILTER
|
||||
) LOCATIONS_COMBINED
|
||||
GROUP BY LOCATIONS_COMBINED.id_location
|
||||
)
|
||||
SELECT
|
||||
LOCATIONS.id_location
|
||||
, CASE WHEN
|
||||
v_has_filter_location_id = 0
|
||||
OR IFNULL(LOCATIONS_FILTERS.does_meet_id_filter, 0) = 1
|
||||
THEN 1 ELSE 0 END AS does_meet_id_filters
|
||||
, CASE WHEN
|
||||
(
|
||||
v_has_filter_location_name = 0
|
||||
)
|
||||
OR IFNULL(LOCATIONS_FILTERS.does_meet_name_filter, 0) = 1
|
||||
THEN 1 ELSE 0 END AS does_meet_non_id_filters
|
||||
FROM parts.DOG_Location LOCATIONS
|
||||
LEFT JOIN Location_Filters LOCATIONS_FILTERS ON LOCATIONS.id_location = LOCATIONS_FILTERS.id_location
|
||||
WHERE
|
||||
(
|
||||
a_get_all_location = 1
|
||||
OR (
|
||||
v_has_filter_location_id = 1
|
||||
AND LOCATIONS_FILTERS.does_meet_id_filter = 1
|
||||
)
|
||||
OR (
|
||||
v_has_filter_location_name = 1
|
||||
AND LOCATIONS_FILTERS.does_meet_name_filter = 1
|
||||
)
|
||||
)
|
||||
AND (
|
||||
a_get_inactive_location = 1
|
||||
OR LOCATIONS.active = 1
|
||||
)
|
||||
;
|
||||
END IF;
|
||||
END IF;
|
||||
|
||||
DELETE FROM tmp_Split_Id_Calc_Location;
|
||||
DELETE FROM tmp_Split_Name_Calc_Location;
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
SELECT 'After get Locations ';
|
||||
SELECT * FROM tmp_Location_Calc_Location;
|
||||
END IF;
|
||||
|
||||
-- Filter records
|
||||
IF NOT EXISTS (SELECT * FROM tmp_Msg_Error_Calc_Location t_ERROR INNER JOIN parts.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type WHERE ERROR_TYPE.is_breaking_error = 1 LIMIT 1) THEN
|
||||
DELETE t_LOCATIONS
|
||||
FROM tmp_Location_Calc_Location t_LOCATIONS
|
||||
WHERE
|
||||
(
|
||||
a_require_all_id_search_filters_met = 1
|
||||
AND (
|
||||
t_LOCATIONS.does_meet_id_filters = 0
|
||||
)
|
||||
)
|
||||
OR (
|
||||
a_require_all_non_id_search_filters_met = 1
|
||||
AND (
|
||||
t_LOCATIONS.does_meet_non_id_filters = 0
|
||||
)
|
||||
)
|
||||
OR (
|
||||
a_require_any_id_search_filters_met = 1
|
||||
AND t_LOCATIONS.does_meet_id_filters = 0
|
||||
)
|
||||
OR (
|
||||
a_require_any_non_id_search_filters_met = 1
|
||||
AND t_LOCATIONS.does_meet_non_id_filters = 0
|
||||
)
|
||||
;
|
||||
END IF;
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
SELECT 'After filter Locations';
|
||||
SELECT * FROM tmp_Location_Calc_Location;
|
||||
END IF;
|
||||
|
||||
-- Calculated fields
|
||||
-- Parent Location Ids
|
||||
WITH Location_Parent AS (
|
||||
SELECT
|
||||
LOCATIONS.id_location
|
||||
, GROUP_CONCAT(LOCATION_LINK.id_location_parent, ',') AS csv_id_locations_parent
|
||||
FROM parts.DOG_Location LOCATIONS
|
||||
INNER JOIN DOG_Location_Link LOCATION_LINK ON LOCATIONS.id_location = LOCATION_LINK.id_location_child
|
||||
WHERE
|
||||
a_get_inactive_location = 1
|
||||
OR LOCATION_LINK.active = 1
|
||||
GROUP BY LOCATIONS.id_location
|
||||
)
|
||||
UPDATE tmp_Location_Calc_Location t_LOCATIONS
|
||||
INNER JOIN Location_Parent LOCATIONS_PARENT ON t_LOCATIONS.id_location = LOCATIONS_PARENT.id_location
|
||||
SET
|
||||
t_LOCATIONS.csv_id_locations_parent = LOCATIONS_PARENT.csv_id_locations_parent
|
||||
;
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
SELECT 'After generate calculated fields Locations';
|
||||
SELECT * FROM tmp_Location_Calc_Location;
|
||||
END IF;
|
||||
|
||||
|
||||
-- Location Links
|
||||
INSERT INTO tmp_Location_Link_Calc_Location (
|
||||
id_link
|
||||
, id_location_parent
|
||||
, id_location_child
|
||||
|
||||
, does_meet_id_filters
|
||||
, does_meet_non_id_filters
|
||||
)
|
||||
SELECT
|
||||
LOCATION_LINK.id_link
|
||||
, LOCATION_LINK.id_location_parent
|
||||
, LOCATION_LINK.id_location_child
|
||||
|
||||
, NULL AS does_meet_id_filters
|
||||
, NULL AS does_meet_non_id_filters
|
||||
FROM parts.DOG_Location_Link LOCATION_LINK
|
||||
INNER JOIN tmp_Location_Calc_Location t_LOCATIONS
|
||||
ON LOCATION_LINK.id_location_parent = t_LOCATIONS.id_location
|
||||
OR LOCATION_LINK.id_location_child = t_LOCATIONS.id_location
|
||||
WHERE
|
||||
a_get_inactive_location = 1
|
||||
OR LOCATION_LINK.active = 1
|
||||
;
|
||||
|
||||
-- Permissions
|
||||
IF a_debug = 1 THEN
|
||||
SELECT
|
||||
a_guid -- a_guid
|
||||
, 0 -- get_all_user
|
||||
, 0 -- get_inactive_user
|
||||
, a_id_user -- ids_user
|
||||
, '' -- a_auth0_ids_user
|
||||
, '' -- a_names_user
|
||||
, '' -- a_emails_user
|
||||
, 1 -- a_require_all_id_search_filters_met
|
||||
, 1 -- a_require_any_id_search_filters_met
|
||||
, 0 -- a_require_all_non_id_search_filters_met
|
||||
, 0 -- a_require_any_non_id_search_filters_met
|
||||
, v_id_permission_dog_view -- ids_permission
|
||||
, v_id_access_level_view -- ids_access_level
|
||||
, 0 -- a_show_errors
|
||||
, 0 -- a_debug
|
||||
;
|
||||
END IF;
|
||||
|
||||
CALL parts.p_dog_calc_user(
|
||||
a_guid -- a_guid
|
||||
, 0 -- get_all_user
|
||||
, 0 -- get_inactive_user
|
||||
, a_id_user -- ids_user
|
||||
, '' -- a_auth0_ids_user
|
||||
, '' -- a_names_user
|
||||
, '' -- a_emails_user
|
||||
, 1 -- a_require_all_id_search_filters_met
|
||||
, 1 -- a_require_any_id_search_filters_met
|
||||
, 0 -- a_require_all_non_id_search_filters_met
|
||||
, 0 -- a_require_any_non_id_search_filters_met
|
||||
, v_id_permission_dog_view -- ids_permission
|
||||
, v_id_access_level_view -- ids_access_level
|
||||
, 0 -- a_show_errors
|
||||
, 0 -- a_debug
|
||||
);
|
||||
|
||||
SELECT
|
||||
IFNULL(CALC_USER_T.has_access, 0)
|
||||
INTO
|
||||
v_can_view
|
||||
FROM parts.DOG_Calc_User_Temp CALC_USER_T
|
||||
WHERE CALC_USER_T.GUID = a_guid
|
||||
LIMIT 1
|
||||
;
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
SELECT v_can_view;
|
||||
END IF;
|
||||
|
||||
IF (v_can_view = 0) THEN
|
||||
DELETE t_ME
|
||||
FROM tmp_Msg_Error_Calc_Location t_ME
|
||||
WHERE t_ME.id_type <> v_id_type_error_no_permission
|
||||
;
|
||||
INSERT INTO tmp_Msg_Error_Calc_Location (
|
||||
id_type
|
||||
, code
|
||||
, msg
|
||||
)
|
||||
VALUES (
|
||||
v_id_type_error_no_permission
|
||||
, v_code_type_error_no_permission
|
||||
, 'You do not have permission to view Dogs and Locations.'
|
||||
)
|
||||
;
|
||||
END IF;
|
||||
|
||||
CALL parts.p_dog_clear_calc_user(
|
||||
a_guid
|
||||
, 0 -- a_debug
|
||||
);
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
SELECT 'Before non-permitted data deletion';
|
||||
SELECT * FROM tmp_Location_Calc_Location;
|
||||
SELECT * FROM tmp_Msg_Error_Calc_Location;
|
||||
END IF;
|
||||
|
||||
IF EXISTS(SELECT * FROM tmp_Msg_Error_Calc_Location t_ERROR INNER JOIN parts.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type WHERE ERROR_TYPE.is_breaking_error = 1 LIMIT 1) THEN
|
||||
IF a_debug = 1 THEN
|
||||
SELECT * FROM tmp_Location_Calc_Location;
|
||||
END IF;
|
||||
|
||||
DELETE FROM tmp_Location_Calc_Location;
|
||||
END IF;
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
SELECT 'After non-permitted data deletion';
|
||||
END IF;
|
||||
|
||||
-- Outputs
|
||||
START TRANSACTION;
|
||||
-- Locations
|
||||
INSERT INTO parts.DOG_Location_Temp (
|
||||
guid
|
||||
, id_location
|
||||
, code
|
||||
, name
|
||||
, active
|
||||
|
||||
, csv_id_locations_parent
|
||||
|
||||
, does_meet_id_filters
|
||||
, does_meet_non_id_filters
|
||||
)
|
||||
SELECT
|
||||
a_guid
|
||||
, t_LOCATIONS.id_location
|
||||
, LOCATIONS.code
|
||||
, LOCATIONS.name
|
||||
, LOCATIONS.active
|
||||
|
||||
, t_LOCATIONS.csv_id_locations_parent
|
||||
|
||||
, t_LOCATIONS.does_meet_id_filters
|
||||
, t_LOCATIONS.does_meet_non_id_filters
|
||||
FROM parts.DOG_Location LOCATIONS
|
||||
INNER JOIN tmp_Location_Calc_Location t_LOCATIONS ON LOCATIONS.id_location = t_LOCATIONS.id_location
|
||||
ORDER BY LOCATIONS.name
|
||||
;
|
||||
|
||||
INSERT INTO parts.DOG_Location_Link_Temp (
|
||||
guid
|
||||
, id_link
|
||||
, id_location_parent
|
||||
, id_location_child
|
||||
, active
|
||||
|
||||
, does_meet_id_filters
|
||||
, does_meet_non_id_filters
|
||||
)
|
||||
SELECT
|
||||
a_guid
|
||||
, t_LOCATION_LINK.id_link
|
||||
, LOCATION_LINK.id_location_parent
|
||||
, LOCATION_LINK.id_location_child
|
||||
, LOCATION_LINK.active
|
||||
|
||||
, NULL AS does_meet_id_filters
|
||||
, NULL AS does_meet_non_id_filters
|
||||
FROM parts.DOG_Location_Link LOCATION_LINK
|
||||
INNER JOIN tmp_Location_Link_Calc_Location t_LOCATION_LINK ON LOCATION_LINK.id_link = t_LOCATION_LINK.id_link
|
||||
INNER JOIN parts.DOG_Location LOCATIONS ON LOCATION_LINK.id_location_child = LOCATIONS.id_location
|
||||
ORDER BY LOCATIONS.name
|
||||
;
|
||||
COMMIT;
|
||||
|
||||
-- Errors
|
||||
IF a_show_errors = 1 THEN
|
||||
SELECT
|
||||
t_ERROR.id_error
|
||||
, t_ERROR.id_type
|
||||
, t_ERROR.code
|
||||
, ERROR_TYPE.name
|
||||
, ERROR_TYPE.description
|
||||
, ERROR_TYPE.is_breaking_error
|
||||
, ERROR_TYPE.background_colour
|
||||
, ERROR_TYPE.text_colour
|
||||
, t_ERROR.msg
|
||||
FROM tmp_Msg_Error_Calc_Location t_ERROR
|
||||
INNER JOIN parts.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type
|
||||
;
|
||||
END IF;
|
||||
|
||||
IF a_debug = 1 AND v_can_view = 1 THEN
|
||||
SELECT * FROM tmp_Location_Calc_Location;
|
||||
END IF;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Split_Name_Calc_Location;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Split_Id_Calc_Location;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Msg_Error_Calc_Location;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Location_Link_Calc_Location;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Location_Calc_Location;
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
CALL parts.p_core_debug_timing_reporting ( v_time_start );
|
||||
END IF;
|
||||
END //
|
||||
DELIMITER ;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
|
||||
CALL parts.p_dog_calc_location (
|
||||
'slops ' -- a_guid
|
||||
, 1 -- 'auth0|6582b95c895d09a70ba10fef', -- a_id_user
|
||||
, 1 -- a_get_all_location
|
||||
, 0 -- a_get_inactive_location
|
||||
, '' -- a_ids_location
|
||||
, '' -- a_names_location
|
||||
, 0 -- a_require_all_id_search_filters_met
|
||||
, 0 -- a_require_any_id_search_filters_met
|
||||
, 0 -- a_require_all_non_id_search_filters_met
|
||||
, 0 -- a_require_any_non_id_search_filters_met
|
||||
, 0 -- a_show_errors
|
||||
, 0 -- a_debug
|
||||
);
|
||||
|
||||
CALL parts.p_dog_calc_location (
|
||||
'slops ' -- a_guid
|
||||
, 1 -- 'auth0|6582b95c895d09a70ba10fef', -- a_id_user
|
||||
, 1 -- a_get_all_location
|
||||
, 0 -- a_get_inactive_location
|
||||
, '' -- a_ids_location
|
||||
, 'pat,point' -- a_names_location
|
||||
, 1 -- a_require_all_id_search_filters_met
|
||||
, 1 -- a_require_any_id_search_filters_met
|
||||
, 0 -- a_require_all_non_id_search_filters_met
|
||||
, 1 -- a_require_any_non_id_search_filters_met
|
||||
, 1 -- a_show_errors
|
||||
, 0 -- a_debug
|
||||
);
|
||||
SELECT *
|
||||
FROM parts.DOG_Location_Temp
|
||||
;
|
||||
SELECT *
|
||||
FROM parts.DOG_Location_Link_Temp
|
||||
;
|
||||
/*
|
||||
SELECT *
|
||||
FROM parts.DOG_Location_Temp C
|
||||
WHERE
|
||||
C.does_meet_id_filters
|
||||
AND C.does_meet_non_id_filters
|
||||
;
|
||||
*/
|
||||
CALL parts.p_dog_clear_calc_location (
|
||||
'slips ' -- a_guid
|
||||
, 1 -- debug
|
||||
);
|
||||
|
||||
|
||||
DELETE
|
||||
FROM parts.DOG_Location_Temp
|
||||
;
|
||||
DELETE
|
||||
FROM parts.DOG_Location_Link_Temp
|
||||
;
|
||||
|
||||
*/
|
||||
50
static/MySQL/71200_p_dog_clear_calc_location.sql
Normal file
50
static/MySQL/71200_p_dog_clear_calc_location.sql
Normal file
@@ -0,0 +1,50 @@
|
||||
|
||||
USE parts;
|
||||
|
||||
DROP PROCEDURE IF EXISTS parts.p_dog_clear_calc_location;
|
||||
DROP PROCEDURE IF EXISTS parts.p_location_clear_calc_location;
|
||||
|
||||
DELIMITER //
|
||||
CREATE PROCEDURE parts.p_dog_clear_calc_location (
|
||||
IN a_guid BINARY(36)
|
||||
, IN a_debug BIT
|
||||
)
|
||||
BEGIN
|
||||
DECLARE v_time_start TIMESTAMP(6);
|
||||
SET v_time_start := CURRENT_TIMESTAMP(6);
|
||||
|
||||
CALL parts.p_core_validate_guid ( a_guid );
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
DELETE LOCATIONS_T
|
||||
FROM parts.DOG_Location_Temp LOCATIONS_T
|
||||
WHERE LOCATIONS_T.GUID = a_guid
|
||||
;
|
||||
|
||||
DELETE LOCATION_LINK_T
|
||||
FROM parts.DOG_Location_Link_Temp LOCATION_LINK_T
|
||||
WHERE LOCATION_LINK_T.GUID = a_guid
|
||||
;
|
||||
|
||||
COMMIT;
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
CALL parts.p_debug_timing_reporting( v_time_start );
|
||||
END IF;
|
||||
END //
|
||||
DELIMITER ;
|
||||
|
||||
/*
|
||||
|
||||
CALL parts.p_dog_clear_calc_location (
|
||||
'crips ' -- a_guid
|
||||
, 1 -- debug
|
||||
);
|
||||
|
||||
SELECT *
|
||||
FROM parts.DOG_Calc_User_Temp
|
||||
WHERE GUID = 'chips '
|
||||
;
|
||||
|
||||
*/
|
||||
443
static/MySQL/71200_p_dog_get_many_location.sql
Normal file
443
static/MySQL/71200_p_dog_get_many_location.sql
Normal file
@@ -0,0 +1,443 @@
|
||||
|
||||
USE parts;
|
||||
|
||||
DROP PROCEDURE IF EXISTS parts.p_dog_get_many_location;
|
||||
|
||||
DELIMITER //
|
||||
CREATE PROCEDURE parts.p_dog_get_many_location (
|
||||
IN a_id_user INT
|
||||
, IN a_get_all_location BIT
|
||||
, IN a_get_inactive_location BIT
|
||||
, IN a_ids_location TEXT
|
||||
, IN a_names_location TEXT
|
||||
, IN a_require_all_id_search_filters_met BIT
|
||||
, IN a_require_any_id_search_filters_met BIT
|
||||
, IN a_require_all_non_id_search_filters_met BIT
|
||||
, IN a_require_any_non_id_search_filters_met BIT
|
||||
, IN a_output_LOCATIONS BIT
|
||||
, IN a_output_LOCATION_links BIT
|
||||
, IN a_debug BIT
|
||||
)
|
||||
BEGIN
|
||||
DECLARE v_can_view BIT;
|
||||
DECLARE v_code_type_error_bad_data VARCHAR(100);
|
||||
DECLARE v_code_type_error_no_permission VARCHAR(100);
|
||||
DECLARE v_guid BINARY(36);
|
||||
DECLARE v_id_access_level_view INT;
|
||||
DECLARE v_id_minimum INT;
|
||||
DECLARE v_id_permission_dog_view INT;
|
||||
DECLARE v_id_type_error_bad_data INT;
|
||||
DECLARE v_id_type_error_no_permission INT;
|
||||
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 (
|
||||
id_error INT NOT NULL PRIMARY KEY AUTO_INCREMENT
|
||||
, id_type INT NULL
|
||||
, code VARCHAR(100) NOT NULL
|
||||
, msg TEXT NOT NULL
|
||||
);
|
||||
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
id_type
|
||||
, code
|
||||
, msg
|
||||
)
|
||||
SELECT
|
||||
MET.id_type
|
||||
, @errno
|
||||
, @text
|
||||
FROM parts.CORE_Msg_Error_Type MET
|
||||
WHERE MET.code = 'MYSQL_ERROR'
|
||||
;
|
||||
|
||||
SELECT
|
||||
t_ERROR.id_error
|
||||
, t_ERROR.id_type
|
||||
, t_ERROR.code
|
||||
, ERROR_TYPE.name
|
||||
, ERROR_TYPE.description
|
||||
, ERROR_TYPE.is_breaking_error
|
||||
, ERROR_TYPE.background_colour
|
||||
, ERROR_TYPE.text_colour
|
||||
, t_ERROR.msg
|
||||
FROM tmp_Msg_Error t_ERROR
|
||||
INNER JOIN parts.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type
|
||||
;
|
||||
|
||||
DROP TABLE IF EXISTS tmp_Msg_Error;
|
||||
END;
|
||||
|
||||
SET v_time_start := CURRENT_TIMESTAMP(6);
|
||||
SET v_guid := UUID();
|
||||
SET v_code_type_error_bad_data := 'BAD_DATA';
|
||||
SET v_code_type_error_no_permission := 'NO_PERMISSION';
|
||||
SET v_id_type_error_bad_data := (SELECT ERROR_TYPE.id_type FROM parts.CORE_Msg_Error_Type ERROR_TYPE WHERE ERROR_TYPE.code = v_code_type_error_bad_data LIMIT 1);
|
||||
SET v_id_type_error_no_permission := (SELECT ERROR_TYPE.id_type FROM parts.CORE_Msg_Error_Type ERROR_TYPE WHERE ERROR_TYPE.code = v_code_type_error_no_permission LIMIT 1);
|
||||
SET v_id_permission_dog_view := (SELECT PERMISSION.id_permission FROM parts.DOG_Permission PERMISSION WHERE PERMISSION.code = 'DOG_VIEW' LIMIT 1);
|
||||
SET v_id_access_level_view := (SELECT ACCESS_LEVEL.id_access_level FROM parts.DOG_Access_Level ACCESS_LEVEL WHERE ACCESS_LEVEL.code = 'VIEW' LIMIT 1);
|
||||
|
||||
SET a_id_user := IFNULL(a_id_user, 0);
|
||||
/*
|
||||
SET a_get_all_location := IFNULL(a_get_all_location, 0);
|
||||
SET a_get_inactive_location := IFNULL(a_get_inactive_location, 0);
|
||||
SET a_ids_location := TRIM(IFNULL(a_ids_location, ''));
|
||||
SET a_names_location := TRIM(IFNULL(a_names_location, ''));
|
||||
SET a_hand_signal_default_descriptions_location := TRIM(IFNULL(a_hand_signal_default_descriptions_location, ''));
|
||||
SET a_notes_location := TRIM(IFNULL(a_notes_location, ''));
|
||||
SET a_require_all_id_search_filters_met := IFNULL(a_require_all_id_search_filters_met, 1);
|
||||
SET a_require_any_id_search_filters_met := IFNULL(a_require_any_id_search_filters_met, 1);
|
||||
SET a_require_all_non_id_search_filters_met := IFNULL(a_require_all_non_id_search_filters_met, 0);
|
||||
SET a_require_any_non_id_search_filters_met := IFNULL(a_require_any_non_id_search_filters_met, 1);
|
||||
*/
|
||||
SET a_output_LOCATIONS := IFNULL(a_output_LOCATIONS, 0);
|
||||
SET a_output_LOCATION_links := IFNULL(a_output_LOCATION_links, 0);
|
||||
SET a_debug := IFNULL(a_debug, 0);
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
SELECT
|
||||
a_id_user
|
||||
, a_get_all_location
|
||||
, a_get_inactive_location
|
||||
, a_ids_location
|
||||
, a_names_location
|
||||
, a_require_all_id_search_filters_met
|
||||
, a_require_any_id_search_filters_met
|
||||
, a_require_all_non_id_search_filters_met
|
||||
, a_require_any_non_id_search_filters_met
|
||||
, a_output_LOCATIONS
|
||||
, a_output_LOCATION_links
|
||||
, a_debug
|
||||
;
|
||||
|
||||
SELECT
|
||||
v_id_type_error_bad_data
|
||||
, v_id_type_error_no_permission
|
||||
, v_guid
|
||||
, v_id_permission_dog_view
|
||||
, v_time_start
|
||||
;
|
||||
END IF;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Msg_Error;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Location_Link;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Location;
|
||||
|
||||
CREATE TEMPORARY TABLE tmp_Location (
|
||||
id_location INT NOT NULL
|
||||
, code VARCHAR(100)
|
||||
, name VARCHAR(250)
|
||||
, active BIT
|
||||
|
||||
, does_meet_id_filters BIT
|
||||
, does_meet_non_id_filters BIT
|
||||
);
|
||||
|
||||
CREATE TEMPORARY TABLE tmp_Location_Link (
|
||||
id_link INT NOT NULL
|
||||
, id_location_parent INT
|
||||
, id_location_child INT
|
||||
, active BIT
|
||||
|
||||
, does_meet_id_filters BIT
|
||||
, does_meet_non_id_filters BIT
|
||||
);
|
||||
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS tmp_Msg_Error (
|
||||
id_error INT NOT NULL PRIMARY KEY AUTO_INCREMENT
|
||||
, id_type INT NULL
|
||||
, code VARCHAR(100) NOT NULL
|
||||
, msg TEXT NOT NULL
|
||||
);
|
||||
|
||||
-- Permissions
|
||||
IF a_debug = 1 THEN
|
||||
SELECT
|
||||
v_guid
|
||||
, 0 -- get_all_user
|
||||
, 0 -- get_inactive_user
|
||||
, a_id_user -- ids_user
|
||||
, '' -- a_auth0_ids_user
|
||||
, '' -- a_names_user
|
||||
, '' -- a_emails_user
|
||||
, 1 -- a_require_all_id_search_filters_met
|
||||
, 1 -- a_require_any_id_search_filters_met
|
||||
, 0 -- a_require_all_non_id_search_filters_met
|
||||
, 0 -- a_require_any_non_id_search_filters_met
|
||||
, v_id_permission_dog_view -- ids_permission
|
||||
, v_id_access_level_view -- ids_access_level
|
||||
, 0 -- a_show_errors
|
||||
, 0 -- a_debug
|
||||
;
|
||||
END IF;
|
||||
|
||||
CALL parts.p_dog_calc_user(
|
||||
v_guid
|
||||
, 0 -- get_all_user
|
||||
, 0 -- get_inactive_user
|
||||
, a_id_user -- ids_user
|
||||
, '' -- a_auth0_ids_user
|
||||
, '' -- a_names_user
|
||||
, '' -- a_emails_user
|
||||
, 1 -- a_require_all_id_search_filters_met
|
||||
, 1 -- a_require_any_id_search_filters_met
|
||||
, 0 -- a_require_all_non_id_search_filters_met
|
||||
, 0 -- a_require_any_non_id_search_filters_met
|
||||
, v_id_permission_dog_view -- ids_permission
|
||||
, v_id_access_level_view -- ids_access_level
|
||||
, 0 -- a_show_errors
|
||||
, 0 -- a_debug
|
||||
);
|
||||
|
||||
SELECT
|
||||
IFNULL(CALC_USER_T.has_access, 0)
|
||||
INTO
|
||||
v_can_view
|
||||
FROM parts.DOG_Calc_User_Temp CALC_USER_T
|
||||
WHERE CALC_USER_T.GUID = v_guid
|
||||
LIMIT 1
|
||||
;
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
SELECT v_can_view;
|
||||
SELECT COUNT(*) AS Count_Errors FROM tmp_Msg_Error t_ERROR;
|
||||
SELECT * FROM tmp_Msg_Error t_ERROR;
|
||||
END IF;
|
||||
|
||||
IF (v_can_view = 0) THEN
|
||||
DELETE t_ME
|
||||
FROM tmp_Msg_Error t_ME
|
||||
WHERE t_ME.id_type <> v_id_type_error_no_permission
|
||||
;
|
||||
INSERT INTO tmp_Msg_Error (
|
||||
id_type
|
||||
, code
|
||||
, msg
|
||||
)
|
||||
VALUES (
|
||||
v_id_type_error_no_permission
|
||||
, v_code_type_error_no_permission
|
||||
, 'You do not have permission to view Locations.'
|
||||
)
|
||||
;
|
||||
END IF;
|
||||
|
||||
CALL parts.p_dog_clear_calc_user(
|
||||
v_guid
|
||||
, 0 -- a_debug
|
||||
);
|
||||
|
||||
|
||||
-- Call Location Calc
|
||||
IF NOT EXISTS(SELECT * FROM tmp_Msg_Error t_ERROR INNER JOIN parts.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type WHERE ERROR_TYPE.is_breaking_error = 1 LIMIT 1) THEN
|
||||
IF a_debug = 1 THEN
|
||||
SELECT
|
||||
v_guid -- a_guid
|
||||
, a_id_user -- a_id_user
|
||||
, a_get_all_location -- a_get_all_location
|
||||
, a_get_inactive_location -- a_get_inactive_location
|
||||
, a_ids_location -- a_ids_location
|
||||
, a_names_location -- a_names_location
|
||||
, a_require_all_id_search_filters_met -- a_require_all_id_search_filters_met
|
||||
, a_require_any_id_search_filters_met -- a_require_any_id_search_filters_met
|
||||
, a_require_all_non_id_search_filters_met -- a_require_all_non_id_search_filters_met
|
||||
, a_require_any_non_id_search_filters_met -- a_require_any_non_id_search_filters_met
|
||||
, 0 -- a_show_errors
|
||||
, 0 -- a_debug
|
||||
;
|
||||
END IF;
|
||||
|
||||
CALL parts.p_dog_calc_location (
|
||||
v_guid -- a_guid
|
||||
, a_id_user -- a_id_user
|
||||
, a_get_all_location -- a_get_all_location
|
||||
, a_get_inactive_location -- a_get_inactive_location
|
||||
, a_ids_location -- a_ids_location
|
||||
, a_names_location -- a_names_location
|
||||
, a_require_all_id_search_filters_met -- a_require_all_id_search_filters_met
|
||||
, a_require_any_id_search_filters_met -- a_require_any_id_search_filters_met
|
||||
, a_require_all_non_id_search_filters_met -- a_require_all_non_id_search_filters_met
|
||||
, a_require_any_non_id_search_filters_met -- a_require_any_non_id_search_filters_met
|
||||
, 0 -- a_show_errors
|
||||
, 0 -- a_debug
|
||||
);
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
SELECT COUNT(*) FROM parts.DOG_Location_Temp;
|
||||
SELECT * FROM parts.DOG_Location_Temp;
|
||||
SELECT COUNT(*) FROM parts.DOG_Location_Link_Temp;
|
||||
SELECT * FROM parts.DOG_Location_Link_Temp;
|
||||
END IF;
|
||||
|
||||
INSERT INTO tmp_Location (
|
||||
id_location
|
||||
, code
|
||||
, name
|
||||
, active
|
||||
|
||||
, does_meet_id_filters
|
||||
, does_meet_non_id_filters
|
||||
)
|
||||
SELECT
|
||||
LOCATION_T.id_location
|
||||
, LOCATION_T.code
|
||||
, LOCATION_T.name
|
||||
, LOCATION_T.active
|
||||
|
||||
, LOCATION_T.does_meet_id_filters
|
||||
, LOCATION_T.does_meet_non_id_filters
|
||||
FROM parts.DOG_Location_Temp LOCATION_T
|
||||
WHERE LOCATION_T.GUID = v_guid
|
||||
;
|
||||
|
||||
INSERT INTO tmp_Location_Link (
|
||||
id_link
|
||||
, id_location_parent
|
||||
, id_location_child
|
||||
, active
|
||||
|
||||
, does_meet_id_filters
|
||||
, does_meet_non_id_filters
|
||||
)
|
||||
SELECT
|
||||
LOCATION_LINK_T.id_link
|
||||
, LOCATION_LINK_T.id_location_parent
|
||||
, LOCATION_LINK_T.id_location_child
|
||||
, LOCATION_LINK_T.active
|
||||
|
||||
, NULL AS does_meet_id_filters
|
||||
, NULL AS does_meet_non_id_filters
|
||||
FROM parts.DOG_Location_Link_Temp LOCATION_LINK_T
|
||||
WHERE LOCATION_LINK_T.GUID = v_guid
|
||||
;
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
SELECT COUNT(*) FROM tmp_Location;
|
||||
SELECT * FROM tmp_Location;
|
||||
SELECT COUNT(*) FROM tmp_Location_Link;
|
||||
SELECT * FROM tmp_Location_Link;
|
||||
END IF;
|
||||
END IF;
|
||||
|
||||
-- Filter outputs
|
||||
IF EXISTS(SELECT * FROM tmp_Msg_Error t_ERROR INNER JOIN parts.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type WHERE ERROR_TYPE.is_breaking_error = 1 LIMIT 1) THEN
|
||||
IF a_debug = 1 THEN
|
||||
SELECT * FROM tmp_Location;
|
||||
SELECT * FROM tmp_Location_Link;
|
||||
END IF;
|
||||
|
||||
DELETE FROM tmp_Location_Link;
|
||||
DELETE FROM tmp_Location;
|
||||
END IF;
|
||||
|
||||
|
||||
-- Outputs
|
||||
-- Locations
|
||||
IF a_output_LOCATIONS = 1 THEN
|
||||
SELECT
|
||||
t_LOCATIONS.id_location
|
||||
, t_LOCATIONS.code
|
||||
, t_LOCATIONS.name
|
||||
, t_LOCATIONS.active
|
||||
|
||||
, t_LOCATIONS.does_meet_id_filters
|
||||
, t_LOCATIONS.does_meet_non_id_filters
|
||||
FROM tmp_Location t_LOCATIONS
|
||||
ORDER BY t_LOCATIONS.name
|
||||
;
|
||||
END IF;
|
||||
|
||||
-- Location Links
|
||||
IF a_output_LOCATION_links = 1 THEN
|
||||
SELECT
|
||||
t_LOCATION_LINK.id_link
|
||||
, t_LOCATION_LINK.id_location_parent
|
||||
, t_LOCATION_LINK.id_location_child
|
||||
, t_LOCATION_LINK.active
|
||||
|
||||
, t_LOCATION_LINK.does_meet_id_filters
|
||||
, t_LOCATION_LINK.does_meet_non_id_filters
|
||||
FROM tmp_Location_Link t_LOCATION_LINK
|
||||
INNER JOIN tmp_Location t_LOCATIONS ON t_LOCATION_LINK.id_location_child = t_LOCATIONS.id_location
|
||||
ORDER BY t_LOCATIONS.name
|
||||
;
|
||||
END IF;
|
||||
|
||||
-- Errors
|
||||
SELECT
|
||||
t_ERROR.id_error
|
||||
, t_ERROR.id_type
|
||||
, t_ERROR.code
|
||||
, ERROR_TYPE.name
|
||||
, ERROR_TYPE.description
|
||||
, ERROR_TYPE.is_breaking_error
|
||||
, ERROR_TYPE.background_colour
|
||||
, ERROR_TYPE.text_colour
|
||||
, t_ERROR.msg
|
||||
FROM tmp_Msg_Error t_ERROR
|
||||
INNER JOIN parts.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type
|
||||
;
|
||||
|
||||
IF a_debug = 1 AND v_can_view = 1 THEN
|
||||
SELECT * FROM tmp_Location;
|
||||
END IF;
|
||||
|
||||
CALL parts.p_dog_clear_calc_location(
|
||||
v_guid -- a_guid
|
||||
, 0 -- a_debug
|
||||
);
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Msg_Error;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Location_Link;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_Location;
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
CALL parts.p_core_debug_timing_reporting ( v_time_start );
|
||||
END IF;
|
||||
END //
|
||||
DELIMITER ;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
CALL parts.p_dog_get_many_location (
|
||||
1 -- 'auth0|6582b95c895d09a70ba10fef', -- a_id_user
|
||||
, 1 -- a_get_all_location
|
||||
, 0 -- a_get_inactive_location
|
||||
, '' -- a_ids_location
|
||||
, '' -- a_names_location
|
||||
, 1 -- a_require_all_id_search_filters_met
|
||||
, 1 -- a_require_any_id_search_filters_met
|
||||
, 0 -- a_require_all_non_id_search_filters_met
|
||||
, 1 -- a_require_any_non_id_search_filters_met
|
||||
, 1 -- a_output_LOCATIONS
|
||||
, 1 -- a_output_LOCATION_links
|
||||
, 1 -- a_debug
|
||||
);
|
||||
|
||||
|
||||
CALL demo.p_dog_get_many_location (
|
||||
1 -- 'auth0|6582b95c895d09a70ba10fef', -- a_id_user
|
||||
, 1 -- a_get_all_location
|
||||
, 0 -- a_get_inactive_location
|
||||
, '' -- a_ids_location
|
||||
, 'pat,point' -- a_names_location
|
||||
, 1 -- a_require_all_id_search_filters_met
|
||||
, 1 -- a_require_any_id_search_filters_met
|
||||
, 0 -- a_require_all_non_id_search_filters_met
|
||||
, 1 -- a_require_any_non_id_search_filters_met
|
||||
, 1 -- a_output_LOCATIONS
|
||||
, 1 -- a_output_LOCATION_links
|
||||
, 1 -- a_debug
|
||||
);
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,5 @@
|
||||
|
||||
|
||||
select {
|
||||
border: 1px solid var(--colour-accent);
|
||||
}
|
||||
@@ -128,6 +128,7 @@ header {
|
||||
#formFilters .container-input input {
|
||||
width: 10vh;
|
||||
max-width: 10vh;
|
||||
height: 20px;
|
||||
}
|
||||
/*
|
||||
#formFilters .container-input input {
|
||||
@@ -145,15 +146,16 @@ header {
|
||||
display: none;
|
||||
}
|
||||
#formFilters .container-input.filter.active_only svg.active_only {
|
||||
height: 2vh;
|
||||
height: 25px;
|
||||
fill: var(--colour-text-background);
|
||||
background-color: var(--colour-primary);
|
||||
border: 1px solid var(--colour-primary);
|
||||
width: 2vh;
|
||||
border-radius: 0.5vh;
|
||||
background-color: var(--colour-accent);
|
||||
/* border: 1px solid var(--colour-accent);
|
||||
border-radius: 0.5vh; */
|
||||
width: 25px;
|
||||
}
|
||||
#formFilters .container-input.filter.active_only svg.active_only.is_checked {
|
||||
fill: var(--colour-accent);
|
||||
background-color: var(--colour-text-background);
|
||||
}
|
||||
#formFilters .container-input.filter.is_not_empty {
|
||||
width: 12vh;
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
align-self: center;
|
||||
position: relative;
|
||||
display: block;
|
||||
width: min(calc(90vh), calc(70vw));
|
||||
width: 100%; /* min(calc(90vh), calc(70vw)); */
|
||||
}
|
||||
|
||||
#tableMain select,
|
||||
|
||||
@@ -196,8 +196,9 @@ img.header-logo {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.container-input > input, .container-input > textarea {
|
||||
border: 2px solid var(--colour-primary);
|
||||
.container-input > input,
|
||||
.container-input > textarea {
|
||||
border: 2px solid var(--colour-accent);
|
||||
padding: 1vh;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
.home-hero a {
|
||||
font-size: 1.25rem;
|
||||
margin-bottom: 2rem;
|
||||
color: var(--colour-text-background);
|
||||
color: var(--colour-primary);
|
||||
cursor: pointer;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
|
||||
@@ -4,26 +4,15 @@
|
||||
min-width: 20vh;
|
||||
}
|
||||
|
||||
#tableMain tbody > div {
|
||||
width: 58vh;
|
||||
}
|
||||
#tableMain thead tr th,
|
||||
#tableMain tbody tr td {
|
||||
height: 3vh;
|
||||
}
|
||||
#tableMain tbody tr td.name .name {
|
||||
border: 1px solid var(--colour-accent);
|
||||
/*
|
||||
align-content: center;
|
||||
align-items: center;
|
||||
align-self: center;
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
justify-items: center;
|
||||
justify-self: center;
|
||||
padding-top: auto;
|
||||
padding-bottom: auto;
|
||||
display: flex;
|
||||
resize: none;
|
||||
box-sizing: border-box;
|
||||
*/
|
||||
}
|
||||
/*
|
||||
#tableMain thead tr th.code,
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
max-width: fit-content;
|
||||
}
|
||||
*/
|
||||
|
||||
#tableMain tbody > div {
|
||||
width: 99vh;
|
||||
}
|
||||
#tableMain thead tr th.can-have-button,
|
||||
#tableMain tbody tr td.can-have-button {
|
||||
width: 6vh;
|
||||
|
||||
@@ -4,32 +4,13 @@
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
#tableMain tbody > div {
|
||||
width: 113vh;
|
||||
}
|
||||
#tableMain {
|
||||
max-width: 90vw;
|
||||
}
|
||||
/*
|
||||
#tableMain thead tr th.category, #tableMain tbody tr td.category {
|
||||
width: 8vh;
|
||||
min-width: 8vh;
|
||||
}
|
||||
#tableMain thead tr th.product, #tableMain tbody tr td.product {
|
||||
width: 10vh;
|
||||
min-width: 10vh;
|
||||
}
|
||||
#tableMain thead tr th.product_variations.is_collapsed, #tableMain tbody tr td.product_variations.is_collapsed {
|
||||
width: 10vh;
|
||||
min-width: 10vh;
|
||||
display: table-cell !important;
|
||||
}
|
||||
#tableMain thead tr th.product_variations, #tableMain tbody tr td.product_variations {
|
||||
width: 24vh;
|
||||
min-width: 24vh;
|
||||
}
|
||||
#tableMain thead tr th.active, #tableMain tbody tr td.active {
|
||||
width: 6vh;
|
||||
min-width: 6vh;
|
||||
}
|
||||
*/
|
||||
|
||||
td > input,
|
||||
td > select,
|
||||
|
||||
5
static/css/pages/dog/locations.css
Normal file
5
static/css/pages/dog/locations.css
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
|
||||
#tableMain tbody > div {
|
||||
width: 99vh;
|
||||
}
|
||||
2
static/dist/css/core_home.bundle.css
vendored
2
static/dist/css/core_home.bundle.css
vendored
@@ -23,7 +23,7 @@
|
||||
.home-hero a {
|
||||
font-size: 1.25rem;
|
||||
margin-bottom: 2rem;
|
||||
color: var(--colour-text-background);
|
||||
color: var(--colour-primary);
|
||||
cursor: pointer;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
|
||||
2
static/dist/css/core_home.bundle.css.map
vendored
2
static/dist/css/core_home.bundle.css.map
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"css/core_home.bundle.css","mappings":";AACA,iBAAiB;AACjB;IACI,oBAAoB;IACpB,kBAAkB;IAClB,iBAAiB;IACjB,kBAAkB;AACtB;;AAEA;IACI,gBAAgB;AACpB;;AAEA;IACI,eAAe;IACf,gBAAgB;IAChB,qBAAqB;IACrB,yBAAyB;IACzB,iBAAiB;IACjB,kBAAkB;AACtB;;AAEA;IACI,kBAAkB;IAClB,mBAAmB;IACnB,oCAAoC;IACpC,eAAe;IACf,iBAAiB;IACjB,kBAAkB;AACtB;;AAEA,qBAAqB;AACrB;IACI,eAAe;IACf,iBAAiB;AACrB;;AAEA;IACI,aAAa;IACb,2DAA2D;IAC3D,SAAS;IACT,gBAAgB;AACpB;;AAEA;IACI,aAAa;IACb,wBAAwB;IACxB,kBAAkB;IAClB,+BAA+B;AACnC;;AAEA;IACI,2BAA2B;AAC/B;;AAEA,wBAAwB;AACxB;IACI,eAAe;IACf,wBAAwB;AAC5B;;AAEA;IACI,iBAAiB;IACjB,aAAa;IACb,kBAAkB;IAClB,gBAAgB;IAChB,mBAAmB;IACnB,qCAAqC;AACzC;;AAEA,oBAAoB;AACpB;IACI,eAAe;IACf,iBAAiB;AACrB;;AAEA;IACI,wBAAwB;IACxB,aAAa;IACb,kBAAkB;IAClB,kBAAkB;IAClB,gBAAgB;IAChB,mBAAmB;AACvB;;AAEA;IACI,iBAAiB;IACjB,qBAAqB;IACrB,iBAAiB;IACjB,cAAc;AAClB;;AAEA,gBAAgB;AAChB;IACI,eAAe;IACf,0BAA0B;IAC1B,YAAY;IACZ,kBAAkB;AACtB;;;AAGA,eAAe;AACf,4DAA4D;AAC5D;IACI,UAAU,EAAE,0BAA0B;AAC1C;;AAEA,iEAAiE;AACjE;IACI;QACI,UAAU;IACd;;IAEA;QACI,yCAAyC;IAC7C;AACJ;;AAEA;IACI;QACI,UAAU;QACV,2BAA2B;IAC/B;IACA;QACI,UAAU;QACV,wBAAwB;IAC5B;AACJ;;AAEA,WAAW,qBAAqB,EAAE;AAClC,WAAW,qBAAqB,EAAE;AAClC,WAAW,qBAAqB,EAAE;AAClC,WAAW,qBAAqB,EAAE,C","sources":["webpack://app/./static/css/pages/core/home.css"],"sourcesContent":["\n/* Hero Section */\n.home-hero {\n padding: 8rem 0 4rem;\n align-self: center;\n margin-left: auto;\n margin-right: auto;\n}\n\n.hero-content {\n max-width: 600px;\n}\n\n.home-hero h2 {\n font-size: 24px;\n line-height: 1.2;\n margin-bottom: 1.5rem;\n color: var(--colour-text); \n margin-left: auto;\n margin-right: auto;\n}\n\n.home-hero a {\n font-size: 1.25rem;\n margin-bottom: 2rem;\n color: var(--colour-text-background);\n cursor: pointer;\n margin-left: auto;\n margin-right: auto;\n}\n\n/* Services Section */\n.services {\n padding: 6rem 0;\n background: white;\n}\n\n.services-grid {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));\n gap: 2rem;\n margin-top: 3rem;\n}\n\n.service-card {\n padding: 2rem;\n background: var(--light);\n border-radius: 8px;\n transition: transform 0.3s ease;\n}\n\n.service-card:hover {\n transform: translateY(-5px);\n}\n\n/* Testimonial Section */\n.testimonial {\n padding: 6rem 0;\n background: var(--light);\n}\n\n.testimonial-card {\n background: white;\n padding: 2rem;\n border-radius: 8px;\n max-width: 800px;\n margin: 3rem auto 0;\n box-shadow: 0 4px 6px rgba(0,0,0,0.1);\n}\n\n/* Pricing Section */\n.pricing {\n padding: 6rem 0;\n background: white;\n}\n\n.pricing-card {\n background: var(--light);\n padding: 2rem;\n border-radius: 8px;\n text-align: center;\n max-width: 400px;\n margin: 3rem auto 0;\n}\n\n.price {\n font-size: 2.5rem;\n color: var(--primary);\n font-weight: bold;\n margin: 1rem 0;\n}\n\n/* CTA Section */\n.cta {\n padding: 6rem 0;\n background: var(--primary);\n color: white;\n text-align: center;\n}\n\n\n/* Animations */\n/* Fallback styles to ensure content is visible without JS */\n.reveal {\n opacity: 1; /* Default visible state */\n}\n\n/* Only hide elements if browser supports Intersection Observer */\n@supports (animation-name: fade) {\n .reveal {\n opacity: 0;\n }\n\n .reveal.active {\n animation: fade-up 0.8s ease-out forwards;\n }\n}\n\n@keyframes fade-up {\n 0% {\n opacity: 0;\n transform: translateY(30px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n.delay-1 { animation-delay: 0.1s; }\n.delay-2 { animation-delay: 0.2s; }\n.delay-3 { animation-delay: 0.3s; }\n.delay-4 { animation-delay: 0.4s; }"],"names":[],"sourceRoot":""}
|
||||
{"version":3,"file":"css/core_home.bundle.css","mappings":";AACA,iBAAiB;AACjB;IACI,oBAAoB;IACpB,kBAAkB;IAClB,iBAAiB;IACjB,kBAAkB;AACtB;;AAEA;IACI,gBAAgB;AACpB;;AAEA;IACI,eAAe;IACf,gBAAgB;IAChB,qBAAqB;IACrB,yBAAyB;IACzB,iBAAiB;IACjB,kBAAkB;AACtB;;AAEA;IACI,kBAAkB;IAClB,mBAAmB;IACnB,4BAA4B;IAC5B,eAAe;IACf,iBAAiB;IACjB,kBAAkB;AACtB;;AAEA,qBAAqB;AACrB;IACI,eAAe;IACf,iBAAiB;AACrB;;AAEA;IACI,aAAa;IACb,2DAA2D;IAC3D,SAAS;IACT,gBAAgB;AACpB;;AAEA;IACI,aAAa;IACb,wBAAwB;IACxB,kBAAkB;IAClB,+BAA+B;AACnC;;AAEA;IACI,2BAA2B;AAC/B;;AAEA,wBAAwB;AACxB;IACI,eAAe;IACf,wBAAwB;AAC5B;;AAEA;IACI,iBAAiB;IACjB,aAAa;IACb,kBAAkB;IAClB,gBAAgB;IAChB,mBAAmB;IACnB,qCAAqC;AACzC;;AAEA,oBAAoB;AACpB;IACI,eAAe;IACf,iBAAiB;AACrB;;AAEA;IACI,wBAAwB;IACxB,aAAa;IACb,kBAAkB;IAClB,kBAAkB;IAClB,gBAAgB;IAChB,mBAAmB;AACvB;;AAEA;IACI,iBAAiB;IACjB,qBAAqB;IACrB,iBAAiB;IACjB,cAAc;AAClB;;AAEA,gBAAgB;AAChB;IACI,eAAe;IACf,0BAA0B;IAC1B,YAAY;IACZ,kBAAkB;AACtB;;;AAGA,eAAe;AACf,4DAA4D;AAC5D;IACI,UAAU,EAAE,0BAA0B;AAC1C;;AAEA,iEAAiE;AACjE;IACI;QACI,UAAU;IACd;;IAEA;QACI,yCAAyC;IAC7C;AACJ;;AAEA;IACI;QACI,UAAU;QACV,2BAA2B;IAC/B;IACA;QACI,UAAU;QACV,wBAAwB;IAC5B;AACJ;;AAEA,WAAW,qBAAqB,EAAE;AAClC,WAAW,qBAAqB,EAAE;AAClC,WAAW,qBAAqB,EAAE;AAClC,WAAW,qBAAqB,EAAE,C","sources":["webpack://app/./static/css/pages/core/home.css"],"sourcesContent":["\n/* Hero Section */\n.home-hero {\n padding: 8rem 0 4rem;\n align-self: center;\n margin-left: auto;\n margin-right: auto;\n}\n\n.hero-content {\n max-width: 600px;\n}\n\n.home-hero h2 {\n font-size: 24px;\n line-height: 1.2;\n margin-bottom: 1.5rem;\n color: var(--colour-text); \n margin-left: auto;\n margin-right: auto;\n}\n\n.home-hero a {\n font-size: 1.25rem;\n margin-bottom: 2rem;\n color: var(--colour-primary);\n cursor: pointer;\n margin-left: auto;\n margin-right: auto;\n}\n\n/* Services Section */\n.services {\n padding: 6rem 0;\n background: white;\n}\n\n.services-grid {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));\n gap: 2rem;\n margin-top: 3rem;\n}\n\n.service-card {\n padding: 2rem;\n background: var(--light);\n border-radius: 8px;\n transition: transform 0.3s ease;\n}\n\n.service-card:hover {\n transform: translateY(-5px);\n}\n\n/* Testimonial Section */\n.testimonial {\n padding: 6rem 0;\n background: var(--light);\n}\n\n.testimonial-card {\n background: white;\n padding: 2rem;\n border-radius: 8px;\n max-width: 800px;\n margin: 3rem auto 0;\n box-shadow: 0 4px 6px rgba(0,0,0,0.1);\n}\n\n/* Pricing Section */\n.pricing {\n padding: 6rem 0;\n background: white;\n}\n\n.pricing-card {\n background: var(--light);\n padding: 2rem;\n border-radius: 8px;\n text-align: center;\n max-width: 400px;\n margin: 3rem auto 0;\n}\n\n.price {\n font-size: 2.5rem;\n color: var(--primary);\n font-weight: bold;\n margin: 1rem 0;\n}\n\n/* CTA Section */\n.cta {\n padding: 6rem 0;\n background: var(--primary);\n color: white;\n text-align: center;\n}\n\n\n/* Animations */\n/* Fallback styles to ensure content is visible without JS */\n.reveal {\n opacity: 1; /* Default visible state */\n}\n\n/* Only hide elements if browser supports Intersection Observer */\n@supports (animation-name: fade) {\n .reveal {\n opacity: 0;\n }\n\n .reveal.active {\n animation: fade-up 0.8s ease-out forwards;\n }\n}\n\n@keyframes fade-up {\n 0% {\n opacity: 0;\n transform: translateY(30px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n.delay-1 { animation-delay: 0.1s; }\n.delay-2 { animation-delay: 0.2s; }\n.delay-3 { animation-delay: 0.3s; }\n.delay-4 { animation-delay: 0.4s; }"],"names":[],"sourceRoot":""}
|
||||
23
static/dist/css/main.bundle.css
vendored
23
static/dist/css/main.bundle.css
vendored
@@ -196,8 +196,9 @@ img.header-logo {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.container-input > input, .container-input > textarea {
|
||||
border: 2px solid var(--colour-primary);
|
||||
.container-input > input,
|
||||
.container-input > textarea {
|
||||
border: 2px solid var(--colour-accent);
|
||||
padding: 1vh;
|
||||
}
|
||||
|
||||
@@ -289,6 +290,10 @@ input.dirty, textarea.dirty, select.dirty {
|
||||
|
||||
|
||||
|
||||
select {
|
||||
border: 1px solid var(--colour-accent);
|
||||
}
|
||||
|
||||
img, video {
|
||||
border-radius: 3vh;
|
||||
}
|
||||
@@ -645,6 +650,7 @@ header {
|
||||
#formFilters .container-input input {
|
||||
width: 10vh;
|
||||
max-width: 10vh;
|
||||
height: 20px;
|
||||
}
|
||||
/*
|
||||
#formFilters .container-input input {
|
||||
@@ -662,15 +668,16 @@ header {
|
||||
display: none;
|
||||
}
|
||||
#formFilters .container-input.filter.active_only svg.active_only {
|
||||
height: 2vh;
|
||||
height: 25px;
|
||||
fill: var(--colour-text-background);
|
||||
background-color: var(--colour-primary);
|
||||
border: 1px solid var(--colour-primary);
|
||||
width: 2vh;
|
||||
border-radius: 0.5vh;
|
||||
background-color: var(--colour-accent);
|
||||
/* border: 1px solid var(--colour-accent);
|
||||
border-radius: 0.5vh; */
|
||||
width: 25px;
|
||||
}
|
||||
#formFilters .container-input.filter.active_only svg.active_only.is_checked {
|
||||
fill: var(--colour-accent);
|
||||
background-color: var(--colour-text-background);
|
||||
}
|
||||
#formFilters .container-input.filter.is_not_empty {
|
||||
width: 12vh;
|
||||
@@ -792,7 +799,7 @@ form.filter button.save, form.filter button.button-cancel {
|
||||
align-self: center;
|
||||
position: relative;
|
||||
display: block;
|
||||
width: min(calc(90vh), calc(70vw));
|
||||
width: 100%; /* min(calc(90vh), calc(70vw)); */
|
||||
}
|
||||
|
||||
#tableMain select,
|
||||
|
||||
2
static/dist/css/main.bundle.css.map
vendored
2
static/dist/css/main.bundle.css.map
vendored
File diff suppressed because one or more lines are too long
196
static/dist/js/main.bundle.js
vendored
196
static/dist/js/main.bundle.js
vendored
@@ -1339,7 +1339,7 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
} else {
|
||||
var dataPage = this.getLocalStoragePage();
|
||||
var filters = dataPage[flagFormFilters];
|
||||
var formFilters = this.getFormFilters();
|
||||
var formFilters = TableBasePage.getFormFilters();
|
||||
var filtersDefault = DOM.convertForm2JSON(formFilters);
|
||||
if (!Validation.areEqualDicts(filters, filtersDefault)) {
|
||||
this.callFilterTableContent();
|
||||
@@ -1362,6 +1362,7 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
}, {
|
||||
key: "hookupFilterActive",
|
||||
value: function hookupFilterActive() {
|
||||
var _this3 = this;
|
||||
var filterSelector = idFormFilters + ' #' + flagActiveOnly;
|
||||
var filterActiveOld = document.querySelector(filterSelector);
|
||||
filterActiveOld.removeAttribute('id');
|
||||
@@ -1382,7 +1383,7 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
} else {
|
||||
svgElement.classList.add(flagIsChecked);
|
||||
}
|
||||
return TableBasePage.isDirtyFilter(svgElement);
|
||||
return _this3.handleChangeFilter(event, filterActive);
|
||||
});
|
||||
var filter = document.querySelector(filterSelector);
|
||||
var filterValuePrevious = DOM.getElementValueCurrent(filter);
|
||||
@@ -1392,8 +1393,9 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
}, {
|
||||
key: "hookupFilter",
|
||||
value: function hookupFilter(filterFlag) {
|
||||
var _this4 = this;
|
||||
var handler = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (event, filter) {
|
||||
return TableBasePage.isDirtyFilter(filter);
|
||||
return _this4.handleChangeFilter(event, filter);
|
||||
};
|
||||
var filterSelector = idFormFilters + ' #' + filterFlag;
|
||||
this.hookupEventHandler("change", filterSelector, handler);
|
||||
@@ -1402,6 +1404,44 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
filter.setAttribute(attrValueCurrent, filterValuePrevious);
|
||||
filter.setAttribute(attrValuePrevious, filterValuePrevious);
|
||||
}
|
||||
}, {
|
||||
key: "handleChangeFilter",
|
||||
value: function handleChangeFilter(event, filter) {
|
||||
var isDirtyFilter = DOM.updateAndCheckIsElementDirty(filter);
|
||||
var formFilters = TableBasePage.getFormFilters();
|
||||
var areDirtyFilters = isDirtyFilter || DOM.hasDirtyChildrenContainer(formFilters);
|
||||
var tbody = document.querySelector(idTableMain + ' tbody');
|
||||
var rows = tbody.querySelectorAll(':scope > tr');
|
||||
rows.forEach(function (row) {
|
||||
if (areDirtyFilters && !row.classList.contains(flagIsCollapsed)) row.classList.add(flagIsCollapsed);
|
||||
if (!areDirtyFilters && row.classList.contains(flagIsCollapsed)) {
|
||||
row.classList.remove(flagIsCollapsed);
|
||||
var dirtyInputs = row.querySelectorAll('input.' + flagDirty);
|
||||
dirtyInputs.forEach(function (dirtyInput) {
|
||||
dirtyInput.value = DOM.getElementAttributeValueCurrent(dirtyInput);
|
||||
});
|
||||
}
|
||||
});
|
||||
if (areDirtyFilters) {
|
||||
/*
|
||||
tbody.querySelectorAll('tr').forEach((tr) => {
|
||||
if (!DOM.hasDirtyChildrenContainer(tr)) tr.remove();
|
||||
});
|
||||
*/
|
||||
tbody.innerHTML = '<div>Press "Apply Filters" to refresh the table.</div>' + tbody.innerHTML;
|
||||
if (!tbody.classList.contains(flagIsCollapsed)) tbody.classList.add(flagIsCollapsed);
|
||||
} else {
|
||||
var isDirtyLabel = tbody.querySelector(":scope > div");
|
||||
if (isDirtyLabel != null) isDirtyLabel.remove();
|
||||
if (tbody.classList.contains(flagIsCollapsed)) tbody.classList.remove(flagIsCollapsed);
|
||||
var initialisedElements = tbody.querySelectorAll('.' + flagInitialised);
|
||||
initialisedElements.forEach(function (initialisedElement) {
|
||||
initialisedElement.classList.remove(flagInitialised);
|
||||
});
|
||||
this.hookupTableMain();
|
||||
}
|
||||
this.updateAndToggleShowButtonsSaveCancel();
|
||||
}
|
||||
}, {
|
||||
key: "hookupFilterIsNotEmpty",
|
||||
value: function hookupFilterIsNotEmpty() {
|
||||
@@ -1410,10 +1450,10 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
}, {
|
||||
key: "hookupButtonApplyFilters",
|
||||
value: function hookupButtonApplyFilters() {
|
||||
var _this3 = this;
|
||||
var _this5 = this;
|
||||
this.hookupEventHandler("click", idButtonApplyFilters, function (event, button) {
|
||||
event.stopPropagation();
|
||||
_this3.callFilterTableContent();
|
||||
_this5.callFilterTableContent();
|
||||
});
|
||||
}
|
||||
}, {
|
||||
@@ -1429,8 +1469,9 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
}, {
|
||||
key: "hookupFilterCommandCategory",
|
||||
value: function hookupFilterCommandCategory() {
|
||||
var _this6 = this;
|
||||
this.hookupFilter(attrIdCommandCategory, function (event, filterCommandCategory) {
|
||||
TableBasePage.isDirtyFilter(filterCommandCategory);
|
||||
_this6.handleChangeFilter();
|
||||
var isDirtyFilter = filterCommandCategory.classList.contains(flagDirty);
|
||||
var idCommandCategory = DOM.getElementValueCurrent(filterCommandCategory);
|
||||
console.log("filter commands unsorted");
|
||||
@@ -1467,15 +1508,10 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
.catch(error => console.error('Error:', error));
|
||||
}
|
||||
*/
|
||||
}, {
|
||||
key: "getFormFilters",
|
||||
value: function getFormFilters() {
|
||||
return document.querySelector(idFormFilters);
|
||||
}
|
||||
}, {
|
||||
key: "callFilterTableContent",
|
||||
value: function callFilterTableContent() {
|
||||
var formFilters = this.getFormFilters();
|
||||
var formFilters = TableBasePage.getFormFilters();
|
||||
var filtersJson = DOM.convertForm2JSON(formFilters);
|
||||
utils_Utils.consoleLogIfNotProductionEnvironment("callFilterTableContent");
|
||||
utils_Utils.consoleLogIfNotProductionEnvironment("formFilters");
|
||||
@@ -1512,10 +1548,10 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
}, {
|
||||
key: "getAndLoadFilteredTableContentSinglePageApp",
|
||||
value: function getAndLoadFilteredTableContentSinglePageApp() {
|
||||
var _this4 = this;
|
||||
var _this7 = this;
|
||||
this.callFilterTableContent().then(function (data) {
|
||||
utils_Utils.consoleLogIfNotProductionEnvironment('Table data received:', data);
|
||||
_this4.callbackLoadTableContent(data);
|
||||
_this7.callbackLoadTableContent(data);
|
||||
})["catch"](function (error) {
|
||||
return console.error('Error:', error);
|
||||
});
|
||||
@@ -1530,13 +1566,13 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
}, {
|
||||
key: "saveRecordsTableDirty",
|
||||
value: function saveRecordsTableDirty() {
|
||||
var _this5 = this;
|
||||
var _this8 = this;
|
||||
var records = this.getTableRecords(true);
|
||||
if (records.length == 0) {
|
||||
OverlayError.show('No records to save');
|
||||
return;
|
||||
}
|
||||
var formElement = this.getFormFilters();
|
||||
var formElement = TableBasePage.getFormFilters();
|
||||
var comment = DOM.getElementValueCurrent(document.querySelector(idTextareaConfirm));
|
||||
/*
|
||||
Utils.consoleLogIfNotProductionEnvironment({ formElement, comment, records });
|
||||
@@ -1550,7 +1586,7 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
utils_Utils.consoleLogIfNotProductionEnvironment('Records saved!');
|
||||
utils_Utils.consoleLogIfNotProductionEnvironment('Data received:', data);
|
||||
}
|
||||
_this5.callFilterTableContent();
|
||||
_this8.callFilterTableContent();
|
||||
} else {
|
||||
utils_Utils.consoleLogIfNotProductionEnvironment("error: ", data[flagMessage]);
|
||||
OverlayError.show(data[flagMessage]);
|
||||
@@ -1562,13 +1598,13 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
}, {
|
||||
key: "getTableRecords",
|
||||
value: function getTableRecords() {
|
||||
var _this6 = this;
|
||||
var _this9 = this;
|
||||
var dirtyOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
||||
var records = [];
|
||||
var record;
|
||||
document.querySelectorAll(idTableMain + ' > tbody > tr').forEach(function (row) {
|
||||
if (dirtyOnly && !DOM.hasDirtyChildrenContainer(row)) return;
|
||||
record = _this6.getJsonRow(row);
|
||||
record = _this9.getJsonRow(row);
|
||||
records.push(record);
|
||||
});
|
||||
return records;
|
||||
@@ -1581,13 +1617,13 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
}, {
|
||||
key: "saveRecordsTableDirtySinglePageApp",
|
||||
value: function saveRecordsTableDirtySinglePageApp() {
|
||||
var _this7 = this;
|
||||
var _this10 = this;
|
||||
var records = this.getTableRecords(true);
|
||||
if (records.length == 0) {
|
||||
OverlayError.show('No records to save');
|
||||
return;
|
||||
}
|
||||
var formElement = this.getFormFilters();
|
||||
var formElement = TableBasePage.getFormFilters();
|
||||
var comment = DOM.getElementValueCurrent(document.querySelector(idTextareaConfirm));
|
||||
this.callSaveTableContent(records, formElement, comment).then(function (data) {
|
||||
if (data[flagStatus] == flagSuccess) {
|
||||
@@ -1595,7 +1631,7 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
utils_Utils.consoleLogIfNotProductionEnvironment('Records saved!');
|
||||
utils_Utils.consoleLogIfNotProductionEnvironment('Data received:', data);
|
||||
}
|
||||
_this7.callbackLoadTableContent(data);
|
||||
_this10.callbackLoadTableContent(data);
|
||||
} else {
|
||||
utils_Utils.consoleLogIfNotProductionEnvironment("error: ", data[flagMessage]);
|
||||
OverlayError.show(data[flagMessage]);
|
||||
@@ -1607,13 +1643,13 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
}, {
|
||||
key: "hookupButtonCancel",
|
||||
value: function hookupButtonCancel() {
|
||||
var _this8 = this;
|
||||
var _this11 = this;
|
||||
Events.initialiseEventHandler(idFormFilters + ' button.' + flagCancel, flagInitialised, function (button) {
|
||||
button.addEventListener("click", function (event) {
|
||||
event.stopPropagation();
|
||||
button = event.target;
|
||||
if (button.classList.contains(flagIsCollapsed)) return;
|
||||
_this8.callFilterTableContent();
|
||||
_this11.callFilterTableContent();
|
||||
});
|
||||
button.classList.add(flagIsCollapsed);
|
||||
});
|
||||
@@ -1649,14 +1685,14 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
}, {
|
||||
key: "hookupTableMain",
|
||||
value: function hookupTableMain() {
|
||||
var _this9 = this;
|
||||
var _this12 = this;
|
||||
if (this.constructor === TableBasePage) {
|
||||
throw new Error("Must implement hookupTableMain() method.");
|
||||
}
|
||||
if (true) {
|
||||
// _rowBlank == null) {
|
||||
Events.initialiseEventHandler(idTableMain, flagInitialised, function (table) {
|
||||
_this9.cacheRowBlank();
|
||||
_this12.cacheRowBlank();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1702,9 +1738,9 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
}, {
|
||||
key: "hookupChangeHandlerTableCells",
|
||||
value: function hookupChangeHandlerTableCells(inputSelector) {
|
||||
var _this10 = this;
|
||||
var _this13 = this;
|
||||
var handler = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (event, element) {
|
||||
_this10.handleChangeNestedElementCellTable(event, element);
|
||||
_this13.handleChangeNestedElementCellTable(event, element);
|
||||
};
|
||||
Events.initialiseEventHandler(inputSelector, flagInitialised, function (input) {
|
||||
input.addEventListener("change", function (event) {
|
||||
@@ -1836,9 +1872,9 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
}, {
|
||||
key: "hookupChangeHandlerTableCellsWhenNotCollapsed",
|
||||
value: function hookupChangeHandlerTableCellsWhenNotCollapsed(inputSelector) {
|
||||
var _this11 = this;
|
||||
var _this14 = this;
|
||||
var handler = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (event, element) {
|
||||
if (!element.classList.contains(flagIsCollapsed)) _this11.handleChangeNestedElementCellTable(event, element);
|
||||
if (!element.classList.contains(flagIsCollapsed)) _this14.handleChangeNestedElementCellTable(event, element);
|
||||
};
|
||||
this.hookupEventHandler("change", inputSelector, handler);
|
||||
}
|
||||
@@ -1865,10 +1901,10 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
}, {
|
||||
key: "hookupFieldsActive",
|
||||
value: function hookupFieldsActive() {
|
||||
var _this12 = this;
|
||||
var _this15 = this;
|
||||
var flagTable = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
||||
var handleClickRowNew = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (event, element) {
|
||||
_this12.handleClickAddRowTable(event, element);
|
||||
_this15.handleClickAddRowTable(event, element);
|
||||
};
|
||||
var selectorButton = 'table' + (Validation.isEmpty(flagTable) ? '' : '.' + flagTable) + ' > tbody > tr > td.' + flagActive + ' .' + flagButton + '.' + flagActive;
|
||||
var selectorButtonDelete = selectorButton + '.' + flagDelete;
|
||||
@@ -1883,12 +1919,12 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
}, {
|
||||
key: "hookupButtonsRowDelete",
|
||||
value: function hookupButtonsRowDelete(selectorButtonDelete, selectorButtonUndelete) {
|
||||
var _this13 = this;
|
||||
var _this16 = this;
|
||||
var changeHandler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (event, element) {
|
||||
_this13.handleChangeNestedElementCellTable(event, element);
|
||||
_this16.handleChangeNestedElementCellTable(event, element);
|
||||
};
|
||||
this.hookupEventHandler("click", selectorButtonDelete, function (event, element) {
|
||||
_this13.handleClickButtonRowDelete(event, element, selectorButtonDelete, selectorButtonUndelete, function (changeEvent, changeElement) {
|
||||
_this16.handleClickButtonRowDelete(event, element, selectorButtonDelete, selectorButtonUndelete, function (changeEvent, changeElement) {
|
||||
changeHandler(changeEvent, changeElement);
|
||||
});
|
||||
});
|
||||
@@ -1896,9 +1932,9 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
}, {
|
||||
key: "handleClickButtonRowDelete",
|
||||
value: function handleClickButtonRowDelete(event, element, selectorButtonDelete, selectorButtonUndelete) {
|
||||
var _this14 = this;
|
||||
var _this17 = this;
|
||||
var changeHandler = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : function (event, element) {
|
||||
_this14.handleChangeNestedElementCellTable(event, element);
|
||||
_this17.handleChangeNestedElementCellTable(event, element);
|
||||
};
|
||||
if (element.tagName.toUpperCase() != 'SVG') element = element.parentElement;
|
||||
var valuePrevious = DOM.getElementAttributeValuePrevious(element);
|
||||
@@ -1923,12 +1959,12 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
}, {
|
||||
key: "hookupButtonsRowUndelete",
|
||||
value: function hookupButtonsRowUndelete(selectorButtonDelete, selectorButtonUndelete) {
|
||||
var _this15 = this;
|
||||
var _this18 = this;
|
||||
var changeHandler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (event, element) {
|
||||
_this15.handleChangeNestedElementCellTable(event, element);
|
||||
_this18.handleChangeNestedElementCellTable(event, element);
|
||||
};
|
||||
this.hookupEventHandler("click", selectorButtonUndelete, function (event, element) {
|
||||
_this15.handleClickButtonRowUndelete(event, element, selectorButtonDelete, selectorButtonUndelete, function (changeEvent, changeElement) {
|
||||
_this18.handleClickButtonRowUndelete(event, element, selectorButtonDelete, selectorButtonUndelete, function (changeEvent, changeElement) {
|
||||
changeHandler(changeEvent, changeElement);
|
||||
});
|
||||
});
|
||||
@@ -1936,9 +1972,9 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
}, {
|
||||
key: "handleClickButtonRowUndelete",
|
||||
value: function handleClickButtonRowUndelete(event, element, selectorButtonDelete, selectorButtonUndelete) {
|
||||
var _this16 = this;
|
||||
var _this19 = this;
|
||||
var changeHandler = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : function (event, element) {
|
||||
_this16.handleChangeNestedElementCellTable(event, element);
|
||||
_this19.handleChangeNestedElementCellTable(event, element);
|
||||
};
|
||||
if (element.tagName.toUpperCase() != 'SVG') element = element.parentElement;
|
||||
var valuePrevious = DOM.getElementAttributeValuePrevious(element);
|
||||
@@ -1963,17 +1999,17 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
}, {
|
||||
key: "hookupTableCellDdlPreviews",
|
||||
value: function hookupTableCellDdlPreviews(fieldFlag, optionList) {
|
||||
var _this17 = this;
|
||||
var _this20 = this;
|
||||
var cellSelector = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
||||
var ddlHookup = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function (ddlSelector) {
|
||||
_this17.hookupTableCellDdls(ddlSelector);
|
||||
_this20.hookupTableCellDdls(ddlSelector);
|
||||
};
|
||||
var changeHandler = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : function (event, element) {
|
||||
_this17.handleChangeNestedElementCellTable(event, element);
|
||||
_this20.handleChangeNestedElementCellTable(event, element);
|
||||
};
|
||||
if (cellSelector == null) cellSelector = idTableMain + ' > tbody > tr > td.' + fieldFlag;
|
||||
this.hookupEventHandler("click", cellSelector + ' div.' + fieldFlag, function (event, div) {
|
||||
_this17.handleClickTableCellDdlPreview(event, div, fieldFlag, optionList, cellSelector, function (ddlSelector) {
|
||||
_this20.handleClickTableCellDdlPreview(event, div, fieldFlag, optionList, cellSelector, function (ddlSelector) {
|
||||
ddlHookup(ddlSelector, function (event, element) {
|
||||
changeHandler(event, element);
|
||||
});
|
||||
@@ -1984,9 +2020,9 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
}, {
|
||||
key: "hookupTableCellDdls",
|
||||
value: function hookupTableCellDdls(ddlSelector) {
|
||||
var _this18 = this;
|
||||
var _this21 = this;
|
||||
var changeHandler = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (event, element) {
|
||||
_this18.handleChangeNestedElementCellTable(event, element);
|
||||
_this21.handleChangeNestedElementCellTable(event, element);
|
||||
};
|
||||
this.hookupEventHandler("change", ddlSelector, function (event, element) {
|
||||
changeHandler(event, element);
|
||||
@@ -1995,10 +2031,10 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
}, {
|
||||
key: "handleClickTableCellDdlPreview",
|
||||
value: function handleClickTableCellDdlPreview(event, div, fieldFlag, optionObjectList) {
|
||||
var _this19 = this;
|
||||
var _this22 = this;
|
||||
var cellSelector = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
|
||||
var ddlHookup = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : function (cellSelector) {
|
||||
_this19.hookupTableCellDdls(cellSelector);
|
||||
_this22.hookupTableCellDdls(cellSelector);
|
||||
};
|
||||
if (Validation.isEmpty(cellSelector)) cellSelector = idTableMain + ' > tbody > tr > td.' + fieldFlag;
|
||||
var idSelected = DOM.getElementAttributeValueCurrent(div);
|
||||
@@ -2046,19 +2082,19 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
}, {
|
||||
key: "hookupFieldsCommandCategory",
|
||||
value: function hookupFieldsCommandCategory() {
|
||||
var _this20 = this;
|
||||
var _this23 = this;
|
||||
this.hookupTableCellDdlPreviews(flagCommandCategory, utils_Utils.getListFromDict(filterCommandCategories).sort(function (a, b) {
|
||||
return a[flagName].localeCompare(b[flagName]);
|
||||
}), null, function (cellSelector) {
|
||||
_this20.hookupCommandCategoryDdls(cellSelector);
|
||||
_this23.hookupCommandCategoryDdls(cellSelector);
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "hookupCommandCategoryDdls",
|
||||
value: function hookupCommandCategoryDdls(ddlSelector) {
|
||||
var _this21 = this;
|
||||
var _this24 = this;
|
||||
this.hookupChangeHandlerTableCells(ddlSelector, function (event, element) {
|
||||
_this21.handleChangeCommandCategoryDdl(event, element);
|
||||
_this24.handleChangeCommandCategoryDdl(event, element);
|
||||
});
|
||||
}
|
||||
}, {
|
||||
@@ -2092,7 +2128,7 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
}, {
|
||||
key: "hookupFieldsCommand",
|
||||
value: function hookupFieldsCommand() {
|
||||
var _this22 = this;
|
||||
var _this25 = this;
|
||||
this.hookupEventHandler("click", idTableMain + ' td.' + flagCommand + ' .' + flagCommand, function (event, div) {
|
||||
utils_Utils.consoleLogIfNotProductionEnvironment(div);
|
||||
var parentTr = DOM.getRowFromElement(div);
|
||||
@@ -2101,8 +2137,8 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
parentTr: parentTr
|
||||
});
|
||||
var tdCommandCategory = parentTr.querySelector('td.' + flagCommandCategory);
|
||||
var idCommandCategoryRow = _this22.getIdCommandCategoryRow(parentTr); // DOM.getElementAttributeValueCurrent(tdCommandCategory);
|
||||
var idCommandCategoryFilter = _this22.getIdCommandCategoryFilter();
|
||||
var idCommandCategoryRow = _this25.getIdCommandCategoryRow(parentTr); // DOM.getElementAttributeValueCurrent(tdCommandCategory);
|
||||
var idCommandCategoryFilter = _this25.getIdCommandCategoryFilter();
|
||||
var filterCommandList = utils_Utils.getListFromDict(filterCommands);
|
||||
var commandsInCategory = filterCommandList.filter(function (command) {
|
||||
return (command[attrIdCommandCategory] == idCommandCategoryRow || idCommandCategoryRow == 0) && (command[attrIdCommandCategory] == idCommandCategoryFilter || idCommandCategoryFilter == 0);
|
||||
@@ -2118,9 +2154,9 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
commandsInCategory: commandsInCategory
|
||||
});
|
||||
utils_Utils.consoleLogIfNotProductionEnvironment(filterCommandList);
|
||||
_this22.handleClickTableCellDdlPreview(event, div, flagCommand, sortedCommands, null, function (cellSelector) {
|
||||
_this22.hookupTableCellDdls(cellSelector, function (event, element) {
|
||||
_this22.handleChangeNestedElementCellTable(event, element);
|
||||
_this25.handleClickTableCellDdlPreview(event, div, flagCommand, sortedCommands, null, function (cellSelector) {
|
||||
_this25.hookupTableCellDdls(cellSelector, function (event, element) {
|
||||
_this25.handleChangeNestedElementCellTable(event, element);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -2135,7 +2171,7 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
}, {
|
||||
key: "getIdCommandCategoryFilter",
|
||||
value: function getIdCommandCategoryFilter() {
|
||||
var formFilters = this.getFormFilters();
|
||||
var formFilters = TableBasePage.getFormFilters();
|
||||
var commandCategoryFilter = formFilters.querySelector('#' + attrIdCommandCategory);
|
||||
var commandFilter = formFilters.querySelector('#' + attrIdCommand);
|
||||
var idCommandCategory = 0;
|
||||
@@ -2172,7 +2208,7 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
}, {
|
||||
key: "getIdCommandFilter",
|
||||
value: function getIdCommandFilter() {
|
||||
var formFilters = this.getFormFilters();
|
||||
var formFilters = TableBasePage.getFormFilters();
|
||||
var commandFilter = formFilters.querySelector('#' + attrIdCommand);
|
||||
var valueCurrentCommandFilter = DOM.getElementAttributeValueCurrent(commandFilter);
|
||||
var idCommand = Number(valueCurrentCommandFilter);
|
||||
@@ -2215,7 +2251,7 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
throw new Error("Must implement leave() method.");
|
||||
}
|
||||
base_table_superPropGet(TableBasePage, "leave", this, 3)([]);
|
||||
var formFilters = this.getFormFilters();
|
||||
var formFilters = TableBasePage.getFormFilters();
|
||||
var dataPage = {};
|
||||
dataPage[flagFormFilters] = DOM.convertForm2JSON(formFilters);
|
||||
this.setLocalStoragePage(dataPage);
|
||||
@@ -2240,35 +2276,15 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
||||
key: "updateAndToggleShowButtonsSaveCancel",
|
||||
value: function updateAndToggleShowButtonsSaveCancel() {
|
||||
var records = this.getTableRecords(true);
|
||||
var existsDirtyRecord = records.length > 0;
|
||||
this.toggleShowButtonsSaveCancel(existsDirtyRecord);
|
||||
var isDirtyMainTable = records.length > 0;
|
||||
var formFilters = TableBasePage.getFormFilters();
|
||||
var areDirtyFilters = DOM.hasDirtyChildrenContainer(formFilters);
|
||||
this.toggleShowButtonsSaveCancel(isDirtyMainTable && !areDirtyFilters);
|
||||
}
|
||||
}], [{
|
||||
key: "isDirtyFilter",
|
||||
value: function isDirtyFilter(filter) {
|
||||
var isDirty = DOM.updateAndCheckIsElementDirty(filter);
|
||||
var tbody = document.querySelector(idTableMain + ' tbody');
|
||||
var rows = tbody.querySelectorAll(':scope > tr');
|
||||
var cancelButton = document.querySelector(idFormFilters + ' ' + idButtonCancel);
|
||||
var saveButton = document.querySelector(idFormFilters + ' ' + idButtonSave);
|
||||
rows.forEach(function (row) {
|
||||
if (isDirty && !row.classList.contains(flagIsCollapsed)) row.classList.add(flagIsCollapsed);
|
||||
if (!isDirty && row.classList.contains(flagIsCollapsed)) row.classList.remove(flagIsCollapsed);
|
||||
});
|
||||
if (isDirty) {
|
||||
// tbody.querySelectorAll('tr').forEach((tr) => { tr.remove(); });
|
||||
tbody.innerHTML = '<div>Press "Apply Filters" to refresh the table.</div>' + tbody.innerHTML;
|
||||
if (!tbody.classList.contains(flagIsCollapsed)) tbody.classList.add(flagIsCollapsed);
|
||||
if (!cancelButton.classList.contains(flagIsCollapsed)) cancelButton.classList.add(flagIsCollapsed);
|
||||
if (!saveButton.classList.contains(flagIsCollapsed)) saveButton.classList.add(flagIsCollapsed);
|
||||
} else {
|
||||
if (tbody.classList.contains(flagIsCollapsed)) tbody.classList.remove(flagIsCollapsed);
|
||||
if (cancelButton.classList.contains(flagIsCollapsed)) cancelButton.classList.remove(flagIsCollapsed);
|
||||
if (saveButton.classList.contains(flagIsCollapsed)) saveButton.classList.remove(flagIsCollapsed);
|
||||
var isDirtyLabel = tbody.querySelector(":scope > div");
|
||||
if (isDirtyLabel != null) isDirtyLabel.remove();
|
||||
}
|
||||
return isDirty;
|
||||
key: "getFormFilters",
|
||||
value: function getFormFilters() {
|
||||
return document.querySelector(idFormFilters);
|
||||
}
|
||||
}, {
|
||||
key: "getTableMain",
|
||||
|
||||
2
static/dist/js/main.bundle.js.map
vendored
2
static/dist/js/main.bundle.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -98,4 +98,13 @@ export default class API {
|
||||
return await API.request(hashSaveDogDogCommandLink, 'POST', dataRequest);
|
||||
}
|
||||
|
||||
// Locations
|
||||
static async saveLocations(locations, formFilters, comment) {
|
||||
let dataRequest = {};
|
||||
dataRequest[flagFormFilters] = DOM.convertForm2JSON(formFilters);
|
||||
dataRequest[flagLocation] = locations;
|
||||
dataRequest[flagComment] = comment;
|
||||
return await API.request(hashSaveDogLocation, 'POST', dataRequest);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ export default class TableBasePage extends BasePage {
|
||||
} else {
|
||||
let dataPage = this.getLocalStoragePage();
|
||||
let filters = dataPage[flagFormFilters];
|
||||
let formFilters = this.getFormFilters();
|
||||
let formFilters = TableBasePage.getFormFilters();
|
||||
let filtersDefault = DOM.convertForm2JSON(formFilters);
|
||||
if (!Validation.areEqualDicts(filters, filtersDefault)) {
|
||||
this.callFilterTableContent();
|
||||
@@ -84,14 +84,14 @@ export default class TableBasePage extends BasePage {
|
||||
else {
|
||||
svgElement.classList.add(flagIsChecked);
|
||||
}
|
||||
return TableBasePage.isDirtyFilter(svgElement);
|
||||
return this.handleChangeFilter(event, filterActive);
|
||||
});
|
||||
let filter = document.querySelector(filterSelector);
|
||||
let filterValuePrevious = DOM.getElementValueCurrent(filter);
|
||||
filter.setAttribute(attrValueCurrent, filterValuePrevious);
|
||||
filter.setAttribute(attrValuePrevious, filterValuePrevious);
|
||||
}
|
||||
hookupFilter(filterFlag, handler = (event, filter) => { return TableBasePage.isDirtyFilter(filter); }) {
|
||||
hookupFilter(filterFlag, handler = (event, filter) => { return this.handleChangeFilter(event, filter); }) {
|
||||
let filterSelector = idFormFilters + ' #' + filterFlag;
|
||||
this.hookupEventHandler("change", filterSelector, handler);
|
||||
let filter = document.querySelector(filterSelector);
|
||||
@@ -99,31 +99,42 @@ export default class TableBasePage extends BasePage {
|
||||
filter.setAttribute(attrValueCurrent, filterValuePrevious);
|
||||
filter.setAttribute(attrValuePrevious, filterValuePrevious);
|
||||
}
|
||||
static isDirtyFilter(filter) {
|
||||
let isDirty = DOM.updateAndCheckIsElementDirty(filter);
|
||||
handleChangeFilter(event, filter) {
|
||||
let isDirtyFilter = DOM.updateAndCheckIsElementDirty(filter);
|
||||
let formFilters = TableBasePage.getFormFilters();
|
||||
let areDirtyFilters = isDirtyFilter || DOM.hasDirtyChildrenContainer(formFilters);
|
||||
let tbody = document.querySelector(idTableMain + ' tbody');
|
||||
let rows = tbody.querySelectorAll(':scope > tr');
|
||||
let cancelButton = document.querySelector(idFormFilters + ' ' + idButtonCancel);
|
||||
let saveButton = document.querySelector(idFormFilters + ' ' + idButtonSave);
|
||||
rows.forEach((row) => {
|
||||
if (isDirty && !row.classList.contains(flagIsCollapsed)) row.classList.add(flagIsCollapsed);
|
||||
if (!isDirty && row.classList.contains(flagIsCollapsed)) row.classList.remove(flagIsCollapsed);
|
||||
if (areDirtyFilters && !row.classList.contains(flagIsCollapsed)) row.classList.add(flagIsCollapsed);
|
||||
if (!areDirtyFilters && row.classList.contains(flagIsCollapsed)) {
|
||||
row.classList.remove(flagIsCollapsed);
|
||||
let dirtyInputs = row.querySelectorAll('input.' + flagDirty);
|
||||
dirtyInputs.forEach((dirtyInput) => {
|
||||
dirtyInput.value = DOM.getElementAttributeValueCurrent(dirtyInput);
|
||||
});
|
||||
}
|
||||
});
|
||||
if (isDirty) {
|
||||
// tbody.querySelectorAll('tr').forEach((tr) => { tr.remove(); });
|
||||
if (areDirtyFilters) {
|
||||
/*
|
||||
tbody.querySelectorAll('tr').forEach((tr) => {
|
||||
if (!DOM.hasDirtyChildrenContainer(tr)) tr.remove();
|
||||
});
|
||||
*/
|
||||
tbody.innerHTML = '<div>Press "Apply Filters" to refresh the table.</div>' + tbody.innerHTML;
|
||||
if (!tbody.classList.contains(flagIsCollapsed)) tbody.classList.add(flagIsCollapsed);
|
||||
if (!cancelButton.classList.contains(flagIsCollapsed)) cancelButton.classList.add(flagIsCollapsed);
|
||||
if (!saveButton.classList.contains(flagIsCollapsed)) saveButton.classList.add(flagIsCollapsed);
|
||||
}
|
||||
else {
|
||||
if (tbody.classList.contains(flagIsCollapsed)) tbody.classList.remove(flagIsCollapsed);
|
||||
if (cancelButton.classList.contains(flagIsCollapsed)) cancelButton.classList.remove(flagIsCollapsed);
|
||||
if (saveButton.classList.contains(flagIsCollapsed)) saveButton.classList.remove(flagIsCollapsed);
|
||||
let isDirtyLabel = tbody.querySelector(":scope > div");
|
||||
if (isDirtyLabel != null) isDirtyLabel.remove();
|
||||
if (tbody.classList.contains(flagIsCollapsed)) tbody.classList.remove(flagIsCollapsed);
|
||||
let initialisedElements = tbody.querySelectorAll('.' + flagInitialised);
|
||||
initialisedElements.forEach((initialisedElement) => {
|
||||
initialisedElement.classList.remove(flagInitialised);
|
||||
});
|
||||
this.hookupTableMain();
|
||||
}
|
||||
return isDirty;
|
||||
this.updateAndToggleShowButtonsSaveCancel();
|
||||
}
|
||||
hookupFilterIsNotEmpty() {
|
||||
this.hookupFilter(flagIsNotEmpty);
|
||||
@@ -142,7 +153,7 @@ export default class TableBasePage extends BasePage {
|
||||
}
|
||||
hookupFilterCommandCategory() {
|
||||
this.hookupFilter(attrIdCommandCategory, (event, filterCommandCategory) => {
|
||||
TableBasePage.isDirtyFilter(filterCommandCategory);
|
||||
this.handleChangeFilter();
|
||||
let isDirtyFilter = filterCommandCategory.classList.contains(flagDirty);
|
||||
let idCommandCategory = DOM.getElementValueCurrent(filterCommandCategory);
|
||||
console.log("filter commands unsorted");
|
||||
@@ -173,11 +184,11 @@ export default class TableBasePage extends BasePage {
|
||||
.catch(error => console.error('Error:', error));
|
||||
}
|
||||
*/
|
||||
getFormFilters() {
|
||||
static getFormFilters() {
|
||||
return document.querySelector(idFormFilters);
|
||||
}
|
||||
callFilterTableContent() {
|
||||
let formFilters = this.getFormFilters();
|
||||
let formFilters = TableBasePage.getFormFilters();
|
||||
let filtersJson = DOM.convertForm2JSON(formFilters);
|
||||
Utils.consoleLogIfNotProductionEnvironment("callFilterTableContent");
|
||||
Utils.consoleLogIfNotProductionEnvironment("formFilters");
|
||||
@@ -223,7 +234,7 @@ export default class TableBasePage extends BasePage {
|
||||
OverlayError.show('No records to save');
|
||||
return;
|
||||
}
|
||||
let formElement = this.getFormFilters();
|
||||
let formElement = TableBasePage.getFormFilters();
|
||||
let comment = DOM.getElementValueCurrent(document.querySelector(idTextareaConfirm));
|
||||
/*
|
||||
Utils.consoleLogIfNotProductionEnvironment({ formElement, comment, records });
|
||||
@@ -266,7 +277,7 @@ export default class TableBasePage extends BasePage {
|
||||
OverlayError.show('No records to save');
|
||||
return;
|
||||
}
|
||||
let formElement = this.getFormFilters();
|
||||
let formElement = TableBasePage.getFormFilters();
|
||||
let comment = DOM.getElementValueCurrent(document.querySelector(idTextareaConfirm));
|
||||
this.callSaveTableContent(records, formElement, comment)
|
||||
.then(data => {
|
||||
@@ -703,7 +714,7 @@ export default class TableBasePage extends BasePage {
|
||||
return DOM.getElementAttributeValueCurrent(elementCommandCategory);
|
||||
}
|
||||
getIdCommandCategoryFilter() {
|
||||
let formFilters = this.getFormFilters();
|
||||
let formFilters = TableBasePage.getFormFilters();
|
||||
let commandCategoryFilter = formFilters.querySelector('#' + attrIdCommandCategory);
|
||||
let commandFilter = formFilters.querySelector('#' + attrIdCommand);
|
||||
let idCommandCategory = 0;
|
||||
@@ -730,7 +741,7 @@ export default class TableBasePage extends BasePage {
|
||||
return DOM.getElementAttributeValueCurrent(elementCommand);
|
||||
}
|
||||
getIdCommandFilter() {
|
||||
let formFilters = this.getFormFilters();
|
||||
let formFilters = TableBasePage.getFormFilters();
|
||||
let commandFilter = formFilters.querySelector('#' + attrIdCommand);
|
||||
let valueCurrentCommandFilter = DOM.getElementAttributeValueCurrent(commandFilter);
|
||||
let idCommand = Number(valueCurrentCommandFilter);
|
||||
@@ -765,7 +776,7 @@ export default class TableBasePage extends BasePage {
|
||||
throw new Error("Must implement leave() method.");
|
||||
}
|
||||
super.leave();
|
||||
let formFilters = this.getFormFilters();
|
||||
let formFilters = TableBasePage.getFormFilters();
|
||||
let dataPage = {};
|
||||
dataPage[flagFormFilters] = DOM.convertForm2JSON(formFilters);
|
||||
this.setLocalStoragePage(dataPage);
|
||||
@@ -786,7 +797,11 @@ export default class TableBasePage extends BasePage {
|
||||
|
||||
updateAndToggleShowButtonsSaveCancel() {
|
||||
let records = this.getTableRecords(true);
|
||||
let existsDirtyRecord = records.length > 0;
|
||||
this.toggleShowButtonsSaveCancel(existsDirtyRecord);
|
||||
let isDirtyMainTable = records.length > 0;
|
||||
|
||||
let formFilters = TableBasePage.getFormFilters();
|
||||
let areDirtyFilters = DOM.hasDirtyChildrenContainer(formFilters);
|
||||
|
||||
this.toggleShowButtonsSaveCancel(isDirtyMainTable && !areDirtyFilters);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,10 +38,8 @@ export default class PageDogCommandCategories extends TableBasePage {
|
||||
let inputName = row.querySelector('td.' + flagName + ' .' + flagName);
|
||||
let buttonActive = row.querySelector('td.' + flagActive + ' .' + flagActive);
|
||||
|
||||
/*
|
||||
console.log("inputName");
|
||||
console.log(inputName);
|
||||
*/
|
||||
console.log("inputCode");
|
||||
console.log(inputCode);
|
||||
|
||||
let jsonRow = {};
|
||||
jsonRow[attrIdCommandCategory] = row.getAttribute(attrIdCommandCategory);
|
||||
|
||||
83
static/js/pages/dog/locations.js
Normal file
83
static/js/pages/dog/locations.js
Normal file
@@ -0,0 +1,83 @@
|
||||
|
||||
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 DogTableMixinPage from "./mixin_table.js";
|
||||
|
||||
export default class PageDogLocations extends TableBasePage {
|
||||
static hash = hashPageDogLocations;
|
||||
static attrIdRowObject = attrIdLocation;
|
||||
callSaveTableContent = API.saveLocations;
|
||||
|
||||
constructor(router) {
|
||||
super(router);
|
||||
this.dogMixin = new DogTableMixinPage(this);
|
||||
}
|
||||
|
||||
initialize() {
|
||||
this.sharedInitialize();
|
||||
}
|
||||
|
||||
hookupFilters() {
|
||||
this.sharedHookupFilters();
|
||||
this.hookupFilterActive();
|
||||
}
|
||||
|
||||
loadRowTable(rowJson) {
|
||||
if (rowJson == null) return;
|
||||
if (_verbose) { Utils.consoleLogIfNotProductionEnvironment("applying data row: ", rowJson); }
|
||||
}
|
||||
getJsonRow(row) {
|
||||
if (row == null) return;
|
||||
let inputName = row.querySelector('td.' + flagName + ' .' + flagName);
|
||||
let buttonActive = row.querySelector('td.' + flagActive + ' .' + flagActive);
|
||||
|
||||
let jsonRow = {};
|
||||
jsonRow[attrIdLocation] = row.getAttribute(attrIdLocation);
|
||||
jsonRow[flagLocationParent] = this.getIdLocationParentRow(row);
|
||||
jsonRow[flagName] = DOM.getElementAttributeValueCurrent(inputName);
|
||||
jsonRow[flagActive] = buttonActive.classList.contains(flagDelete);
|
||||
return jsonRow;
|
||||
}
|
||||
getIdLocationParentRow(row) {
|
||||
let elementLocationParent = row.querySelector('td.' + flagLocationParent + ' .' + flagLocationParent);
|
||||
return DOM.getElementAttributeValueCurrent(elementLocationParent);
|
||||
}
|
||||
initialiseRowNew(tbody, row) {
|
||||
|
||||
}
|
||||
postInitialiseRowNewCallback(tbody) {
|
||||
let newRows = tbody.querySelectorAll('tr.' + flagRowNew);
|
||||
let newestRow = newRows[0];
|
||||
let clickableElementsSelector = [
|
||||
'td.' + flagDog + ' div.' + flagDog
|
||||
, ',td.' + flagLocationCategory + ' div.' + flagLocationCategory
|
||||
, ',td.' + flagLocation + ' div.' + flagLocation
|
||||
].join('');
|
||||
newestRow.querySelectorAll(clickableElementsSelector).forEach((clickableElement) => {
|
||||
clickableElement.click();
|
||||
});
|
||||
}
|
||||
|
||||
hookupTableMain() {
|
||||
super.hookupTableMain();
|
||||
this.hookupFieldsLocationCategory();
|
||||
this.hookupFieldsNameTable();
|
||||
this.hookupFieldsActive();
|
||||
}
|
||||
hookupFieldsLocationParent() {
|
||||
this.hookupTableCellDdlPreviews(
|
||||
flagLocationParent
|
||||
, Utils.getListFromDict(locations)
|
||||
);
|
||||
}
|
||||
|
||||
leave() {
|
||||
super.leave();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import PageDogCommandCategories from './pages/dog/command_categories.js';
|
||||
import PageDogCommands from './pages/dog/commands.js';
|
||||
import PageDogDogCommandLinks from './pages/dog/dog_command_links.js';
|
||||
// import PageDogDogs from './pages/dog/dogs.js';
|
||||
import PageDogLocations from './pages/dog/locations.js';
|
||||
// Legal
|
||||
import PageAccessibilityReport from './pages/legal/accessibility_report.js';
|
||||
import PageAccessibilityStatement from './pages/legal/accessibility_statement.js';
|
||||
@@ -36,6 +37,7 @@ export default class Router {
|
||||
this.pages[hashPageDogCommands] = { name: 'PageDogCommands', module: PageDogCommands };
|
||||
this.pages[hashPageDogDogCommandLinks] = { name: 'PageDogDogCommandLinks', module: PageDogDogCommandLinks };
|
||||
// this.pages[hashPageDogDogs] = { name: 'PageDogDogs', module: PageDogDogs };
|
||||
this.pages[hashPageDogLocations] = { name: 'PageDogLocations', module: PageDogLocations };
|
||||
// Legal
|
||||
this.pages[hashPageAccessibilityStatement] = { name: 'PageAccessibilityStatement', module: PageAccessibilityStatement };
|
||||
this.pages[hashPageDataRetentionSchedule] = { name: 'PageDataRetentionSchedule', module: PageRetentionSchedule };
|
||||
@@ -55,6 +57,7 @@ export default class Router {
|
||||
this.routes[hashPageDogCommands] = (isPopState = false) => this.navigateToHash(hashPageDogCommands, isPopState);
|
||||
this.routes[hashPageDogDogCommandLinks] = (isPopState = false) => this.navigateToHash(hashPageDogDogCommandLinks, isPopState);
|
||||
// this.routes[hashPageDogDogs] = (isPopState = false) => this.navigateToHash(hashPageDogDogs, isPopState);
|
||||
this.routes[hashPageDogLocations] = (isPopState = false) => this.navigateToHash(hashPageDogLocations, isPopState);
|
||||
// Legal
|
||||
this.routes[hashPageAccessibilityStatement] = (isPopState = false) => this.navigateToHash(hashPageAccessibilityStatement, isPopState);
|
||||
this.routes[hashPageDataRetentionSchedule] = (isPopState = false) => this.navigateToHash(hashPageDataRetentionSchedule, isPopState);
|
||||
|
||||
Reference in New Issue
Block a user