Skip to content

Commit

Permalink
Merge pull request #782 from ChildMindInstitute/release/2.0.2
Browse files Browse the repository at this point in the history
Release/2.0.2
  • Loading branch information
BamMironov authored May 23, 2024
2 parents 1158771 + b754639 commit 520f9fe
Show file tree
Hide file tree
Showing 42 changed files with 618 additions and 198 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ android {
applicationId "lab.childmindinstitute.data"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1563
versionName "2.0.1"
versionCode 1565
versionName "2.0.2"
resValue "string", "app_name", "Mindlogger"
resValue "string", "build_config_package", "lab.childmindinstitute.data"
manifestPlaceholders = [
Expand Down
48 changes: 24 additions & 24 deletions ios/MindloggerMobile.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1643,7 +1643,7 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
CURRENT_PROJECT_VERSION = 1563;
CURRENT_PROJECT_VERSION = 1565;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
Expand All @@ -1655,7 +1655,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 2.0.1;
MARKETING_VERSION = 2.0.2;
OTHER_LDFLAGS = (
"-ObjC",
"-lc++",
Expand All @@ -1674,15 +1674,15 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1563;
CURRENT_PROJECT_VERSION = 1565;
INFOPLIST_FILE = MindloggerMobileTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 2.0.1;
MARKETING_VERSION = 2.0.2;
OTHER_LDFLAGS = (
"-ObjC",
"-lc++",
Expand All @@ -1704,7 +1704,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1563;
CURRENT_PROJECT_VERSION = 1565;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8RHKE85KB6;
ENABLE_BITCODE = NO;
Expand All @@ -1715,7 +1715,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.0.1;
MARKETING_VERSION = 2.0.2;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -1745,7 +1745,7 @@
CODE_SIGN_ENTITLEMENTS = MindloggerMobile/MindloggerMobileRelease.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1563;
CURRENT_PROJECT_VERSION = 1565;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8RHKE85KB6;
INFOPLIST_FILE = MindloggerMobile/Info.plist;
Expand All @@ -1755,7 +1755,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.0.1;
MARKETING_VERSION = 2.0.2;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -1955,7 +1955,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1563;
CURRENT_PROJECT_VERSION = 1565;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8RHKE85KB6;
ENABLE_BITCODE = NO;
Expand All @@ -1966,7 +1966,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.0.1;
MARKETING_VERSION = 2.0.2;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -1995,7 +1995,7 @@
CODE_SIGN_ENTITLEMENTS = MindloggerMobileDevRelease.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1563;
CURRENT_PROJECT_VERSION = 1565;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8RHKE85KB6;
INFOPLIST_FILE = "MindloggerMobile dev-Info.plist";
Expand All @@ -2005,7 +2005,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.0.1;
MARKETING_VERSION = 2.0.2;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -2034,7 +2034,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1563;
CURRENT_PROJECT_VERSION = 1565;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8RHKE85KB6;
ENABLE_BITCODE = NO;
Expand All @@ -2045,7 +2045,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.0.1;
MARKETING_VERSION = 2.0.2;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -2075,7 +2075,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1563;
CURRENT_PROJECT_VERSION = 1565;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8RHKE85KB6;
INFOPLIST_FILE = "MindloggerMobile qa-Info.plist";
Expand All @@ -2085,7 +2085,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.0.1;
MARKETING_VERSION = 2.0.2;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand All @@ -2112,7 +2112,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = MindloggerMobileStagingDebug.entitlements;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1563;
CURRENT_PROJECT_VERSION = 1565;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8RHKE85KB6;
ENABLE_BITCODE = NO;
Expand All @@ -2123,7 +2123,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.0.1;
MARKETING_VERSION = 2.0.2;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -2152,7 +2152,7 @@
CODE_SIGN_ENTITLEMENTS = MindloggerMobileStagingRelease.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1563;
CURRENT_PROJECT_VERSION = 1565;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8RHKE85KB6;
INFOPLIST_FILE = "MindloggerMobile staging-Info.plist";
Expand All @@ -2162,7 +2162,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.0.1;
MARKETING_VERSION = 2.0.2;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -2191,7 +2191,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1563;
CURRENT_PROJECT_VERSION = 1565;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8RHKE85KB6;
ENABLE_BITCODE = NO;
Expand All @@ -2202,7 +2202,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.0.1;
MARKETING_VERSION = 2.0.2;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -2232,7 +2232,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1563;
CURRENT_PROJECT_VERSION = 1565;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8RHKE85KB6;
INFOPLIST_FILE = "MindloggerMobile uat-Info.plist";
Expand All @@ -2242,7 +2242,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.0.1;
MARKETING_VERSION = 2.0.2;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mindlogger-mobile",
"version": "2.0.1",
"version": "2.0.2",
"private": true,
"scripts": {
"android": "yarn android:dev",
Expand Down
4 changes: 2 additions & 2 deletions src/entities/activity/lib/services/AnswersQueueService.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
ChangeQueueObservable,
IObservable,
createSecureStorage,
IChangeQueueNotify,
} from '@app/shared/lib';

import { SendAnswersInput } from '../types';
Expand All @@ -23,7 +23,7 @@ const storage = createSecureStorage('upload_queue-storage');
const StartKey = '1';

class AnswersQueueService implements IAnswersQueueService {
constructor(changeObservable: IChangeQueueNotify) {
constructor(changeObservable: IObservable) {
storage.addOnValueChangedListener(() => {
changeObservable.notify();
});
Expand Down
4 changes: 4 additions & 0 deletions src/entities/activity/lib/services/AnswersUploadService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,10 @@ class AnswersUploadService implements IAnswersUploadService {
throw new Error(
'[UploadAnswersService.uploadAnswers] Answers were not uploaded',
);
} else {
this.logger.log(
'[UploadAnswersService.uploadAnswers]: Check result: uploaded successfully',
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const DrawingTest: FC<DrawingTestProps> = props => {
} = useImageDimensions(imageUrl);

const { exampleImageHeight, canvasContainerHeight, canvasSize } =
getElementsDimensions(props.dimensions, exampleImageDimensions);
getElementsDimensions(dimensions, exampleImageDimensions);

const containerHeight = exampleImageHeight + canvasSize;

Expand Down
4 changes: 2 additions & 2 deletions src/features/pass-survey/lib/types/payload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,8 @@ export type AudioResponse = MediaFile;
export type AudioPlayerResponse = boolean;

export type TimeRangeResponse = {
startTime: HourMinute;
endTime: HourMinute;
startTime: HourMinute | null;
endTime: HourMinute | null;
};

export type RadioResponse = RadioOption;
Expand Down
23 changes: 22 additions & 1 deletion src/features/pass-survey/model/AnswerValidator.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { Item } from '@app/shared/ui';
import { ConditionalLogicModel } from '@entities/conditional-logic';

import { Answers, PipelineItem, RadioResponse } from '../lib';
import {
Answers,
PipelineItem,
RadioResponse,
TimeRangeResponse,
} from '../lib';

type AnswerValidatorArgs = {
items: PipelineItem[];
Expand All @@ -19,6 +24,7 @@ export interface IAnswerValidator {
isLessThen(value: number): boolean;
includesOption(optionValue: string): boolean;
notIncludesOption(optionValue: string): boolean;
isValidAnswer(): boolean;
}

function AnswerValidator(params?: AnswerValidatorArgs): IAnswerValidator {
Expand Down Expand Up @@ -89,6 +95,21 @@ function AnswerValidator(params?: AnswerValidatorArgs): IAnswerValidator {

return ConditionalLogicModel.doesNotIncludeValue(answer, optionValue);
},
isValidAnswer() {
switch (currentPipelineItem?.type) {
case 'TimeRange': {
const answer = currentAnswer?.answer as TimeRangeResponse;

if (answer) {
return !!answer?.startTime && !!answer?.endTime;
}

return true;
}
default:
return true;
}
},
};
}

Expand Down
9 changes: 6 additions & 3 deletions src/features/pass-survey/model/hooks/useActivityStepper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const ConditionalLogicItems: ActivityItemType[] = [
];

function useActivityStepper(state: ActivityState | undefined) {
const answerValidator = AnswerValidator(state);
const step = state?.step ?? 0;
const items = state?.items ?? [];
const answers = state?.answers ?? {};
Expand All @@ -36,12 +37,16 @@ function useActivityStepper(state: ActivityState | undefined) {

const canSkip =
!!currentPipelineItem?.isSkippable && !hasAnswer && !isSplashStep;

const canMoveNext =
isTutorialStep ||
isMessageStep ||
isAbTestStep ||
currentPipelineItem?.isSkippable ||
(hasAnswer && (!additionalAnswerRequired || hasAdditionalAnswer));
(hasAnswer &&
(!additionalAnswerRequired || hasAdditionalAnswer) &&
answerValidator.isValidAnswer());

const canMoveBack = currentPipelineItem?.isAbleToMoveBack;
const canReset =
currentPipelineItem?.canBeReset && (hasAnswer || hasAdditionalAnswer);
Expand All @@ -53,8 +58,6 @@ function useActivityStepper(state: ActivityState | undefined) {
currentPipelineItem!?.type,
);

const answerValidator = AnswerValidator(state);

function isValid() {
const valid = answerValidator.isCorrect();

Expand Down
4 changes: 1 addition & 3 deletions src/features/pass-survey/model/hooks/useIdleTimer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ const useIdleTimer = (input: UseIdleTimerInput): UseIdleTimerResult => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

const onIdleElapsed = () => {
onFinish();
};
const onIdleElapsed = () => onFinish();

const restart = () => {
timer?.restart();
Expand Down
Loading

0 comments on commit 520f9fe

Please sign in to comment.