From ef3868baac16c2562d257ddfb3b12c83acd81b3c Mon Sep 17 00:00:00 2001 From: Ana Rute Mendes Date: Fri, 6 Mar 2020 16:07:07 -0300 Subject: [PATCH] CCU: snipe-it: remove fields from purchasing form validation The fields item dimensions and weight won't be used anymore in the purchasing ticket. --- resources/celerity/map.php | 38 +++++++++---------- .../js/extensions/snipe-fields-validation.js | 27 ------------- 2 files changed, 17 insertions(+), 48 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 68ba73420b..4fa41e0e27 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -9,7 +9,7 @@ return array( 'names' => array( 'conpherence.pkg.css' => '0e3cf785', 'conpherence.pkg.js' => '020aebcf', - 'core.pkg.css' => 'ba768cdb', + 'core.pkg.css' => 'd3c0fdce', 'core.pkg.js' => '845355f4', 'dark-console.pkg.js' => '187792c2', 'differential.pkg.css' => '5c459f92', @@ -120,7 +120,7 @@ return array( 'rsrc/css/diviner/diviner-shared.css' => '4bd263b0', 'rsrc/css/font/font-awesome.css' => '3883938a', 'rsrc/css/font/font-lato.css' => '23631304', - 'rsrc/css/font/phui-font-icon-base.css' => '303c9b87', + 'rsrc/css/font/phui-font-icon-base.css' => '72efec24', 'rsrc/css/layout/phabricator-source-code-view.css' => '03d7ac28', 'rsrc/css/phui/button/phui-button-bar.css' => 'a4aa75c4', 'rsrc/css/phui/button/phui-button-simple.css' => '1ff278aa', @@ -130,7 +130,7 @@ return array( 'rsrc/css/phui/calendar/phui-calendar-month.css' => 'cb758c42', 'rsrc/css/phui/calendar/phui-calendar.css' => 'f11073aa', 'rsrc/css/phui/object-item/phui-oi-big-ui.css' => 'fa74cc35', - 'rsrc/css/phui/object-item/phui-oi-color.css' => 'b517bfa0', + 'rsrc/css/phui/object-item/phui-oi-color.css' => '256e6f73', 'rsrc/css/phui/object-item/phui-oi-drag-ui.css' => 'da15d3dc', 'rsrc/css/phui/object-item/phui-oi-flush-ui.css' => '490e2e2e', 'rsrc/css/phui/object-item/phui-oi-list-view.css' => 'd7723ecc', @@ -514,7 +514,7 @@ return array( 'rsrc/js/core/darkconsole/DarkMessage.js' => '26cd4b73', 'rsrc/js/core/darkconsole/behavior-dark-console.js' => '457f4d16', 'rsrc/js/core/phtize.js' => '2f1db1ed', - 'rsrc/js/extensions/snipe-fields-validation.js' => '0557f2e3', + 'rsrc/js/extensions/snipe-fields-validation.js' => '73e6e0ce', 'rsrc/js/phui/behavior-phui-dropdown-menu.js' => '5cf0501a', 'rsrc/js/phui/behavior-phui-file-upload.js' => 'e150bd50', 'rsrc/js/phui/behavior-phui-selectable-list.js' => 'b26a41e4', @@ -844,7 +844,7 @@ return array( 'phui-document-view-css' => '52b748a5', 'phui-document-view-pro-css' => 'b9613a10', 'phui-feed-story-css' => 'a0c05029', - 'phui-font-icon-base-css' => '303c9b87', + 'phui-font-icon-base-css' => '72efec24', 'phui-fontkit-css' => '1ec937e5', 'phui-form-css' => '1f177cb7', 'phui-form-view-css' => '01b796c0', @@ -864,7 +864,7 @@ return array( 'phui-list-view-css' => '2f253c22', 'phui-object-box-css' => 'b8d7eea0', 'phui-oi-big-ui-css' => 'fa74cc35', - 'phui-oi-color-css' => 'b517bfa0', + 'phui-oi-color-css' => '256e6f73', 'phui-oi-drag-ui-css' => 'da15d3dc', 'phui-oi-flush-ui-css' => '490e2e2e', 'phui-oi-list-view-css' => 'd7723ecc', @@ -907,7 +907,7 @@ return array( 'releeph-request-differential-create-dialog' => '0ac1ea31', 'releeph-request-typeahead-css' => 'bce37359', 'setup-issue-css' => '5eed85b2', - 'snipe-fields-validation-js' => '0557f2e3', + 'snipe-fields-validation-js' => '73e6e0ce', 'sprite-login-css' => '18b368a6', 'sprite-tokens-css' => 'f1896dc5', 'syntax-default-css' => '055fc231', @@ -967,16 +967,7 @@ return array( 'javelin-behavior', 'javelin-stratcom', 'javelin-dom', - 'phuix-form-control-view', - 'phuix-icon-view', - 'javelin-behavior-phabricator-gesture', - ), - '03dde462' => array( - 'phui-oi-list-view-css', - ), - '040fce04' => array( - 'javelin-behavior', - 'javelin-request', + 'javelin-workflow', ), '05d290ef' => array( 'javelin-install', @@ -1144,6 +1135,9 @@ return array( 'javelin-json', 'phabricator-draggable-list', ), + '256e6f73' => array( + 'phui-oi-list-view-css', + ), '2633bef7' => array( 'multirow-row-manager', 'javelin-install', @@ -1985,9 +1979,6 @@ return array( 'multirow-row-manager', 'trigger-rule', ), - 'b517bfa0' => array( - 'phui-oi-list-view-css', - ), 'b557770a' => array( 'javelin-install', 'javelin-util', @@ -2062,7 +2053,12 @@ return array( 'phabricator-phtize', 'javelin-dom', ), - 'd057e45a' => array( + 'c3d24e63' => array( + 'javelin-install', + 'javelin-workboard-card', + 'javelin-workboard-header', + ), + 'c687e867' => array( 'javelin-behavior', 'javelin-dom', 'javelin-stratcom', diff --git a/webroot/rsrc/js/extensions/snipe-fields-validation.js b/webroot/rsrc/js/extensions/snipe-fields-validation.js index 430652801b..404da60ed9 100644 --- a/webroot/rsrc/js/extensions/snipe-fields-validation.js +++ b/webroot/rsrc/js/extensions/snipe-fields-validation.js @@ -63,12 +63,6 @@ function shipping_validations() { let el_description = document.getElementsByName( "std:maniphest:shipping:item-description" )[0]; - let el_dimensions = document.getElementsByName( - "std:maniphest:shipping:item-dimensions" - )[0]; - let el_weight = document.getElementsByName( - "std:maniphest:shipping:item-weight" - )[0]; if (!import_asset.checked) { assets.parentNode.parentNode.style.display = "none"; @@ -131,14 +125,6 @@ function shipping_validations() { country_of_origin: { value: option.attributes["data-country-of-origin"].value, label: "Country of origin" - }, - weight: { - value: option.attributes["data-weight"].value, - label: "Weight" - }, - dimensions: { - value: option.attributes["data-dimensions"].value, - label: "Dimensions" } } }; @@ -166,16 +152,12 @@ function shipping_validations() { if (items.length == 1) { el_country_of_origin.value = item.props.country_of_origin.value; - el_dimensions.value = item.props.dimensions.value; - el_weight.value = item.props.weight.value; el_currency.value = item.props.currency.value; } }); if (items.length > 1) { el_country_of_origin.value = ""; - el_dimensions.value = ""; - el_weight.value = ""; el_currency.value = ""; } @@ -213,18 +195,9 @@ function fetch_and_hide_extra_assets_elements(index, unique_items) { asset["quantity"] = document.getElementsByName( "std:maniphest:purchasing:quantity" + index )[0].parentNode.parentNode; - asset["weight_parent"] = document.getElementsByName( - "std:maniphest:purchasing:item-weight" + index - )[0].parentNode.parentNode; - asset["dimensions_parent"] = document.getElementsByName( - "std:maniphest:purchasing:item-dimensions" + index - )[0].parentNode.parentNode; asset["country_of_origin_parent"] = document.getElementsByName( "std:maniphest:purchasing:country-origin" + index )[0].parentNode.parentNode; - asset["weight_parent"] = document.getElementsByName( - "std:maniphest:purchasing:item-weight" + index - )[0].parentNode.parentNode; asset["asset_cost_parent"] = document.getElementsByName( "std:maniphest:purchasing:expected-cost" + index )[0].parentNode.parentNode; -- GitLab