Skip to content

Commit 05e7d40

Browse files
authored
Merge pull request #143 from codebar-ag/feature-v0.11.0-merge
Feature v0.11.0 Merge
2 parents b8be38b + 94db43a commit 05e7d40

385 files changed

Lines changed: 23634 additions & 10126 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.ci

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ SESSION_DRIVER=database
3434
SESSION_LIFETIME=120
3535

3636
# Mail
37-
MAIL_MAILER=log
37+
MAIL_MAILER=smtp
38+
MAIL_HOST=localhost
39+
MAIL_PORT=1025
40+
MAIL_USERNAME=null
41+
MAIL_PASSWORD=null
42+
MAIL_ENCRYPTION=null
3843
MAIL_FROM_ADDRESS="no-reply@solidtime.test"
3944
MAIL_FROM_NAME="solidtime"
4045
MAIL_REPLY_TO_ADDRESS="hello@solidtime.test"
@@ -56,3 +61,6 @@ TELESCOPE_ENABLED=false
5661

5762
# Services
5863
GOTENBERG_URL=http://0.0.0.0:3000
64+
65+
# Octane
66+
OCTANE_SERVER=frankenphp

.github/workflows/playwright.yml

Lines changed: 56 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,18 @@ jobs:
1010
if: false # Temporarily disabled
1111
runs-on: ubuntu-latest
1212
timeout-minutes: 60
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8]
17+
shardTotal: [8]
1318

1419
services:
1520
mailpit:
1621
image: 'axllent/mailpit:latest'
22+
ports:
23+
- 1025:1025
24+
- 8025:8025
1725
pgsql_test:
1826
image: postgres:15
1927
env:
@@ -61,22 +69,63 @@ jobs:
6169
- name: "Build Frontend"
6270
run: npm run build
6371

64-
- name: "Run Laravel Server"
65-
run: php artisan serve > /dev/null 2>&1 &
72+
- name: "Install FrankenPHP"
73+
run: |
74+
ARCH="$(uname -m)"
75+
curl -fsSL "https://github.com/dunglas/frankenphp/releases/latest/download/frankenphp-linux-${ARCH}" -o /usr/local/bin/frankenphp
76+
chmod +x /usr/local/bin/frankenphp
77+
78+
- name: "Run Laravel Octane Server"
79+
run: php artisan octane:start --server=frankenphp --host=127.0.0.1 --port=8000 --workers=4 --max-requests=500 > /dev/null 2>&1 &
80+
env:
81+
OCTANE_SERVER: frankenphp
6682

6783
- name: "Install Playwright Browsers"
6884
run: npx playwright install --with-deps
6985

7086
- name: "Run Playwright tests"
71-
run: npx playwright test
87+
run: npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
7288
env:
7389
PLAYWRIGHT_BASE_URL: 'http://127.0.0.1:8000'
90+
MAILPIT_BASE_URL: 'http://localhost:8025'
7491

75-
- name: "Upload test results"
92+
- name: "Upload blob report"
7693
uses: actions/upload-artifact@v4
7794
if: always()
7895
with:
79-
name: test-results
80-
path: test-results/
81-
retention-days: 30
96+
name: blob-report-${{ matrix.shardIndex }}
97+
path: blob-report/
98+
retention-days: 7
99+
100+
merge-reports:
101+
if: needs.test.result == 'success'
102+
needs: [test]
103+
runs-on: ubuntu-latest
104+
steps:
105+
- name: "Checkout code"
106+
uses: actions/checkout@v4
107+
108+
- name: "Setup node"
109+
uses: actions/setup-node@v4
110+
with:
111+
node-version: '20.x'
112+
113+
- name: "Install dependencies"
114+
run: npm ci
82115

116+
- name: "Download blob reports"
117+
uses: actions/download-artifact@v4
118+
with:
119+
path: all-blob-reports
120+
pattern: blob-report-*
121+
merge-multiple: true
122+
123+
- name: "Merge reports"
124+
run: npx playwright merge-reports --reporter html ./all-blob-reports
125+
126+
- name: "Upload merged HTML report"
127+
uses: actions/upload-artifact@v4
128+
with:
129+
name: playwright-report
130+
path: playwright-report/
131+
retention-days: 30

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ If you have a **feature request**, please [**create a discussion**](https://gith
3737

3838
Please open an issue or start a discussion and wait for approval before submitting a pull request. This does not apply to tiny fixes or changes however, please keep in mind that we might not merge PRs for various reasons.
3939

40+
**If you submit an AI slop pull request (especially without following the proper procedure), you will be banned from future contributions to solidtime.**
41+
4042
Please read the [CONTRIBUTING.md](./CONTRIBUTING.md) before sumbitting a Pull Request.
4143

4244
We do accept contributions in the [documentation repository](https://github.com/solidtime-io/docs) f.e. to add new self-hosting guides.

app/Filament/Resources/FailedJobResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static function form(Form $form): Form
5050
TextInput::make('queue')->disabled(),
5151

5252
// make text a little bit smaller because often a complete Stack Trace is shown:
53-
TextArea::make('exception')->disabled()->columnSpan(4)->extraInputAttributes(['style' => 'font-size: 80%;']),
53+
Textarea::make('exception')->disabled()->columnSpan(4)->extraInputAttributes(['style' => 'font-size: 80%;']),
5454
PrettyJsonField::make('payload')->disabled()->columnSpan(4),
5555
])->columns(4);
5656
}

app/Filament/Resources/OrganizationInvitationResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public static function form(Form $form): Form
3939
->required(),
4040
Select::make('role')
4141
->options(Role::class),
42-
Forms\Components\Select::make('organization_id')
42+
Select::make('organization_id')
4343
->label('Organization')
4444
->relationship(name: 'organization', titleAttribute: 'name')
4545
->searchable(['name'])

app/Filament/Resources/OrganizationResource.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public static function form(Form $form): Form
5555
->label('Is personal?')
5656
->hiddenOn(['create'])
5757
->required(),
58-
Forms\Components\Select::make('user_id')
58+
Select::make('user_id')
5959
->label('Owner')
6060
->relationship(name: 'owner', titleAttribute: 'email')
6161
->searchable(['name', 'email'])
@@ -76,7 +76,7 @@ public static function form(Form $form): Form
7676
Select::make('time_format')
7777
->options(TimeFormat::toSelectArray())
7878
->required(),
79-
Forms\Components\Select::make('currency')
79+
Select::make('currency')
8080
->label('Currency')
8181
->options(function (): array {
8282
$currencies = ISOCurrencyProvider::getInstance()->getAvailableCurrencies();
@@ -114,22 +114,22 @@ public static function table(Table $table): Table
114114
{
115115
return $table
116116
->columns([
117-
Tables\Columns\TextColumn::make('name')
117+
TextColumn::make('name')
118118
->searchable()
119119
->sortable(),
120120
Tables\Columns\IconColumn::make('personal_team')
121121
->boolean()
122122
->label('Is personal?')
123123
->sortable(),
124-
Tables\Columns\TextColumn::make('owner.email')
124+
TextColumn::make('owner.email')
125125
->sortable(),
126-
Tables\Columns\TextColumn::make('currency'),
126+
TextColumn::make('currency'),
127127
TextColumn::make('billable_rate')
128128
->money(fn (Organization $resource) => $resource->currency, divideBy: 100),
129-
Tables\Columns\TextColumn::make('created_at')
129+
TextColumn::make('created_at')
130130
->dateTime()
131131
->sortable(),
132-
Tables\Columns\TextColumn::make('updated_at')
132+
TextColumn::make('updated_at')
133133
->dateTime()
134134
->sortable()
135135
->toggleable(isToggledHiddenByDefault: true),
@@ -223,7 +223,7 @@ public static function table(Table $table): Table
223223

224224
return $select;
225225
}),
226-
Forms\Components\Select::make('timezone')
226+
Select::make('timezone')
227227
->label('Timezone')
228228
->options(fn (): array => app(TimezoneService::class)->getSelectOptions())
229229
->searchable()

app/Filament/Resources/OrganizationResource/RelationManagers/UsersRelationManager.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ public function table(Table $table): Table
4949
return $table
5050
->recordTitleAttribute('name')
5151
->columns([
52-
Tables\Columns\TextColumn::make('name'),
53-
Tables\Columns\TextColumn::make('role'),
52+
TextColumn::make('name'),
53+
TextColumn::make('role'),
5454
TextColumn::make('billable_rate')
5555
->money($organization->currency, divideBy: 100),
5656
])
5757
->headerActions([
58-
Tables\Actions\AttachAction::make()
58+
AttachAction::make()
5959
->recordTitle(fn (User $record): string => "{$record->name} ({$record->email})")
6060
->form(fn (AttachAction $action): array => [
6161
$action->getRecordSelect(),

app/Filament/Resources/ReportResource.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ public static function form(Form $form): Form
6363
return $record->getRawOriginal('properties');
6464
})
6565
->disabled(),
66-
Forms\Components\DateTimePicker::make('created_at')
66+
DateTimePicker::make('created_at')
6767
->label('Created At')
6868
->hiddenOn(['create'])
6969
->disabled(),
70-
Forms\Components\DateTimePicker::make('updated_at')
70+
DateTimePicker::make('updated_at')
7171
->label('Updated At')
7272
->hiddenOn(['create'])
7373
->disabled(),
@@ -78,10 +78,10 @@ public static function table(Table $table): Table
7878
{
7979
return $table
8080
->columns([
81-
Tables\Columns\TextColumn::make('name')
81+
TextColumn::make('name')
8282
->searchable()
8383
->sortable(),
84-
Tables\Columns\TextColumn::make('description')
84+
TextColumn::make('description')
8585
->searchable()
8686
->sortable(),
8787
ToggleColumn::make('is_public')
@@ -90,10 +90,10 @@ public static function table(Table $table): Table
9090
TextColumn::make('organization.name')
9191
->searchable()
9292
->sortable(),
93-
Tables\Columns\TextColumn::make('created_at')
93+
TextColumn::make('created_at')
9494
->dateTime()
9595
->sortable(),
96-
Tables\Columns\TextColumn::make('updated_at')
96+
TextColumn::make('updated_at')
9797
->dateTime()
9898
->sortable()
9999
->toggleable(isToggledHiddenByDefault: true),

app/Filament/Resources/TimeEntryResource.php

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace App\Filament\Resources;
66

77
use App\Filament\Resources\TimeEntryResource\Pages;
8+
use App\Models\Member;
89
use App\Models\TimeEntry;
910
use Filament\Forms\Components\DateTimePicker;
1011
use Filament\Forms\Components\Select;
@@ -16,6 +17,7 @@
1617
use Filament\Tables\Columns\TextColumn;
1718
use Filament\Tables\Filters\SelectFilter;
1819
use Filament\Tables\Table;
20+
use Illuminate\Database\Eloquent\Builder;
1921

2022
class TimeEntryResource extends Resource
2123
{
@@ -51,15 +53,23 @@ public static function form(Form $form): Form
5153
->rules([
5254
'after_or_equal:start',
5355
]),
54-
Select::make('user_id')
55-
->relationship(name: 'user', titleAttribute: 'email')
56-
->searchable(['name', 'email'])
56+
Select::make('member_id')
57+
->relationship(
58+
name: 'member',
59+
titleAttribute: 'id',
60+
modifyQueryUsing: fn (Builder $query) => $query->with(['user', 'organization'])
61+
)
62+
->getOptionLabelFromRecordUsing(fn (Member $record): string => $record->user->email.' ('.$record->organization->name.')')
63+
->searchable()
5764
->required(),
5865
Select::make('project_id')
5966
->relationship(name: 'project', titleAttribute: 'name')
6067
->searchable(['name'])
6168
->nullable(),
62-
// TODO
69+
Select::make('task_id')
70+
->relationship(name: 'task', titleAttribute: 'name')
71+
->searchable(['name'])
72+
->nullable(),
6373
]);
6474
}
6575

@@ -83,11 +93,11 @@ public static function table(Table $table): Table
8393
($record->end?->toDateTimeString('minute') ?? '...').')';
8494
})
8595
->label('Time'),
86-
Tables\Columns\TextColumn::make('organization.name')
96+
TextColumn::make('organization.name')
8797
->sortable(),
88-
Tables\Columns\TextColumn::make('created_at')
98+
TextColumn::make('created_at')
8999
->sortable(),
90-
Tables\Columns\TextColumn::make('updated_at')
100+
TextColumn::make('updated_at')
91101
->sortable(),
92102
])
93103
->filters([

app/Filament/Resources/TimeEntryResource/Pages/CreateTimeEntry.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,28 @@
55
namespace App\Filament\Resources\TimeEntryResource\Pages;
66

77
use App\Filament\Resources\TimeEntryResource;
8+
use App\Models\Member;
89
use Filament\Resources\Pages\CreateRecord;
910

1011
class CreateTimeEntry extends CreateRecord
1112
{
1213
protected static string $resource = TimeEntryResource::class;
14+
15+
/**
16+
* @param array<string, mixed> $data
17+
* @return array<string, mixed>
18+
*/
19+
protected function mutateFormDataBeforeCreate(array $data): array
20+
{
21+
if (isset($data['member_id'])) {
22+
/** @var Member|null $member */
23+
$member = Member::query()->find($data['member_id']);
24+
if ($member !== null) {
25+
$data['user_id'] = $member->user_id;
26+
$data['organization_id'] = $member->organization_id;
27+
}
28+
}
29+
30+
return $data;
31+
}
1332
}

0 commit comments

Comments
 (0)