Skip to content

Commit

Permalink
Merge pull request #78 from BRACKETS-by-TRIAD/feat/add-upgrade-guide-…
Browse files Browse the repository at this point in the history
…to-changelog

feat: upgrade guide
  • Loading branch information
strstensky authored Feb 12, 2024
2 parents 2204db2 + 8a2ad33 commit 1abc157
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pages/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@ All notable changes to Craftable PRO will be documented on this page.

<div className="changelog-container">

## v2.0.0 - 2024-02-12

### What's Changed

- feat: domain restricted registration
- feat: add support for 2FA
- feat: sortable component
- feat: make CraftableProUser model swappable for other model in config
- feat: added support for time column in generator
- fix: password format in src/Http/Requests/Auth/InviteUserStoreRequest.php
- fix: translations import validation message
- fix: populate locale field in auth form from shared settings data
- fix: added close logic for media element
- fix: password reset route names
- fix: when disabled verification set verified now
- fix: load max file size in media library from config

### [Upgrade Guide](/getting-started/upgrade-guide)

## v1.1.22 - 2023-12-05

### What's Changed
Expand Down
1 change: 1 addition & 0 deletions pages/getting-started/_meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"installation": "Installation",
"upgrade-guide": "Upgrade Guide",
"directory-structure": "Directory Structure",
"config-file": "Configuration",
"inertiajs-configuration": "InertiaJS Configuration",
Expand Down
99 changes: 99 additions & 0 deletions pages/getting-started/upgrade-guide.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import { Callout, Tab, Tabs } from 'nextra-theme-docs';

# Upgrading from v1.x
Follow these steps to upgrade your Craftable PRO installation to v2:

<div className="steps-container">

### Publish Migrations, Assets, and JS Stubs

Execute the following commands in your terminal to publish migrations, public assets, and JavaScript stubs required for Craftable PRO:
```bash copy
php artisan vendor:publish --provider="Brackets\CraftablePro\CraftableProServiceProvider" --tag="craftable-pro-migrations"
php artisan vendor:publish --provider="Brackets\CraftablePro\CraftableProServiceProvider" --tag="craftable-pro-public"
php artisan vendor:publish --provider="Brackets\CraftablePro\CraftableProServiceProvider" --tag="craftable-pro-js-stubs"
```

Don't forget to run the migrations after publishing them:
```bash copy
php artisan migrate
```

### Add newly required npm dependency

Next, you need to add the vue-slicksort package, which is a dependency for some of the draggable functionalities in Craftable PRO's Vue components. Run the following npm command:
{/* prettier-ignore */}
<Tabs items={["npm", "yarn"]}>
<Tab>
```bash copy
npm install vue-slicksort
```
</Tab>
<Tab>
```bash copy
yarn add vue-slicksort
```
</Tab>
</Tabs>

### Update Configuration

If you've previously published the Craftable PRO configuration file, please ensure it's updated. Compare your project's `config/craftable-pro.php` with the default configuration found at `vendor/brackets/craftable-pro/config/craftable-pro.php` and add any missing settings.

### Update Inertia Request Handling

If you've customized CraftableProHandleInertiaRequests middleware, update share method to include the following variables. This enhancement is crucial for supporting two-factor authentication and integrating with social media login services:

```php copy
public function share(Request $request): array
{
// Prior shared data...

$showTwoFactorAuthCTA = $this->showTwoFactorAuthCTA($request);

return array_merge(parent::share($request), [
'auth' => [
// ...
'showTwoFactorCTA' => fn() => $showTwoFactorAuthCTA,
],
// ...
'config' => [
'craftable_pro' => [
'track_user_last_active_time' => config('craftable-pro.track_user_last_active_time', false),
],
'socialite' => [
'microsoft' => config('craftable-pro.social_login.allowed_services.microsoft', false),
'github' => config('craftable-pro.social_login.allowed_services.github', false),
'google' => config('craftable-pro.social_login.allowed_services.google', false),
'twitter' => config('craftable-pro.social_login.allowed_services.twitter', false),
'facebook' => config('craftable-pro.social_login.allowed_services.facebook', false),
'apple' => config('craftable-pro.social_login.allowed_services.apple', false),
],
'media_library' => [
'max_file_size' => config('media-library.max_file_size', 1024 * 1024 * 2),
]
],
// ...
]);
}
```

### Run npm install and npm run craftable-pro:dev

Finally, don't forget to run `craftable-pro:build` or `craftable-pro:dev` to ensure that your project's frontend assets are up-to-date.

{/* prettier-ignore */}
<Tabs items={["npm", "yarn"]}>
<Tab>
```bash copy
npm run craftable-pro:build
```
</Tab>
<Tab>
```bash copy
yarn craftable-pro:build
```
</Tab>
</Tabs>

</div>

0 comments on commit 1abc157

Please sign in to comment.