feat: nuevo ticket siempre con prioridad media, sin consejos
This commit is contained in:
1 parent
baef1cc5d6
commit
dedab95cc5
1 file changed
+18
-52
@@ -12,7 +12,6 @@ export default function NewTicketPage() {
|
|||||||
|
|
||||||
const [title, setTitle] = useState("");
|
const [title, setTitle] = useState("");
|
||||||
const [description, setDescription] = useState("");
|
const [description, setDescription] = useState("");
|
||||||
const [priority, setPriority] = useState("Medium");
|
|
||||||
const [groups, setGroups] = useState<Group[]>([]);
|
const [groups, setGroups] = useState<Group[]>([]);
|
||||||
const [groupId, setGroupId] = useState("");
|
const [groupId, setGroupId] = useState("");
|
||||||
|
|
||||||
@@ -29,7 +28,8 @@ export default function NewTicketPage() {
|
|||||||
}
|
}
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
const result = await createTicket({ title, description, priority, groupId: Number(groupId) });
|
// La prioridad siempre es Media al crear: la ajusta el equipo después.
|
||||||
|
const result = await createTicket({ title, description, priority: "Medium", groupId: Number(groupId) });
|
||||||
router.push(`/tickets/${result.id}`);
|
router.push(`/tickets/${result.id}`);
|
||||||
} catch (err: unknown) {
|
} catch (err: unknown) {
|
||||||
setError(err instanceof Error ? err.message : "Error al crear el ticket");
|
setError(err instanceof Error ? err.message : "Error al crear el ticket");
|
||||||
@@ -50,7 +50,7 @@ export default function NewTicketPage() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col-lg-8">
|
<div className="col-12">
|
||||||
<div className="card">
|
<div className="card">
|
||||||
<div className="card-body p-4">
|
<div className="card-body p-4">
|
||||||
{error && (
|
{error && (
|
||||||
@@ -86,37 +86,21 @@ export default function NewTicketPage() {
|
|||||||
></textarea>
|
></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="row">
|
<div className="mb-4">
|
||||||
<div className="col-md-6 mb-4">
|
<label className="form-label fw-semibold">Departamento</label>
|
||||||
<label className="form-label fw-semibold">Departamento</label>
|
<select
|
||||||
<select
|
className="form-select"
|
||||||
className="form-select"
|
value={groupId}
|
||||||
value={groupId}
|
onChange={(e) => setGroupId(e.target.value)}
|
||||||
onChange={(e) => setGroupId(e.target.value)}
|
required
|
||||||
required
|
>
|
||||||
>
|
<option value="">Seleccionar departamento...</option>
|
||||||
<option value="">Seleccionar departamento...</option>
|
{groups.map((g) => (
|
||||||
{groups.map((g) => (
|
<option key={g.id} value={g.id}>
|
||||||
<option key={g.id} value={g.id}>
|
{g.name}
|
||||||
{g.name}
|
</option>
|
||||||
</option>
|
))}
|
||||||
))}
|
</select>
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="col-md-6 mb-4">
|
|
||||||
<label className="form-label fw-semibold">Prioridad</label>
|
|
||||||
<select
|
|
||||||
className="form-select"
|
|
||||||
value={priority}
|
|
||||||
onChange={(e) => setPriority(e.target.value)}
|
|
||||||
>
|
|
||||||
<option value="Low">Baja</option>
|
|
||||||
<option value="Medium">Media</option>
|
|
||||||
<option value="High">Alta</option>
|
|
||||||
<option value="Critical">Crítica</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="d-flex gap-2">
|
<div className="d-flex gap-2">
|
||||||
@@ -145,24 +129,6 @@ export default function NewTicketPage() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Tips */}
|
|
||||||
<div className="col-lg-4">
|
|
||||||
<div className="card">
|
|
||||||
<div className="card-body">
|
|
||||||
<h6 className="d-flex align-items-center gap-2 mb-3">
|
|
||||||
<i className="bi bi-lightbulb" style={{ color: "#ffc107" }}></i>
|
|
||||||
Consejos
|
|
||||||
</h6>
|
|
||||||
<ul className="mb-0" style={{ fontSize: "0.85rem", lineHeight: 1.7 }}>
|
|
||||||
<li>Sé específico en el asunto del ticket</li>
|
|
||||||
<li>Incluye pasos para reproducir el problema</li>
|
|
||||||
<li>Adjunta capturas de pantalla si es posible</li>
|
|
||||||
<li>Asigna la prioridad adecuada según el impacto</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user