Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@ node_modules
/saturn
/dist/hot
/resources/assets/dist
.mcp.json
.claude
.gemini
AGENTS.md
GEMINI.md
opencode.jsonc
.codegraph
1 change: 0 additions & 1 deletion docs/.vitepress/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export function sidebar(): DefaultTheme.SidebarItem[] {
{ text: 'List', link: '/guide/form-fields/list.md' },
{ text: 'AutocompleteList', link: '/guide/form-fields/autocomplete-list.md' },
{ text: 'Geolocation', link: '/guide/form-fields/geolocation.md' },
{ text: 'Multi-Forms (deprecated)', link: '/guide/multiforms.md' },
// { text: 'Custom form field', link: '/guide/custom-form-fields.md' }
]
},
Expand Down
6 changes: 0 additions & 6 deletions docs/guide/building-entity-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,6 @@ Here is the full list of available methods:

- `configureDefaultSort(string $sortBy, string $sortDir = "asc")`: `EntityListQueryParams $queryParams` will be filled with this default value (see above)

- `configureMultiformAttribute(string $attribute)`: :warning: This feature has been deprecated in version 9.6.0 and was replaced by the [Entity Map](#entity-map) feature. You can still access to the [documentation](multiforms.md) for legacy usage.

- `configureEntityMap(string $attribute, EntityListEntities $entities)`: configure an Entity Map to display multiple entities in a single Entity List; [see detailed section](#entity-map) above.

- `configurePageAlert(string $template, string $alertLevel = null, string $fieldKey = null, bool $declareTemplateAsPath = false)`: display a dynamic message above the list; [see detailed doc](page-alerts.md)
Expand All @@ -255,10 +253,6 @@ To go ahead and learn how to add a link in the Sharp side menu, [look here](buil

## Entity Map

::: info
This feature replaces the deprecated Multiforms functionality, which remains available for legacy use in version 9.x but will be removed in 10.x.
:::

The Entity Map lets you display multiple entities within a single Entity List. This makes it possible to link different Show Pages or Forms based on a discriminating attribute.

To set it up, declare the Entity Map in the `buildListConfig()` method by using `configureEntityMap()`:
Expand Down
6 changes: 0 additions & 6 deletions docs/guide/entity-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,6 @@ class MyEntity extends SharpEntity

When you need to configure a "unique" resource that does not fit into a List / Show schema, like an account or a configuration item, you can use a Single Show or Form. This is a dedicated topic, [documented here](single-show.md).

### Handle Multiforms

::: info
This feature has been deprecated and was replaced in version 9.6.0 by the [Entity Map](./building-entity-list.md#entity-map) feature.
:::

## Declare the Entity in Sharp configuration

The last step is to declare the entity in Sharp, in your `SharpAppServiceProvider` implementation.
Expand Down
4 changes: 0 additions & 4 deletions docs/guide/form-fields/upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ When a crop ratio is set, any uploaded picture will be auto-cropped (centered).

The second argument, `$croppableFileTypes`, provide a way to limit the crop configuration to a list of image files extensions. For instance, it can be useful to define a crop for jpg and png, but not for gif because it will destroy animation.

### `setImageCompactThumbnail(bool $compactThumbnail = true)`

If true and if the upload has a thumbnail, it is limited to 60px high (to compact in a list item, for instance).

### `setImageOptimize(bool $imageOptimize = true)`

If true, some optimization will be applied on the uploaded images (in order to reduce files weight). It relies on spatie's [laravel-image-optimizer](https://github.com/spatie/laravel-image-optimizer). Please note that you will need some of these packages on your system:
Expand Down
79 changes: 0 additions & 79 deletions docs/guide/multiforms.md

This file was deleted.

91 changes: 91 additions & 0 deletions docs/guide/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,94 @@

You should update the following dependencies in your `composer.json` file:
- `inertiajs/inertia-laravel` to `^3.0` (cf. https://inertiajs.com/docs/v3/getting-started/upgrade-guide)

## Deprecated methods

### Forms

#### Upload `setImageCompactThumbnail()` has not impact and can be removed
```php
\Code16\Sharp\Form\Fields\SharpFormUploadField::make('upload')
->setImageCompactThumbnail() // [!code --]
```

## Removed methods

Several features and methods that were deprecated in Sharp 9.0 have been removed to clean up the codebase.

### General
- The `currentSharpRequest()` helper and its associated `CurrentSharpRequest` class were removed. Use `sharp()->context()` instead (cf. [Context](context)).
- The `SharpAuthenticationCheckHandler` interface was removed. Use the `viewSharp` Gate instead.
- The `withSharpCurrentBreadcrumb()` method in `SharpAssertions` was removed. Use `withSharpBreadcrumb()` instead.
- Removal of "multi-forms". Replace all `SharpEntity::getMultiforms()` implementations to `SharpEntityList::configureEntityMap()` instead (cf. [Building entity list](building-entity-list#entity-map)).
- Smart handling of legacy fontaweome icons class has been removed. Tou must convert all `fa-` occurences to `fas-*`, `far-*`, `fab-*`.

### Configuration
- The legacy configuration handling based on the `sharp.php` config file was removed. You must now use a `SharpAppServiceProvider` with a `SharpConfigBuilder`.
- `SharpConfigBuilder::addEntity()` has been removed in favor of `SharpConfigBuilder::declareEntity()`.

### Forms
- The legacy `$formValidatorClass` property handling in `SharpForm` was removed. Implement the `SharpForm::rules()` and `SharpForm::messages()` methods instead (cf. [Building form](building-form#input-validation)). Along with this removal, the following classes have been removed:
- `\Code16\Sharp\Form\Validator\SharpFormRequest`
- `\Code16\Sharp\Form\Validator\SharpValidator`
- `\Code16\Sharp\Http\Middleware\Api\BindSharpValidationResolver`
- In `SharpFormUploadField`, the following deprecated methods were removed:
```php
\Code16\Sharp\Form\Fields\SharpFormUploadField::make('upload')
->setCropRatio() // [!code --]
->setImageCropRatio() // [!code ++]

->shouldOptimizeImage() // [!code --]
->setImageOptimize() // [!code ++]

->setTransformable() // [!code --]
->setImageTransformable() // [!code ++]

->setFileFilterImages() // [!code --]
->setImageOnly() // [!code ++]

->setFileFilter() // [!code --]
->setAllowedExtensions() // [!code ++]
```
- The `FormLayoutColum::withSingleField()` & `ShowLayoutColum::withSingleField()` method was removed. Use `withField()` or `withListField()` instead.
- `SharpFormDateField::setDisplayFormat()` has been removed
- `SharpFormAutocompleteField` was removed. Migrate to the following
- `SharpFormAutocompleteField::make('key', 'local')` to `SharpFormAutocompleteLocalField::make('key')`
- `SharpFormAutocompleteField::make('key', 'remote')` to `SharpFormAutocompleteRemoteField::make('key')`

### Entity Lists
- The `setWidthOnSmallScreens()` and `setWidthOnSmallScreensFill()` methods in `EntityListField` were removed as they are no longer used in the new front-end table UI.
- The `configureMultiformAttribute()` method in `SharpEntityList` was removed. Use `configureEntityMap()` instead.

### Show
- The `configureMultiformAttribute()` method in `SharpShow` was removed. It's not used by sharp.

### Renamed classes

The following classes have been renamed / moved:

```php
use \Code16\Sharp\EntityList\Filters\EntityListCheckFilter; // [!code --]
use \Code16\Sharp\Utils\Filters\CheckFilter; // [!code --]
use \Code16\Sharp\Filters\CheckFilter; // [!code ++]

use \Code16\Sharp\EntityList\Filters\EntityListDateRangeFilter; // [!code --]
use \Code16\Sharp\Utils\Filters\DateRangeFilter; // [!code --]
use \Code16\Sharp\Filters\DateRangeFilter; // [!code ++]

use \Code16\Sharp\EntityList\Filters\EntityListDateRangeRequiredFilter; // [!code --]
use \Code16\Sharp\Utils\Filters\DateRangeRequiredFilter; // [!code --]
use \Code16\Sharp\Filters\DateRangeRequiredFilter; // [!code ++]

use \Code16\Sharp\EntityList\Filters\EntityListSelectFilter; // [!code --]
use \Code16\Sharp\Utils\Filters\SelectFilter; // [!code --]
use \Code16\Sharp\Filters\SelectFilter; // [!code ++]

use \Code16\Sharp\EntityList\Filters\EntityListSelectMultipleFilter; // [!code --]
use \Code16\Sharp\Utils\Filters\SelectMultipleFilter; // [!code --]
use \Code16\Sharp\Filters\SelectMultipleFilter; // [!code ++]

use \Code16\Sharp\EntityList\Filters\EntityListSelectRequiredFilter; // [!code --]
use \Code16\Sharp\Utils\Filters\SelectRequiredFilter; // [!code --]
use \Code16\Sharp\Filters\SelectRequiredFilter; // [!code ++]
```
10 changes: 0 additions & 10 deletions src/Auth/SharpAuthenticationCheckHandler.php

This file was deleted.

9 changes: 0 additions & 9 deletions src/Config/SharpConfigBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,6 @@ public function configureBreadcrumbLabelsCache(bool $cache = true, int $duration
return $this;
}

/** @deprecated use declareEntity instead, and set the entityKey in the SharpEntity class */
public function addEntity(string $key, string $entityClass): self
{
$this->config['entities'][$key] = $entityClass;
$this->config['entity_resolver'] = null;

return $this;
}

public function declareEntity(string $entityClass): self
{
if (! is_subclass_of($entityClass, BaseSharpEntity::class)) {
Expand Down
50 changes: 0 additions & 50 deletions src/Config/SharpLegacyConfigBuilder.php

This file was deleted.

1 change: 0 additions & 1 deletion src/Data/Form/Fields/FormUploadFieldData.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public function __construct(
#[LiteralTypeScriptType('[number, number]')]
public ?array $imageCropRatio = null,
public bool $imageTransformable = true,
public bool $imageCompactThumbnail = false,
public ?bool $imageTransformKeepOriginal = null,
/** @var array<string> */
public ?array $imageTransformableFileTypes = null,
Expand Down
14 changes: 0 additions & 14 deletions src/EntityList/Fields/EntityListField.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,7 @@ public function setHtml(bool $html = true): self
return $this;
}

/**
* @deprecated
*/
public function setWidthOnSmallScreens(int $widthOnSmallScreens): self
{
return $this;
}

/**
* @deprecated
*/
public function setWidthOnSmallScreensFill(): self
{
return $this;
}

public function toArray(): array
{
Expand Down
4 changes: 0 additions & 4 deletions src/EntityList/Fields/EntityListFieldsContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ public function setWidthOfField(string $fieldKey, ?int $width, int|bool|null $wi

if ($widthOnSmallScreens === false) {
$field->hideOnSmallScreens();
} elseif ($widthOnSmallScreens !== null) {
$field->setWidthOnSmallScreens($widthOnSmallScreens);
} else {
$field->setWidthOnSmallScreensFill();
}
}

Expand Down
10 changes: 0 additions & 10 deletions src/EntityList/Filters/EntityListCheckFilter.php

This file was deleted.

10 changes: 0 additions & 10 deletions src/EntityList/Filters/EntityListDateRangeFilter.php

This file was deleted.

10 changes: 0 additions & 10 deletions src/EntityList/Filters/EntityListDateRangeRequiredFilter.php

This file was deleted.

Loading
Loading