Skip to content

Commit

Permalink
fix(#883): use empty list instead of list with empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael von Bargen committed Oct 10, 2023
1 parent 84aff37 commit 5c807be
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ data class DataEntriesForDataEntryTypeQuery(
) : FilterQuery<DataEntry>, PageableSortableQuery {

@Deprecated("Please use other constructor setting sort as List<String>")
constructor(entryType: EntryType, page: Int = 0, size: Int = Int.MAX_VALUE, sort: String): this(
constructor(entryType: EntryType, page: Int = 0, size: Int = Int.MAX_VALUE, sort: String) : this(
entryType = entryType,
page = page,
size = size,
sort = listOf(sort),
sort = if (sort.isBlank()) listOf() else listOf(sort),
)

override fun applyFilter(element: DataEntry) = element.entryType == this.entryType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ data class DataEntriesForUserQuery(
user = user,
page = page,
size = size,
sort = listOf(sort),
sort = if (sort.isBlank()) listOf() else listOf(sort),
filters = filters
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ data class DataEntriesQuery(
constructor(page: Int = 0, size: Int = Int.MAX_VALUE, sort: String, filters: List<String> = listOf()): this(
page = page,
size = size,
sort = listOf(sort),
sort = if (sort.isBlank()) listOf() else listOf(sort),
filters = filters
)

Expand Down
2 changes: 1 addition & 1 deletion view/view-api/src/main/kotlin/query/task/AllTasksQuery.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ data class AllTasksQuery(
constructor(page: Int = 0, size: Int = Int.MAX_VALUE, sort: String, filters: List<String> = listOf()): this(
page = page,
size = size,
sort = listOf(sort),
sort = if (sort.isBlank()) listOf() else listOf(sort),
filters = filters
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ data class AllTasksWithDataEntriesQuery(
constructor(page: Int = 0, size: Int = Int.MAX_VALUE, sort: String, filters: List<String> = listOf()): this(
page = page,
size = size,
sort = listOf(sort),
sort = if (sort.isBlank()) listOf() else listOf(sort),
filters = filters
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ data class TasksForCandidateUserAndGroupQuery(
includeAssigned = includeAssigned,
page = page,
size = size,
sort = listOf(sort),
sort = if (sort.isBlank()) listOf() else listOf(sort),
filters = filters
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ data class TasksForGroupQuery(
includeAssigned = includeAssigned,
page = page,
size = size,
sort = listOf(sort),
sort = if (sort.isBlank()) listOf() else listOf(sort),
filters = filters
)

Expand Down
6 changes: 3 additions & 3 deletions view/view-api/src/main/kotlin/query/task/TasksForUserQuery.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ data class TasksForUserQuery(
assignedToMeOnly = assignedToMeOnly,
page = page,
size = size,
sort = listOf(sort),
sort = if (sort.isBlank()) listOf() else listOf(sort),
filters = filters
)

/**
* Compatibility constructor for old clients.
*/
@Deprecated(message = "Please use other constructor setting the assignedToMeOnly.")
constructor(user: User, page: Int = 0, size: Int = Int.MAX_VALUE, sort: List<String> = listOf(), filters: List<String> = listOf()): this(
constructor(user: User, page: Int = 0, size: Int = Int.MAX_VALUE, sort: String? = null, filters: List<String> = listOf()): this(
user = user,
assignedToMeOnly = false,
page = page,
size = size,
sort = sort,
sort = if (sort.isNullOrBlank()) listOf() else listOf(sort),
filters = filters
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ data class TasksWithDataEntriesForGroupQuery(

@Deprecated("Please use other constructor setting sort as List<String>")
constructor(user: User, includeAssigned: Boolean = false, page: Int = 0, size: Int = Int.MAX_VALUE, sort: String, filters: List<String> = listOf()) : this(
user = user, includeAssigned = includeAssigned, page = page, size = size, sort = listOf(sort), filters = filters
user = user, includeAssigned = includeAssigned, page = page, size = size, if (sort.isBlank()) listOf() else listOf(sort), filters = filters
)

override fun applyFilter(element: TaskWithDataEntries): Boolean =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ data class TasksWithDataEntriesForUserQuery(

@Deprecated("Please use other constructor setting sort as List<String>")
constructor(user: User, assignedToMeOnly: Boolean = false, page: Int = 0, size: Int = Int.MAX_VALUE, sort: String, filters: List<String> = listOf()) : this(
user = user, assignedToMeOnly = assignedToMeOnly, page = page, size = size, sort = listOf(sort), filters = filters
user = user, assignedToMeOnly = assignedToMeOnly, page = page, size = size, sort = if (sort.isBlank()) listOf() else listOf(sort), filters = filters
)

/**
* Compatibility constructor for old clients.
*/
@Deprecated("Please use other constructor setting the assignedToMeOnly.")
constructor(user: User, page: Int = 0, size: Int = Int.MAX_VALUE, sort: List<String> = listOf(), filters: List<String> = listOf()) : this(
user = user, assignedToMeOnly = false, page = page, size = size, sort = sort, filters = filters
constructor(user: User, page: Int = 0, size: Int = Int.MAX_VALUE, sort: String? = null, filters: List<String> = listOf()) : this(
user = user, assignedToMeOnly = false, page = page, size = size, sort = if (sort.isNullOrBlank()) listOf() else listOf(sort), filters = filters
)

override fun applyFilter(element: TaskWithDataEntries): Boolean =
Expand Down

0 comments on commit 5c807be

Please sign in to comment.