Merge pull request '[TEST REPORT] Đồng bộ project_id và sprint_id lên URL' (#48) from Sprint-4/MS-35-BE-Technical into master
Reviewed-on: #48
This commit is contained in:
commit
4daa37ec9f
|
|
@ -23,6 +23,7 @@ import {
|
||||||
} from '@mantine/core'
|
} from '@mantine/core'
|
||||||
import { notifications } from '@mantine/notifications'
|
import { notifications } from '@mantine/notifications'
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
|
import { useLocation, useNavigate } from 'react-router-dom'
|
||||||
import classes from './SprintReview.module.css'
|
import classes from './SprintReview.module.css'
|
||||||
|
|
||||||
type DataProject = {
|
type DataProject = {
|
||||||
|
|
@ -72,12 +73,70 @@ const SprintReview = () => {
|
||||||
const [criteriaUsers, setCriteriaUsers] = useState<DataCriteriaUsers[]>([])
|
const [criteriaUsers, setCriteriaUsers] = useState<DataCriteriaUsers[]>([])
|
||||||
const [infoBoard, setInfoBoard] = useState('')
|
const [infoBoard, setInfoBoard] = useState('')
|
||||||
const [filter, setFilter] = useState({
|
const [filter, setFilter] = useState({
|
||||||
project: '',
|
projectID: '',
|
||||||
sprint: '',
|
sprintID: '',
|
||||||
})
|
})
|
||||||
const [dataProject, setDataProject] = useState<DataProject[]>([])
|
const [dataProject, setDataProject] = useState<DataProject[]>([])
|
||||||
const [dataSprint, setDataSprint] = useState<DataSprint[]>([])
|
const [dataSprint, setDataSprint] = useState<DataSprint[]>([])
|
||||||
const [finalPoint, setFinalPoint] = useState('')
|
const [finalPoint, setFinalPoint] = useState('')
|
||||||
|
|
||||||
|
const navigate = useNavigate()
|
||||||
|
const location = useLocation()
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const searchParams = new URLSearchParams(location.search)
|
||||||
|
const allParams: { [key: string]: string } = {}
|
||||||
|
|
||||||
|
searchParams.forEach((value, key) => {
|
||||||
|
allParams[key] = value
|
||||||
|
})
|
||||||
|
|
||||||
|
const newFilter = {
|
||||||
|
projectID: allParams.projectID || '',
|
||||||
|
sprintID: allParams.sprintID || '',
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!allParams.projectID) {
|
||||||
|
searchParams.delete('sprintID')
|
||||||
|
}
|
||||||
|
|
||||||
|
setFilter(newFilter)
|
||||||
|
navigate(`?${searchParams.toString()}`)
|
||||||
|
}, [location.search]) // Mỗi khi URL thay đổi, cập nhật giá trị
|
||||||
|
|
||||||
|
const handleSelectChangeSprint = (sprintID: any) => {
|
||||||
|
const searchParams = new URLSearchParams(location.search)
|
||||||
|
if (sprintID) {
|
||||||
|
searchParams.set('sprintID', sprintID)
|
||||||
|
} else {
|
||||||
|
searchParams.delete('sprintID')
|
||||||
|
}
|
||||||
|
if (filter.projectID) {
|
||||||
|
searchParams.set('projectID', filter.projectID)
|
||||||
|
}
|
||||||
|
navigate(`?${searchParams.toString()}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleSelectChangeProject = (projectID: any) => {
|
||||||
|
if (projectID === null) {
|
||||||
|
setFilter({ projectID: '', sprintID: '' })
|
||||||
|
setInfoBoard('')
|
||||||
|
} else {
|
||||||
|
setFilter({ projectID: projectID, sprintID: '' })
|
||||||
|
}
|
||||||
|
setDataSprint([])
|
||||||
|
setIsDisabledSprint(true)
|
||||||
|
const searchParams = new URLSearchParams(location.search)
|
||||||
|
|
||||||
|
if (projectID) {
|
||||||
|
searchParams.set('projectID', projectID)
|
||||||
|
} else {
|
||||||
|
searchParams.delete('projectID')
|
||||||
|
searchParams.delete('sprintID')
|
||||||
|
}
|
||||||
|
navigate(`?${searchParams.toString()}`)
|
||||||
|
}
|
||||||
|
|
||||||
const getListDataProject = async () => {
|
const getListDataProject = async () => {
|
||||||
try {
|
try {
|
||||||
const params = {}
|
const params = {}
|
||||||
|
|
@ -156,10 +215,10 @@ const SprintReview = () => {
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (filter.project) {
|
if (filter.projectID) {
|
||||||
setLoading(true)
|
setLoading(true)
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
const result = await getBoardByIdProject(filter.project)
|
const result = await getBoardByIdProject(filter.projectID)
|
||||||
if (result.values[0]) {
|
if (result.values[0]) {
|
||||||
setInfoBoard(result.values[0].id ?? '')
|
setInfoBoard(result.values[0].id ?? '')
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
|
|
@ -170,7 +229,7 @@ const SprintReview = () => {
|
||||||
setIsDisabledSprint(true)
|
setIsDisabledSprint(true)
|
||||||
setDataSprint([])
|
setDataSprint([])
|
||||||
}
|
}
|
||||||
}, [filter.project])
|
}, [filter.projectID])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (infoBoard != '') {
|
if (infoBoard != '') {
|
||||||
|
|
@ -195,9 +254,9 @@ const SprintReview = () => {
|
||||||
setLoading(true)
|
setLoading(true)
|
||||||
setCriteriaSprint([])
|
setCriteriaSprint([])
|
||||||
setCriteriaUsers([])
|
setCriteriaUsers([])
|
||||||
if (filter.sprint) {
|
if (filter.sprintID) {
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
const result = await getListCriteriasBySprint(filter.sprint)
|
const result = await getListCriteriasBySprint(filter.sprintID)
|
||||||
if (result) {
|
if (result) {
|
||||||
setCriteriaSprint(result.criterias ?? [])
|
setCriteriaSprint(result.criterias ?? [])
|
||||||
setCriteriaUsers(result.users ?? [])
|
setCriteriaUsers(result.users ?? [])
|
||||||
|
|
@ -213,7 +272,7 @@ const SprintReview = () => {
|
||||||
|
|
||||||
const getAll = () => {
|
const getAll = () => {
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
const result = await getListCriteriasBySprint(filter.sprint)
|
const result = await getListCriteriasBySprint(filter.sprintID)
|
||||||
if (result) {
|
if (result) {
|
||||||
setCriteriaSprint(result.criterias ?? [])
|
setCriteriaSprint(result.criterias ?? [])
|
||||||
setCriteriaUsers(result.users ?? [])
|
setCriteriaUsers(result.users ?? [])
|
||||||
|
|
@ -226,24 +285,24 @@ const SprintReview = () => {
|
||||||
|
|
||||||
const handleUpdate = async () => {
|
const handleUpdate = async () => {
|
||||||
const dataSprintSearch = dataSprint.find(
|
const dataSprintSearch = dataSprint.find(
|
||||||
(item: DataSprint) => item.id == Number(filter.sprint),
|
(item: DataSprint) => item.id == Number(filter.sprintID),
|
||||||
)
|
)
|
||||||
|
|
||||||
const values = {
|
const values = {
|
||||||
name: dataSprint.find((item: any) => item.id == filter.sprint)?.name,
|
name: dataSprint.find((item: any) => item.id == filter.sprintID)?.name,
|
||||||
|
|
||||||
start_date: dataSprintSearch?.startDate,
|
start_date: dataSprintSearch?.startDate,
|
||||||
end_date: dataSprintSearch?.endDate,
|
end_date: dataSprintSearch?.endDate,
|
||||||
complete_date: dataSprintSearch?.completeDate,
|
complete_date: dataSprintSearch?.completeDate,
|
||||||
|
|
||||||
project_id: filter.project,
|
project_id: filter.projectID,
|
||||||
criterias: criteriaSprint,
|
criterias: criteriaSprint,
|
||||||
users: criteriaUsers,
|
users: criteriaUsers,
|
||||||
finalPoint: finalPoint,
|
finalPoint: finalPoint,
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const res = await update(
|
const res = await update(
|
||||||
`${updateSprintReview}/${filter.sprint}`,
|
`${updateSprintReview}/${filter.sprintID}`,
|
||||||
values,
|
values,
|
||||||
getAll,
|
getAll,
|
||||||
)
|
)
|
||||||
|
|
@ -302,7 +361,7 @@ const SprintReview = () => {
|
||||||
setAction('update')
|
setAction('update')
|
||||||
}}
|
}}
|
||||||
style={{
|
style={{
|
||||||
display: filter.sprint ? 'block' : 'none',
|
display: filter.sprintID ? 'block' : 'none',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Update
|
Update
|
||||||
|
|
@ -345,7 +404,7 @@ const SprintReview = () => {
|
||||||
searchable
|
searchable
|
||||||
clearable
|
clearable
|
||||||
w="60%"
|
w="60%"
|
||||||
value={filter.project || null}
|
value={filter.projectID || null}
|
||||||
size="xs"
|
size="xs"
|
||||||
label=""
|
label=""
|
||||||
data={dataProject.map((project) => ({
|
data={dataProject.map((project) => ({
|
||||||
|
|
@ -353,18 +412,7 @@ const SprintReview = () => {
|
||||||
label: project.name,
|
label: project.name,
|
||||||
}))}
|
}))}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
if (e === null) {
|
handleSelectChangeProject(e)
|
||||||
// Clear project
|
|
||||||
setFilter({ project: '', sprint: '' }) // Clear cả project và sprint
|
|
||||||
setDataSprint([]) // Reset dataSprint để không hiển thị các giá trị sprint cũ
|
|
||||||
setInfoBoard('')
|
|
||||||
setIsDisabledSprint(true) // Vô hiệu hóa Select của sprint
|
|
||||||
} else {
|
|
||||||
// Chọn project mới
|
|
||||||
setFilter({ project: e, sprint: '' }) // Clear sprint khi chọn project mới
|
|
||||||
setDataSprint([]) // Xóa dữ liệu sprint khi đổi project
|
|
||||||
setIsDisabledSprint(true) // Vô hiệu hóa lại Select sprint cho đến khi load xong
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
></Select>
|
></Select>
|
||||||
<Text
|
<Text
|
||||||
|
|
@ -380,7 +428,7 @@ const SprintReview = () => {
|
||||||
searchable
|
searchable
|
||||||
clearable
|
clearable
|
||||||
w="40%"
|
w="40%"
|
||||||
value={filter.sprint || null} // Đảm bảo rằng nếu filter.sprint trống, thì giá trị sẽ là null
|
value={filter.sprintID || null} // Đảm bảo rằng nếu filter.sprint trống, thì giá trị sẽ là null
|
||||||
size="xs"
|
size="xs"
|
||||||
ml={'sm'}
|
ml={'sm'}
|
||||||
label=""
|
label=""
|
||||||
|
|
@ -389,7 +437,8 @@ const SprintReview = () => {
|
||||||
label: sprint.name,
|
label: sprint.name,
|
||||||
}))}
|
}))}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setFilter({ ...filter, sprint: e! })
|
setFilter({ ...filter, sprintID: e! })
|
||||||
|
handleSelectChangeSprint(e) // Gọi hàm để cập nhật URL với sprintID
|
||||||
}}
|
}}
|
||||||
></Select>
|
></Select>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
@ -404,12 +453,18 @@ const SprintReview = () => {
|
||||||
w={'50%'}
|
w={'50%'}
|
||||||
>
|
>
|
||||||
<Text style={{ textAlign: 'center' }} fw={600}>
|
<Text style={{ textAlign: 'center' }} fw={600}>
|
||||||
{dataProject.find((item: any) => item.id === filter.project)?.name}{' '}
|
{
|
||||||
{dataSprint.find((item: any) => item.id === Number(filter.sprint))
|
dataProject.find((item: any) => item.id === filter.projectID)
|
||||||
|
?.name
|
||||||
|
}{' '}
|
||||||
|
{dataSprint.find((item: any) => item.id === Number(filter.sprintID))
|
||||||
?.name
|
?.name
|
||||||
? '/'
|
? '/'
|
||||||
: ''}{' '}
|
: ''}{' '}
|
||||||
{dataSprint.find((item) => item.id === Number(filter.sprint))?.name}
|
{
|
||||||
|
dataSprint.find((item) => item.id === Number(filter.sprintID))
|
||||||
|
?.name
|
||||||
|
}
|
||||||
</Text>
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ import { useForm } from '@mantine/form'
|
||||||
import { notifications } from '@mantine/notifications'
|
import { notifications } from '@mantine/notifications'
|
||||||
import { IconInfoSquare, IconSquareXFilled } from '@tabler/icons-react'
|
import { IconInfoSquare, IconSquareXFilled } from '@tabler/icons-react'
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
|
import { useLocation, useNavigate } from 'react-router-dom'
|
||||||
import classes from './TestReport.module.css'
|
import classes from './TestReport.module.css'
|
||||||
|
|
||||||
type DataProject = {
|
type DataProject = {
|
||||||
|
|
@ -79,14 +80,69 @@ const TestReport = () => {
|
||||||
const [isDisabledSprint, setIsDisabledSprint] = useState(true)
|
const [isDisabledSprint, setIsDisabledSprint] = useState(true)
|
||||||
const [infoBoard, setInfoBoard] = useState('')
|
const [infoBoard, setInfoBoard] = useState('')
|
||||||
const [filter, setFilter] = useState({
|
const [filter, setFilter] = useState({
|
||||||
project: '',
|
projectID: '',
|
||||||
sprint: '',
|
sprintID: '',
|
||||||
})
|
})
|
||||||
const [dataProject, setDataProject] = useState<DataProject[]>([])
|
const [dataProject, setDataProject] = useState<DataProject[]>([])
|
||||||
const [dataSprint, setDataSprint] = useState<DataSprint[]>([])
|
const [dataSprint, setDataSprint] = useState<DataSprint[]>([])
|
||||||
|
|
||||||
const [dataListTestCases, setDataListTestCases] = useState<any[]>([])
|
const [dataListTestCases, setDataListTestCases] = useState<any[]>([])
|
||||||
|
|
||||||
|
const navigate = useNavigate()
|
||||||
|
const location = useLocation()
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const searchParams = new URLSearchParams(location.search)
|
||||||
|
const allParams: { [key: string]: string } = {}
|
||||||
|
|
||||||
|
searchParams.forEach((value, key) => {
|
||||||
|
allParams[key] = value
|
||||||
|
})
|
||||||
|
|
||||||
|
const newFilter = {
|
||||||
|
projectID: allParams.projectID || '',
|
||||||
|
sprintID: allParams.sprintID || '',
|
||||||
|
}
|
||||||
|
setFilter(newFilter)
|
||||||
|
if (!allParams.projectID) {
|
||||||
|
searchParams.delete('sprintID')
|
||||||
|
}
|
||||||
|
navigate(`?${searchParams.toString()}`)
|
||||||
|
}, [location.search]) // Mỗi khi URL thay đổi, cập nhật giá trị
|
||||||
|
|
||||||
|
const handleSelectChangeSprint = (sprintID: any) => {
|
||||||
|
const searchParams = new URLSearchParams(location.search)
|
||||||
|
if (sprintID) {
|
||||||
|
searchParams.set('sprintID', sprintID)
|
||||||
|
} else {
|
||||||
|
searchParams.delete('sprintID')
|
||||||
|
}
|
||||||
|
if (filter.projectID) {
|
||||||
|
searchParams.set('projectID', filter.projectID)
|
||||||
|
}
|
||||||
|
navigate(`?${searchParams.toString()}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleSelectChangeProject = (projectID: any) => {
|
||||||
|
if (projectID === null) {
|
||||||
|
setFilter({ projectID: '', sprintID: '' })
|
||||||
|
setInfoBoard('')
|
||||||
|
} else {
|
||||||
|
setFilter({ projectID: projectID, sprintID: '' })
|
||||||
|
}
|
||||||
|
setDataSprint([])
|
||||||
|
setIsDisabledSprint(true)
|
||||||
|
const searchParams = new URLSearchParams(location.search)
|
||||||
|
|
||||||
|
if (projectID) {
|
||||||
|
searchParams.set('projectID', projectID)
|
||||||
|
} else {
|
||||||
|
searchParams.delete('projectID')
|
||||||
|
searchParams.delete('sprintID')
|
||||||
|
}
|
||||||
|
navigate(`?${searchParams.toString()}`)
|
||||||
|
}
|
||||||
|
|
||||||
const getListDataProject = async () => {
|
const getListDataProject = async () => {
|
||||||
try {
|
try {
|
||||||
const params = {}
|
const params = {}
|
||||||
|
|
@ -165,10 +221,10 @@ const TestReport = () => {
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (filter.project) {
|
if (filter.projectID) {
|
||||||
setLoading(true)
|
setLoading(true)
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
const result = await getBoardByIdProject(filter.project)
|
const result = await getBoardByIdProject(filter.projectID)
|
||||||
if (result.values[0]) {
|
if (result.values[0]) {
|
||||||
setInfoBoard(result.values[0].id ?? '')
|
setInfoBoard(result.values[0].id ?? '')
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
|
|
@ -180,7 +236,7 @@ const TestReport = () => {
|
||||||
setDataSprint([])
|
setDataSprint([])
|
||||||
setInfoBoard('')
|
setInfoBoard('')
|
||||||
}
|
}
|
||||||
}, [filter.project])
|
}, [filter.projectID])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (infoBoard != '') {
|
if (infoBoard != '') {
|
||||||
|
|
@ -204,9 +260,9 @@ const TestReport = () => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setLoading(true)
|
setLoading(true)
|
||||||
setDataListTestCases([])
|
setDataListTestCases([])
|
||||||
if (filter.sprint) {
|
if (filter.sprintID) {
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
const result = await getListTestCase(filter.sprint)
|
const result = await getListTestCase(filter.sprintID)
|
||||||
if (result) {
|
if (result) {
|
||||||
setDataListTestCases(result ?? [])
|
setDataListTestCases(result ?? [])
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
|
|
@ -234,17 +290,17 @@ const TestReport = () => {
|
||||||
const handleCreate = async (values: DataTestCases) => {
|
const handleCreate = async (values: DataTestCases) => {
|
||||||
try {
|
try {
|
||||||
const dataSprintSearch = dataSprint.find(
|
const dataSprintSearch = dataSprint.find(
|
||||||
(item: DataSprint) => item.id == Number(filter.sprint),
|
(item: DataSprint) => item.id == Number(filter.sprintID),
|
||||||
)
|
)
|
||||||
const { ...data } = values
|
const { ...data } = values
|
||||||
data.sprint_name = dataSprintSearch?.name
|
data.sprint_name = dataSprintSearch?.name
|
||||||
data.project_id = filter.project
|
data.project_id = filter.projectID
|
||||||
data.start_date = dataSprintSearch?.startDate
|
data.start_date = dataSprintSearch?.startDate
|
||||||
data.end_date = dataSprintSearch?.endDate
|
data.end_date = dataSprintSearch?.endDate
|
||||||
data.complete_date = dataSprintSearch?.completeDate
|
data.complete_date = dataSprintSearch?.completeDate
|
||||||
delete data.id
|
delete data.id
|
||||||
|
|
||||||
const res = await post(`${createTestCase}/${filter.sprint}`, data)
|
const res = await post(`${createTestCase}/${filter.sprintID}`, data)
|
||||||
if (res.status === true) {
|
if (res.status === true) {
|
||||||
setAction('')
|
setAction('')
|
||||||
form.reset()
|
form.reset()
|
||||||
|
|
@ -262,7 +318,7 @@ const TestReport = () => {
|
||||||
|
|
||||||
const getAll = async () => {
|
const getAll = async () => {
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
const result = await getListTestCase(filter.sprint)
|
const result = await getListTestCase(filter.sprintID)
|
||||||
if (result) {
|
if (result) {
|
||||||
setDataListTestCases(result ?? [])
|
setDataListTestCases(result ?? [])
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
|
|
@ -296,7 +352,7 @@ const TestReport = () => {
|
||||||
form.reset()
|
form.reset()
|
||||||
}}
|
}}
|
||||||
style={{
|
style={{
|
||||||
display: filter.sprint ? 'block' : 'none',
|
display: filter.sprintID && filter.projectID ? 'block' : 'none',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
+ Add
|
+ Add
|
||||||
|
|
@ -339,7 +395,7 @@ const TestReport = () => {
|
||||||
searchable
|
searchable
|
||||||
clearable
|
clearable
|
||||||
w="60%"
|
w="60%"
|
||||||
value={filter.project || null}
|
value={filter.projectID || null}
|
||||||
size="xs"
|
size="xs"
|
||||||
label=""
|
label=""
|
||||||
data={dataProject.map((project) => ({
|
data={dataProject.map((project) => ({
|
||||||
|
|
@ -347,18 +403,7 @@ const TestReport = () => {
|
||||||
label: project.name,
|
label: project.name,
|
||||||
}))}
|
}))}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
if (e === null) {
|
handleSelectChangeProject(e)
|
||||||
// Clear project
|
|
||||||
setFilter({ project: '', sprint: '' }) // Clear cả project và sprint
|
|
||||||
setDataSprint([]) // Reset dataSprint để không hiển thị các giá trị sprint cũ
|
|
||||||
setInfoBoard('')
|
|
||||||
setIsDisabledSprint(true) // Vô hiệu hóa Select của sprint
|
|
||||||
} else {
|
|
||||||
// Chọn project mới
|
|
||||||
setFilter({ project: e, sprint: '' }) // Clear sprint khi chọn project mới
|
|
||||||
setDataSprint([]) // Xóa dữ liệu sprint khi đổi project
|
|
||||||
setIsDisabledSprint(true) // Vô hiệu hóa lại Select sprint cho đến khi load xong
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
></Select>
|
></Select>
|
||||||
<Text
|
<Text
|
||||||
|
|
@ -374,7 +419,7 @@ const TestReport = () => {
|
||||||
searchable
|
searchable
|
||||||
clearable
|
clearable
|
||||||
w="40%"
|
w="40%"
|
||||||
value={filter.sprint || null} // Đảm bảo rằng nếu filter.sprint trống, thì giá trị sẽ là null
|
value={filter.sprintID || null} // Đảm bảo rằng nếu filter.sprintID trống, thì giá trị sẽ là null
|
||||||
size="xs"
|
size="xs"
|
||||||
ml={'sm'}
|
ml={'sm'}
|
||||||
label=""
|
label=""
|
||||||
|
|
@ -383,7 +428,8 @@ const TestReport = () => {
|
||||||
label: sprint.name,
|
label: sprint.name,
|
||||||
}))}
|
}))}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setFilter({ ...filter, sprint: e! })
|
setFilter({ ...filter, sprintID: e! })
|
||||||
|
handleSelectChangeSprint(e) // Gọi hàm để cập nhật URL với sprintID
|
||||||
}}
|
}}
|
||||||
></Select>
|
></Select>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
@ -398,12 +444,18 @@ const TestReport = () => {
|
||||||
w={'50%'}
|
w={'50%'}
|
||||||
>
|
>
|
||||||
<Text style={{ textAlign: 'center' }} fw={600}>
|
<Text style={{ textAlign: 'center' }} fw={600}>
|
||||||
{dataProject.find((item: any) => item.id === filter.project)?.name}{' '}
|
{
|
||||||
{dataSprint.find((item: any) => item.id === Number(filter.sprint))
|
dataProject.find((item: any) => item.id === filter.projectID)
|
||||||
|
?.name
|
||||||
|
}{' '}
|
||||||
|
{dataSprint.find((item: any) => item.id === Number(filter.sprintID))
|
||||||
?.name
|
?.name
|
||||||
? '/'
|
? '/'
|
||||||
: ''}{' '}
|
: ''}{' '}
|
||||||
{dataSprint.find((item) => item.id === Number(filter.sprint))?.name}
|
{
|
||||||
|
dataSprint.find((item) => item.id === Number(filter.sprintID))
|
||||||
|
?.name
|
||||||
|
}
|
||||||
</Text>
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
@ -421,7 +473,13 @@ const TestReport = () => {
|
||||||
Loading . . .
|
Loading . . .
|
||||||
</Text>
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box style={loading || !filter.sprint ? { display: 'none' } : {}}>
|
<Box
|
||||||
|
style={
|
||||||
|
loading || !filter.sprintID || !filter.projectID
|
||||||
|
? { display: 'none' }
|
||||||
|
: {}
|
||||||
|
}
|
||||||
|
>
|
||||||
{/* Tiêu đề Criteria for Sprint */}
|
{/* Tiêu đề Criteria for Sprint */}
|
||||||
<Title order={5} ml="xs">
|
<Title order={5} ml="xs">
|
||||||
List bug:
|
List bug:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue