mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-08 00:02:15 +01:00
Rename tag_filter parameter to tag_match_type
This commit is contained in:
@@ -59,7 +59,7 @@ class ReportController extends Controller
|
|||||||
$filter->addBillable($properties->billable);
|
$filter->addBillable($properties->billable);
|
||||||
$filter->addMemberIdsFilter($properties->memberIds?->toArray());
|
$filter->addMemberIdsFilter($properties->memberIds?->toArray());
|
||||||
$filter->addProjectIdsFilter($properties->projectIds?->toArray());
|
$filter->addProjectIdsFilter($properties->projectIds?->toArray());
|
||||||
$filter->addTagIdsFilter($properties->tagIds?->toArray(), $properties->tagFilter);
|
$filter->addTagIdsFilter($properties->tagIds?->toArray(), $properties->tagMatchType);
|
||||||
$filter->addTaskIdsFilter($properties->taskIds?->toArray());
|
$filter->addTaskIdsFilter($properties->taskIds?->toArray());
|
||||||
$filter->addClientIdsFilter($properties->clientIds?->toArray());
|
$filter->addClientIdsFilter($properties->clientIds?->toArray());
|
||||||
$timeEntriesQuery = $filter->get();
|
$timeEntriesQuery = $filter->get();
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ class ReportController extends Controller
|
|||||||
$properties->setClientIds($request->input('properties.client_ids', null));
|
$properties->setClientIds($request->input('properties.client_ids', null));
|
||||||
$properties->setProjectIds($request->input('properties.project_ids', null));
|
$properties->setProjectIds($request->input('properties.project_ids', null));
|
||||||
$properties->setTagIds($request->input('properties.tag_ids', null));
|
$properties->setTagIds($request->input('properties.tag_ids', null));
|
||||||
$properties->setTagFilter($request->input('properties.tag_filter', null));
|
$properties->setTagMatchType($request->input('properties.tag_match_type', null));
|
||||||
$properties->setTaskIds($request->input('properties.task_ids', null));
|
$properties->setTaskIds($request->input('properties.task_ids', null));
|
||||||
$properties->weekStart = $request->has('properties.week_start') ? Weekday::from($request->input('properties.week_start')) : $user->week_start;
|
$properties->weekStart = $request->has('properties.week_start') ? Weekday::from($request->input('properties.week_start')) : $user->week_start;
|
||||||
$timezone = $user->timezone;
|
$timezone = $user->timezone;
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ class TimeEntryController extends Controller
|
|||||||
$filter->addMemberIdFilter($member);
|
$filter->addMemberIdFilter($member);
|
||||||
$filter->addMemberIdsFilter($request->input('member_ids'));
|
$filter->addMemberIdsFilter($request->input('member_ids'));
|
||||||
$filter->addProjectIdsFilter($request->input('project_ids'));
|
$filter->addProjectIdsFilter($request->input('project_ids'));
|
||||||
$filter->addTagIdsFilter($request->input('tag_ids'), $request->input('tag_filter'));
|
$filter->addTagIdsFilter($request->input('tag_ids'), $request->input('tag_match_type'));
|
||||||
$filter->addTaskIdsFilter($request->input('task_ids'));
|
$filter->addTaskIdsFilter($request->input('task_ids'));
|
||||||
$filter->addClientIdsFilter($request->input('client_ids'));
|
$filter->addClientIdsFilter($request->input('client_ids'));
|
||||||
$filter->addBillableFilter($request->input('billable'));
|
$filter->addBillableFilter($request->input('billable'));
|
||||||
@@ -559,7 +559,7 @@ class TimeEntryController extends Controller
|
|||||||
$filter->addMemberIdFilter($member);
|
$filter->addMemberIdFilter($member);
|
||||||
$filter->addMemberIdsFilter($request->input('member_ids'));
|
$filter->addMemberIdsFilter($request->input('member_ids'));
|
||||||
$filter->addProjectIdsFilter($request->input('project_ids'));
|
$filter->addProjectIdsFilter($request->input('project_ids'));
|
||||||
$filter->addTagIdsFilter($request->input('tag_ids'), $request->input('tag_filter'));
|
$filter->addTagIdsFilter($request->input('tag_ids'), $request->input('tag_match_type'));
|
||||||
$filter->addTaskIdsFilter($request->input('task_ids'));
|
$filter->addTaskIdsFilter($request->input('task_ids'));
|
||||||
$filter->addClientIdsFilter($request->input('client_ids'));
|
$filter->addClientIdsFilter($request->input('client_ids'));
|
||||||
$filter->addBillableFilter($request->input('billable'));
|
$filter->addBillableFilter($request->input('billable'));
|
||||||
|
|||||||
@@ -124,10 +124,10 @@ class ReportStoreRequest extends BaseFormRequest
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
'properties.tag_filter' => [
|
'properties.tag_match_type' => [
|
||||||
'nullable',
|
'nullable',
|
||||||
'string',
|
'string',
|
||||||
'in:'.TimeEntryFilter::TAG_FILTER_CONTAINS.','.TimeEntryFilter::TAG_FILTER_NOT_CONTAINS,
|
'in:'.TimeEntryFilter::TAG_MATCH_TYPE_CONTAINS.','.TimeEntryFilter::TAG_MATCH_TYPE_NOT_CONTAINS,
|
||||||
],
|
],
|
||||||
'properties.task_ids' => [
|
'properties.task_ids' => [
|
||||||
'nullable',
|
'nullable',
|
||||||
|
|||||||
@@ -139,9 +139,9 @@ class TimeEntryAggregateExportRequest extends BaseFormRequest
|
|||||||
})->uuid()->validate($attribute, $value, $fail);
|
})->uuid()->validate($attribute, $value, $fail);
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
'tag_filter' => [
|
'tag_match_type' => [
|
||||||
'string',
|
'string',
|
||||||
'in:'.TimeEntryFilter::TAG_FILTER_CONTAINS.','.TimeEntryFilter::TAG_FILTER_NOT_CONTAINS,
|
'in:'.TimeEntryFilter::TAG_MATCH_TYPE_CONTAINS.','.TimeEntryFilter::TAG_MATCH_TYPE_NOT_CONTAINS,
|
||||||
],
|
],
|
||||||
// Filter by task IDs, task IDs are OR combined
|
// Filter by task IDs, task IDs are OR combined
|
||||||
'task_ids' => [
|
'task_ids' => [
|
||||||
|
|||||||
@@ -125,9 +125,9 @@ class TimeEntryAggregateRequest extends BaseFormRequest
|
|||||||
})->uuid()->validate($attribute, $value, $fail);
|
})->uuid()->validate($attribute, $value, $fail);
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
'tag_filter' => [
|
'tag_match_type' => [
|
||||||
'string',
|
'string',
|
||||||
'in:'.TimeEntryFilter::TAG_FILTER_CONTAINS.','.TimeEntryFilter::TAG_FILTER_NOT_CONTAINS,
|
'in:'.TimeEntryFilter::TAG_MATCH_TYPE_CONTAINS.','.TimeEntryFilter::TAG_MATCH_TYPE_NOT_CONTAINS,
|
||||||
],
|
],
|
||||||
// Filter by task IDs, task IDs are OR combined
|
// Filter by task IDs, task IDs are OR combined
|
||||||
'task_ids' => [
|
'task_ids' => [
|
||||||
|
|||||||
@@ -110,9 +110,9 @@ class TimeEntryIndexExportRequest extends TimeEntryIndexRequest
|
|||||||
})->uuid()->validate($attribute, $value, $fail);
|
})->uuid()->validate($attribute, $value, $fail);
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
'tag_filter' => [
|
'tag_match_type' => [
|
||||||
'string',
|
'string',
|
||||||
'in:'.TimeEntryFilter::TAG_FILTER_CONTAINS.','.TimeEntryFilter::TAG_FILTER_NOT_CONTAINS,
|
'in:'.TimeEntryFilter::TAG_MATCH_TYPE_CONTAINS.','.TimeEntryFilter::TAG_MATCH_TYPE_NOT_CONTAINS,
|
||||||
],
|
],
|
||||||
// Filter by task IDs, task IDs are OR combined
|
// Filter by task IDs, task IDs are OR combined
|
||||||
'task_ids' => [
|
'task_ids' => [
|
||||||
|
|||||||
@@ -103,9 +103,9 @@ class TimeEntryIndexRequest extends BaseFormRequest
|
|||||||
})->uuid()->validate($attribute, $value, $fail);
|
})->uuid()->validate($attribute, $value, $fail);
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
'tag_filter' => [
|
'tag_match_type' => [
|
||||||
'string',
|
'string',
|
||||||
'in:'.TimeEntryFilter::TAG_FILTER_CONTAINS.','.TimeEntryFilter::TAG_FILTER_NOT_CONTAINS,
|
'in:'.TimeEntryFilter::TAG_MATCH_TYPE_CONTAINS.','.TimeEntryFilter::TAG_MATCH_TYPE_NOT_CONTAINS,
|
||||||
],
|
],
|
||||||
// Filter by task IDs, task IDs are OR combined
|
// Filter by task IDs, task IDs are OR combined
|
||||||
'task_ids' => [
|
'task_ids' => [
|
||||||
|
|||||||
@@ -56,8 +56,8 @@ class DetailedReportResource extends BaseResource
|
|||||||
'project_ids' => $this->resource->properties->projectIds?->toArray(),
|
'project_ids' => $this->resource->properties->projectIds?->toArray(),
|
||||||
/** @var array<string>|null $tags_ids Filter by tag IDs, tag IDs are OR combined */
|
/** @var array<string>|null $tags_ids Filter by tag IDs, tag IDs are OR combined */
|
||||||
'tag_ids' => $this->resource->properties->tagIds?->toArray(),
|
'tag_ids' => $this->resource->properties->tagIds?->toArray(),
|
||||||
/** @var string|null $tag_filter Tag filter mode */
|
/** @var string|null $tag_match_type Tag match type */
|
||||||
'tag_filter' => $this->resource->properties->tagFilter,
|
'tag_match_type' => $this->resource->properties->tagMatchType,
|
||||||
/** @var array<string>|null $task_ids Filter by task IDs, task IDs are OR combined */
|
/** @var array<string>|null $task_ids Filter by task IDs, task IDs are OR combined */
|
||||||
'task_ids' => $this->resource->properties->taskIds?->toArray(),
|
'task_ids' => $this->resource->properties->taskIds?->toArray(),
|
||||||
/** @var string|null $rounding_type Rounding type for time entries */
|
/** @var string|null $rounding_type Rounding type for time entries */
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ class ReportPropertiesDto implements Castable
|
|||||||
*/
|
*/
|
||||||
public ?Collection $tagIds = null;
|
public ?Collection $tagIds = null;
|
||||||
|
|
||||||
public ?string $tagFilter = null;
|
public ?string $tagMatchType = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Collection<int, string>|null
|
* @var Collection<int, string>|null
|
||||||
@@ -117,7 +117,7 @@ class ReportPropertiesDto implements Castable
|
|||||||
$dto->clientIds = $data->clientIds !== null ? ReportPropertiesDto::idArrayToCollection($data->clientIds) : null;
|
$dto->clientIds = $data->clientIds !== null ? ReportPropertiesDto::idArrayToCollection($data->clientIds) : null;
|
||||||
$dto->projectIds = $data->projectIds !== null ? ReportPropertiesDto::idArrayToCollection($data->projectIds) : null;
|
$dto->projectIds = $data->projectIds !== null ? ReportPropertiesDto::idArrayToCollection($data->projectIds) : null;
|
||||||
$dto->tagIds = $data->tagIds !== null ? ReportPropertiesDto::idArrayToCollection($data->tagIds) : null;
|
$dto->tagIds = $data->tagIds !== null ? ReportPropertiesDto::idArrayToCollection($data->tagIds) : null;
|
||||||
$dto->tagFilter = isset($data->tagFilter) ? ReportPropertiesDto::tagFilterValue($data->tagFilter) : null;
|
$dto->tagMatchType = isset($data->tagMatchType) ? ReportPropertiesDto::tagMatchTypeValue($data->tagMatchType) : null;
|
||||||
$dto->taskIds = $data->taskIds ? ReportPropertiesDto::idArrayToCollection($data->taskIds) : null;
|
$dto->taskIds = $data->taskIds ? ReportPropertiesDto::idArrayToCollection($data->taskIds) : null;
|
||||||
$dto->group = TimeEntryAggregationType::from($data->group);
|
$dto->group = TimeEntryAggregationType::from($data->group);
|
||||||
$dto->subGroup = TimeEntryAggregationType::from($data->subGroup);
|
$dto->subGroup = TimeEntryAggregationType::from($data->subGroup);
|
||||||
@@ -147,7 +147,7 @@ class ReportPropertiesDto implements Castable
|
|||||||
'clientIds' => $value->clientIds?->toArray(),
|
'clientIds' => $value->clientIds?->toArray(),
|
||||||
'projectIds' => $value->projectIds?->toArray(),
|
'projectIds' => $value->projectIds?->toArray(),
|
||||||
'tagIds' => $value->tagIds?->toArray(),
|
'tagIds' => $value->tagIds?->toArray(),
|
||||||
'tagFilter' => $value->tagFilter,
|
'tagMatchType' => $value->tagMatchType,
|
||||||
'taskIds' => $value->taskIds?->toArray(),
|
'taskIds' => $value->taskIds?->toArray(),
|
||||||
'group' => $value->group->value,
|
'group' => $value->group->value,
|
||||||
'subGroup' => $value->subGroup->value,
|
'subGroup' => $value->subGroup->value,
|
||||||
@@ -191,19 +191,19 @@ class ReportPropertiesDto implements Castable
|
|||||||
/**
|
/**
|
||||||
* @return 'contains'|'not_contains'|null
|
* @return 'contains'|'not_contains'|null
|
||||||
*/
|
*/
|
||||||
public static function tagFilterValue(mixed $tagFilter): ?string
|
public static function tagMatchTypeValue(mixed $tagMatchType): ?string
|
||||||
{
|
{
|
||||||
if ($tagFilter === null) {
|
if ($tagMatchType === null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (! is_string($tagFilter)) {
|
if (! is_string($tagMatchType)) {
|
||||||
throw new \InvalidArgumentException('The given tag filter is not a string');
|
throw new \InvalidArgumentException('The given tag match type is not a string');
|
||||||
}
|
}
|
||||||
if (! in_array($tagFilter, [TimeEntryFilter::TAG_FILTER_CONTAINS, TimeEntryFilter::TAG_FILTER_NOT_CONTAINS], true)) {
|
if (! in_array($tagMatchType, [TimeEntryFilter::TAG_MATCH_TYPE_CONTAINS, TimeEntryFilter::TAG_MATCH_TYPE_NOT_CONTAINS], true)) {
|
||||||
throw new \InvalidArgumentException('The given tag filter is not valid');
|
throw new \InvalidArgumentException('The given tag match type is not valid');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $tagFilter;
|
return $tagMatchType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -238,9 +238,9 @@ class ReportPropertiesDto implements Castable
|
|||||||
$this->tagIds = $tagIds !== null ? ReportPropertiesDto::idArrayToCollection($tagIds) : null;
|
$this->tagIds = $tagIds !== null ? ReportPropertiesDto::idArrayToCollection($tagIds) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setTagFilter(mixed $tagFilter): void
|
public function setTagMatchType(mixed $tagMatchType): void
|
||||||
{
|
{
|
||||||
$this->tagFilter = ReportPropertiesDto::tagFilterValue($tagFilter);
|
$this->tagMatchType = ReportPropertiesDto::tagMatchTypeValue($tagMatchType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ class TimeEntryFilter
|
|||||||
{
|
{
|
||||||
public const string NONE_VALUE = 'none';
|
public const string NONE_VALUE = 'none';
|
||||||
|
|
||||||
public const string TAG_FILTER_CONTAINS = 'contains';
|
public const string TAG_MATCH_TYPE_CONTAINS = 'contains';
|
||||||
|
|
||||||
public const string TAG_FILTER_NOT_CONTAINS = 'not_contains';
|
public const string TAG_MATCH_TYPE_NOT_CONTAINS = 'not_contains';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Builder<TimeEntry>
|
* @var Builder<TimeEntry>
|
||||||
@@ -196,17 +196,17 @@ class TimeEntryFilter
|
|||||||
/**
|
/**
|
||||||
* @param array<string>|null $tagIds
|
* @param array<string>|null $tagIds
|
||||||
*/
|
*/
|
||||||
public function addTagIdsFilter(?array $tagIds, ?string $tagFilter = self::TAG_FILTER_CONTAINS): self
|
public function addTagIdsFilter(?array $tagIds, ?string $tagMatchType = self::TAG_MATCH_TYPE_CONTAINS): self
|
||||||
{
|
{
|
||||||
if ($tagIds === null) {
|
if ($tagIds === null) {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
if ($tagFilter === null) {
|
if ($tagMatchType === null) {
|
||||||
$tagFilter = self::TAG_FILTER_CONTAINS;
|
$tagMatchType = self::TAG_MATCH_TYPE_CONTAINS;
|
||||||
}
|
}
|
||||||
if (! in_array($tagFilter, [self::TAG_FILTER_CONTAINS, self::TAG_FILTER_NOT_CONTAINS], true)) {
|
if (! in_array($tagMatchType, [self::TAG_MATCH_TYPE_CONTAINS, self::TAG_MATCH_TYPE_NOT_CONTAINS], true)) {
|
||||||
Log::warning('Invalid tag filter value', ['value' => $tagFilter]);
|
Log::warning('Invalid tag match type value', ['value' => $tagMatchType]);
|
||||||
$tagFilter = self::TAG_FILTER_CONTAINS;
|
$tagMatchType = self::TAG_MATCH_TYPE_CONTAINS;
|
||||||
}
|
}
|
||||||
$includeNone = in_array(self::NONE_VALUE, $tagIds, true);
|
$includeNone = in_array(self::NONE_VALUE, $tagIds, true);
|
||||||
$tagIds = array_values(array_filter($tagIds, fn (string $id): bool => $id !== self::NONE_VALUE));
|
$tagIds = array_values(array_filter($tagIds, fn (string $id): bool => $id !== self::NONE_VALUE));
|
||||||
@@ -227,7 +227,7 @@ class TimeEntryFilter
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if ($tagFilter === self::TAG_FILTER_NOT_CONTAINS) {
|
if ($tagMatchType === self::TAG_MATCH_TYPE_NOT_CONTAINS) {
|
||||||
$this->builder->where(function (Builder $builder) use ($tagCondition, $includeNone): void {
|
$this->builder->where(function (Builder $builder) use ($tagCondition, $includeNone): void {
|
||||||
$builder->whereNot($tagCondition);
|
$builder->whereNot($tagCondition);
|
||||||
if (! $includeNone) {
|
if (! $includeNone) {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import DateRangePicker from '@/packages/ui/src/Input/DateRangePicker.vue';
|
|||||||
import TagDropdown from '@/packages/ui/src/Tag/TagDropdown.vue';
|
import TagDropdown from '@/packages/ui/src/Tag/TagDropdown.vue';
|
||||||
import { useTagsQuery } from '@/utils/useTagsQuery';
|
import { useTagsQuery } from '@/utils/useTagsQuery';
|
||||||
import { useTagsStore } from '@/utils/useTags';
|
import { useTagsStore } from '@/utils/useTags';
|
||||||
import type { TagFilter } from '@/types/reporting';
|
import type { TagMatchType } from '@/types/reporting';
|
||||||
|
|
||||||
type TimeEntryRoundingType = 'up' | 'down' | 'nearest';
|
type TimeEntryRoundingType = 'up' | 'down' | 'nearest';
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ const selectedProjects = defineModel<string[]>('selectedProjects', { required: t
|
|||||||
const selectedTasks = defineModel<string[]>('selectedTasks', { required: true });
|
const selectedTasks = defineModel<string[]>('selectedTasks', { required: true });
|
||||||
const selectedClients = defineModel<string[]>('selectedClients', { required: true });
|
const selectedClients = defineModel<string[]>('selectedClients', { required: true });
|
||||||
const selectedTags = defineModel<string[]>('selectedTags', { required: true });
|
const selectedTags = defineModel<string[]>('selectedTags', { required: true });
|
||||||
const tagFilter = defineModel<TagFilter>('tagFilter', { required: true });
|
const tagMatchType = defineModel<TagMatchType>('tagMatchType', { required: true });
|
||||||
const billable = defineModel<'true' | 'false' | null>('billable', { required: true });
|
const billable = defineModel<'true' | 'false' | null>('billable', { required: true });
|
||||||
const roundingEnabled = defineModel<boolean>('roundingEnabled', { required: true });
|
const roundingEnabled = defineModel<boolean>('roundingEnabled', { required: true });
|
||||||
const roundingType = defineModel<TimeEntryRoundingType>('roundingType', { required: true });
|
const roundingType = defineModel<TimeEntryRoundingType>('roundingType', { required: true });
|
||||||
@@ -106,12 +106,12 @@ async function createTag(name: string) {
|
|||||||
type="button"
|
type="button"
|
||||||
class="w-full rounded-md px-2 py-1.5 text-left text-sm font-medium"
|
class="w-full rounded-md px-2 py-1.5 text-left text-sm font-medium"
|
||||||
:class="
|
:class="
|
||||||
tagFilter === 'contains'
|
tagMatchType === 'contains'
|
||||||
? 'bg-card-background-active text-text-primary'
|
? 'bg-card-background-active text-text-primary'
|
||||||
: 'text-text-secondary hover:bg-card-background-active'
|
: 'text-text-secondary hover:bg-card-background-active'
|
||||||
"
|
"
|
||||||
@click="
|
@click="
|
||||||
tagFilter = 'contains';
|
tagMatchType = 'contains';
|
||||||
emit('submit');
|
emit('submit');
|
||||||
">
|
">
|
||||||
Contains
|
Contains
|
||||||
@@ -120,12 +120,12 @@ async function createTag(name: string) {
|
|||||||
type="button"
|
type="button"
|
||||||
class="w-full rounded-md px-2 py-1.5 text-left text-sm font-medium"
|
class="w-full rounded-md px-2 py-1.5 text-left text-sm font-medium"
|
||||||
:class="
|
:class="
|
||||||
tagFilter === 'not_contains'
|
tagMatchType === 'not_contains'
|
||||||
? 'bg-card-background-active text-text-primary'
|
? 'bg-card-background-active text-text-primary'
|
||||||
: 'text-text-secondary hover:bg-card-background-active'
|
: 'text-text-secondary hover:bg-card-background-active'
|
||||||
"
|
"
|
||||||
@click="
|
@click="
|
||||||
tagFilter = 'not_contains';
|
tagMatchType = 'not_contains';
|
||||||
emit('submit');
|
emit('submit');
|
||||||
">
|
">
|
||||||
Does Not Contain
|
Does Not Contain
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ import type { ExportFormat } from '@/types/reporting';
|
|||||||
import { getRandomColorWithSeed } from '@/packages/ui/src/utils/color';
|
import { getRandomColorWithSeed } from '@/packages/ui/src/utils/color';
|
||||||
import { useProjectsQuery } from '@/utils/useProjectsQuery';
|
import { useProjectsQuery } from '@/utils/useProjectsQuery';
|
||||||
import { useAggregatedTimeEntriesQuery } from '@/utils/useAggregatedTimeEntriesQuery';
|
import { useAggregatedTimeEntriesQuery } from '@/utils/useAggregatedTimeEntriesQuery';
|
||||||
import type { TagFilter } from '@/types/reporting';
|
import type { TagMatchType } from '@/types/reporting';
|
||||||
|
|
||||||
type TimeEntryRoundingType = 'up' | 'down' | 'nearest';
|
type TimeEntryRoundingType = 'up' | 'down' | 'nearest';
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ const selectedProjects = ref<string[]>([]);
|
|||||||
const selectedMembers = ref<string[]>([]);
|
const selectedMembers = ref<string[]>([]);
|
||||||
const selectedTasks = ref<string[]>([]);
|
const selectedTasks = ref<string[]>([]);
|
||||||
const selectedClients = ref<string[]>([]);
|
const selectedClients = ref<string[]>([]);
|
||||||
const tagFilter = ref<TagFilter>('contains');
|
const tagMatchType = ref<TagMatchType>('contains');
|
||||||
|
|
||||||
const billable = ref<'true' | 'false' | null>(null);
|
const billable = ref<'true' | 'false' | null>(null);
|
||||||
const roundingEnabled = ref<boolean>(false);
|
const roundingEnabled = ref<boolean>(false);
|
||||||
@@ -124,7 +124,7 @@ const filterParams = computed<AggregatedTimeEntriesQueryParams>(() => {
|
|||||||
task_ids: selectedTasks.value.length > 0 ? selectedTasks.value : undefined,
|
task_ids: selectedTasks.value.length > 0 ? selectedTasks.value : undefined,
|
||||||
client_ids: selectedClients.value.length > 0 ? selectedClients.value : undefined,
|
client_ids: selectedClients.value.length > 0 ? selectedClients.value : undefined,
|
||||||
tag_ids: selectedTags.value.length > 0 ? selectedTags.value : undefined,
|
tag_ids: selectedTags.value.length > 0 ? selectedTags.value : undefined,
|
||||||
tag_filter: selectedTags.value.length > 0 ? tagFilter.value : undefined,
|
tag_match_type: selectedTags.value.length > 0 ? tagMatchType.value : undefined,
|
||||||
billable: billable.value !== null ? billable.value : undefined,
|
billable: billable.value !== null ? billable.value : undefined,
|
||||||
member_id: getCurrentRole() === 'employee' ? getCurrentMembershipId() : undefined,
|
member_id: getCurrentRole() === 'employee' ? getCurrentMembershipId() : undefined,
|
||||||
rounding_type: roundingEnabled.value ? roundingType.value : undefined,
|
rounding_type: roundingEnabled.value ? roundingType.value : undefined,
|
||||||
@@ -369,7 +369,7 @@ const tableData = computed(() => {
|
|||||||
v-model:selected-tasks="selectedTasks"
|
v-model:selected-tasks="selectedTasks"
|
||||||
v-model:selected-clients="selectedClients"
|
v-model:selected-clients="selectedClients"
|
||||||
v-model:selected-tags="selectedTags"
|
v-model:selected-tags="selectedTags"
|
||||||
v-model:tag-filter="tagFilter"
|
v-model:tag-match-type="tagMatchType"
|
||||||
v-model:billable="billable"
|
v-model:billable="billable"
|
||||||
v-model:rounding-enabled="roundingEnabled"
|
v-model:rounding-enabled="roundingEnabled"
|
||||||
v-model:rounding-type="roundingType"
|
v-model:rounding-type="roundingType"
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ import ReportingFilterBar from '@/Components/Common/Reporting/ReportingFilterBar
|
|||||||
import { useTimeEntriesReportQuery } from '@/utils/useTimeEntriesReportQuery';
|
import { useTimeEntriesReportQuery } from '@/utils/useTimeEntriesReportQuery';
|
||||||
import { useTimeEntriesMutations } from '@/utils/useTimeEntriesMutations';
|
import { useTimeEntriesMutations } from '@/utils/useTimeEntriesMutations';
|
||||||
import { useOrganizationQuery } from '@/utils/useOrganizationQuery';
|
import { useOrganizationQuery } from '@/utils/useOrganizationQuery';
|
||||||
import type { TagFilter } from '@/types/reporting';
|
import type { TagMatchType } from '@/types/reporting';
|
||||||
|
|
||||||
// TimeEntryRoundingType is now defined in ReportingRoundingControls component
|
// TimeEntryRoundingType is now defined in ReportingRoundingControls component
|
||||||
type TimeEntryRoundingType = 'up' | 'down' | 'nearest';
|
type TimeEntryRoundingType = 'up' | 'down' | 'nearest';
|
||||||
@@ -85,7 +85,7 @@ const selectedProjects = ref<string[]>([]);
|
|||||||
const selectedMembers = ref<string[]>([]);
|
const selectedMembers = ref<string[]>([]);
|
||||||
const selectedTasks = ref<string[]>([]);
|
const selectedTasks = ref<string[]>([]);
|
||||||
const selectedClients = ref<string[]>([]);
|
const selectedClients = ref<string[]>([]);
|
||||||
const tagFilter = ref<TagFilter>('contains');
|
const tagMatchType = ref<TagMatchType>('contains');
|
||||||
const billable = ref<'true' | 'false' | null>(null);
|
const billable = ref<'true' | 'false' | null>(null);
|
||||||
const roundingEnabled = ref<boolean>(false);
|
const roundingEnabled = ref<boolean>(false);
|
||||||
const roundingType = ref<TimeEntryRoundingType>('nearest');
|
const roundingType = ref<TimeEntryRoundingType>('nearest');
|
||||||
@@ -117,7 +117,7 @@ function getFilterAttributes() {
|
|||||||
task_ids: selectedTasks.value.length > 0 ? selectedTasks.value : undefined,
|
task_ids: selectedTasks.value.length > 0 ? selectedTasks.value : undefined,
|
||||||
client_ids: selectedClients.value.length > 0 ? selectedClients.value : undefined,
|
client_ids: selectedClients.value.length > 0 ? selectedClients.value : undefined,
|
||||||
tag_ids: selectedTags.value.length > 0 ? selectedTags.value : undefined,
|
tag_ids: selectedTags.value.length > 0 ? selectedTags.value : undefined,
|
||||||
tag_filter: selectedTags.value.length > 0 ? tagFilter.value : undefined,
|
tag_match_type: selectedTags.value.length > 0 ? tagMatchType.value : undefined,
|
||||||
billable: billable.value !== null ? billable.value : undefined,
|
billable: billable.value !== null ? billable.value : undefined,
|
||||||
rounding_type: roundingEnabled.value ? roundingType.value : undefined,
|
rounding_type: roundingEnabled.value ? roundingType.value : undefined,
|
||||||
rounding_minutes: roundingEnabled.value ? roundingMinutes.value : undefined,
|
rounding_minutes: roundingEnabled.value ? roundingMinutes.value : undefined,
|
||||||
@@ -340,7 +340,7 @@ async function downloadExport(format: ExportFormat) {
|
|||||||
v-model:selected-tasks="selectedTasks"
|
v-model:selected-tasks="selectedTasks"
|
||||||
v-model:selected-clients="selectedClients"
|
v-model:selected-clients="selectedClients"
|
||||||
v-model:selected-tags="selectedTags"
|
v-model:selected-tags="selectedTags"
|
||||||
v-model:tag-filter="tagFilter"
|
v-model:tag-match-type="tagMatchType"
|
||||||
v-model:billable="billable"
|
v-model:billable="billable"
|
||||||
v-model:rounding-enabled="roundingEnabled"
|
v-model:rounding-enabled="roundingEnabled"
|
||||||
v-model:rounding-type="roundingType"
|
v-model:rounding-type="roundingType"
|
||||||
|
|||||||
@@ -448,7 +448,7 @@ const ReportStoreRequest = z
|
|||||||
client_ids: z.union([z.array(z.string()), z.null()]).optional(),
|
client_ids: z.union([z.array(z.string()), z.null()]).optional(),
|
||||||
project_ids: z.union([z.array(z.string()), z.null()]).optional(),
|
project_ids: z.union([z.array(z.string()), z.null()]).optional(),
|
||||||
tag_ids: z.union([z.array(z.string()), z.null()]).optional(),
|
tag_ids: z.union([z.array(z.string()), z.null()]).optional(),
|
||||||
tag_filter: z.enum(['contains', 'not_contains']).optional(),
|
tag_match_type: z.enum(['contains', 'not_contains']).optional(),
|
||||||
task_ids: z.union([z.array(z.string()), z.null()]).optional(),
|
task_ids: z.union([z.array(z.string()), z.null()]).optional(),
|
||||||
group: TimeEntryAggregationType,
|
group: TimeEntryAggregationType,
|
||||||
sub_group: TimeEntryAggregationType,
|
sub_group: TimeEntryAggregationType,
|
||||||
@@ -482,7 +482,7 @@ const DetailedReportResource = z
|
|||||||
client_ids: z.union([z.array(z.string()), z.null()]),
|
client_ids: z.union([z.array(z.string()), z.null()]),
|
||||||
project_ids: z.union([z.array(z.string()), z.null()]),
|
project_ids: z.union([z.array(z.string()), z.null()]),
|
||||||
tag_ids: z.union([z.array(z.string()), z.null()]),
|
tag_ids: z.union([z.array(z.string()), z.null()]),
|
||||||
tag_filter: z.union([z.enum(['contains', 'not_contains']), z.null()]),
|
tag_match_type: z.union([z.enum(['contains', 'not_contains']), z.null()]),
|
||||||
task_ids: z.union([z.array(z.string()), z.null()]),
|
task_ids: z.union([z.array(z.string()), z.null()]),
|
||||||
rounding_type: z.union([z.string(), z.null()]),
|
rounding_type: z.union([z.string(), z.null()]),
|
||||||
rounding_minutes: z.union([z.number(), z.null()]),
|
rounding_minutes: z.union([z.number(), z.null()]),
|
||||||
@@ -3787,7 +3787,7 @@ Users with the permission `time-entries:view:own` can only use this en
|
|||||||
schema: z.array(z.string()).min(1).optional(),
|
schema: z.array(z.string()).min(1).optional(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'tag_filter',
|
name: 'tag_match_type',
|
||||||
type: 'Query',
|
type: 'Query',
|
||||||
schema: z.enum(['contains', 'not_contains']).optional(),
|
schema: z.enum(['contains', 'not_contains']).optional(),
|
||||||
},
|
},
|
||||||
@@ -4173,7 +4173,7 @@ If the group parameters are all set to `null` or are all missing, the
|
|||||||
schema: z.array(z.string()).min(1).optional(),
|
schema: z.array(z.string()).min(1).optional(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'tag_filter',
|
name: 'tag_match_type',
|
||||||
type: 'Query',
|
type: 'Query',
|
||||||
schema: z.enum(['contains', 'not_contains']).optional(),
|
schema: z.enum(['contains', 'not_contains']).optional(),
|
||||||
},
|
},
|
||||||
@@ -4372,7 +4372,7 @@ If the group parameters are all set to `null` or are all missing, the
|
|||||||
schema: z.array(z.string()).min(1).optional(),
|
schema: z.array(z.string()).min(1).optional(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'tag_filter',
|
name: 'tag_match_type',
|
||||||
type: 'Query',
|
type: 'Query',
|
||||||
schema: z.enum(['contains', 'not_contains']).optional(),
|
schema: z.enum(['contains', 'not_contains']).optional(),
|
||||||
},
|
},
|
||||||
@@ -4505,7 +4505,7 @@ If the group parameters are all set to `null` or are all missing, the
|
|||||||
schema: z.array(z.string()).min(1).optional(),
|
schema: z.array(z.string()).min(1).optional(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'tag_filter',
|
name: 'tag_match_type',
|
||||||
type: 'Query',
|
type: 'Query',
|
||||||
schema: z.enum(['contains', 'not_contains']).optional(),
|
schema: z.enum(['contains', 'not_contains']).optional(),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
export type ExportFormat = 'xlsx' | 'csv' | 'ods' | 'pdf';
|
export type ExportFormat = 'xlsx' | 'csv' | 'ods' | 'pdf';
|
||||||
export type TagFilter = 'contains' | 'not_contains';
|
export type TagMatchType = 'contains' | 'not_contains';
|
||||||
|
|||||||
Reference in New Issue
Block a user