-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added support for fetching single task
- Loading branch information
Showing
12 changed files
with
164 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import React from 'react'; | ||
|
||
import { Box, HStack } from '@chakra-ui/react'; | ||
import { SortBy } from 'src/services/getTasks'; | ||
|
||
import { SortButton } from 'src/components/SortButton'; | ||
|
||
interface TitleRowProps { | ||
currentSort: SortBy; | ||
setCurrentSort: React.Dispatch<React.SetStateAction<SortBy>>; | ||
sortAsc: boolean; | ||
setSortAsc: React.Dispatch<React.SetStateAction<boolean>>; | ||
detailView?: boolean; | ||
} | ||
|
||
const TitleRow: React.FC<TitleRowProps> = ({ | ||
currentSort, | ||
setCurrentSort, | ||
setSortAsc, | ||
sortAsc, | ||
detailView, | ||
}) => ( | ||
<HStack | ||
display={'flex'} | ||
p="8px 16px" | ||
justifyContent={'space-around'} | ||
spacing={5} | ||
> | ||
<Box flex="1" textAlign="left" textColor={'#484848'} fontSize={'sm'}> | ||
Status | ||
</Box> | ||
<SortButton | ||
currentSort={currentSort} | ||
setCurrentSort={setCurrentSort} | ||
sortAsc={sortAsc} | ||
setSortAsc={setSortAsc} | ||
title={'Task Name'} | ||
name={SortBy.Name} | ||
/> | ||
<Box flex="2" textAlign="left" textColor={'#484848'} fontSize={'sm'}> | ||
Task-ID | ||
</Box> | ||
<SortButton | ||
currentSort={currentSort} | ||
setCurrentSort={setCurrentSort} | ||
sortAsc={sortAsc} | ||
setSortAsc={setSortAsc} | ||
title={'Next Execution Time'} | ||
name={SortBy.Default} | ||
/> | ||
</HStack> | ||
); | ||
|
||
export default TitleRow; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...ler-ui/src/main/java/com/github/bekk/dbscheduleruiapi/model/TaskDetailsRequestParams.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.github.bekk.dbscheduleruiapi.model; | ||
|
||
import java.util.Optional; | ||
|
||
public class TaskDetailsRequestParams extends TaskRequestParams { | ||
|
||
private Optional<String> taskId; | ||
private String taskName; | ||
|
||
public TaskDetailsRequestParams() { | ||
} | ||
|
||
public TaskDetailsRequestParams(TaskFilter filter, int pageNumber, int size, TaskSort sorting, boolean asc, String taskName, Optional<String> taskId) { | ||
super(filter, pageNumber, size, sorting, asc); | ||
this.taskId = taskId; | ||
this.taskName = taskName; | ||
} | ||
|
||
public Optional<String> getTaskId() { | ||
return taskId; | ||
} | ||
|
||
public void setTaskId(Optional<String> taskId) { | ||
this.taskId = taskId; | ||
} | ||
|
||
public String getTaskName() { | ||
return taskName; | ||
} | ||
|
||
public void setTaskName(String taskName) { | ||
this.taskName = taskName; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
db-scheduler-ui/src/main/java/com/github/bekk/dbscheduleruiapi/util/TaskPagination.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.github.bekk.dbscheduleruiapi.util; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class TaskPagination { | ||
|
||
public static <T> List<T> paginate(List<T> allItems, int pageNumber, int pageSize) { | ||
int startIndex = pageNumber * pageSize; | ||
int endIndex = Math.min(startIndex + pageSize, allItems.size()); | ||
|
||
return (startIndex < endIndex) ? allItems.subList(startIndex, endIndex) : new ArrayList<>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters