Pages corrections pages missions
This commit is contained in:
parent
312ed5894d
commit
b543c87e42
@ -1078,18 +1078,10 @@ export default function CarnetPage() {
|
|||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
) : selectedFolder === 'Missions' ? (
|
) : selectedFolder === 'Missions' ? (
|
||||||
selectedMission ? (
|
<MissionsView
|
||||||
<MissionFilesView
|
onMissionSelect={handleMissionSelect}
|
||||||
missionId={selectedMission.id}
|
selectedMissionId={selectedMission?.id}
|
||||||
onFileSelect={handleMissionFileSelect}
|
/>
|
||||||
selectedFileKey={selectedMissionFile?.key}
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<MissionsView
|
|
||||||
onMissionSelect={handleMissionSelect}
|
|
||||||
selectedMissionId={selectedMission?.id}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
) : (
|
) : (
|
||||||
<NotesView
|
<NotesView
|
||||||
notes={notes}
|
notes={notes}
|
||||||
@ -1127,22 +1119,39 @@ export default function CarnetPage() {
|
|||||||
onSave={handleContactSave}
|
onSave={handleContactSave}
|
||||||
onDelete={handleContactDelete}
|
onDelete={handleContactDelete}
|
||||||
/>
|
/>
|
||||||
) : selectedFolder === 'Missions' && selectedMissionFile ? (
|
) : selectedFolder === 'Missions' ? (
|
||||||
<Editor
|
selectedMission ? (
|
||||||
note={{
|
selectedMissionFile ? (
|
||||||
id: selectedMissionFile.key,
|
<Editor
|
||||||
title: selectedMissionFile.key.split('/').pop() || 'Fichier',
|
note={{
|
||||||
content: selectedMissionFile.content,
|
id: selectedMissionFile.key,
|
||||||
lastModified: new Date().toISOString(),
|
title: selectedMissionFile.key.split('/').pop() || 'Fichier',
|
||||||
type: 'file',
|
content: selectedMissionFile.content,
|
||||||
mime: 'text/plain',
|
lastModified: new Date().toISOString(),
|
||||||
etag: ''
|
type: 'file',
|
||||||
}}
|
mime: 'text/plain',
|
||||||
onSave={async (note) => {
|
etag: ''
|
||||||
await handleMissionFileSave(note.content);
|
}}
|
||||||
}}
|
onSave={async (note) => {
|
||||||
currentFolder="Missions"
|
await handleMissionFileSave(note.content);
|
||||||
/>
|
}}
|
||||||
|
currentFolder="Missions"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<MissionFilesView
|
||||||
|
missionId={selectedMission.id}
|
||||||
|
onFileSelect={handleMissionFileSelect}
|
||||||
|
selectedFileKey={selectedMissionFile?.key}
|
||||||
|
initialPath="attachments"
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
) : (
|
||||||
|
<div className="flex items-center justify-center h-full">
|
||||||
|
<div className="text-center">
|
||||||
|
<p className="text-carnet-text-muted">Sélectionnez une mission</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
) : (
|
) : (
|
||||||
<Editor
|
<Editor
|
||||||
note={selectedNote}
|
note={selectedNote}
|
||||||
|
|||||||
@ -16,15 +16,17 @@ interface MissionFilesViewProps {
|
|||||||
missionId: string;
|
missionId: string;
|
||||||
onFileSelect: (file: MissionFile) => void;
|
onFileSelect: (file: MissionFile) => void;
|
||||||
selectedFileKey?: string;
|
selectedFileKey?: string;
|
||||||
|
initialPath?: string; // Optional initial path (e.g., "attachments")
|
||||||
}
|
}
|
||||||
|
|
||||||
export const MissionFilesView: React.FC<MissionFilesViewProps> = ({
|
export const MissionFilesView: React.FC<MissionFilesViewProps> = ({
|
||||||
missionId,
|
missionId,
|
||||||
onFileSelect,
|
onFileSelect,
|
||||||
selectedFileKey
|
selectedFileKey,
|
||||||
|
initialPath = 'attachments' // Default to attachments folder
|
||||||
}) => {
|
}) => {
|
||||||
const [files, setFiles] = useState<MissionFile[]>([]);
|
const [files, setFiles] = useState<MissionFile[]>([]);
|
||||||
const [currentPath, setCurrentPath] = useState<string>('');
|
const [currentPath, setCurrentPath] = useState<string>(initialPath);
|
||||||
const [isLoading, setIsLoading] = useState(true);
|
const [isLoading, setIsLoading] = useState(true);
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user