Skip to content
This repository was archived by the owner on May 30, 2023. It is now read-only.

Commit 4d6fb55

Browse files
committed
Merge branch 'develop' of https://github.com/daita-technologies/interface into fix/group_drag_bound
2 parents d7c89e4 + 752e8fe commit 4d6fb55

33 files changed

Lines changed: 206 additions & 71 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "daita-interface",
3-
"version": "0.1.0",
3+
"version": "1.1.0",
44
"private": true,
55
"description": "React-based user interface for the DAITA platform.",
66
"author": "DAITA Technologies",

src/components/Annotation/Formart/daita/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ export const exportAnnotation = (
215215
)}`;
216216
const link = document.createElement("a");
217217
link.href = jsonString;
218-
link.download = `${imageName.replace(/\.[^.]+$/, "-Daita")}.json`;
218+
link.download = `${imageName.replace(/\.[^.]+$/, "-DAITA")}.json`;
219219

220220
link.click();
221221
};

src/components/CheckingApp/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Box, CircularProgress } from "@mui/material";
1+
import { Box, CircularProgress, Typography } from "@mui/material";
22
import {
33
CREDENTIAL_TOKEN_EXPIRE_NAME,
44
LAST_USED_SYSTEM_STORAGE_KEY_NAME,
@@ -154,12 +154,14 @@ const CheckingApp = function ({ children }: TokenCheckingProps) {
154154
return (
155155
<Box
156156
display="flex"
157+
flexDirection="column"
157158
alignItems="center"
158159
justifyContent="center"
159160
minHeight="100vh"
160161
minWidth="100vw"
161162
>
162163
<CircularProgress size={40} />
164+
<Typography mt={1}>Checking application status...</Typography>
163165
</Box>
164166
);
165167
}

src/components/CloneProjectModal/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
} from "reduxes/annotationProject/selector";
2424
import { useEffect } from "react";
2525
import { selectorListProjects } from "reduxes/project/selector";
26+
import { MAX_PROJECT_DESCRIPTION_CHARACTER_LENGTH } from "constants/defaultValues";
2627
import { CloneProjectToAnnotationFields } from "./type";
2728

2829
const CloneProjectModal = function () {
@@ -162,8 +163,8 @@ const CloneProjectModal = function () {
162163
{...register("annotationProjectDescription", {
163164
required: false,
164165
maxLength: {
165-
value: 75,
166-
message: `Your project description cannot exceed 75 characters.`,
166+
value: MAX_PROJECT_DESCRIPTION_CHARACTER_LENGTH,
167+
message: `Your project description cannot exceed ${MAX_PROJECT_DESCRIPTION_CHARACTER_LENGTH} characters.`,
167168
},
168169
})}
169170
error={!!errors.annotationProjectDescription}

src/components/CreateProjectModal/index.tsx

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ import {
2525
EMPTY_DATASET_CREATE_PROJECT_DATASET_TYPE_VALUE,
2626
EXISTING_DATASET_CREATE_PROJECT_DATASET_TYPE_VALUE,
2727
ID_TOKEN_NAME,
28+
MAX_DATASET_IMAGES,
2829
MAX_DATASET_IMAGES_CREATE_PROJECT,
30+
MAX_PROJECT_DESCRIPTION_CHARACTER_LENGTH,
2931
MIN_DATASET_IMAGES_CREATE_PROJECT,
3032
TOKEN_NAME,
3133
// MAX_ALLOW_UPLOAD_IMAGES,
@@ -122,7 +124,11 @@ const CreateProjectDatasetTypeControl = function (
122124
if (selectedPrebuildDataset) {
123125
setPrebuildDataset(selectedPrebuildDataset);
124126
setNumberOfDatasetImages(
125-
selectedPrebuildDataset.totalImage
127+
selectedPrebuildDataset?.totalImage &&
128+
selectedPrebuildDataset.totalImage > MAX_DATASET_IMAGES
129+
? MAX_DATASET_IMAGES
130+
: selectedPrebuildDataset?.totalImage ||
131+
MIN_DATASET_IMAGES_CREATE_PROJECT
126132
);
127133
}
128134
}}
@@ -138,7 +144,7 @@ const CreateProjectDatasetTypeControl = function (
138144
/>
139145
</Box>
140146
<Typography variant="body2" mt={2}>
141-
Number of dataset images:
147+
Number of images:
142148
</Typography>
143149
<Box display="flex" alignItems="center" columnGap={1} pl={1}>
144150
<Slider
@@ -149,8 +155,11 @@ const CreateProjectDatasetTypeControl = function (
149155
onChange={onChangeNumberOfDatasetImagesSlider}
150156
min={MIN_DATASET_IMAGES_CREATE_PROJECT}
151157
max={
152-
prebuildDataset?.totalImage ||
153-
MIN_DATASET_IMAGES_CREATE_PROJECT
158+
prebuildDataset?.totalImage &&
159+
prebuildDataset.totalImage > MAX_DATASET_IMAGES
160+
? MAX_DATASET_IMAGES
161+
: prebuildDataset?.totalImage ||
162+
MIN_DATASET_IMAGES_CREATE_PROJECT
154163
}
155164
disabled={isCreatingProject}
156165
/>
@@ -162,8 +171,11 @@ const CreateProjectDatasetTypeControl = function (
162171
inputProps={{
163172
min: MIN_DATASET_IMAGES_CREATE_PROJECT,
164173
max:
165-
prebuildDataset?.totalImage ||
166-
MIN_DATASET_IMAGES_CREATE_PROJECT,
174+
prebuildDataset?.totalImage &&
175+
prebuildDataset.totalImage > MAX_DATASET_IMAGES
176+
? MAX_DATASET_IMAGES
177+
: prebuildDataset?.totalImage ||
178+
MIN_DATASET_IMAGES_CREATE_PROJECT,
167179
type: "number",
168180
"aria-labelledby": "input-number-of-dataset-images-slider",
169181
}}
@@ -312,8 +324,8 @@ const CreateProjectModal = function (props: CreateProjectModalProps) {
312324
{...register("description", {
313325
required: false,
314326
maxLength: {
315-
value: 75,
316-
message: `Your project description cannot exceed 75 characters.`,
327+
value: MAX_PROJECT_DESCRIPTION_CHARACTER_LENGTH,
328+
message: `Your project description cannot exceed ${MAX_PROJECT_DESCRIPTION_CHARACTER_LENGTH} characters.`,
317329
},
318330
})}
319331
error={!!errors.description}

src/components/FeedbackComponent/FeedbackForm.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ export const FeedbackForm = function ({
207207
color="text.secondary"
208208
display="inline-block"
209209
>
210-
File types supported: JPG, PNG, Max size: 5 MB
210+
File types supported: JPG, PNG, Max size: 2 MB
211211
</Typography>
212212
<Box mt={1}>
213213
<UploadZoneWrapper
@@ -329,6 +329,8 @@ export const FeedbackFormSlack = function ({
329329
if (onSendFail) onSendFail();
330330
resolve({ action: FeedbackFormAction.NO_ACTION });
331331
});
332+
} else {
333+
resolve({ action: FeedbackFormAction.NO_ACTION });
332334
}
333335
});
334336

src/components/InviteFriendModal/index.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,20 @@ const InviteFriendModal = function () {
122122
{isFetchingInviteEmailTemplate ? (
123123
<Box
124124
display="flex"
125+
flexDirection="column"
125126
alignItems="center"
126127
justifyContent="center"
127128
my={2}
128129
>
129130
<CircularProgress size={20} />
131+
<Typography
132+
mt={1}
133+
color="text.secondary"
134+
variant="body2"
135+
fontStyle="italic"
136+
>
137+
Fetching email content...
138+
</Typography>
130139
</Box>
131140
) : (
132141
<Box

src/components/ReCaptchaInput/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const ReCaptchaInput = function ({
3737
ref={recaptchaRef}
3838
sitekey={RECAPTCHA_SITE_KEY}
3939
size="invisible"
40+
badge="inline"
4041
/>
4142
{/* NOTE: We use invisible recaptcha is auto generate when submitted, therefore no need show required message */}
4243
{error && error.message !== REQUIRE_RECAPTCHA_ERROR_MESSAGE && (

src/components/UploadFile/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ const UploadFile = function (props: UploadFileProps) {
460460
border: "1px dashed",
461461
borderColor: isDragActive ? "primary.main" : "text.secondary",
462462
borderWidth: isDragActive ? 2 : 1,
463-
cursor: "pointer",
463+
cursor: isDisabledUpload ? "not-allowed" : "pointer",
464464
borderRadius: "6px",
465465
}}
466466
display="flex"

src/constants/defaultValues.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ export const CREATE_PROJECT_DATASET_TYPE_LIST: CreateProjectDatasetTypeControlTy
164164
},
165165
];
166166

167+
export const MAX_PROJECT_DESCRIPTION_CHARACTER_LENGTH = 300;
168+
167169
export const MIN_DATASET_IMAGES_CREATE_PROJECT = 1;
168170
export const MAX_DATASET_IMAGES_CREATE_PROJECT = 1000;
169171

@@ -234,3 +236,5 @@ export const MAX_SIZE_FEEDBACK_ATTACHED_FILE = 2000000;
234236

235237
export const QUIT_FEEDBACK_ALERT_MESSAGE =
236238
"Your feedback content will be lost. Are you sure you want to quit?";
239+
240+
export const MAX_DATASET_IMAGES = 800;

0 commit comments

Comments
 (0)