Skip to content

Commit

Permalink
fix(model): fix model tag text
Browse files Browse the repository at this point in the history
  • Loading branch information
qscgyujm committed Apr 27, 2023
1 parent ca16673 commit 94610d7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const Images = (props: Props) => {
}, []);

function onUploadFileInput(e: React.ChangeEvent<HTMLInputElement>): void {
for (let i = 0; i < e.target.files.length; i++) {
for (let i = 0; i < e.target.files.length; i += 1) {
const formData = new FormData();
formData.append('image', e.target.files[i]);
formData.append('project', modelId.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ import { Stack, DefaultButton, Label, TextField, Text } from '@fluentui/react';

import { trainingProjectPartsSelectorFactory, postPartByProject } from '../../../store/partSlice';
import { getTagsClasses } from './styles';
import { updateCustomVisionProjectTags } from '../../../store/trainingProjectSlice';
import { ProjectType, updateCustomVisionProjectTags } from '../../../store/trainingProjectSlice';

import Tag from '../../Models/Tag';

interface Props {
modelId: number;
projectType: ProjectType;
}

const Tags = (props: Props) => {
const { modelId } = props;
const { modelId, projectType } = props;

const partSelector = useMemo(() => trainingProjectPartsSelectorFactory(modelId), [modelId]);
const parts = useSelector(partSelector);
Expand Down Expand Up @@ -89,7 +90,7 @@ const Tags = (props: Props) => {
{isAdd && <TextField value={localPart} onChange={(_, newValue) => setLocalPart(newValue)} />}
</Stack>
<Stack horizontalAlign="space-between" horizontal>
<Text>Add at least 2 tags to Save</Text>
<Text>{`Add at least ${projectType === 'Classification' ? '1 tag' : '2 tags'} to Save`}</Text>
{isAdd ? (
<DefaultButton
className={classes.button}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const ModelTraining = (props: Props) => {

return (
<>
<TagsSection modelId={model.id} />
<TagsSection modelId={model.id} projectType={model.projectType} />
<ImagesSection modelId={model.id} />
<TrainingFooter cvModelId={model.id} projectType={model.projectType} />
</>
Expand Down

0 comments on commit 94610d7

Please sign in to comment.