@influenzanet/case-web-app-core 2.7.5-staging.1 → 2.7.5-staging.12

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.
Files changed (29) hide show
  1. package/CHANGELOG.md +35 -2
  2. package/build/AppCore.d.ts +7 -7
  3. package/build/api/authAPI.d.ts +1 -1
  4. package/build/api/instances/authenticatedApi.d.ts +3 -0
  5. package/build/api/types/user.d.ts +8 -3
  6. package/build/api/userAPI.d.ts +3 -3
  7. package/build/components/dialogs/GlobalDialogs/Login.d.ts +2 -2
  8. package/build/components/dialogs/GlobalDialogs/ManageProfiles.d.ts +1 -3
  9. package/build/components/pages/Pages.d.ts +5 -5
  10. package/build/components/pages/components/LinkResolver/LinkResolver.d.ts +2 -9
  11. package/build/components/pages/components/LinkResolver/Resolvers/Invitation.d.ts +2 -2
  12. package/build/components/pages/components/LinkResolver/Resolvers/LinkResolverConst.d.ts +7 -0
  13. package/build/components/pages/components/LinkResolver/Resolvers/PasswordReset.d.ts +2 -2
  14. package/build/components/pages/components/LinkResolver/Resolvers/StudyLogin.d.ts +2 -2
  15. package/build/index.d.ts +8 -9
  16. package/build/index.es.js +1239 -572
  17. package/build/index.es.js.map +1 -1
  18. package/build/index.js +1239 -572
  19. package/build/index.js.map +1 -1
  20. package/build/store/actions/studiesActions.d.ts +8 -0
  21. package/build/store/actions/userActions.d.ts +9 -0
  22. package/build/store/rootReducer.d.ts +1 -1
  23. package/build/store/studiesSlice.d.ts +1 -4
  24. package/build/store/thunks/studiesThunks.d.ts +18 -0
  25. package/build/store/thunks/userThunks.d.ts +3 -0
  26. package/build/store/userSlice.d.ts +0 -2
  27. package/package.json +3 -1
  28. package/build/thunks/studiesThunks.d.ts +0 -18
  29. package/build/thunks/userThunks.d.ts +0 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.7.5 - staging
4
+
5
+ ## Bugfix
6
+
7
+ - corrected multiple instances of circular reference
8
+
9
+ ## Added
10
+
11
+ - Thunks available to be used in your application
12
+ - `enterStudiesThunk` : used to simplify the assignment of a profile to new studies.
13
+ It also make sure to fetch new surveys associated to the newly assigned studies.
14
+
15
+ ## Changed
16
+
17
+ - SurveyList component rework
18
+
19
+ - profiles are no longer subscribed to default studies inside this component
20
+ - active surveys are now saved in the redux store so it's easy to re render the component
21
+ from your application in case the user is assigned new surveys or studies
22
+
23
+ - DefaultStudiesManager component
24
+
25
+ - initialize store state related to studies and surveys
26
+ - make sure default studies are assigned to all profiles (backward compatibility)
27
+
28
+ ## 2.7.4 - 2023-11-20
29
+
30
+ ### Changed
31
+
32
+ - on logout, the local storage is emptied and the persistState flag is set to false, preventing the app to save
33
+ an empty state. This fixed an incorrect behavior during the sign up process for users that previously unsubscribed
34
+ from the platform and then subscribed again
35
+
3
36
  ## 2.7.3 - 2023-10-25
4
37
 
5
38
  ### Changed
@@ -229,7 +262,7 @@
229
262
  ### Changed
230
263
 
231
264
  - [BREAKING-CHANGE]: updated dependencies - react markdown renderer needs new format. See documentation here:
232
- <https://github.com/coneno/case-web-ui/blob/master/CHANGELOG.md#breaking-changes>
265
+ <https://github.com/coneno/case-web-ui/blob/master/CHANGELOG.md#breaking-changes>
233
266
 
234
267
  ## [1.0.19]
235
268
 
@@ -253,7 +286,7 @@
253
286
 
254
287
  ### Changed
255
288
 
256
- - *BREAKING*: at signup request sent to the backend, it will send the instanceID as http header. This requires a participant-api (api-gateway) with v0.13.0 or later. This header field was included for providing the instanceID for reCaptcha validation.
289
+ - _BREAKING_: at signup request sent to the backend, it will send the instanceID as http header. This requires a participant-api (api-gateway) with v0.13.0 or later. This header field was included for providing the instanceID for reCaptcha validation.
257
290
  - Updating project dependencies (case-web-ui), with minor improvements.
258
291
 
259
292
  ## [1.0.16]
@@ -1,10 +1,10 @@
1
- import React from 'react';
2
- import { FooterConfig } from './types/footerConfig';
3
- import { AppConfig } from './types/appConfig';
4
- import { HeaderConfig } from './types/headerConfig';
5
- import { NavbarConfig } from './types/navbarConfig';
6
- import { PagesConfig } from './types/pagesConfig';
7
- import { CustomSurveyResponseComponent } from '@influenzanet/case-web-ui/build/components/survey/SurveySingleItemView/ResponseComponent/ResponseComponent';
1
+ import React from "react";
2
+ import { FooterConfig } from "./types/footerConfig";
3
+ import { AppConfig } from "./types/appConfig";
4
+ import { HeaderConfig } from "./types/headerConfig";
5
+ import { NavbarConfig } from "./types/navbarConfig";
6
+ import { PagesConfig } from "./types/pagesConfig";
7
+ import { CustomSurveyResponseComponent } from "@influenzanet/case-web-ui/build/components/survey/SurveySingleItemView/ResponseComponent/ResponseComponent";
8
8
  export interface Extension {
9
9
  name: string;
10
10
  component: React.FunctionComponent<any>;
@@ -1,4 +1,4 @@
1
- import { SignupMsg, LoginMsg, TokenResponse, LoginResponse, AutoTokenValidationResponse } from './types/authAPI';
1
+ import { SignupMsg, LoginMsg, TokenResponse, LoginResponse, AutoTokenValidationResponse } from "./types/authAPI";
2
2
  export declare const signupWithEmailRequest: (creds: SignupMsg, recaptchaToken?: string | undefined) => Promise<import("axios").AxiosResponse<TokenResponse, any>>;
3
3
  export declare const loginWithEmailRequest: (creds: LoginMsg) => Promise<import("axios").AxiosResponse<LoginResponse, any>>;
4
4
  export declare const resend2FAVerificationCodeRequest: (creds: LoginMsg) => Promise<import("axios").AxiosResponse<any, any>>;
@@ -1,4 +1,7 @@
1
+ import { TokenResponse } from "../types/authAPI";
1
2
  declare const authApiInstance: import("axios").AxiosInstance;
3
+ export declare const renewTokenURL = "/v1/auth/renew-token";
4
+ export declare const renewTokenReq: (refreshToken: string) => Promise<import("axios").AxiosResponse<TokenResponse, any>>;
2
5
  export declare const renewToken: () => Promise<string>;
3
6
  export declare const setDefaultAccessTokenHeader: (token: string) => void;
4
7
  export declare const resetApiAuth: () => void;
@@ -28,12 +28,17 @@ export interface Profile {
28
28
  /**
29
29
  * The following fields were added here for convenience since
30
30
  * the types defined in this file are also used as type for
31
- * the redux store object.
31
+ * the redux store object. This practice of using the same type
32
+ * for different domains only because they superficially share a set
33
+ * of common properties is huge mistake that we
34
+ * cannot correct right now because it would involve a large
35
+ * refactoring
32
36
  *
33
- * This is a huge mistake but we cannot refactor everything now.
37
+ * When adding properties here make sure you remove them
38
+ * when posting the profile in ../userAPI.ts
34
39
  */
35
40
  studies: string[];
36
- assignedSurveys: AssignedSurvey[];
41
+ activeSurveys: AssignedSurvey[];
37
42
  }
38
43
  export interface ContactPreferences {
39
44
  subscribedToNewsletter: boolean;
@@ -1,6 +1,6 @@
1
- import { PasswordResetInfos } from './types/authAPI';
2
- import { ServiceStatus } from './types/general';
3
- import { User, Profile, ContactPreferences, ContactInfo } from './types/user';
1
+ import { PasswordResetInfos } from "./types/authAPI";
2
+ import { ServiceStatus } from "./types/general";
3
+ import { User, Profile, ContactPreferences, ContactInfo } from "./types/user";
4
4
  export declare const initiatePasswordResetReq: (instanceId: string, accountId: string) => Promise<import("axios").AxiosResponse<ServiceStatus, any>>;
5
5
  export declare const getInfosForPasswordResetReq: (token: string) => Promise<import("axios").AxiosResponse<PasswordResetInfos, any>>;
6
6
  export declare const resetPasswordReq: (token: string, newPassword: string) => Promise<import("axios").AxiosResponse<ServiceStatus, any>>;
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { DefaultRoutes } from '../../../types/routing';
1
+ import React from "react";
2
+ import { DefaultRoutes } from "../../../types/routing";
3
3
  interface LoginProps {
4
4
  defaultRoutes: DefaultRoutes;
5
5
  }
@@ -1,5 +1,3 @@
1
1
  import React from "react";
2
- interface ManageProfilesProps {
3
- }
4
- declare const ManageProfiles: React.FC<ManageProfilesProps>;
2
+ declare const ManageProfiles: React.FC;
5
3
  export default ManageProfiles;
@@ -1,8 +1,8 @@
1
- import React from 'react';
2
- import { PagesConfig } from '../../types/pagesConfig';
3
- import { DefaultRoutes } from '../../types/routing';
4
- import { Extension } from '../../AppCore';
5
- import { CustomSurveyResponseComponent } from '@influenzanet/case-web-ui/build/components/survey/SurveySingleItemView/ResponseComponent/ResponseComponent';
1
+ import React from "react";
2
+ import { PagesConfig } from "../../types/pagesConfig";
3
+ import { DefaultRoutes } from "../../types/routing";
4
+ import { Extension } from "../../AppCore";
5
+ import { CustomSurveyResponseComponent } from "@influenzanet/case-web-ui/build/components/survey/SurveySingleItemView/ResponseComponent/ResponseComponent";
6
6
  interface PagesProps {
7
7
  config?: PagesConfig;
8
8
  extensions?: Extension[];
@@ -1,12 +1,5 @@
1
- import React from 'react';
2
- import { DefaultRoutes } from '../../../../types/routing';
3
- export declare const linkResolverRootUrl = "/link";
4
- export declare const LinkResolverPaths: {
5
- ContactVerification: string;
6
- PasswordReset: string;
7
- StudyLogin: string;
8
- Invitation: string;
9
- };
1
+ import React from "react";
2
+ import { DefaultRoutes } from "../../../../types/routing";
10
3
  interface LinkResolverProps {
11
4
  defaultRoutes: DefaultRoutes;
12
5
  }
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { DefaultRoutes } from '../../../../../types/routing';
1
+ import React from "react";
2
+ import { DefaultRoutes } from "../../../../../types/routing";
3
3
  interface InvitationProps {
4
4
  defaultRoutes: DefaultRoutes;
5
5
  }
@@ -0,0 +1,7 @@
1
+ export declare const linkResolverRootUrl = "/link";
2
+ export declare const LinkResolverPaths: {
3
+ ContactVerification: string;
4
+ PasswordReset: string;
5
+ StudyLogin: string;
6
+ Invitation: string;
7
+ };
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { DefaultRoutes } from '../../../../../types/routing';
1
+ import React from "react";
2
+ import { DefaultRoutes } from "../../../../../types/routing";
3
3
  interface PasswordResetProps {
4
4
  defaultRoutes: DefaultRoutes;
5
5
  }
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { DefaultRoutes } from '../../../../../types/routing';
1
+ import React from "react";
2
+ import { DefaultRoutes } from "../../../../../types/routing";
3
3
  interface StudyLoginProps {
4
4
  defaultRoutes: DefaultRoutes;
5
5
  }
package/build/index.d.ts CHANGED
@@ -6,6 +6,11 @@ import * as userAPI from "./api/userAPI";
6
6
  import { useAuthTokenCheck } from "./hooks/useAuthTokenCheck";
7
7
  import PreventAccidentalNavigationPrompt from "./components/misc/PreventAccidentalNavigationPrompt";
8
8
  import InternalNavigator from "./components/misc/InternalNavigator";
9
+ import { AppConfig } from "./types/appConfig";
10
+ import { HeaderConfig } from './types/headerConfig';
11
+ import { FooterConfig } from './types/footerConfig';
12
+ import { NavbarConfig } from './types/navbarConfig';
13
+ import { PageConfig, PagesConfig } from './types/pagesConfig';
9
14
  declare const coreReduxActions: {
10
15
  appActions: import("@reduxjs/toolkit").CaseReducerActions<{
11
16
  reset: (state: import("immer/dist/internal").WritableDraft<import("./store/appSlice").AppState>) => import("immer/dist/internal").WritableDraft<import("./store/appSlice").AppState>;
@@ -71,19 +76,13 @@ declare const coreReduxActions: {
71
76
  payload: string;
72
77
  type: string;
73
78
  }) => void;
74
- initializeActiveSurveys: (state: import("immer/dist/internal").WritableDraft<import("./store/userSlice").UserState>, action: {
75
- payload: import("./thunks/studiesThunks").ProfilesSurveysMap;
76
- type: string;
77
- }) => void;
78
79
  }>;
79
80
  signupActions: {
80
81
  contactVerified: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
81
82
  };
82
- fetchStudiesForUserPending: import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkPendingActionCreator<void, {}>;
83
- fetchStudiesForUserFulfilled: import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkFulfilledActionCreator<import("./thunks/userThunks").ProfileStudiesMap, void, {}>;
84
- fetchStudiesForUserRejected: import("@reduxjs/toolkit/dist/createAsyncThunk").AsyncThunkRejectedActionCreator<void, {}>;
83
+ studiesActions: import("@reduxjs/toolkit").CaseReducerActions<{}>;
85
84
  };
86
85
  declare const coreReduxThunks: {
87
- enterStudy: import("@reduxjs/toolkit").AsyncThunk<import("./thunks/studiesThunks").EnterStudyPayload, import("./thunks/studiesThunks").EnterStudyRequest, {}>;
86
+ enterStudiesThunk: import("@reduxjs/toolkit").AsyncThunk<import("./store/actions/studiesActions").EnterStudiesPayload, import("./store/thunks/studiesThunks").EnterStudiesRequest, {}>;
88
87
  };
89
- export { AppCore, initI18n, store, reducersManager, localStorageManager, studyAPI, userAPI, coreReduxActions, coreReduxThunks, useAuthTokenCheck, PreventAccidentalNavigationPrompt, InternalNavigator, };
88
+ export { AppCore, initI18n, store, reducersManager, localStorageManager, studyAPI, userAPI, coreReduxActions, coreReduxThunks, useAuthTokenCheck, PreventAccidentalNavigationPrompt, InternalNavigator, type AppConfig, type HeaderConfig, type FooterConfig, type NavbarConfig, type PageConfig, type PagesConfig };