@influenzanet/case-web-app-core 2.7.5-staging.8 → 2.7.6

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 (31) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/build/api/studyAPI.d.ts +2 -2
  3. package/build/components/ImageBrowser/ImageBrowser.d.ts +16 -0
  4. package/build/components/ImageBrowser/models/ImageBrowserViewModel.d.ts +4 -0
  5. package/build/components/ImageBrowser/services/ImageBrowserDataReader.d.ts +4 -0
  6. package/build/components/UserProfilesSelector/UserProfilesSelector.d.ts +9 -0
  7. package/build/components/UserSymptomsHistory/UserSymptomsHistory.d.ts +18 -0
  8. package/build/components/UserSymptomsHistory/models/IUserSymptomsHistoryReportParser.d.ts +8 -0
  9. package/build/components/UserSymptomsHistory/models/SymptomsResult.d.ts +5 -0
  10. package/build/components/UserSymptomsHistory/services/UserSymptomsHistoryReportReader.d.ts +14 -0
  11. package/build/components/UserSymptomsHistory/services/config/SymptomsConfig.d.ts +9 -0
  12. package/build/components/UserSymptomsHistory/services/parsers/UserSymptomsHistoryReportParserV1.d.ts +10 -0
  13. package/build/components/UserSymptomsHistory/services/parsers/index.d.ts +3 -0
  14. package/build/components/pages/Pages.d.ts +5 -5
  15. package/build/components/pages/components/ContentRenderer.d.ts +4 -4
  16. package/build/components/pages/components/LinkResolver/LinkResolver.d.ts +2 -9
  17. package/build/components/pages/components/LinkResolver/Resolvers/Invitation.d.ts +2 -2
  18. package/build/components/pages/components/LinkResolver/Resolvers/LinkResolverConst.d.ts +7 -0
  19. package/build/components/pages/components/LinkResolver/Resolvers/PasswordReset.d.ts +2 -2
  20. package/build/components/pages/components/LinkResolver/Resolvers/StudyLogin.d.ts +2 -2
  21. package/build/index.d.ts +1 -1
  22. package/build/index.es.js +1083 -402
  23. package/build/index.es.js.map +1 -1
  24. package/build/index.js +1083 -402
  25. package/build/index.js.map +1 -1
  26. package/build/store/actions/studiesActions.d.ts +3 -3
  27. package/build/store/thunks/studiesThunks.d.ts +9 -5
  28. package/build/types/pagesConfig.d.ts +44 -40
  29. package/build/utils/Reports/models/ReportModels.d.ts +20 -0
  30. package/build/utils/Reports/models/services/reportService.d.ts +1 -0
  31. package/package.json +8 -4
package/CHANGELOG.md CHANGED
@@ -2,20 +2,41 @@
2
2
 
3
3
  ## 2.7.5 - staging
4
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
+
5
20
  ## Changed
6
21
 
7
22
  - SurveyList component rework
23
+
8
24
  - profiles are no longer subscribed to default studies inside this component
9
25
  - active surveys are now saved in the redux store so it's easy to re render the component
10
26
  from your application in case the user is assigned new surveys or studies
11
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
+
12
33
  ## 2.7.4 - 2023-11-20
13
34
 
14
35
  ### Changed
15
36
 
16
37
  - on logout, the local storage is emptied and the persistState flag is set to false, preventing the app to save
17
38
  an empty state. This fixed an incorrect behavior during the sign up process for users that previously unsubscribed
18
- from the platform
39
+ from the platform and then subscribed again
19
40
 
20
41
  ## 2.7.3 - 2023-10-25
21
42
 
@@ -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>>;
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ import { ImageBrowserDataReader } from "./services/ImageBrowserDataReader";
3
+ import "./ImageBrowser.scss";
4
+ export interface ImageBrowserProps {
5
+ className?: string;
6
+ enableAnimations?: boolean;
7
+ dataReader: ImageBrowserDataReader;
8
+ dateLocales?: Array<{
9
+ code: string;
10
+ locale: any;
11
+ format: string;
12
+ }>;
13
+ translationNamespace?: string;
14
+ }
15
+ declare const ImageBrowser: React.FC<ImageBrowserProps>;
16
+ export default ImageBrowser;
@@ -0,0 +1,4 @@
1
+ export interface ImageBrowserViewModel {
2
+ date: number;
3
+ imageUrl: string;
4
+ }
@@ -0,0 +1,4 @@
1
+ import { ImageBrowserViewModel } from "../models/ImageBrowserViewModel";
2
+ export declare abstract class ImageBrowserDataReader {
3
+ abstract next: (count: number) => Promise<Array<ImageBrowserViewModel>>;
4
+ }
@@ -0,0 +1,9 @@
1
+ import "./UserProfilesSelector.scss";
2
+ import React from "react";
3
+ interface UserProfilesSelectorProps {
4
+ selectedProfileId: string;
5
+ onProfileChange: (profileId: string) => Promise<void>;
6
+ className?: string;
7
+ }
8
+ declare const UserProfilesSelector: React.FC<UserProfilesSelectorProps>;
9
+ export default UserProfilesSelector;
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ import { ImageBrowserDataReader } from "../ImageBrowser/services/ImageBrowserDataReader";
3
+ export declare type UserSymptomsHistoryDataReader = {
4
+ init: (studyId: string, profileId: string) => Promise<ImageBrowserDataReader>;
5
+ };
6
+ export declare type UserSymptomsHistoryProps = {
7
+ className?: string;
8
+ studyId: string;
9
+ DataReader?: UserSymptomsHistoryDataReader;
10
+ translationNamespace?: string;
11
+ dateLocales?: Array<{
12
+ code: string;
13
+ locale: any;
14
+ format: string;
15
+ }>;
16
+ };
17
+ declare const UserSymptomsHistory: React.FC<UserSymptomsHistoryProps>;
18
+ export default UserSymptomsHistory;
@@ -0,0 +1,8 @@
1
+ import { ParsedReport } from "../../../utils/Reports/models/ReportModels";
2
+ import { ImageBrowserViewModel } from "../../ImageBrowser/models/ImageBrowserViewModel";
3
+ import { SymptomsConfig } from "../services/config/SymptomsConfig";
4
+ interface IUserSymptomsHistoryReportParser {
5
+ version: string;
6
+ parse: (report: ParsedReport, config: SymptomsConfig) => ImageBrowserViewModel;
7
+ }
8
+ export default IUserSymptomsHistoryReportParser;
@@ -0,0 +1,5 @@
1
+ import { GenderKeys } from "../services/config/SymptomsConfig";
2
+ export interface SymptomsResult {
3
+ symptoms: Array<string>;
4
+ gender: GenderKeys;
5
+ }
@@ -0,0 +1,14 @@
1
+ import { ImageBrowserViewModel } from "../../ImageBrowser/models/ImageBrowserViewModel";
2
+ import { ImageBrowserDataReader } from "../../ImageBrowser/services/ImageBrowserDataReader";
3
+ import { SymptomsConfig } from "./config/SymptomsConfig";
4
+ export declare class UserSymptomsHistoryReportReader extends ImageBrowserDataReader {
5
+ static config: SymptomsConfig;
6
+ studyId: string;
7
+ profileId: string;
8
+ startingDate: number | undefined;
9
+ hasMoreData: boolean;
10
+ private constructor();
11
+ static init: (studyId: string, profileId: string) => Promise<UserSymptomsHistoryReportReader>;
12
+ next: (count: number) => Promise<Array<ImageBrowserViewModel>>;
13
+ private parseReports;
14
+ }
@@ -0,0 +1,9 @@
1
+ export declare type SymptomsToImageMap = {
2
+ [key: string]: string;
3
+ default: string;
4
+ };
5
+ export declare type GenderKeys = "0" | "1" | "2";
6
+ export declare type SymptomsConfig = {
7
+ [K in GenderKeys]: SymptomsToImageMap[];
8
+ };
9
+ export declare function isValidUserSymptomsHistoryConfig(obj: any): obj is SymptomsConfig;
@@ -0,0 +1,10 @@
1
+ import { ImageBrowserViewModel } from "../../../ImageBrowser/models/ImageBrowserViewModel";
2
+ import IUserSymptomsHistoryReportParser from "../../models/IUserSymptomsHistoryReportParser";
3
+ import { ParsedReport } from "../../../../utils/Reports/models/ReportModels";
4
+ import { SymptomsConfig } from "../config/SymptomsConfig";
5
+ declare class UserSymptomsHistoryReportParserV1 implements IUserSymptomsHistoryReportParser {
6
+ version: string;
7
+ parse: (report: ParsedReport, config: SymptomsConfig) => ImageBrowserViewModel;
8
+ private reportDataToImage;
9
+ }
10
+ export default UserSymptomsHistoryReportParserV1;
@@ -0,0 +1,3 @@
1
+ import IUserSymptomsHistoryReportParser from "../../models/IUserSymptomsHistoryReportParser";
2
+ declare const parsers: Array<IUserSymptomsHistoryReportParser>;
3
+ export default parsers;
@@ -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,7 +1,7 @@
1
- import React from 'react';
2
- import { PagesConfig, PageRow, HelmetPageConfig } from '../../../types/pagesConfig';
3
- import { DefaultRoutes } from '../../../types/routing';
4
- import { Extension } from '../../../AppCore';
1
+ import React from "react";
2
+ import { PagesConfig, PageRow, HelmetPageConfig } from "../../../types/pagesConfig";
3
+ import { DefaultRoutes } from "../../../types/routing";
4
+ import { Extension } from "../../../AppCore";
5
5
  interface ContentRendererProps {
6
6
  hideTitleBar?: boolean;
7
7
  isAuthenticated: boolean;
@@ -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
@@ -83,6 +83,6 @@ declare const coreReduxActions: {
83
83
  studiesActions: import("@reduxjs/toolkit").CaseReducerActions<{}>;
84
84
  };
85
85
  declare const coreReduxThunks: {
86
- enterStudyThunk: import("@reduxjs/toolkit").AsyncThunk<import("./store/actions/studiesActions").EnterStudyPayload, import("./store/thunks/studiesThunks").EnterStudyRequest, {}>;
86
+ enterStudiesThunk: import("@reduxjs/toolkit").AsyncThunk<import("./store/actions/studiesActions").EnterStudiesPayload, import("./store/thunks/studiesThunks").EnterStudiesRequest, {}>;
87
87
  };
88
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 };