-
-
-
+
diff --git a/src/layouts/selectYear/selectYear.spec.js b/src/layouts/selectYear/selectYear.spec.js
index 882a68129..27b84ed5f 100644
--- a/src/layouts/selectYear/selectYear.spec.js
+++ b/src/layouts/selectYear/selectYear.spec.js
@@ -1 +1,55 @@
-test.todo('some test to be written in the future');
\ No newline at end of file
+import { shallowMount } from '@vue/test-utils';
+import { nextTick } from 'vue'
+import { getMountOptions } from '@/helpers/unitTestHelper.js';
+import { storeActions } from '@/constants/storeActions.js'
+import selectYear from './selectYear.vue';
+
+describe('selectYear.vue', () => {
+ test("Should render the 'pageHeader.Text' data value 'text' prop value for the Header component, 'radioQuestion.Question' data value as 'questionText' prop value for the 'radioQuestion' component and 'years' values for 'answers' prop values for the 'radioQuestion' component.", async () => {
+
+ // Arrange
+ const mockDataAndAction = {
+ actionList: [
+ {
+ actionName: storeActions.GET_PAGE_DATA,
+ data: {
+ "Result": [
+ {
+ Type: "PageHeadingWidget",
+ Model: {
+ Text: "Mock Data"
+ }
+ },
+ {
+ Type: "RadioQuestionWidget",
+ Model: {
+ Question: "Mock Data"
+ }
+ }
+ ]
+ }
+ },
+ {
+ actionName: storeActions.GET_YEARS,
+ data: ['2023', '2022', '2021']
+ }
+ ]
+ };
+
+ const mountOptions = getMountOptions(mockDataAndAction);
+
+ // Act
+ const wrapper = shallowMount(selectYear, mountOptions);
+ await nextTick()
+
+ // Assert
+ const header = await wrapper.find('.Header');
+ expect(header.attributes('text')).toEqual("Mock Data");
+
+ const radioQuestion = await wrapper.findComponent('.radioQuestion');
+ expect(radioQuestion.attributes('answers')).toEqual('2023,2022,2021');
+ expect(radioQuestion.attributes('questiontext')).toEqual("Mock Data");
+ });
+
+
+})
\ No newline at end of file
diff --git a/src/layouts/selectYear/selectYear.vue b/src/layouts/selectYear/selectYear.vue
index 63a08e02e..3b633b005 100644
--- a/src/layouts/selectYear/selectYear.vue
+++ b/src/layouts/selectYear/selectYear.vue
@@ -1,60 +1,78 @@
-
-
-
-
-
+
diff --git a/src/store/index.js b/src/store/index.js
index 3c78d7f1c..e861a5ff0 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -1,9 +1,7 @@
import { createStore } from "vuex";
import { endpoints } from "@/constants/endpoints.js";
import createPersistedState from "vuex-persistedstate";
-import axios from "axios";
import globalMethods from "@/global-methods";
-import router from "@/router";
export default createStore({
plugins: [
@@ -27,17 +25,17 @@ export default createStore({
mutations: {
updateYear(state, data) {
state.year = data.year;
- state.makes = data.makes;
+ state.makes = data.makes.data;
state.slideTransition = "slide";
},
updateMake(state, data) {
state.make = data.make;
- state.models = data.models.data.Result;
+ state.models = data.models.data;
state.slideTransition = "slide";
},
updateModel(state, data) {
state.model = data.model;
- state.styles = data.styles.data.Result;
+ state.styles = data.styles.data;
state.slideTransition = "slide";
},
updateStyle(state, data) {
@@ -55,50 +53,60 @@ export default createStore({
},
},
actions: {
- async selectYear(context, year) {
- let makes = [];
- await globalMethods
- .callHttpClient({
- method: "GET",
- endpoint: `https://mockey.qa.sagaws.net/service/makes/year=${year}`,
- payload: {},
- })
- .then(function (response) {
- makes = response.data.Result;
+ getYears(){
+ return globalMethods.callHttpClient({
+ method: endpoints.GetYears.method,
+ endpoint: endpoints.GetYears.url,
+ payload:{}
});
- context.commit("updateYear", { year, makes });
- router.push(`/select-make?year=${year}`);
- },
- async selectMake({ commit, state }, make) {
- const models = await axios.get(
- `https://mockey.qa.sagaws.net/service/models/year=${state.year}/make=${make}`
- );
- commit("updateMake", { make, models });
- router.push(`/select-model?year=${state.year}&make=${make}`);
- },
- async selectModel({ commit, state }, model) {
- const styles = await axios.get(
- `https://mockey.qa.sagaws.net/service/styles/year=${state.year}/make=${state.make}/model=${model}`
- );
- commit("updateModel", { model, styles });
- router.push(
- `/select-style?year=${state.year}&make=${state.make}&model=${model}`
- );
- },
- selectStyle({ commit, state }, style) {
- commit("updateStyle", { style });
- router.push(
- `/damage?year=${state.year}&make=${state.make}&model=${state.model}&style=${style}`
- );
- },
- getRouteInfo(context, { pageName }) {
- return globalMethods.callHttpClient({
- method: endpoints.GetRouteInfoEndpoint.method,
- endpoint: endpoints.GetRouteInfoEndpoint.url,
- payload: {
- pageName: pageName,
- },
- });
- },
+ },
+ selectYear(context, { year }) {
+ return globalMethods.callHttpClient({
+ method: endpoints.GetMakes.method,
+ endpoint: endpoints.GetMakes.url,
+ payload:{
+ "Year": year
+ }
+ });
+ },
+ selectMake({ commit, state }, { make }) {
+ return globalMethods.callHttpClient({
+ method: endpoints.GetModels.method,
+ endpoint: endpoints.GetModels.url,
+ payload:{
+ "Year": state.year,
+ "Make": make
+ }
+ });
+ },
+ selectModel({ commit, state }, { model }) {
+ return globalMethods.callHttpClient({
+ method: endpoints.GetStyles.method,
+ endpoint: endpoints.GetStyles.url,
+ payload:{
+ "Year": state.year,
+ "Make": state.make,
+ "Model": model
+ }
+ });
+ },
+ getRouteInfo(context, { relativeUrl }) {
+ return globalMethods.callHttpClient({
+ method: endpoints.GetRouteInfoEndpoint.method,
+ endpoint: endpoints.GetRouteInfoEndpoint.url,
+ payload: {
+ relativeUrl: relativeUrl,
+ },
+ });
+ },
+ // For mock data purposes only
+ getMockPageData(context, { relativeUrl }) {
+ return globalMethods.callMockHttpClient({
+ method: endpoints.GetPageData.method,
+ endpoint: relativeUrl,
+ payload: {
+ },
+ });
+ },
},
});
diff --git a/src/styles/commonComponentStyles/ymmsCommonStyles.scss b/src/styles/commonComponentStyles/ymmsCommonStyles.scss
index a550552b9..7fd2a4f18 100644
--- a/src/styles/commonComponentStyles/ymmsCommonStyles.scss
+++ b/src/styles/commonComponentStyles/ymmsCommonStyles.scss
@@ -1,61 +1,41 @@
-.vehicle-select-attributes {
- height: 100vh;
+.select-car {
+ height: calc(100vh - 1rem);
- .select-car-form {
- background: $white;
- height: 100%;
-
- form {
- height: calc(100% - 230px);
- overflow-y: scroll;
- overflow-x: hidden;
- }
-
- .car_list, .current_car_info-text, .needed_car_info-text {
- flex-shrink: 0;
- width: 100%;
- position: relative;
- transition: transform .3s;
- }
- }
-
- .current_car_info {
- position: relative;
- min-height: 2.5rem;
-
- .current_car_info-text {
- position: absolute;
- }
+ .car_list {
+ // Height will be determined by overall height of content above list
+ height: calc(100% - 100px);
+ width: calc(100% - 1rem);
}
}
-
+
+// Animations
.slide-enter-from {
- opacity: 0;
- transform: translateX(30vw);
+ opacity: 0;
+ transform: translateX(30vw);
}
.slide-enter-active, .slide-leave-active {
- transition: all .4s;
+ transition: all .4s;
}
.slide-leave-to {
- opacity: 0;
- transform: translateX(-30vw);
+ opacity: 0;
+ transform: translateX(-30vw);
}
.slide_reverse-enter-from {
- opacity: 0;
- transform: translateX(-30vw);
+ opacity: 0;
+ transform: translateX(-30vw);
}
.slide_reverse-enter-active, .slide_reverse-leave-active {
- transition: all .4s;
+ transition: all .4s;
}
.slide_reverse-leave-to {
- opacity: 0;
- transform: translateX(30vw);
+ opacity: 0;
+ transform: translateX(30vw);
}
.fade-enter-from, .fade-leave-to {
- opacity: 0;
+ opacity: 0;
}
.fade-enter-active, .fade-leave-active {
- transition: all .5s ease;
-}
+ transition: all .5s ease;
+}
\ No newline at end of file
diff --git a/src/styles/commonRadioStyles.scss b/src/styles/commonRadioStyles.scss
new file mode 100644
index 000000000..953a75985
--- /dev/null
+++ b/src/styles/commonRadioStyles.scss
@@ -0,0 +1,59 @@
+.radiogroup {
+ &.radio-list-button {
+ input[type="radio"] {
+ opacity: 0;
+ position: fixed;
+ width: 0;
+ &:focus-visible + label {
+ box-shadow: 0 0 0 2px $blue;
+ }
+ &:focus + label {
+ box-shadow: 0 0 0 2px $blue;
+ }
+ &:checked + label {
+ background: $blue-100;
+ box-shadow: 0 0 0 1px $blue;
+ }
+ }
+ label {
+ position: relative;
+ background: $white;
+ height: 3rem;
+ transition: all 150ms linear;
+ border-radius: $border-radius-lg;
+ border: 1px solid $gray-500;
+ width: 100%;
+ &:hover {
+ box-shadow: 0 0 0 4px $blue-100;
+ cursor: pointer;
+ }
+ + p {
+ display: none;
+ }
+ &.error {
+ border: 1px solid $danger;
+ + p {
+ display: flex;
+ color: $danger;
+ }
+ }
+ &.button-loader {
+ padding: 0 40px 0 12px;
+ &:after {
+ content: url(../../assets/img/icons/button-spinner-blue.svg);
+ position: absolute;
+ right: 14px;
+ width: 16px;
+ height: 16px;
+ margin-left: 12px;
+ animation: rotation 1s infinite linear;
+ @keyframes rotation {
+ 100% {
+ transform:rotate(360deg);
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/styles/uxVariables.scss b/src/styles/uxVariables.scss
index 31ad10d5d..7998b7a87 100644
--- a/src/styles/uxVariables.scss
+++ b/src/styles/uxVariables.scss
@@ -163,3 +163,8 @@ $box-shadow: 0 .5rem 1rem rgba($black, .15);
$box-shadow-sm: 0 .125rem .25rem rgba($black, .075);
$box-shadow-lg: 0 1rem 3rem rgba($black, .25);//Safelite default
$box-shadow-inset: inset 0 1px 2px rgba($black, .075);
+
+//Alerts
+$alert-bg-scale: -90%;
+$alert-border-scale: -100%;
+$alert-color-scale: 40%;
diff --git a/src/commonComponents/carAttributes/carAttributes.spec.js b/src/uxComponents/alert/alert.spec.js
similarity index 100%
rename from src/commonComponents/carAttributes/carAttributes.spec.js
rename to src/uxComponents/alert/alert.spec.js
diff --git a/src/uxComponents/alert/alert.vue b/src/uxComponents/alert/alert.vue
new file mode 100644
index 000000000..b47d75f3c
--- /dev/null
+++ b/src/uxComponents/alert/alert.vue
@@ -0,0 +1,81 @@
+
+
+
{{alertHeadline}}
+
{{alertCopy}}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/uxComponents/buttonPrimary/buttonPrimary.vue b/src/uxComponents/buttonPrimary/buttonPrimary.vue
index 5e0dd1dcf..9741d9c49 100644
--- a/src/uxComponents/buttonPrimary/buttonPrimary.vue
+++ b/src/uxComponents/buttonPrimary/buttonPrimary.vue
@@ -14,12 +14,12 @@
export default {
name: "buttonPrimary",
props: {
- buttonText: String
+ buttonText: String,
+ isDisabled: Boolean
},
data() {
return {
- isLoading: false,
- isDisabled: false,
+ isLoading: false
};
},
methods: {
diff --git a/src/uxComponents/header/header.spec.js b/src/uxComponents/header/header.spec.js
new file mode 100644
index 000000000..d02c78d9f
--- /dev/null
+++ b/src/uxComponents/header/header.spec.js
@@ -0,0 +1,16 @@
+import { shallowMount } from '@vue/test-utils';
+import Header from './header';
+
+describe('Header.vue', () => {
+ it("Should render the 'text' prop value as a span value for the header span text value.", () => {
+ // Act
+ const wrapper = shallowMount(Header, {
+ propsData: {
+ text: 'Header Content'
+ }
+ });
+
+ // Assert
+ expect(wrapper.find('span').text()).toContain("Header Content");
+ })
+});
\ No newline at end of file
diff --git a/src/uxComponents/header/header.vue b/src/uxComponents/header/header.vue
new file mode 100644
index 000000000..a2a68eeb7
--- /dev/null
+++ b/src/uxComponents/header/header.vue
@@ -0,0 +1,16 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/uxComponents/radio/radio.spec.js b/src/uxComponents/radio/radio.spec.js
new file mode 100644
index 000000000..ba59e2650
--- /dev/null
+++ b/src/uxComponents/radio/radio.spec.js
@@ -0,0 +1,23 @@
+import { shallowMount } from '@vue/test-utils';
+import radio from './radio';
+
+describe('radio.vue', () => {
+ it("Should render the 'text' prop value as a span value for the radio button label and add the 'value' prop value as the radio button value and id.", () => {
+ // Act
+ const wrapper = shallowMount(radio, {
+ propsData: {
+ value: '2023',
+ text: '12'
+ }
+ });
+
+ // Assert
+ expect(wrapper.find('span').text()).toEqual('12');
+ expect(wrapper.find('input').attributes()).toEqual({
+ class: 'position-absolute opacity-0',
+ id: '2023',
+ type: 'radio',
+ value: '2023'
+ });
+ })
+})
\ No newline at end of file
diff --git a/src/uxComponents/radio/radio.vue b/src/uxComponents/radio/radio.vue
new file mode 100644
index 000000000..1f4e63f39
--- /dev/null
+++ b/src/uxComponents/radio/radio.vue
@@ -0,0 +1,39 @@
+
+
+
+
+ {{ text }}
+
+
+
+
+
+
diff --git a/src/layouts/selectDamage/selectDamage.spec.js b/src/uxComponents/radioList/radioList.spec.js
similarity index 100%
rename from src/layouts/selectDamage/selectDamage.spec.js
rename to src/uxComponents/radioList/radioList.spec.js
diff --git a/src/uxComponents/radioList/radioList.vue b/src/uxComponents/radioList/radioList.vue
new file mode 100644
index 000000000..6b59e6f57
--- /dev/null
+++ b/src/uxComponents/radioList/radioList.vue
@@ -0,0 +1,34 @@
+
+
+
+
+
diff --git a/vue.config.js b/vue.config.js
index 8027ca62b..bda41b2dd 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -24,6 +24,7 @@ module.exports = {
@import "./node_modules/bootstrap/scss/bootstrap";
@import "@/styles/commonStyles.scss";
@import "@/styles/commonButtonStyles.scss";
+ @import "@/styles/commonRadioStyles.scss";
@import "@/styles/commonTypographyStyles.scss";
@import "@/styles/commonComponentStyles/ymmsCommonStyles.scss";
`
diff --git a/vue.release.config.js b/vue.release.config.js
index c6b87f434..5bc60309f 100644
--- a/vue.release.config.js
+++ b/vue.release.config.js
@@ -14,6 +14,7 @@ module.exports = {
@import "./node_modules/bootstrap/scss/bootstrap";
@import "@/styles/commonStyles.scss";
@import "@/styles/commonButtonStyles.scss";
+ @import "@/styles/commonRadioStyles.scss";
@import "@/styles/commonTypographyStyles.scss";
@import "@/styles/commonComponentStyles/ymmsCommonStyles.scss";
`