@influenzanet/case-web-app-core 2.7.5-staging.2 → 2.7.5-staging.20

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 (30) hide show
  1. package/CHANGELOG.md +40 -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/studyAPI.d.ts +2 -2
  6. package/build/api/types/user.d.ts +8 -3
  7. package/build/api/userAPI.d.ts +3 -3
  8. package/build/components/dialogs/GlobalDialogs/Login.d.ts +2 -2
  9. package/build/components/dialogs/GlobalDialogs/ManageProfiles.d.ts +1 -3
  10. package/build/components/pages/Pages.d.ts +5 -5
  11. package/build/components/pages/components/LinkResolver/LinkResolver.d.ts +2 -9
  12. package/build/components/pages/components/LinkResolver/Resolvers/Invitation.d.ts +2 -2
  13. package/build/components/pages/components/LinkResolver/Resolvers/LinkResolverConst.d.ts +7 -0
  14. package/build/components/pages/components/LinkResolver/Resolvers/PasswordReset.d.ts +2 -2
  15. package/build/components/pages/components/LinkResolver/Resolvers/StudyLogin.d.ts +2 -2
  16. package/build/index.d.ts +8 -9
  17. package/build/index.es.js +1274 -571
  18. package/build/index.es.js.map +1 -1
  19. package/build/index.js +1274 -571
  20. package/build/index.js.map +1 -1
  21. package/build/store/actions/studiesActions.d.ts +8 -0
  22. package/build/store/actions/userActions.d.ts +9 -0
  23. package/build/store/rootReducer.d.ts +1 -1
  24. package/build/store/studiesSlice.d.ts +1 -4
  25. package/build/store/thunks/studiesThunks.d.ts +18 -0
  26. package/build/store/thunks/userThunks.d.ts +3 -0
  27. package/build/store/userSlice.d.ts +0 -2
  28. package/package.json +1 -1
  29. package/build/thunks/studiesThunks.d.ts +0 -18
  30. package/build/thunks/userThunks.d.ts +0 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
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
+
13
+ - `enterStudiesThunk` : used to simplify the assignment of a profile to new studies.
14
+ It also make sure to fetch new surveys associated to the newly assigned studies.
15
+
16
+ - `getReportsForUser` : now support the `limit` parameter. NOTE: it only properly works with versions of the
17
+ study service supporting the parameter server side, otherwise it gets ignored and all results are returned.
18
+ Check study service changelog to see which version supports this new parameter
19
+
20
+ ## Changed
21
+
22
+ - SurveyList component rework
23
+
24
+ - profiles are no longer subscribed to default studies inside this component
25
+ - active surveys are now saved in the redux store so it's easy to re render the component
26
+ from your application in case the user is assigned new surveys or studies
27
+
28
+ - DefaultStudiesManager component
29
+
30
+ - initialize store state related to studies and surveys
31
+ - make sure default studies are assigned to all profiles (backward compatibility)
32
+
33
+ ## 2.7.4 - 2023-11-20
34
+
35
+ ### Changed
36
+
37
+ - on logout, the local storage is emptied and the persistState flag is set to false, preventing the app to save
38
+ an empty state. This fixed an incorrect behavior during the sign up process for users that previously unsubscribed
39
+ from the platform and then subscribed again
40
+
3
41
  ## 2.7.3 - 2023-10-25
4
42
 
5
43
  ### Changed
@@ -229,7 +267,7 @@
229
267
  ### Changed
230
268
 
231
269
  - [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>
270
+ <https://github.com/coneno/case-web-ui/blob/master/CHANGELOG.md#breaking-changes>
233
271
 
234
272
  ## [1.0.19]
235
273
 
@@ -253,7 +291,7 @@
253
291
 
254
292
  ### Changed
255
293
 
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.
294
+ - _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
295
  - Updating project dependencies (case-web-ui), with minor improvements.
258
296
 
259
297
  ## [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;
@@ -1,8 +1,8 @@
1
- import { SurveyReferenceReq, SurveyAndContextMsg, SurveyResponseReq, AssignedSurveys, Studies, SurveyInfos, StudiesForUser, ConvertTempParticipantReq, ReportHistory } from './types/studyAPI';
1
+ import { SurveyReferenceReq, SurveyAndContextMsg, SurveyResponseReq, AssignedSurveys, Studies, SurveyInfos, StudiesForUser, ConvertTempParticipantReq, ReportHistory } from "./types/studyAPI";
2
2
  export declare const getStudiesForUserReq: () => Promise<import("axios").AxiosResponse<StudiesForUser, any>>;
3
3
  export declare const getAllAvailableStudiesReq: () => Promise<import("axios").AxiosResponse<Studies, any>>;
4
4
  export declare const getSurveyInfosForStudyReq: (studyKey: string) => Promise<import("axios").AxiosResponse<SurveyInfos, any>>;
5
- export declare const getReportsForUser: (onlyForStudies?: string[] | undefined, onlyForProfiles?: string[] | undefined, reportKey?: string | undefined, from?: number | undefined, until?: number | undefined, ignoreReports?: string[] | undefined) => Promise<import("axios").AxiosResponse<ReportHistory, any>>;
5
+ export declare const getReportsForUser: (onlyForStudies?: string[] | undefined, onlyForProfiles?: string[] | undefined, reportKey?: string | undefined, from?: number | undefined, until?: number | undefined, ignoreReports?: string[] | undefined, limit?: number | undefined) => Promise<import("axios").AxiosResponse<ReportHistory, any>>;
6
6
  export declare const enterStudyReq: (studyKey: string, profileId: string) => Promise<import("axios").AxiosResponse<AssignedSurveys, any>>;
7
7
  export declare const leaveStudyRequest: (studyKey: string, profileId: string) => Promise<import("axios").AxiosResponse<AssignedSurveys, any>>;
8
8
  export declare const getAllAssignedSurveysReq: () => Promise<import("axios").AxiosResponse<AssignedSurveys, any>>;
@@ -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 };