mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-10-16 17:53:18 +01:00
Compare commits
2 Commits
a0262addb7
...
feature/ex
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf7bc076cf | ||
|
|
f6b6b0a467 |
4
.github/workflows/build-onpremise.yml
vendored
4
.github/workflows/build-onpremise.yml
vendored
@@ -141,7 +141,7 @@ jobs:
|
|||||||
${{ env.DOCKER_REPO }}
|
${{ env.DOCKER_REPO }}
|
||||||
|
|
||||||
- name: "Login to solidtime OnPremise Registry"
|
- name: "Login to solidtime OnPremise Registry"
|
||||||
uses: docker/login-action@v4.6.0
|
uses: docker/login-action@v4.5.2
|
||||||
with:
|
with:
|
||||||
registry: registry.on-premise.solidtime.io
|
registry: registry.on-premise.solidtime.io
|
||||||
username: ${{ secrets.ONPREMISE_USERNAME }}
|
username: ${{ secrets.ONPREMISE_USERNAME }}
|
||||||
@@ -195,7 +195,7 @@ jobs:
|
|||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|
||||||
- name: "Login to solidtime OnPremise Registry"
|
- name: "Login to solidtime OnPremise Registry"
|
||||||
uses: docker/login-action@v4.6.0
|
uses: docker/login-action@v4.5.2
|
||||||
with:
|
with:
|
||||||
registry: registry.on-premise.solidtime.io
|
registry: registry.on-premise.solidtime.io
|
||||||
username: ${{ secrets.ONPREMISE_USERNAME }}
|
username: ${{ secrets.ONPREMISE_USERNAME }}
|
||||||
|
|||||||
2
.github/workflows/build-private.yml
vendored
2
.github/workflows/build-private.yml
vendored
@@ -177,7 +177,7 @@ jobs:
|
|||||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||||
|
|
||||||
- name: "Login to GitHub Container Registry"
|
- name: "Login to GitHub Container Registry"
|
||||||
uses: docker/login-action@v4.6.0
|
uses: docker/login-action@v4.5.2
|
||||||
with:
|
with:
|
||||||
registry: rg.fr-par.scw.cloud/solidtime
|
registry: rg.fr-par.scw.cloud/solidtime
|
||||||
username: nologin
|
username: nologin
|
||||||
|
|||||||
8
.github/workflows/build-public.yml
vendored
8
.github/workflows/build-public.yml
vendored
@@ -117,13 +117,13 @@ jobs:
|
|||||||
${{ env.GHCR_REPO }}
|
${{ env.GHCR_REPO }}
|
||||||
|
|
||||||
- name: "Login to Docker Hub Container Registry"
|
- name: "Login to Docker Hub Container Registry"
|
||||||
uses: docker/login-action@v4.6.0
|
uses: docker/login-action@v4.5.2
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: "Login to GitHub Container Registry"
|
- name: "Login to GitHub Container Registry"
|
||||||
uses: docker/login-action@v4.6.0
|
uses: docker/login-action@v4.5.2
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
@@ -177,13 +177,13 @@ jobs:
|
|||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|
||||||
- name: "Login to Docker Hub"
|
- name: "Login to Docker Hub"
|
||||||
uses: docker/login-action@v4.6.0
|
uses: docker/login-action@v4.5.2
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: "Login to GHCR"
|
- name: "Login to GHCR"
|
||||||
uses: docker/login-action@v4.6.0
|
uses: docker/login-action@v4.5.2
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
|
|||||||
2
.github/workflows/phpunit.yml
vendored
2
.github/workflows/phpunit.yml
vendored
@@ -68,7 +68,7 @@ jobs:
|
|||||||
run: php artisan test --stop-on-failure --coverage-text --coverage-clover=coverage.xml
|
run: php artisan test --stop-on-failure --coverage-text --coverage-clover=coverage.xml
|
||||||
|
|
||||||
- name: "Upload coverage reports to Codecov"
|
- name: "Upload coverage reports to Codecov"
|
||||||
uses: codecov/codecov-action@v7.1.1
|
uses: codecov/codecov-action@v7.0.0
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
slug: solidtime-io/solidtime
|
slug: solidtime-io/solidtime
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class ClockifyProjectsImporter extends DefaultImporter
|
|||||||
'organization_id' => $this->organization->id,
|
'organization_id' => $this->organization->id,
|
||||||
], [
|
], [
|
||||||
'color' => $this->colorService->getRandomColor(),
|
'color' => $this->colorService->getRandomColor(),
|
||||||
'is_billable' => ($record['Billability'] ?? '') === 'Yes',
|
'is_billable' => $record['Billability'] === 'Yes',
|
||||||
'billable_rate' => $billableRateKey !== null && $record[$billableRateKey] !== '' ? (int) (((float) $record[$billableRateKey]) * 100) : null,
|
'billable_rate' => $billableRateKey !== null && $record[$billableRateKey] !== '' ? (int) (((float) $record[$billableRateKey]) * 100) : null,
|
||||||
'estimated_time' => isset($record['Estimated (h)']) && is_numeric($record['Estimated (h)']) ? (int) ($record['Estimated (h)'] * 3600) : null,
|
'estimated_time' => isset($record['Estimated (h)']) && is_numeric($record['Estimated (h)']) ? (int) ($record['Estimated (h)'] * 3600) : null,
|
||||||
'archived_at' => $record['Status'] === 'Archived' ? Carbon::now() : null,
|
'archived_at' => $record['Status'] === 'Archived' ? Carbon::now() : null,
|
||||||
@@ -54,7 +54,6 @@ class ClockifyProjectsImporter extends DefaultImporter
|
|||||||
if ($tasksKey !== null && $record[$tasksKey] !== '') {
|
if ($tasksKey !== null && $record[$tasksKey] !== '') {
|
||||||
$tasks = explode(', ', $record[$tasksKey]);
|
$tasks = explode(', ', $record[$tasksKey]);
|
||||||
foreach ($tasks as $task) {
|
foreach ($tasks as $task) {
|
||||||
$this->checkTaskNameLength($task);
|
|
||||||
$this->taskImportHelper->getKey([
|
$this->taskImportHelper->getKey([
|
||||||
'name' => $task,
|
'name' => $task,
|
||||||
'project_id' => $projectId,
|
'project_id' => $projectId,
|
||||||
@@ -84,6 +83,7 @@ class ClockifyProjectsImporter extends DefaultImporter
|
|||||||
'Project',
|
'Project',
|
||||||
'Status',
|
'Status',
|
||||||
'Visibility',
|
'Visibility',
|
||||||
|
'Billability',
|
||||||
];
|
];
|
||||||
foreach ($requiredFields as $requiredField) {
|
foreach ($requiredFields as $requiredField) {
|
||||||
if (! in_array($requiredField, $header, true)) {
|
if (! in_array($requiredField, $header, true)) {
|
||||||
|
|||||||
@@ -103,7 +103,6 @@ class ClockifyTimeEntriesImporter extends DefaultImporter
|
|||||||
}
|
}
|
||||||
$taskId = null;
|
$taskId = null;
|
||||||
if (! $isBreak && $taskKey !== null && $record[$taskKey] !== '') {
|
if (! $isBreak && $taskKey !== null && $record[$taskKey] !== '') {
|
||||||
$this->checkTaskNameLength($record[$taskKey]);
|
|
||||||
$taskId = $this->taskImportHelper->getKey([
|
$taskId = $this->taskImportHelper->getKey([
|
||||||
'name' => $record[$taskKey],
|
'name' => $record[$taskKey],
|
||||||
'project_id' => $projectId,
|
'project_id' => $projectId,
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ use Illuminate\Database\Eloquent\Builder;
|
|||||||
|
|
||||||
abstract class DefaultImporter implements ImporterContract
|
abstract class DefaultImporter implements ImporterContract
|
||||||
{
|
{
|
||||||
protected const TASK_NAME_MAX_LENGTH = 500;
|
|
||||||
|
|
||||||
protected Organization $organization;
|
protected Organization $organization;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -183,16 +181,6 @@ abstract class DefaultImporter implements ImporterContract
|
|||||||
$this->billableRateService = app(BillableRateService::class);
|
$this->billableRateService = app(BillableRateService::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @throws ImportException
|
|
||||||
*/
|
|
||||||
protected function checkTaskNameLength(string $taskName): void
|
|
||||||
{
|
|
||||||
if (strlen($taskName) > self::TASK_NAME_MAX_LENGTH) {
|
|
||||||
throw new ImportException('Task name ("'.$taskName.'") is too long, maximum length is '.self::TASK_NAME_MAX_LENGTH.' characters');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function getReport(): ReportDto
|
public function getReport(): ReportDto
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -113,7 +113,6 @@ class GenericTimeEntriesImporter extends DefaultImporter
|
|||||||
}
|
}
|
||||||
$taskId = null;
|
$taskId = null;
|
||||||
if ($record['task'] !== '') {
|
if ($record['task'] !== '') {
|
||||||
$this->checkTaskNameLength($record['task']);
|
|
||||||
$taskId = $this->taskImportHelper->getKey([
|
$taskId = $this->taskImportHelper->getKey([
|
||||||
'name' => $record['task'],
|
'name' => $record['task'],
|
||||||
'project_id' => $projectId,
|
'project_id' => $projectId,
|
||||||
|
|||||||
@@ -92,7 +92,6 @@ class HarvestTimeEntriesImporter extends DefaultImporter
|
|||||||
}
|
}
|
||||||
$taskId = null;
|
$taskId = null;
|
||||||
if ($record['Task'] !== '') {
|
if ($record['Task'] !== '') {
|
||||||
$this->checkTaskNameLength($record['Task']);
|
|
||||||
$taskId = $this->taskImportHelper->getKey([
|
$taskId = $this->taskImportHelper->getKey([
|
||||||
'name' => $record['Task'],
|
'name' => $record['Task'],
|
||||||
'project_id' => $projectId,
|
'project_id' => $projectId,
|
||||||
|
|||||||
@@ -199,7 +199,6 @@ class SolidtimeImporter extends DefaultImporter
|
|||||||
if ($projectId === null) {
|
if ($projectId === null) {
|
||||||
throw new Exception('Project does not exist');
|
throw new Exception('Project does not exist');
|
||||||
}
|
}
|
||||||
$this->checkTaskNameLength($task['name']);
|
|
||||||
$this->taskImportHelper->getKey([
|
$this->taskImportHelper->getKey([
|
||||||
'name' => $task['name'],
|
'name' => $task['name'],
|
||||||
'project_id' => $projectId,
|
'project_id' => $projectId,
|
||||||
|
|||||||
@@ -153,16 +153,9 @@ class TogglDataImporter extends DefaultImporter
|
|||||||
}
|
}
|
||||||
foreach ($projectMembers as $projectMember) {
|
foreach ($projectMembers as $projectMember) {
|
||||||
$userId = $this->userImportHelper->getKeyByExternalIdentifier((string) $projectMember->user_id);
|
$userId = $this->userImportHelper->getKeyByExternalIdentifier((string) $projectMember->user_id);
|
||||||
if ($userId === null) {
|
|
||||||
throw new Exception('User does not exist');
|
|
||||||
}
|
|
||||||
$memberId = $this->memberImportHelper->getKeyByExternalIdentifier($userId);
|
|
||||||
if ($memberId === null) {
|
|
||||||
throw new Exception('Member does not exist');
|
|
||||||
}
|
|
||||||
$this->projectMemberImportHelper->getKey([
|
$this->projectMemberImportHelper->getKey([
|
||||||
'project_id' => $projectId,
|
'project_id' => $projectId,
|
||||||
'member_id' => $memberId,
|
'member_id' => $this->memberImportHelper->getKeyByExternalIdentifier($userId),
|
||||||
], [
|
], [
|
||||||
'user_id' => $userId,
|
'user_id' => $userId,
|
||||||
'billable_rate' => $projectMember->rate !== null ? (int) ($projectMember->rate * 100) : null,
|
'billable_rate' => $projectMember->rate !== null ? (int) ($projectMember->rate * 100) : null,
|
||||||
@@ -189,7 +182,6 @@ class TogglDataImporter extends DefaultImporter
|
|||||||
if ($projectId === null) {
|
if ($projectId === null) {
|
||||||
throw new Exception('Project does not exist');
|
throw new Exception('Project does not exist');
|
||||||
}
|
}
|
||||||
$this->checkTaskNameLength($task->name);
|
|
||||||
$this->taskImportHelper->getKey([
|
$this->taskImportHelper->getKey([
|
||||||
'name' => $task->name,
|
'name' => $task->name,
|
||||||
'project_id' => $projectId,
|
'project_id' => $projectId,
|
||||||
|
|||||||
@@ -97,7 +97,6 @@ class TogglTimeEntriesImporter extends DefaultImporter
|
|||||||
}
|
}
|
||||||
$taskId = null;
|
$taskId = null;
|
||||||
if ($record['Task'] !== '') {
|
if ($record['Task'] !== '') {
|
||||||
$this->checkTaskNameLength($record['Task']);
|
|
||||||
$taskId = $this->taskImportHelper->getKey([
|
$taskId = $this->taskImportHelper->getKey([
|
||||||
'name' => $record['Task'],
|
'name' => $record['Task'],
|
||||||
'project_id' => $projectId,
|
'project_id' => $projectId,
|
||||||
|
|||||||
@@ -1579,57 +1579,6 @@ test('test that project selection works in create modal', async ({ page, ctx })
|
|||||||
expect(createBody.data.project_id).not.toBeNull();
|
expect(createBody.data.project_id).not.toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test that ctrl+enter submits the create modal after selecting a project via keyboard', async ({
|
|
||||||
page,
|
|
||||||
ctx,
|
|
||||||
}) => {
|
|
||||||
// Regression test for https://github.com/solidtime-io/solidtime/issues/1238
|
|
||||||
const projectName = 'Keyboard Submit Project ' + Math.floor(1 + Math.random() * 10000);
|
|
||||||
await createProjectViaApi(ctx, { name: projectName });
|
|
||||||
|
|
||||||
await goToTimeOverview(page);
|
|
||||||
|
|
||||||
await page.getByRole('button', { name: 'Time entry actions' }).click();
|
|
||||||
await page.getByRole('menuitem', { name: 'Manual time entry' }).click();
|
|
||||||
await expect(page.getByRole('dialog')).toBeVisible();
|
|
||||||
// The menu that opened the modal animates out and only then hands focus back to its
|
|
||||||
// own trigger.
|
|
||||||
await expect(page.locator('[role="menu"]')).toHaveCount(0);
|
|
||||||
|
|
||||||
// Fill the description, then move to the project dropdown and select a project purely via keyboard
|
|
||||||
const description = page.getByRole('dialog').getByRole('textbox', { name: 'Description' });
|
|
||||||
await description.fill('Keyboard submit test');
|
|
||||||
await description.press('Tab');
|
|
||||||
await expect(
|
|
||||||
page.getByRole('dialog').getByRole('button', { name: 'No Project' })
|
|
||||||
).toBeFocused();
|
|
||||||
await page.keyboard.press('Enter');
|
|
||||||
await page.getByTestId('client_dropdown_search').fill(projectName);
|
|
||||||
await expect(page.getByRole('option', { name: projectName })).toBeVisible();
|
|
||||||
await page.keyboard.press('Enter');
|
|
||||||
const projectTrigger = page.getByRole('dialog').getByRole('button', { name: projectName });
|
|
||||||
await expect(projectTrigger).toBeVisible();
|
|
||||||
// The trigger label updates on the next tick, but the dropdown keeps focus until its
|
|
||||||
// exit animation has finished and reka-ui hands focus back to the trigger.
|
|
||||||
await expect(projectTrigger).toBeFocused();
|
|
||||||
|
|
||||||
// Ctrl+Enter must submit even though focus is no longer on the description input
|
|
||||||
const [createResponse] = await Promise.all([
|
|
||||||
page.waitForResponse(
|
|
||||||
(response) => response.url().includes('/time-entries') && response.status() === 201
|
|
||||||
),
|
|
||||||
page.keyboard.press('Control+Enter'),
|
|
||||||
]);
|
|
||||||
const createBody = await createResponse.json();
|
|
||||||
expect(createBody.data.description).toBe('Keyboard submit test');
|
|
||||||
expect(createBody.data.project_id).not.toBeNull();
|
|
||||||
await expect(page.getByRole('dialog')).toBeHidden();
|
|
||||||
const newTimeEntry = page.locator('[data-testid="time_entry_row"]').first();
|
|
||||||
await expect(newTimeEntry.getByTestId('time_entry_description').first()).toHaveValue(
|
|
||||||
'Keyboard submit test'
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('test that tag selection works in create modal', async ({ page }) => {
|
test('test that tag selection works in create modal', async ({ page }) => {
|
||||||
await goToTimeOverview(page);
|
await goToTimeOverview(page);
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ useFocus(clientNameInput, { initialValue: true });
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DialogModal closeable :show="show" @close="show = false" @submit="submit">
|
<DialogModal closeable :show="show" @close="show = false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="flex space-x-2">
|
<div class="flex space-x-2">
|
||||||
<span> Create Client </span>
|
<span> Create Client </span>
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ useFocus(clientNameInput, { initialValue: true });
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DialogModal closeable :show="show" @close="show = false" @submit="submit">
|
<DialogModal closeable :show="show" @close="show = false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="flex space-x-2">
|
<div class="flex space-x-2">
|
||||||
<span> Update Client </span>
|
<span> Update Client </span>
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ const roleDescription = computed(() => {
|
|||||||
v-model:show="showOwnershipTransferConfirmModal"
|
v-model:show="showOwnershipTransferConfirmModal"
|
||||||
:member-name="member.name"
|
:member-name="member.name"
|
||||||
@submit="submit"></MemberOwnershipTransferConfirmModal>
|
@submit="submit"></MemberOwnershipTransferConfirmModal>
|
||||||
<DialogModal closeable :show="show" @close="show = false" @submit="saveWithChecks()">
|
<DialogModal closeable :show="show" @close="show = false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="flex space-x-2">
|
<div class="flex space-x-2">
|
||||||
<span> Update Member </span>
|
<span> Update Member </span>
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ useFocus(clientNameInput, { initialValue: true });
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DialogModal closeable :show="show" @close="show = false" @submit="submit">
|
<DialogModal closeable :show="show" @close="show = false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="flex space-x-2">
|
<div class="flex space-x-2">
|
||||||
<span> Invite Member </span>
|
<span> Invite Member </span>
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ async function submitBillableRate() {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DialogModal closeable :show="show" @close="show = false" @submit="submit">
|
<DialogModal closeable :show="show" @close="show = false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="flex space-x-2">
|
<div class="flex space-x-2">
|
||||||
<span> Edit Project {{ props.originalProject.name }} </span>
|
<span> Edit Project {{ props.originalProject.name }} </span>
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ useFocus(projectNameInput, { initialValue: true });
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DialogModal closeable :show="show" @close="show = false" @submit="submit">
|
<DialogModal closeable :show="show" @close="show = false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="flex space-x-2">
|
<div class="flex space-x-2">
|
||||||
<span>Add Project Member</span>
|
<span>Add Project Member</span>
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ useFocus(projectNameInput, { initialValue: true });
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DialogModal closeable :show="show" @close="show = false" @submit="submit">
|
<DialogModal closeable :show="show" @close="show = false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="flex space-x-2">
|
<div class="flex space-x-2">
|
||||||
<span>Edit Project Member</span>
|
<span>Edit Project Member</span>
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ async function submit() {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DialogModal closeable :show="show" @close="show = false" @submit="submit">
|
<DialogModal closeable :show="show" @close="show = false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="flex space-x-2">
|
<div class="flex space-x-2">
|
||||||
<span> Create Report </span>
|
<span> Create Report </span>
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ async function submit() {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DialogModal closeable :show="show" @close="show = false" @submit="submit">
|
<DialogModal closeable :show="show" @close="show = false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="flex space-x-2">
|
<div class="flex space-x-2">
|
||||||
<span> Create Report </span>
|
<span> Create Report </span>
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ useFocus(tagNameInput, { initialValue: true });
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DialogModal closeable :show="show" @close="show = false" @submit="submit">
|
<DialogModal closeable :show="show" @close="show = false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="flex space-x-2">
|
<div class="flex space-x-2">
|
||||||
<span> Update Tag </span>
|
<span> Update Tag </span>
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ useFocus(taskNameInput, { initialValue: true });
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DialogModal closeable :show="show" @close="show = false" @submit="submit">
|
<DialogModal closeable :show="show" @close="show = false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="flex space-x-2">
|
<div class="flex space-x-2">
|
||||||
<span> Create Task </span>
|
<span> Create Task </span>
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ useFocus(taskNameInput, { initialValue: true });
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DialogModal closeable :show="show" @close="show = false" @submit="submit">
|
<DialogModal closeable :show="show" @close="show = false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="flex space-x-2">
|
<div class="flex space-x-2">
|
||||||
<span> Update Task </span>
|
<span> Update Task </span>
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ async function submit() {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DialogModal closeable :show="show" @close="emit('cancel')" @submit="submit">
|
<DialogModal closeable :show="show" @close="emit('cancel')">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="flex items-center space-x-2">
|
<div class="flex items-center space-x-2">
|
||||||
<Coffee class="w-5 h-5 text-text-secondary" />
|
<Coffee class="w-5 h-5 text-text-secondary" />
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Modal from './Modal.vue';
|
import Modal from './Modal.vue';
|
||||||
|
|
||||||
const emit = defineEmits(['close', 'submit']);
|
const emit = defineEmits(['close']);
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
show: {
|
show: {
|
||||||
@@ -24,12 +24,7 @@ const close = () => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Modal
|
<Modal :show="show" :max-width="maxWidth" :closeable="closeable" @close="close">
|
||||||
:show="show"
|
|
||||||
:max-width="maxWidth"
|
|
||||||
:closeable="closeable"
|
|
||||||
@close="close"
|
|
||||||
@submit="emit('submit')">
|
|
||||||
<div class="px-4 lg:px-6 py-4">
|
<div class="px-4 lg:px-6 py-4">
|
||||||
<div class="text-lg font-medium text-text-primary" role="heading">
|
<div class="text-lg font-medium text-text-primary" role="heading">
|
||||||
<slot name="title" />
|
<slot name="title" />
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Dialog, DialogContent, DialogFooter } from './dialog/index';
|
import { Dialog, DialogContent, DialogFooter } from './dialog/index';
|
||||||
import { computed, nextTick } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
show: {
|
show: {
|
||||||
@@ -17,7 +17,7 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['close', 'submit']);
|
const emit = defineEmits(['close']);
|
||||||
|
|
||||||
const close = () => {
|
const close = () => {
|
||||||
if (props.closeable) {
|
if (props.closeable) {
|
||||||
@@ -25,25 +25,6 @@ const close = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Ctrl+Enter (Cmd+Enter on macOS) submits the modal from any focused element inside it.
|
|
||||||
// Handled in the capture phase so child elements (buttons, dropdown triggers, inputs with
|
|
||||||
// their own Enter handlers) never see the keystroke and cannot open or double-submit.
|
|
||||||
async function onKeydownCapture(event: KeyboardEvent) {
|
|
||||||
if (event.key !== 'Enter' || !(event.ctrlKey || event.metaKey) || event.isComposing) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
event.preventDefault();
|
|
||||||
event.stopPropagation();
|
|
||||||
// Inputs like the time and duration fields commit their value on blur, so blur first
|
|
||||||
// and let the resulting model updates settle before submitting.
|
|
||||||
const active = document.activeElement;
|
|
||||||
if (active instanceof HTMLElement) {
|
|
||||||
active.blur();
|
|
||||||
}
|
|
||||||
await nextTick();
|
|
||||||
emit('submit');
|
|
||||||
}
|
|
||||||
|
|
||||||
const maxWidthClass = computed(() => {
|
const maxWidthClass = computed(() => {
|
||||||
return {
|
return {
|
||||||
sm: 'sm:max-w-sm',
|
sm: 'sm:max-w-sm',
|
||||||
@@ -58,7 +39,7 @@ const maxWidthClass = computed(() => {
|
|||||||
<template>
|
<template>
|
||||||
<Dialog :open="show" @update:open="close">
|
<Dialog :open="show" @update:open="close">
|
||||||
<DialogContent :class="maxWidthClass">
|
<DialogContent :class="maxWidthClass">
|
||||||
<div class="min-w-0" @keydown.capture="onKeydownCapture">
|
<div class="min-w-0">
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ const currentClientName = computed(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DialogModal closeable :show="show" @close="show = false" @submit="submit">
|
<DialogModal closeable :show="show" @close="show = false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="flex space-x-2">
|
<div class="flex space-x-2">
|
||||||
<span> Create Project </span>
|
<span> Create Project </span>
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ useFocus(tagNameInput, { initialValue: true });
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DialogModal closeable :show="show" @close="show = false" @submit="submit">
|
<DialogModal closeable :show="show" @close="show = false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="flex space-x-2">
|
<div class="flex space-x-2">
|
||||||
<span> Create Tags </span>
|
<span> Create Tags </span>
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ async function submit() {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DialogModal closeable :show="show" @close="show = false" @submit="submit">
|
<DialogModal closeable :show="show" @close="show = false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="flex items-center space-x-2 text-amber-600 dark:text-amber-400">
|
<div class="flex items-center space-x-2 text-amber-600 dark:text-amber-400">
|
||||||
<Coffee class="w-5 h-5" />
|
<Coffee class="w-5 h-5" />
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ const billableProxy = computed({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DialogModal closeable :show="show" @close="show = false" @submit="submit">
|
<DialogModal closeable :show="show" @close="show = false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="flex space-x-2">
|
<div class="flex space-x-2">
|
||||||
<span> Create manual time entry </span>
|
<span> Create manual time entry </span>
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ const typeProxy = computed({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DialogModal closeable :show="show" @close="show = false" @submit="submit">
|
<DialogModal closeable :show="show" @close="show = false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="flex space-x-2">
|
<div class="flex space-x-2">
|
||||||
<span> Edit time entry </span>
|
<span> Edit time entry </span>
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ import {
|
|||||||
} from '@/packages/api/src';
|
} from '@/packages/api/src';
|
||||||
import { Checkbox } from '@/packages/ui/src';
|
import { Checkbox } from '@/packages/ui/src';
|
||||||
import { TagIcon, ExclamationTriangleIcon } from '@heroicons/vue/20/solid';
|
import { TagIcon, ExclamationTriangleIcon } from '@heroicons/vue/20/solid';
|
||||||
import { XMarkIcon } from '@heroicons/vue/16/solid';
|
|
||||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '..';
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '..';
|
||||||
import { Button } from '@/packages/ui/src/Buttons';
|
import { Button } from '@/packages/ui/src/Buttons';
|
||||||
import TagDropdown from '@/packages/ui/src/Tag/TagDropdown.vue';
|
import TagDropdown from '@/packages/ui/src/Tag/TagDropdown.vue';
|
||||||
@@ -61,13 +60,6 @@ const projectId = ref<string | null>(null);
|
|||||||
const billable = ref<boolean | undefined>(undefined);
|
const billable = ref<boolean | undefined>(undefined);
|
||||||
const selectedTags = ref<string[]>([]);
|
const selectedTags = ref<string[]>([]);
|
||||||
|
|
||||||
// Clearing the project puts both fields back to "leave unchanged", the same state the form
|
|
||||||
// returns to after a successful submit.
|
|
||||||
function resetProject() {
|
|
||||||
projectId.value = null;
|
|
||||||
taskId.value = undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
const timeEntryBillable = computed({
|
const timeEntryBillable = computed({
|
||||||
get: () => {
|
get: () => {
|
||||||
if (billable.value === undefined) {
|
if (billable.value === undefined) {
|
||||||
@@ -155,7 +147,7 @@ const showBreakWarning = computed(
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DialogModal closeable :show="show" @close="show = false" @submit="submit">
|
<DialogModal closeable :show="show" @close="show = false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="flex space-x-2">
|
<div class="flex space-x-2">
|
||||||
<span> Update {{ timeEntries.length }} time entries </span>
|
<span> Update {{ timeEntries.length }} time entries </span>
|
||||||
@@ -190,59 +182,42 @@ const showBreakWarning = computed(
|
|||||||
</Field>
|
</Field>
|
||||||
<Field>
|
<Field>
|
||||||
<FieldLabel for="project">Project</FieldLabel>
|
<FieldLabel for="project">Project</FieldLabel>
|
||||||
<div class="flex items-center gap-1 min-w-0">
|
<TimeTrackerProjectTaskDropdown
|
||||||
<!-- the dropdown declares its own `class` prop, which goes to the
|
v-model:project="projectId"
|
||||||
trigger button, so the growing has to happen on a wrapper -->
|
v-model:task="taskId"
|
||||||
<div class="flex-1 min-w-0">
|
variant="input"
|
||||||
<TimeTrackerProjectTaskDropdown
|
align="start"
|
||||||
v-model:project="projectId"
|
size="default"
|
||||||
v-model:task="taskId"
|
:clients
|
||||||
variant="input"
|
:create-project
|
||||||
align="start"
|
:create-client
|
||||||
size="default"
|
:currency="currency"
|
||||||
:clients
|
:organization-billable-rate="organizationBillableRate"
|
||||||
:create-project
|
:can-create-project
|
||||||
:create-client
|
empty-placeholder="Select project..."
|
||||||
:currency="currency"
|
allow-reset
|
||||||
:organization-billable-rate="organizationBillableRate"
|
:enable-estimated-time
|
||||||
:can-create-project
|
:projects="projects"
|
||||||
empty-placeholder="Select project..."
|
:tasks="tasks"></TimeTrackerProjectTaskDropdown>
|
||||||
:enable-estimated-time
|
|
||||||
:projects="projects"
|
|
||||||
:tasks="tasks"></TimeTrackerProjectTaskDropdown>
|
|
||||||
</div>
|
|
||||||
<button
|
|
||||||
v-if="projectId !== null"
|
|
||||||
type="button"
|
|
||||||
data-testid="project_reset_button"
|
|
||||||
class="p-1 rounded hover:bg-quaternary text-text-tertiary hover:text-text-primary"
|
|
||||||
@click="resetProject">
|
|
||||||
<XMarkIcon class="w-4 h-4" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</Field>
|
</Field>
|
||||||
<Field>
|
<Field>
|
||||||
<FieldLabel>Tag</FieldLabel>
|
<FieldLabel>Tag</FieldLabel>
|
||||||
<div class="flex items-center space-x-5">
|
<div class="flex space-x-5">
|
||||||
<!-- the dropdown root is `min-w-0`, so as a flex item it would shrink
|
<TagDropdown
|
||||||
below its trigger and let the button overflow into the checkbox -->
|
v-model="selectedTags"
|
||||||
<div class="shrink-0">
|
:create-tag
|
||||||
<TagDropdown
|
:tags="tags"
|
||||||
v-model="selectedTags"
|
:show-no-tag-option="false">
|
||||||
:create-tag
|
<template #trigger>
|
||||||
:tags="tags"
|
<Button variant="input" :disabled="removeAllTags">
|
||||||
:show-no-tag-option="false">
|
<TagIcon class="h-4 text-icon-default" />
|
||||||
<template #trigger>
|
<span v-if="selectedTags.length > 0">
|
||||||
<Button variant="input" :disabled="removeAllTags">
|
Set {{ selectedTags.length }} tags
|
||||||
<TagIcon class="h-4 text-icon-default" />
|
</span>
|
||||||
<span v-if="selectedTags.length > 0">
|
<span v-else>Select Tags...</span>
|
||||||
Set {{ selectedTags.length }} tags
|
</Button>
|
||||||
</span>
|
</template>
|
||||||
<span v-else>Select Tags...</span>
|
</TagDropdown>
|
||||||
</Button>
|
|
||||||
</template>
|
|
||||||
</TagDropdown>
|
|
||||||
</div>
|
|
||||||
<Field orientation="horizontal">
|
<Field orientation="horizontal">
|
||||||
<Checkbox id="no_tags" v-model:checked="removeAllTags"></Checkbox>
|
<Checkbox id="no_tags" v-model:checked="removeAllTags"></Checkbox>
|
||||||
<FieldLabel for="no_tags">Remove all tags</FieldLabel>
|
<FieldLabel for="no_tags">Remove all tags</FieldLabel>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import type {
|
|||||||
Client,
|
Client,
|
||||||
} from '@/packages/api/src';
|
} from '@/packages/api/src';
|
||||||
|
|
||||||
import { PlusCircleIcon, MinusIcon } from '@heroicons/vue/16/solid';
|
import { PlusCircleIcon, MinusIcon, XMarkIcon } from '@heroicons/vue/16/solid';
|
||||||
import ProjectCreateModal from '@/packages/ui/src/Project/ProjectCreateModal.vue';
|
import ProjectCreateModal from '@/packages/ui/src/Project/ProjectCreateModal.vue';
|
||||||
import { twMerge } from 'tailwind-merge';
|
import { twMerge } from 'tailwind-merge';
|
||||||
import { Button } from '@/packages/ui/src/Buttons';
|
import { Button } from '@/packages/ui/src/Buttons';
|
||||||
@@ -58,6 +58,7 @@ const props = withDefaults(
|
|||||||
createClient: (client: CreateClientBody) => Promise<Client | undefined>;
|
createClient: (client: CreateClientBody) => Promise<Client | undefined>;
|
||||||
currency: string;
|
currency: string;
|
||||||
emptyPlaceholder?: string;
|
emptyPlaceholder?: string;
|
||||||
|
allowReset?: boolean;
|
||||||
noProjectValue?: string | null;
|
noProjectValue?: string | null;
|
||||||
enableEstimatedTime: boolean;
|
enableEstimatedTime: boolean;
|
||||||
organizationBillableRate: number | null;
|
organizationBillableRate: number | null;
|
||||||
@@ -69,6 +70,7 @@ const props = withDefaults(
|
|||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
emptyPlaceholder: 'No Project',
|
emptyPlaceholder: 'No Project',
|
||||||
|
allowReset: false,
|
||||||
noProjectValue: NO_PROJECT_ID,
|
noProjectValue: NO_PROJECT_ID,
|
||||||
variant: 'ghost',
|
variant: 'ghost',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
@@ -556,6 +558,12 @@ function selectProject(projectId: string) {
|
|||||||
emit('changed', project.value, task.value);
|
emit('changed', project.value, task.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function resetProject() {
|
||||||
|
project.value = null;
|
||||||
|
task.value = null;
|
||||||
|
emit('changed', project.value, task.value);
|
||||||
|
}
|
||||||
|
|
||||||
const showCreateProject = ref(false);
|
const showCreateProject = ref(false);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -563,28 +571,40 @@ const showCreateProject = ref(false);
|
|||||||
<Dropdown v-model="open" :close-on-content-click="false" :align="props.align">
|
<Dropdown v-model="open" :close-on-content-click="false" :align="props.align">
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<slot name="trigger">
|
<slot name="trigger">
|
||||||
<Button
|
<div class="flex items-center gap-1">
|
||||||
:variant="props.variant"
|
<Button
|
||||||
:size="props.size"
|
:variant="props.variant"
|
||||||
:class="twMerge('w-full justify-start overflow-hidden', props.class)">
|
:size="props.size"
|
||||||
<div
|
:class="twMerge('w-full justify-start overflow-hidden', props.class)">
|
||||||
class="w-2.5 h-2.5 rounded-full shrink-0"
|
<div
|
||||||
:style="{ backgroundColor: selectedProjectColor }"></div>
|
class="w-2.5 h-2.5 rounded-full shrink-0"
|
||||||
<span class="truncate shrink-[1] text-text-primary">{{
|
:style="{ backgroundColor: selectedProjectColor }"></div>
|
||||||
selectedProjectName
|
<span class="truncate shrink-[1] text-text-primary">{{
|
||||||
}}</span>
|
selectedProjectName
|
||||||
<template v-if="currentTask">
|
}}</span>
|
||||||
<ChevronRightIcon class="!size-3 text-text-primary shrink-0 -mx-1" />
|
<template v-if="currentTask">
|
||||||
<span class="truncate shrink-[100]">{{ currentTask.name }}</span>
|
<ChevronRightIcon class="!size-3 text-text-primary shrink-0 -mx-1" />
|
||||||
</template>
|
<span class="truncate shrink-[100]">{{ currentTask.name }}</span>
|
||||||
<template v-if="selectedClientName">
|
</template>
|
||||||
<span class="dark:text-text-tertiary text-text-quaternary shrink-0">•</span>
|
<template v-if="selectedClientName">
|
||||||
<span
|
<span class="dark:text-text-tertiary text-text-quaternary shrink-0"
|
||||||
class="truncate shrink-[200] dark:text-text-tertiary text-text-quaternary"
|
>•</span
|
||||||
>{{ selectedClientName }}</span
|
>
|
||||||
>
|
<span
|
||||||
</template>
|
class="truncate shrink-[200] dark:text-text-tertiary text-text-quaternary"
|
||||||
</Button>
|
>{{ selectedClientName }}</span
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</Button>
|
||||||
|
<button
|
||||||
|
v-if="allowReset && project !== null"
|
||||||
|
type="button"
|
||||||
|
data-testid="project_reset_button"
|
||||||
|
class="p-1 rounded hover:bg-quaternary text-text-tertiary hover:text-text-primary"
|
||||||
|
@click.stop="resetProject">
|
||||||
|
<XMarkIcon class="w-4 h-4" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</slot>
|
</slot>
|
||||||
</template>
|
</template>
|
||||||
<template #content>
|
<template #content>
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
"Project","Client","Status","Visibility","Tasks","Tracked (h)","Estimated (h)","Remaining (h)","Overage (h)","Progress(%)","Project members","Project manager","Note"
|
|
||||||
"Project for Big Company","Big Company","Active","Public","Task 1, Task 2, Task 3","1.38","","","","","Constantin Graf","",""
|
|
||||||
"Project without Client","","Active","Public","","0.00","","","","","Constantin Graf","",""
|
|
||||||
"TEST","Big Company","Active","Public","","0.00","","","","","Constantin Graf","",""
|
|
||||||
|
@@ -119,24 +119,6 @@ class ClockifyProjectsImporterTest extends ImporterTestAbstract
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_import_of_test_file_without_billability_column_defaults_to_not_billable(): void
|
|
||||||
{
|
|
||||||
// Arrange
|
|
||||||
$organization = Organization::factory()->create();
|
|
||||||
$timezone = 'Europe/Vienna';
|
|
||||||
$importer = new ClockifyProjectsImporter;
|
|
||||||
$importer->init($organization);
|
|
||||||
// Some Clockify exports don't contain a "Billability" column.
|
|
||||||
$data = Storage::disk('testfiles')->get('clockify_projects_import_test_5.csv');
|
|
||||||
|
|
||||||
// Act
|
|
||||||
$importer->importData($data, $timezone);
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
$project = Project::query()->where('organization_id', $organization->id)->where('name', 'Project for Big Company')->firstOrFail();
|
|
||||||
$this->assertFalse($project->is_billable);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function test_import_supports_activities_column_alias_for_tasks(): void
|
public function test_import_supports_activities_column_alias_for_tasks(): void
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
|
|||||||
@@ -66,27 +66,4 @@ class GenericTimeEntriesImporterTest extends ImporterTestAbstract
|
|||||||
$this->assertSame(0, $report->projectsCreated);
|
$this->assertSame(0, $report->projectsCreated);
|
||||||
$this->assertSame(0, $report->clientsCreated);
|
$this->assertSame(0, $report->clientsCreated);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_import_fails_if_task_name_is_too_long(): void
|
|
||||||
{
|
|
||||||
// Arrange
|
|
||||||
$organization = Organization::factory()->create();
|
|
||||||
$timezone = 'Europe/Vienna';
|
|
||||||
$importer = new GenericTimeEntriesImporter;
|
|
||||||
$importer->init($organization);
|
|
||||||
$taskName = str_repeat('a', 501);
|
|
||||||
$data = "description,billable,client,project,tags,start,end,task,user_name,user_email\n".
|
|
||||||
'"Working hard","true","Big Company","Project for Big Company","","2024-03-04T09:23:00Z","2024-03-04T10:23:01Z","'.$taskName.'","Peter Tester","peter.test@email.test"';
|
|
||||||
|
|
||||||
// Act
|
|
||||||
try {
|
|
||||||
$importer->importData($data, $timezone);
|
|
||||||
} catch (ImportException $e) {
|
|
||||||
// Assert
|
|
||||||
$this->assertSame('Task name ("'.$taskName.'") is too long, maximum length is 500 characters', $e->getMessage());
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$this->fail();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user