Skip to content

Commit

Permalink
Merge branch 'release/0.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
choules committed Apr 3, 2024
2 parents 4748620 + 62007ab commit ac3e39f
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 31 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.2.0] - 2024-04-03

### Added

- Added a database seeder to update hardware models and operating system versions after an app update

### Changed

- Adjusted the displayed meta data for minor operating system versions
- Set the alignment of icon columns to center
- Explicitly set a date format (Y-m-d) for the release dates

### Fixed

- Prevent null values for acceptableApplicationBundleIDs and blockedApplicationBundleIDs, what has led to an error in Nudge
- Set correct attribute name for blockedApplicationBundleIDs

## [0.1.1] - 2024-03-27

### Added
Expand Down
66 changes: 37 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ php artisan make:user

**Important**: When deploying in a local testing environment, please be aware that the database seeder will automatically create a first admin account with a `admin@hostname` as user name and a default password `admin`.

## Updating

We are trying to keep the provided data for operating systems and hardware models up to date. So if you update the application you may want to use the provided seeders to update these database tables in your deployment:

```shell
php artisan db:seed UpdateSeeder --force
```

## Configuration

Beside the common options for a Laravel application there are some app specific configuration you may adjust by defining them in your `.env` file:
Expand Down Expand Up @@ -71,35 +79,35 @@ This application is able to dynamically generate a hardware specific JSON file w
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AssociatedBundleIdentifiers</key>
<array>
<string>com.github.macadmins.Nudge</string>
</array>
<key>Label</key>
<string>com.github.macadmins.Nudge</string>
<key>LimitLoadToSessionType</key>
<array>
<string>Aqua</string>
</array>
<key>ProgramArguments</key>
<array>
<string>/Applications/Utilities/Nudge.app/Contents/MacOS/Nudge</string>
<string>-json-url</string>
<string>https://nudge-config.test/macos/config/generic/model/`sysctl hw.model | awk '{ print \$2 }'`</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartCalendarInterval</key>
<array>
<dict>
<key>Minute</key>
<integer>0</integer>
</dict>
<dict>
<key>Minute</key>
<integer>30</integer>
</dict>
</array>
<key>AssociatedBundleIdentifiers</key>
<array>
<string>com.github.macadmins.Nudge</string>
</array>
<key>Label</key>
<string>com.github.macadmins.Nudge</string>
<key>LimitLoadToSessionType</key>
<array>
<string>Aqua</string>
</array>
<key>ProgramArguments</key>
<array>
<string>/Applications/Utilities/Nudge.app/Contents/MacOS/Nudge</string>
<string>-json-url</string>
<string>https://nudge-config.test/macos/config/generic/model/`sysctl hw.model | awk '{ print \$2 }'`</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartCalendarInterval</key>
<array>
<dict>
<key>Minute</key>
<integer>0</integer>
</dict>
<dict>
<key>Minute</key>
<integer>30</integer>
</dict>
</array>
</dict>
</plist>
```
Expand Down
9 changes: 7 additions & 2 deletions app/Filament/Resources/ConfigurationResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Filament\Forms\Components\Repeater;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\Section;
use Filament\Support\Enums\Alignment;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use Illuminate\Support\Arr;
Expand Down Expand Up @@ -116,14 +117,16 @@ public static function form(Form $form): Form
->label('Acceptable Application Bundle ID')
->maxLength(255),
)
->defaultItems(0)
->addActionLabel('Add App Bundle ID'),
Repeater::make('blocked_application_bundle_ids')
Repeater::make('blockedApplicationBundleIDs')
->label('Blocked Application Bundle IDs')
->simple(
TextInput::make('blockedApplicationBundleIDs')
TextInput::make('blocked_application_bundle_id')
->label('Blocked Application Bundle ID')
->maxLength(255),
)
->defaultItems(0)
->addActionLabel('Add App Bundle ID'),

])
Expand Down Expand Up @@ -330,11 +333,13 @@ public static function table(Table $table): Table
->sortable(),
Tables\Columns\IconColumn::make('parent_configuration_exists')->exists('parentConfiguration')
->label('has Parent Config')
->alignment(Alignment::Center)
->boolean()
->trueColor('info')
->falseColor('gray'),
Tables\Columns\IconColumn::make('has_nudge_config')
->label('Nudge Configuration')
->alignment(Alignment::Center)
->boolean()
->trueColor('info')
->falseColor('gray'),
Expand Down
1 change: 1 addition & 0 deletions app/Filament/Resources/MajorOperatingSystemResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public static function table(Table $table): Table
->sortable(),
Tables\Columns\TextColumn::make('minor_operating_systems_max_release_date')->max('minorOperatingSystems', 'release_date')
->label('Latest release')
->date("Y-m-d")
->sortable(),
])
->filters([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Support\Enums\Alignment;
use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
Expand Down Expand Up @@ -40,7 +41,14 @@ public function table(Table $table): Table
->sortable(),
Tables\Columns\TextColumn::make('release_date')
->searchable()
->date("Y-m-d")
->sortable(),
Tables\Columns\IconColumn::make('about_update_url')
->icon('heroicon-o-globe-alt')
->alignment(Alignment::Center)
->color('info')
->url(fn ($record) => $record->about_update_url)
->openUrlInNewTab(),
])
->filters([
//
Expand Down
21 changes: 21 additions & 0 deletions database/seeders/UpdateSeeder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class UpdateSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$this->call([
MajorOperatingSystemSeeder::class,
MinorOperatingSystemSeeder::class,
HardwareModelSeeder::class,
]);
}
}

0 comments on commit ac3e39f

Please sign in to comment.