@bytebrand/fe-ui-core 4.8.29 → 4.8.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -47,7 +47,7 @@ describe('MaterialDatePicker', () => {
|
|
|
47
47
|
fireEvent.click(okButton);
|
|
48
48
|
fireEvent.focusOut(input);
|
|
49
49
|
|
|
50
|
-
expect(handleChange).toHaveBeenCalledTimes(
|
|
50
|
+
expect(handleChange).toHaveBeenCalledTimes(3);
|
|
51
51
|
expect(handleOpen).toHaveBeenCalledTimes(1);
|
|
52
52
|
expect(handleBlur).toHaveBeenCalledTimes(1);
|
|
53
53
|
});
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useEffect, FunctionComponent } from 'react';
|
|
1
|
+
import React, { useState, useEffect, useRef, FunctionComponent } from 'react';
|
|
2
2
|
import _get from 'lodash/get';
|
|
3
3
|
import { Hidden } from 'react-grid-system';
|
|
4
4
|
import PriceContent from './partials/PriceContent';
|
|
@@ -104,19 +104,31 @@ const VehicleDetailedSidebar: FunctionComponent<IVehicleDetailedSidebarProps> =
|
|
|
104
104
|
}
|
|
105
105
|
];
|
|
106
106
|
|
|
107
|
+
const initialDefaultAppliedForPath = useRef<string | null>(null);
|
|
108
|
+
|
|
107
109
|
useEffect(() => {
|
|
108
110
|
const getlocalStorageActiveTabCDP = localStorage.getItem('activeTabCDP');
|
|
109
|
-
if (
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
111
|
+
if (getlocalStorageActiveTabCDP) {
|
|
112
|
+
const activeTab = tabsTitles.findIndex(({ title }: { title: string }) => {
|
|
113
|
+
return title === getlocalStorageActiveTabCDP;
|
|
114
|
+
});
|
|
115
|
+
if (activeTab === -1) {
|
|
116
|
+
setActiveTab(null, 0);
|
|
117
|
+
} else {
|
|
118
|
+
setActiveTab(null, activeTab);
|
|
119
|
+
}
|
|
120
|
+
localStorage.removeItem('activeTabCDP');
|
|
121
|
+
initialDefaultAppliedForPath.current = pathname;
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
if (
|
|
125
|
+
initialDefaultAppliedForPath.current !== pathname
|
|
126
|
+
&& _get(price, 'leasing.isActive', false)
|
|
127
|
+
) {
|
|
128
|
+
setActiveTab(null, 1);
|
|
129
|
+
initialDefaultAppliedForPath.current = pathname;
|
|
117
130
|
}
|
|
118
|
-
|
|
119
|
-
}, [pathname, activeTab]); // tslint:disable-line:align
|
|
131
|
+
}, [pathname, activeTab, price]); // tslint:disable-line:align
|
|
120
132
|
|
|
121
133
|
const priceProps = {
|
|
122
134
|
tabsTitles,
|