Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ErykKul committed Jun 27, 2024
1 parent 5efb5d2 commit f458d79
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
6 changes: 3 additions & 3 deletions src/sections/upload-dataset-files/FileUploader.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@
}

.selected_file>div {
background-color: #ffc !important;
margin-bottom: 0.5rem;
background-color: #ffc !important;
}

.file:nth-of-type(even)>div {
margin-bottom: 0.5rem;
padding: 0.5rem;
background-color: #f8f9fc;
margin-bottom: 0.5rem;
}

.file:nth-of-type(odd)>div {
margin-bottom: 0.5rem;
padding: 0.5rem;
background-color: white;
margin-bottom: 0.5rem;
}

.file {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ export function UploadedFiles({
const { t } = useTranslation('uploadDatasetFiles')
const [selected, setSelected] = useState(new Set<FileUploadState>())
const [filesToRestrict, setFilesToRestrict] = useState<FileUploadState[]>([])
const [tagOptions, setTagOptions] = useState([t('tags.documentation'), t('tags.data'), t('tags.code')])
const [tagOptions, setTagOptions] = useState([
t('tags.documentation'),
t('tags.data'),
t('tags.code')
])
const [terms, setTerms] = useState('')
const [requestAccess, setRequestAccess] = useState(true)
const [showRestrictionModal, setShowRestrictionModal] = useState(false)
Expand Down Expand Up @@ -67,7 +71,9 @@ export function UploadedFiles({
if (res.saved) {
const filesToAddTagsTo = Array.from(selected).map((file) => {
const newTags = [...file.tags]
res.tags.forEach((t) => { if (!file.tags.some((x) => x === t)) newTags.push(t) })
res.tags.forEach((t) => {
if (!file.tags.some((x) => x === t)) newTags.push(t)
})
file.tags = newTags
return file
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,11 @@ export interface AddTagsModalResult {
tags: string[]
}

export function AddTagsModal({
show,
availableTags,
setTagOptions,
update
}: AddTagsModalProps) {
export function AddTagsModal({ show, availableTags, setTagOptions, update }: AddTagsModalProps) {
const { t } = useTranslation('uploadDatasetFiles')
const [tagsToAdd, setTagsToAdd] = useState<string[]>([])
const [tag, setTag] = useState('')
const handleClose = (saved: boolean) =>
update({ saved: saved, tags: tagsToAdd })
const handleClose = (saved: boolean) => update({ saved: saved, tags: tagsToAdd })
const addTagOption = () => {
if (tag && !availableTags.includes(tag)) {
setTagOptions([...availableTags, tag])
Expand All @@ -39,7 +33,6 @@ export function AddTagsModal({
}
}


return (
<Modal show={show} onHide={() => handleClose(false)} size="lg">
<Modal.Header>
Expand All @@ -66,7 +59,7 @@ export function AddTagsModal({
</Form.Group.Label>
<Col sm={9}>
<div className={styles.tag_info}>{t('tags.creatingNewTag')}</div>
<div className="input-group mb-3" onKeyDown={handleEnter} >
<div className="input-group mb-3" onKeyDown={handleEnter}>
<Form.Group.Input
type="text"
placeholder={t('tags.addNewTag')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ interface TagOptionsModalProps {
hide: () => void
}

export function TagOptionsModal({ availableTags, setTagOptions, show, hide }: TagOptionsModalProps) {
export function TagOptionsModal({
availableTags,
setTagOptions,
show,
hide
}: TagOptionsModalProps) {
const { t } = useTranslation('uploadDatasetFiles')
const [tag, setTag] = useState('')
const addTagOption = () => {
Expand Down

0 comments on commit f458d79

Please sign in to comment.