@tracktor/shared-module 2.7.0 → 2.9.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,4 @@
1
1
  # [Versions](https://github.com/Tracktor/shared-module/releases)
2
2
 
3
- ## v2.7.0
4
- - **[feat]** - add `useFilter` hook
5
- - **[feat]** - add `localStorageKeys` in props of `InjectDependenciesContext` context
3
+ ## v2.9.0
4
+ - **[feat]** - add `adaptWorksiteName` adapter function
package/README.md CHANGED
@@ -45,31 +45,35 @@ export default App;
45
45
 
46
46
 
47
47
  ## Components
48
- | Module | Type | Description | Dependencies |
49
- |-----------------|-----------------|-----------------------------------------------------|------------------------------------------------------------|
50
- | RequireAuth | React Component | Component for protected routing | Axios & react-router-dom |
51
- | GTMSendPageView | React Component | Send page view event to Google Tag Manager | @tracktor/react-google-tag-manager & react-router-dom |
52
- | AxiosConfig | React Component | Initialize Axios with custom default config options | Axios |
53
- | I18nConfig | React Component | Initialize i18n with custom config options | i18next & react-i18next & i18next-browser-languagedetector |
54
- | SentryConfig | React Component | Initialize Sentry | @sentry/react & react-router-dom |
55
- | MapBoxConfig | React Component | Initialize MapBox | mapbox-gl |
56
- | DaysJSConfig | React Component | Initialize DayJS | dayjs |
48
+ | Module | Type | Description | Dependencies |
49
+ |------------------------|-----------------|-----------------------------------------------------|------------------------------------------------------------|
50
+ | RequireAuth | React Component | Component for protected routing | Axios & react-router-dom |
51
+ | GTMSendPageView | React Component | Send page view event to Google Tag Manager | @tracktor/react-google-tag-manager & react-router-dom |
52
+ | InitializeAxiosConfig | React Component | Initialize Axios with custom default config options | Axios |
53
+ | InitializeI18nConfig | React Component | Initialize i18n with custom config options | i18next & react-i18next & i18next-browser-languagedetector |
54
+ | InitializeSentryConfig | React Component | Initialize Sentry | @sentry/react & react-router-dom |
55
+ | InitializeMapBoxConfig | React Component | Initialize MapBox | mapbox-gl |
56
+ | InitializeDaysJSConfig | React Component | Initialize DayJS | dayjs |
57
+ | PreloadErrorHandler | React Component | his component is used to handle preload error. | dayjs |
57
58
 
58
59
  ## Hooks
59
- | Module | Description | Dependencies |
60
- |---------------------|---------------------------------------------------------------------------|--------------|
61
- | useAdapter | Hook with several adapter | - |
62
- | useAuth | Hook for authentification management | Axios |
63
- | useResponseError | This hook is used to print error messages from the API | i18next |
64
- | useInfiniteDataGrid | his hook is used to handle the infinite scroll of the DataGrid component. | - |
60
+ | Module | Description | Dependencies |
61
+ |---------------------|----------------------------------------------------------------------------|--------------|
62
+ | useAdapter | Hook with several adapter | - |
63
+ | useAuth | Hook for authentification management | Axios |
64
+ | useResponseError | This hook is used to print error messages from the API | i18next |
65
+ | useInfiniteDataGrid | This hook is used to handle the infinite scroll of the DataGrid component. | - |
66
+ | useCurrentLanguage | This get the current language of app | - |
67
+ | useFilters | Hook to handle filter | - |
65
68
 
66
69
  ## Config
67
70
  | Module | Description |
68
71
  |-----------------------|------------------------------------|
69
72
  | getOrvalOperationName | Get config for orval operationName |
70
73
 
71
- ## Utils
72
- | Module | Description |
73
- |-----------------|----------------------|
74
- | dateAdapter | Adapt given date |
75
- | distanceAdapter | Adapt given distance |
74
+ ## Utils function
75
+ | Module | Description |
76
+ |---------------------|----------------------|
77
+ | dateAdapter | Adapt given date |
78
+ | distanceAdapter | Adapt given distance |
79
+ | worksiteNameAdapter | Adapt worksite name |
@@ -40,10 +40,9 @@ export interface RequireAuthProps {
40
40
  * @param Fallback
41
41
  * @param isLogged
42
42
  * @param loginPath
43
- * @param localStorageKey
44
43
  * @param redirect401Path
45
44
  * @param props
46
45
  * @constructor
47
46
  */
48
- declare const RequireAuth: ({ Fallback, isLogged, loginPath, localStorageKey, redirect401Path, ...props }: RequireAuthProps) => import("react/jsx-runtime").JSX.Element;
47
+ declare const RequireAuth: ({ Fallback, isLogged, loginPath, redirect401Path, ...props }: RequireAuthProps) => import("react/jsx-runtime").JSX.Element;
49
48
  export default RequireAuth;
@@ -13,5 +13,6 @@ export declare const useAdapter: (params?: useAdapterParams) => {
13
13
  dateAdapter: (date: string | number | Date | null | undefined, format?: string) => string;
14
14
  distanceAdapter: (distance?: string | number | null | undefined, metric?: string) => string;
15
15
  filePathAdapter: (path?: string | null, size?: number | "full") => string;
16
+ worksiteNameAdapter: (name: unknown) => string;
16
17
  };
17
18
  export default useAdapter;
package/dist/main.d.ts CHANGED
@@ -36,3 +36,4 @@ export { default as getOrvalConfig } from './config/orval';
36
36
  export * from './config/orval';
37
37
  export { default as dateAdapter } from './utils/adapter/dateAdapter';
38
38
  export { default as distanceAdapter } from './utils/adapter/distanceAdapter';
39
+ export { default as worksiteNameAdapter } from './utils/adapter/worksiteNameAdapter';