Skip to content

Commit ca487a7

Browse files
committed
wip
1 parent 324a12f commit ca487a7

23 files changed

+12245
-670
lines changed

INTERNAL_CHANGES_GUIDE.md

Lines changed: 304 additions & 596 deletions
Large diffs are not rendered by default.

INTERNAL_CHANGES_GUIDE.patch

Lines changed: 11858 additions & 0 deletions
Large diffs are not rendered by default.

app/Actions/Jetstream/AddOrganizationMember.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class AddOrganizationMember implements AddsTeamMembers
2525
*/
2626
public function add(User $owner, Organization $organization, string $email, ?string $role = null): void
2727
{
28-
Gate::forUser($owner)->authorize('addTeamMember', $organization); // TODO: refactor after owner refactoring
28+
Gate::forUser($owner)->authorize('addTeamMember', [$organization]); // TODO: refactor after owner refactoring
2929

3030
$this->validate($organization, $email, $role);
3131

app/Actions/Jetstream/UpdateOrganization.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class UpdateOrganization implements UpdatesTeamNames
2525
*/
2626
public function update(User $user, Organization $organization, array $input): void
2727
{
28-
Gate::forUser($user)->authorize('update', $organization);
28+
Gate::forUser($user)->authorize('update', [$organization]);
2929

3030
Validator::make($input, [
3131
'name' => [

app/Http/Middleware/ShareInertiaData.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,8 @@ public function handle(Request $request, Closure $next): Response
7979
'currency' => $user->currentTeam->currency,
8080
// Sidebar counts respecting visibility (projects assigned to the user)
8181
'counts' => (function () use ($user) {
82+
/** @var Organization $organization */
8283
$organization = $user->currentTeam;
83-
if ($organization === null) {
84-
return [];
85-
}
8684
/** @var AppPermissionStore $permissionStore */
8785
$permissionStore = app(AppPermissionStore::class);
8886
$canViewAllProjects = $permissionStore->has($organization, 'projects:view:all');

e2e/clients.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ async function goToProjectsOverview(page: Page) {
77
}
88

99
// Create new project via modal
10-
test.skip('test that creating and deleting a new client via the modal works (disabled - deletion no longer supported)', async ({ page }) => {
10+
test.skip('test that creating and deleting a new client via the modal works (disabled - deletion no longer supported)', async ({
11+
page,
12+
}) => {
1113
const newClientName = 'New Project ' + Math.floor(1 + Math.random() * 10000);
1214
await goToProjectsOverview(page);
1315
await page.getByRole('button', { name: 'Create Client' }).click();

e2e/projects.spec.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ async function goToProjectsOverview(page: Page) {
99
}
1010

1111
// Create new project via modal
12-
test.skip('test that creating and deleting a new project via the modal works (disabled - deletion no longer supported)', async ({ page }) => {
12+
test.skip('test that creating and deleting a new project via the modal works (disabled - deletion no longer supported)', async ({
13+
page,
14+
}) => {
1315
const newProjectName = 'New Project ' + Math.floor(1 + Math.random() * 10000);
1416
await goToProjectsOverview(page);
1517
await page.getByRole('button', { name: 'Create Project' }).click();
@@ -102,12 +104,12 @@ test('test that updating billable rate works with existing time entries', async
102104
(await response.json()).data.billable_rate === newBillableRate * 100
103105
),
104106
]);
105-
await expect(
106-
page
107-
.getByRole('row')
108-
.first()
109-
.getByText(formatCentsWithOrganizationDefaults(newBillableRate * 100))
110-
).toBeVisible();
107+
108+
// UI no longer shows billable rate in the overview by default.
109+
// Reopen the edit modal and verify the value was persisted.
110+
await page.getByRole('row').first().getByRole('button').click();
111+
await page.getByRole('menuitem').getByText('Edit').first().click();
112+
await expect(page.getByPlaceholder('Billable Rate')).toHaveValue(newBillableRate.toString());
111113
});
112114

113115
// Create new project with new Client

e2e/tasks.spec.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,12 @@ test('test that creating and deleting a new tag in a new project works', async (
6969

7070
const moreButton = page.locator("[aria-label='Actions for Project " + newProjectName + "']");
7171
moreButton.click();
72-
const deleteButton = page.locator("[aria-label='Delete Project " + newProjectName + "']");
73-
72+
// Deletion no longer supported: archive instead.
73+
const archiveButton = page.locator("[aria-label='Archive Project " + newProjectName + "']");
7474
await Promise.all([
75-
deleteButton.click(),
76-
page.waitForResponse(
77-
async (response) =>
78-
response.url().includes('/projects') &&
79-
response.request().method() === 'DELETE' &&
80-
response.status() === 204
81-
),
75+
archiveButton.click(),
76+
expect(page.getByTestId('project_table')).not.toContainText(newProjectName),
8277
]);
83-
await expect(page.getByTestId('project_table')).not.toContainText(newProjectName);
8478
});
8579

8680
test('test that archiving and unarchiving tasks works', async ({ page }) => {

e2e/timetracker.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,10 @@ test('test that entering a random value in the time range does not start the tim
187187
}) => {
188188
await goToDashboard(page);
189189
await page.getByTestId('time_entry_time').fill('asdasdasd');
190-
await page.getByTestId('time_entry_time').press('Tab'),
190+
(await page.getByTestId('time_entry_time').press('Tab'),
191191
await page.locator(
192192
'[data-testid="dashboard_timer"] [data-testid="timer_button"].bg-accent-300/70'
193-
);
193+
));
194194
});
195195

196196
test('test that entering a time starts the timer on enter', async ({ page }) => {

resources/js/Components/Common/Client/ClientMoreOptionsDropdown.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
2-
import { ArchiveBoxIcon, PencilSquareIcon, TrashIcon } from '@heroicons/vue/20/solid';
2+
import { ArchiveBoxIcon, PencilSquareIcon } from '@heroicons/vue/20/solid';
33
import type { Client } from '@/packages/api/src';
4-
import { canDeleteClients, canUpdateClients } from '@/utils/permissions';
4+
import { canUpdateClients } from '@/utils/permissions';
55
import {
66
DropdownMenu,
77
DropdownMenuContent,

0 commit comments

Comments
 (0)