Merge pull request 'hiệu chỉnh flow get data project, sprint' (#33) from Sprint-3/MS-23 into master

Reviewed-on: #33
This commit is contained in:
vincent.vo 2024-09-18 18:26:25 +10:00
commit f68fe91071
4 changed files with 41 additions and 18 deletions

View File

@ -144,7 +144,7 @@
padding-left: 5px;
padding-top: 5px;
padding-bottom: 5px;
margin-left: 20px;
/* margin-left: 20px; */
transition: background-color 0.3s;
}
@ -153,7 +153,7 @@
}
.criteriaTable {
padding-left: 55px; /* Further indentation for the criteria table */
padding-left: 35px; /* Further indentation for the criteria table */
}
.link {

View File

@ -44,18 +44,22 @@ const CriteriaTable = ({ data }: { data: TableRow[] }) => (
<Table striped highlightOnHover withTableBorder withColumnBorders>
<Table.Thead>
<Table.Tr bg="#228be66b">
<Table.Th style={{ textAlign: 'center' }}>Criteria</Table.Th>
<Table.Th style={{ textAlign: 'center' }}>Note</Table.Th>
<Table.Th style={{ textAlign: 'center' }}>Created by</Table.Th>
<Table.Th style={{ textAlign: 'center' }}>Point</Table.Th>
<Table.Th style={{ textAlign: 'center', width: '25%' }}>
Criteria
</Table.Th>
<Table.Th style={{ textAlign: 'center', width: '45%' }}>Note</Table.Th>
<Table.Th style={{ textAlign: 'center', width: '20%' }}>
Created by
</Table.Th>
<Table.Th style={{ textAlign: 'center', width: '10%' }}>Point</Table.Th>
</Table.Tr>
</Table.Thead>
<Table.Tbody>
{data.map((row, index) => (
<Table.Tr key={index}>
<Table.Td>{row.criteria}</Table.Td>
<Table.Td>{row.note}</Table.Td>
<Table.Td>{row.createdBy}</Table.Td>
<Table.Td style={{ textAlign: 'start' }}>{row.criteria}</Table.Td>
<Table.Td style={{ textAlign: 'start' }}>{row.note}</Table.Td>
<Table.Td style={{ textAlign: 'start' }}>{row.createdBy}</Table.Td>
<Table.Td>{row.point}</Table.Td>
</Table.Tr>
))}

View File

@ -206,8 +206,6 @@ const SprintReview = () => {
setLoading(false)
}
}, [filter])
// console.log(criteriaSprint, 'criteriaSprint')
// console.log(criteriaUsers, 'criteriaUsers')
const getAll = () => {
const fetchData = async () => {
@ -255,7 +253,6 @@ const SprintReview = () => {
const rowStyle = {
height: '30px', // Điều chỉnh chiều cao hàng
}
// console.log(filter, 'filter')
const handleInputChange = (
index: number,
@ -335,7 +332,7 @@ const SprintReview = () => {
searchable
clearable
w="60%"
value={filter.project}
value={filter.project || null}
size="xs"
label=""
data={dataProject.map((project) => ({
@ -343,7 +340,18 @@ const SprintReview = () => {
label: project.name,
}))}
onChange={(e) => {
setFilter({ ...filter, project: e! })
if (e === null) {
// 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>
<Text
@ -359,7 +367,7 @@ const SprintReview = () => {
searchable
clearable
w="40%"
value={filter.sprint}
value={filter.sprint || null} // Đảm bảo rằng nếu filter.sprint trống, thì giá trị sẽ là null
size="xs"
ml={'sm'}
label=""

View File

@ -323,7 +323,7 @@ const TestReport = () => {
searchable
clearable
w="60%"
value={filter.project}
value={filter.project || null}
size="xs"
label=""
data={dataProject.map((project) => ({
@ -331,7 +331,18 @@ const TestReport = () => {
label: project.name,
}))}
onChange={(e) => {
setFilter({ ...filter, project: e! })
if (e === null) {
// 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>
<Text
@ -347,7 +358,7 @@ const TestReport = () => {
searchable
clearable
w="40%"
value={filter.sprint}
value={filter.sprint || null} // Đảm bảo rằng nếu filter.sprint trống, thì giá trị sẽ là null
size="xs"
ml={'sm'}
label=""