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

Commit 0a264f4

Browse files
authored
Merge pull request #281 from daita-technologies/update/user-feedbacks
Update: user feedbacks
2 parents ced2686 + fd094af commit 0a264f4

10 files changed

Lines changed: 31 additions & 20 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/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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
EXISTING_DATASET_CREATE_PROJECT_DATASET_TYPE_VALUE,
2727
ID_TOKEN_NAME,
2828
MAX_DATASET_IMAGES_CREATE_PROJECT,
29+
MAX_PROJECT_DESCRIPTION_CHARACTER_LENGTH,
2930
MIN_DATASET_IMAGES_CREATE_PROJECT,
3031
TOKEN_NAME,
3132
// MAX_ALLOW_UPLOAD_IMAGES,
@@ -312,8 +313,8 @@ const CreateProjectModal = function (props: CreateProjectModalProps) {
312313
{...register("description", {
313314
required: false,
314315
maxLength: {
315-
value: 75,
316-
message: `Your project description cannot exceed 75 characters.`,
316+
value: MAX_PROJECT_DESCRIPTION_CHARACTER_LENGTH,
317+
message: `Your project description cannot exceed ${MAX_PROJECT_DESCRIPTION_CHARACTER_LENGTH} characters.`,
317318
},
318319
})}
319320
error={!!errors.description}

src/constants/defaultValues.tsx

Lines changed: 2 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

src/routes/AnnotationPage/ControlPanel/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ import {
9090
intToRGB,
9191
} from "../LabelAnnotation/ClassManageModal/useListClassView";
9292

93+
const IS_MAC_PLATFORM = /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);
94+
9395
function ControlPanel() {
9496
const history = useHistory();
9597
const dispatch = useDispatch();
@@ -594,7 +596,7 @@ function ControlPanel() {
594596
sx={{ border: "1px dashed grey" }}
595597
justifyContent="space-evenly"
596598
>
597-
<Tooltip title="Ctrl+Z">
599+
<Tooltip title={`Undo (${IS_MAC_PLATFORM ? "⌘" : "Ctrl"}+Z)`}>
598600
<span>
599601
<IconButton
600602
onClick={handleUndoDrawObject}
@@ -604,7 +606,7 @@ function ControlPanel() {
604606
</IconButton>
605607
</span>
606608
</Tooltip>
607-
<Tooltip title="Ctrl+Shift+Z">
609+
<Tooltip title={`Redo (${IS_MAC_PLATFORM ? "⌘" : "Ctrl"}+Shift+Z)`}>
608610
<span>
609611
<IconButton
610612
onClick={handleRedoDrawObject}

src/routes/AnnotationPage/Editor/index.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,16 +183,20 @@ function Editor() {
183183
}
184184
};
185185
const keyDownHandler = (e: KeyboardEvent<HTMLDivElement>) => {
186-
if (e.ctrlKey && e.shiftKey && e.key === "Z") {
186+
if (
187+
(e.ctrlKey || e.metaKey) &&
188+
e.shiftKey &&
189+
(e.key === "Z" || e.key === "z")
190+
) {
187191
dispatch(redoDrawObject());
188-
} else if (e.ctrlKey && e.key === "z") {
192+
} else if ((e.ctrlKey || e.metaKey) && e.key === "z") {
189193
dispatch(undoDrawObject());
190194
} else if (e.key === " ") {
191195
setKeyDown(e.key);
192196
if (currentDrawState !== DrawState.ZOOMDRAGGING) {
193197
dispatch(changeCurrentDrawState({ drawState: DrawState.ZOOMDRAGGING }));
194198
}
195-
} else if (e.key === "Delete") {
199+
} else if (e.key === "Delete" || e.key === "Backspace") {
196200
if (selectedDrawObjectId) {
197201
dispatch(deleteDrawObject({ drawObjectId: selectedDrawObjectId }));
198202
if (toolTipLayer.current?.attrs.id === selectedDrawObjectId) {

src/routes/AnnotationPage/ImagePreview/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
selectorIdDrawObjectByImageName,
1111
} from "reduxes/annotationmanager/selecetor";
1212
import { selectorCurrentAnnotationFiles } from "reduxes/annotationProject/selector";
13-
import { QUIT_ANNOTATION_EDITOR_PROMPT_MESSAGE } from "../constants";
13+
import { QUIT_ANNOTATION_EDITOR_ALERT_MESSAGE } from "../constants";
1414
import ChangePreviewConfirmDialog from "./ChangePreviewConfirmDialog";
1515
import ImagePreviewBadge from "./ImagePreviewBadge";
1616

@@ -134,7 +134,7 @@ function ImagePreview() {
134134
<>
135135
<BeforeUnload
136136
isActive={!!needConfirmChangePreviewImageDialog}
137-
message={QUIT_ANNOTATION_EDITOR_PROMPT_MESSAGE}
137+
message={QUIT_ANNOTATION_EDITOR_ALERT_MESSAGE}
138138
/>
139139
<List
140140
sx={{

src/routes/AnnotationPage/constants.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,5 @@ export const DRAW_ELLIPSE_SHORT_KEY = "e";
55
export const DRAW_LINE_SHORT_KEY = "x";
66
export const DRAW_SEGMENTATION_SHORT_KEY = "f";
77
export const QUIT_ANNOTATION_EDITOR_ALERT_MESSAGE =
8-
"If you change the preview image, all annotation already processed will be lost. Do you still want to CANCEL?";
9-
export const QUIT_ANNOTATION_EDITOR_PROMPT_MESSAGE =
10-
"If you change the preview image, all annotation already processed will be lost. Do you still want to LEAVE?";
8+
"The annotation was modified. If you do not save it before proceeding, your changes will be lost.";
119
export const FULL_PADDING_VALUE = 10000;

src/routes/DashboardPage/UpdateProjectInfoDialog.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ import {
88
Typography,
99
} from "@mui/material";
1010
import { MyButton } from "components";
11-
import { ID_TOKEN_NAME } from "constants/defaultValues";
11+
import {
12+
ID_TOKEN_NAME,
13+
MAX_PROJECT_DESCRIPTION_CHARACTER_LENGTH,
14+
} from "constants/defaultValues";
1215
import { useEffect } from "react";
1316
import { useForm } from "react-hook-form";
1417
import { useDispatch, useSelector } from "react-redux";
@@ -109,8 +112,8 @@ const UpdateProjectInfoDialog = function () {
109112
{...register("description", {
110113
required: false,
111114
maxLength: {
112-
value: 75,
113-
message: `Your project description cannot exceed 75 characters.`,
115+
value: MAX_PROJECT_DESCRIPTION_CHARACTER_LENGTH,
116+
message: `Your project description cannot exceed ${MAX_PROJECT_DESCRIPTION_CHARACTER_LENGTH} characters.`,
114117
},
115118
})}
116119
error={!!errors.description}
@@ -133,7 +136,7 @@ const UpdateProjectInfoDialog = function () {
133136
color="text.secondary"
134137
>
135138
* The maximum number of characters for Project name and Description
136-
is 75.
139+
is {MAX_PROJECT_DESCRIPTION_CHARACTER_LENGTH}.
137140
</Typography>
138141
<Button sx={{ display: "none" }} type="submit" />
139142
</Box>

src/routes/ProjectDetail/PreprocessingOption/ExpertPreprocessOption.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ const ExpertPreprocessingOption = function () {
211211
</Typography>
212212
<InfoTooltip
213213
sx={{ ml: 1 }}
214-
title="If enabled, our system selects the most appropriate reference images for the selected methods of the preprocessing run."
214+
title="If you run it, our system selects the most appropriate reference images for the selected methods of the preprocessing run."
215215
/>
216216
</Box>
217217
<Box mt={2} display="flex" gap={1}>

0 commit comments

Comments
 (0)