Centrale Refactor Big
This commit is contained in:
parent
06f5560d27
commit
818a96d0a0
@ -578,73 +578,104 @@ export default function MissionDetailPage() {
|
||||
<div className="bg-white rounded-lg shadow-sm border border-gray-100 p-6">
|
||||
<h2 className="text-xl font-semibold text-gray-800 mb-4">Ressources Métiers</h2>
|
||||
<div className="space-y-3">
|
||||
{mission.rocketChatChannelId && (
|
||||
<a
|
||||
href={mission.rocketChatChannelId}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-center gap-3 p-3 bg-blue-50 rounded-lg border border-blue-100 hover:bg-blue-100 transition-colors cursor-pointer"
|
||||
>
|
||||
<div className="w-10 h-10 bg-blue-100 rounded-full flex items-center justify-center">
|
||||
<Users className="h-5 w-5 text-blue-600" />
|
||||
</div>
|
||||
<div className="flex-1">
|
||||
<p className="font-medium text-gray-900">Espace de discussion</p>
|
||||
<p className="text-sm text-gray-500">RocketChat</p>
|
||||
</div>
|
||||
</a>
|
||||
)}
|
||||
{mission.rocketChatChannelId && (() => {
|
||||
// Build RocketChat URL: parole.slm-lab.net/channel/[channelId]
|
||||
// If it's already a full URL, use it; otherwise build from ID
|
||||
const rocketChatUrl = mission.rocketChatChannelId.startsWith('http')
|
||||
? mission.rocketChatChannelId
|
||||
: `https://parole.slm-lab.net/channel/${mission.rocketChatChannelId}`;
|
||||
|
||||
return (
|
||||
<a
|
||||
href={rocketChatUrl}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-center gap-3 p-3 bg-blue-50 rounded-lg border border-blue-100 hover:bg-blue-100 transition-colors cursor-pointer"
|
||||
>
|
||||
<div className="w-10 h-10 bg-blue-100 rounded-full flex items-center justify-center">
|
||||
<Users className="h-5 w-5 text-blue-600" />
|
||||
</div>
|
||||
<div className="flex-1">
|
||||
<p className="font-medium text-gray-900">Tenant de Parole</p>
|
||||
<p className="text-sm text-gray-500">Espace de discussion</p>
|
||||
</div>
|
||||
</a>
|
||||
);
|
||||
})()}
|
||||
|
||||
{mission.outlineCollectionId && (
|
||||
<a
|
||||
href={mission.outlineCollectionId}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-center gap-3 p-3 bg-purple-50 rounded-lg border border-purple-100 hover:bg-purple-100 transition-colors cursor-pointer"
|
||||
>
|
||||
<div className="w-10 h-10 bg-purple-100 rounded-full flex items-center justify-center">
|
||||
<FileText className="h-5 w-5 text-purple-600" />
|
||||
</div>
|
||||
<div className="flex-1">
|
||||
<p className="font-medium text-gray-900">Espace de documentation</p>
|
||||
<p className="text-sm text-gray-500">Outline</p>
|
||||
</div>
|
||||
</a>
|
||||
)}
|
||||
{mission.outlineCollectionId && (() => {
|
||||
// Build Outline URL: chapitre.slm-lab.net/collection/[collectionId]
|
||||
// If it's already a full URL, use it; otherwise build from ID
|
||||
const outlineUrl = mission.outlineCollectionId.startsWith('http')
|
||||
? mission.outlineCollectionId
|
||||
: `https://chapitre.slm-lab.net/collection/${mission.outlineCollectionId}`;
|
||||
|
||||
return (
|
||||
<a
|
||||
href={outlineUrl}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-center gap-3 p-3 bg-purple-50 rounded-lg border border-purple-100 hover:bg-purple-100 transition-colors cursor-pointer"
|
||||
>
|
||||
<div className="w-10 h-10 bg-purple-100 rounded-full flex items-center justify-center">
|
||||
<FileText className="h-5 w-5 text-purple-600" />
|
||||
</div>
|
||||
<div className="flex-1">
|
||||
<p className="font-medium text-gray-900">Tenant du Chapitre</p>
|
||||
<p className="text-sm text-gray-500">Espace de documentation</p>
|
||||
</div>
|
||||
</a>
|
||||
);
|
||||
})()}
|
||||
|
||||
{mission.giteaRepositoryUrl && (
|
||||
<a
|
||||
href={mission.giteaRepositoryUrl}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-center gap-3 p-3 bg-green-50 rounded-lg border border-green-100 hover:bg-green-100 transition-colors cursor-pointer"
|
||||
>
|
||||
<div className="w-10 h-10 bg-green-100 rounded-full flex items-center justify-center">
|
||||
<FileIcon className="h-5 w-5 text-green-600" />
|
||||
</div>
|
||||
<div className="flex-1">
|
||||
<p className="font-medium text-gray-900">Espace pour les codes sources</p>
|
||||
<p className="text-sm text-gray-500">Gitea</p>
|
||||
</div>
|
||||
</a>
|
||||
)}
|
||||
{mission.giteaRepositoryUrl && (() => {
|
||||
// Gitea URL should already be a full URL, but handle both cases
|
||||
const giteaUrl = mission.giteaRepositoryUrl.startsWith('http')
|
||||
? mission.giteaRepositoryUrl
|
||||
: `https://gite.slm-lab.net/${mission.giteaRepositoryUrl}`;
|
||||
|
||||
return (
|
||||
<a
|
||||
href={giteaUrl}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-center gap-3 p-3 bg-green-50 rounded-lg border border-green-100 hover:bg-green-100 transition-colors cursor-pointer"
|
||||
>
|
||||
<div className="w-10 h-10 bg-green-100 rounded-full flex items-center justify-center">
|
||||
<FileIcon className="h-5 w-5 text-green-600" />
|
||||
</div>
|
||||
<div className="flex-1">
|
||||
<p className="font-medium text-gray-900">Tenant du Code</p>
|
||||
<p className="text-sm text-gray-500">Espace pour les codes sources</p>
|
||||
</div>
|
||||
</a>
|
||||
);
|
||||
})()}
|
||||
|
||||
{mission.leantimeProjectId && (
|
||||
<a
|
||||
href={mission.leantimeProjectId.startsWith('http') ? mission.leantimeProjectId : `https://agilite.slm-lab.net/projects/showProject/${mission.leantimeProjectId}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-center gap-3 p-3 bg-amber-50 rounded-lg border border-amber-100 hover:bg-amber-100 transition-colors cursor-pointer"
|
||||
>
|
||||
<div className="w-10 h-10 bg-amber-100 rounded-full flex items-center justify-center">
|
||||
<Calendar className="h-5 w-5 text-amber-600" />
|
||||
</div>
|
||||
<div className="flex-1">
|
||||
<p className="font-medium text-gray-900">Espace d'organisation</p>
|
||||
<p className="text-sm text-gray-500">Leantime</p>
|
||||
</div>
|
||||
</a>
|
||||
)}
|
||||
{mission.leantimeProjectId && (() => {
|
||||
// Build Leantime URL: agilite.slm-lab.net/projects/showProject/[projectId]
|
||||
// If it's already a full URL, use it; otherwise build from ID
|
||||
const leantimeUrl = mission.leantimeProjectId.startsWith('http')
|
||||
? mission.leantimeProjectId
|
||||
: `https://agilite.slm-lab.net/projects/showProject/${mission.leantimeProjectId}`;
|
||||
|
||||
return (
|
||||
<a
|
||||
href={leantimeUrl}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-center gap-3 p-3 bg-amber-50 rounded-lg border border-amber-100 hover:bg-amber-100 transition-colors cursor-pointer"
|
||||
>
|
||||
<div className="w-10 h-10 bg-amber-100 rounded-full flex items-center justify-center">
|
||||
<Calendar className="h-5 w-5 text-amber-600" />
|
||||
</div>
|
||||
<div className="flex-1">
|
||||
<p className="font-medium text-gray-900">Tenant des Devoirs</p>
|
||||
<p className="text-sm text-gray-500">Espace d'organisation</p>
|
||||
</div>
|
||||
</a>
|
||||
);
|
||||
})()}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user