From ebb02ce4b4366deb7fd61f4b38070e3a04a462cb Mon Sep 17 00:00:00 2001 From: bmauger Date: Thu, 5 Jan 2023 11:54:08 -0500 Subject: [PATCH] Merge pull request #917 from Safelite/BRM-remove-vin-capture-code Remove code for camera vin capture. --- .../textbox-question/textbox-question.vue | 53 +------------------ src/constants/endpoints.js | 4 -- src/constants/store-actions.js | 1 - src/global-methods.js | 19 ------- src/layouts/vin-lookup/vin-lookup.vue | 1 - src/store/index.js | 9 ---- 6 files changed, 1 insertion(+), 86 deletions(-) diff --git a/src/common-components/textbox-question/textbox-question.vue b/src/common-components/textbox-question/textbox-question.vue index 7e247b9ba..957f59f36 100644 --- a/src/common-components/textbox-question/textbox-question.vue +++ b/src/common-components/textbox-question/textbox-question.vue @@ -6,12 +6,7 @@ class="form-label" :class="[questionAlignment === 'center' ? 'text-center w-100 mb-5' : '']" v-html="labelText"> -
+
{{ errorMessage }} @@ -83,7 +70,6 @@ export default { questionAlignment: String, // Left or center. Left is default. cornerStyle: String, // Rounded or square. Square is default. includeSearchIcon: Boolean, - includeCameraIcon: Boolean, }, setup(props) { const propsClone = Object.assign({}, props); @@ -120,18 +106,6 @@ export default { errors, }; }, - methods: { - async submitImage(e) { - await this.dispatchStoreAction(storeActions.LOOKUP_VIN_BY_IMAGE, e.target.files[0]) - .then((response) => { - document.getElementById(this.inputId).value = response.data; - }) - .catch((error) => { - console.log(error); - }); - e.target.value = null; - }, - }, computed: { questionText() { return this.getCmsContent(this.cmsWidgetName, "QuestionText"); @@ -209,31 +183,6 @@ export default { display: flex; } } - &.has-camera-icon { - label { - &.camera-icon-input { - position: absolute; - top: 50%; - transform: translateY(-50%); - right: 1rem; - background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 40 36' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19.9774 16.5228C17.3559 16.5228 15.1864 18.6621 15.1864 21.3476C15.1864 24.0331 17.3107 26.1724 19.9774 26.1724C22.6441 26.1724 24.7684 24.0331 24.7684 21.3476C24.7684 18.6621 22.6441 16.5228 19.9774 16.5228Z' fill='%231574A1'/%3E%3Cpath d='M38.4181 7.23725H29.8701C29.1469 2.64 24.7684 0 19.9774 0C15.1864 0 10.8531 2.64 10.0847 7.23725H1.58192C0.723164 7.23725 0 7.96553 0 8.83035V33.7738C0 34.6387 0.723164 35.3669 1.58192 35.3669H38.4181C39.2768 35.3669 40 34.6387 40 33.7738V8.83035C40 7.96553 39.2768 7.23725 38.4181 7.23725ZM19.9774 29.7683C15.3672 29.7683 11.5706 25.9904 11.5706 21.3021C11.5706 16.6138 15.3672 12.8814 19.9774 12.8814C24.5876 12.8814 28.3842 16.6593 28.3842 21.3476C28.3842 26.0359 24.6328 29.7683 19.9774 29.7683ZM36.565 14.5655H33.0395V11.0152H36.565V14.5655Z' fill='%231574A1'/%3E%3C/svg%3E%0A"); - background-repeat: no-repeat; - background-position: center; - width: 2rem; - height: 100%; - display: flex; - border: none; - background-color: transparent; - &:hover { - cursor: pointer; - } - input[type="file"] { - position: absolute; - left: -9999px; - } - } - } - } } input { &.has-icon { diff --git a/src/constants/endpoints.js b/src/constants/endpoints.js index 3bba311a1..9f4c60d61 100644 --- a/src/constants/endpoints.js +++ b/src/constants/endpoints.js @@ -122,10 +122,6 @@ const endpoints = { url: "/experiments/api/v1/experiments/run", method: "POST", }, - LookupVinByImage: { - url: "https://slimagetovin.azurewebsites.net/home/FindVIN", - method: "POST", - }, }; export { endpoints }; diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index 3d9307914..428280d40 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -19,7 +19,6 @@ const storeActions = { LOOKUP_VEHICLE_BY_VIN: "lookupVehicleByVin", LOOKUP_VIN_BY_PLATE: "lookupVinByPlate", LOOKUP_VIN_BY_ADDRESS: "lookupVinByAddress", - LOOKUP_VIN_BY_IMAGE: "lookupVinByImage", GET_PARTS_OR_QUESTIONS: "getPartsOrQuestions", GET_PARTS: "getParts", GET_WIPERS: "getWipers", diff --git a/src/global-methods.js b/src/global-methods.js index 90d7f2cb6..14e5cca0e 100644 --- a/src/global-methods.js +++ b/src/global-methods.js @@ -53,25 +53,6 @@ export default { }); }, - callSimpleHttpClient({ method, endpoint, payload }) { - return new Promise((resolve, reject) => { - axios({ - method: method, - url: endpoint, - data: payload, - crossDomain: true, - headers: { "Access-Control-Allow-Origin": "*" }, - }).then( - (response) => { - return resolve(response); - }, - (error) => { - return reject(error.response); - } - ); - }); - }, - /* istanbul ignore next */ callMockHttpClient({ method, endpoint }) { // For Mock use only! diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index 77c5caa4c..990fd0658 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -19,7 +19,6 @@ validationRules="vin-required|vin-format" :isDisabled="vinPopulatedOnPageLoad" maxLength="17" - includeCameraIcon :mask="vinMask" />
diff --git a/src/store/index.js b/src/store/index.js index 265db10d0..c41f38ddf 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -529,15 +529,6 @@ export const actions = { }, }); }, - lookupVinByImage(context, image) { - const data = new FormData(); - data.append("file", image); - return globalMethods.callSimpleHttpClient({ - method: endpoints.LookupVinByImage.method, - endpoint: endpoints.LookupVinByImage.url, - payload: data, - }); - }, getVehicleMakes(context, { year }) { return globalMethods.callHttpClient({ method: endpoints.GetVehicleMakes.method,