refactor: simplify upload rules and remove destination flow
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
interface ActionButtonsProps {
|
||||
isUploading: boolean
|
||||
isSecretEmpty: boolean
|
||||
noDestination: boolean
|
||||
hasPendingOrErrors: boolean
|
||||
allDone: boolean
|
||||
hasErrors: boolean
|
||||
@@ -13,7 +12,6 @@ interface ActionButtonsProps {
|
||||
export default function ActionButtons({
|
||||
isUploading,
|
||||
isSecretEmpty,
|
||||
noDestination,
|
||||
hasPendingOrErrors,
|
||||
allDone,
|
||||
hasErrors,
|
||||
@@ -21,7 +19,7 @@ export default function ActionButtons({
|
||||
onCancel,
|
||||
onReset,
|
||||
}: ActionButtonsProps) {
|
||||
const cantUpload = isSecretEmpty || noDestination
|
||||
const cantUpload = isSecretEmpty
|
||||
|
||||
return (
|
||||
<div className="flex gap-3">
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
import { DESTINATIONS } from '@/lib/constants'
|
||||
import type { Destination } from '@/lib/constants'
|
||||
|
||||
interface DestinationPickerProps {
|
||||
destination: Destination | null
|
||||
disabled: boolean
|
||||
onChange: (value: Destination) => void
|
||||
}
|
||||
|
||||
export default function DestinationPicker({
|
||||
destination,
|
||||
disabled,
|
||||
onChange,
|
||||
}: DestinationPickerProps) {
|
||||
return (
|
||||
<div className="space-y-1.5">
|
||||
<label className="block text-sm font-medium text-gray-300">Destination</label>
|
||||
<div className="grid grid-cols-3 gap-2">
|
||||
{DESTINATIONS.map((dest) => (
|
||||
<button
|
||||
key={dest.value}
|
||||
type="button"
|
||||
onClick={() => onChange(dest.value)}
|
||||
disabled={disabled}
|
||||
className={`px-3 py-2 rounded-xl text-sm font-medium transition-all duration-150 border
|
||||
disabled:opacity-50 disabled:cursor-not-allowed
|
||||
${destination === dest.value
|
||||
? 'bg-white text-[#000000] border-white'
|
||||
: 'bg-black-800 text-gray-400 border-white/20 hover:border-white/40 hover:text-gray-200'
|
||||
}`}
|
||||
>
|
||||
{dest.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -170,10 +170,6 @@ export default function FolderDropzone({
|
||||
Deposez votre dossier ici
|
||||
<span className="text-gray-500 font-normal"> ou cliquez pour parcourir</span>
|
||||
</p>
|
||||
<p className="text-xs text-gray-500 mt-1">
|
||||
Contenu attendu : model.glb/gltf + textures (roughness, normal, metalness, color, displace)
|
||||
<br />Les originaux sont archives sur le Drive, les comprimes sont envoyes sur Git.
|
||||
</p>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
|
||||
@@ -2,14 +2,12 @@ import Modal, { ModalActions } from '@/components/ui/Modal'
|
||||
import { CheckIcon } from '@/components/ui/icons'
|
||||
|
||||
interface NoChangesModalProps {
|
||||
destination: string
|
||||
folderName: string
|
||||
onCancel: () => void
|
||||
onModify: () => void
|
||||
}
|
||||
|
||||
export default function NoChangesModal({
|
||||
destination,
|
||||
folderName,
|
||||
onCancel,
|
||||
onModify,
|
||||
@@ -25,7 +23,7 @@ export default function NoChangesModal({
|
||||
Aucun changement detecte
|
||||
</h3>
|
||||
<p className="text-xs text-gray-400 mt-0.5">
|
||||
Le dossier <span className="font-mono text-gray-300">{destination}/{folderName}</span> est identique au contenu distant. Rien a envoyer.
|
||||
Le dossier <span className="font-mono text-gray-300">public/models/{folderName}</span> est identique au contenu distant. Rien a envoyer.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,6 @@ import Modal, { ModalActions } from '@/components/ui/Modal'
|
||||
import { WarningIcon } from '@/components/ui/icons'
|
||||
|
||||
interface OverwriteConfirmModalProps {
|
||||
destination: string
|
||||
folderName: string
|
||||
diffs: FileDiff[]
|
||||
onCancel: () => void
|
||||
@@ -11,7 +10,6 @@ interface OverwriteConfirmModalProps {
|
||||
}
|
||||
|
||||
export default function OverwriteConfirmModal({
|
||||
destination,
|
||||
folderName,
|
||||
diffs,
|
||||
onCancel,
|
||||
@@ -28,7 +26,7 @@ export default function OverwriteConfirmModal({
|
||||
Dossier deja existant
|
||||
</h3>
|
||||
<p className="text-xs text-gray-400 mt-0.5">
|
||||
<span className="font-mono text-yellow-400">{destination}/{folderName}</span> existe deja.
|
||||
<span className="font-mono text-yellow-400">public/models/{folderName}</span> existe deja.
|
||||
Les anciens fichiers seront archives sur le Drive, puis les nouveaux seront envoyes sur le Drive et Git.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user