From 38ce5c826b46ab4067734a89bcb9a62075a074b5 Mon Sep 17 00:00:00 2001 From: Ben Croker Date: Mon, 8 Apr 2024 07:34:31 -0600 Subject: [PATCH] 3.0.0 --- .github/workflows/code-analysis.yaml | 1 - CHANGELOG-WIP.md | 21 -------------------- CHANGELOG.md | 25 +++++------------------- README.md | 2 +- composer.json | 6 +++--- src/controllers/ComponentsController.php | 2 +- 6 files changed, 10 insertions(+), 47 deletions(-) delete mode 100644 CHANGELOG-WIP.md diff --git a/.github/workflows/code-analysis.yaml b/.github/workflows/code-analysis.yaml index 043d81d..d4bf3fa 100644 --- a/.github/workflows/code-analysis.yaml +++ b/.github/workflows/code-analysis.yaml @@ -5,7 +5,6 @@ on: push: branches: - develop - - v3 workflow_dispatch: permissions: contents: read diff --git a/CHANGELOG-WIP.md b/CHANGELOG-WIP.md deleted file mode 100644 index 5513e74..0000000 --- a/CHANGELOG-WIP.md +++ /dev/null @@ -1,21 +0,0 @@ -# Release Notes for Sprig Core - -## 3.0.0 - Unreleased - -> {warning} Template caches and static page caches should be cleared after performing this update. - -### Added - -- Added compatibility with Craft 5.0.0. - -### Changed - -- Changed how the component configuration is encoded. - -### Removed - -- Removed the `sprig.script` variable. -- Removed the `s-on` attribute. -- Removed the `success` variable. Use `sprig.isSuccess` or `sprig.isError` instead. -- Removed the `flashes` variable. Use `sprig.message` or `craft.app.session.flash()` instead. -- Removed the `id` variable. Use `sprig.modelId` instead. diff --git a/CHANGELOG.md b/CHANGELOG.md index c1ecca8..a155bed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,24 +1,12 @@ # Release Notes for Sprig Core -## 3.0.0-beta.2 - 2024-03-26 - -### Removed - -- Removed the `success` variable. Use `sprig.isSuccess` or `sprig.isError` instead. -- Removed the `flashes` variable. Use `sprig.message` or `craft.app.session.flash()` instead. -- Removed the `id` variable. Use `sprig.modelId` instead. - -## 3.0.0-beta.1 - 2024-02-14 +## 3.0.0 - 2024-04-08 > {warning} Template caches and static page caches should be cleared after performing this update. ### Added -- Added compatibility with Craft 5.0.0. -- Added the `sprig.isSuccess` variable. -- Added the `sprig.isError` variable. -- Added the `sprig.message` variable. -- Added the `sprig.modelId` variable. +- Added compatibility with Craft 5. ### Changed @@ -28,9 +16,6 @@ - Removed the `sprig.script` variable. - Removed the `s-on` attribute. - -### Deprecated - -- Deprecated the `success` variable. Use `sprig.isSuccess` or `sprig.isError` instead. -- Deprecated the `flashes` variable. Use `sprig.message` or `craft.app.session.flash()` instead. -- Deprecated the `id` variable. Use `sprig.modelId` instead. +- Removed the `success` variable. Use `sprig.isSuccess` or `sprig.isError` instead. +- Removed the `flashes` variable. Use `sprig.message` instead. +- Removed the `id` variable. Use `sprig.modelId` instead. diff --git a/README.md b/README.md index 18a7156..32f6478 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ [![Stable Version](https://img.shields.io/packagist/v/putyourlightson/craft-sprig-core?label=stable)]((https://packagist.org/packages/putyourlightson/craft-sprig-core)) [![Total Downloads](https://img.shields.io/packagist/dt/putyourlightson/craft-sprig-core)](https://packagist.org/packages/putyourlightson/craft-sprig-core) -

+

# Sprig Core Module for Craft CMS diff --git a/composer.json b/composer.json index 7f9f1ba..0c0f727 100644 --- a/composer.json +++ b/composer.json @@ -1,12 +1,12 @@ { "name": "putyourlightson/craft-sprig-core", "description": "A reactive Twig component framework for Craft.", - "version": "3.0.0-beta.2", + "version": "3.0.0", "type": "craft-module", "license": "mit", "require": { "php": "^8.2", - "craftcms/cms": "^5.0.0" + "craftcms/cms": "^5.0" }, "require-dev": { "craftcms/ecs": "dev-main", @@ -14,7 +14,7 @@ "craftcms/phpstan": "dev-main", "markhuot/craft-pest-core": "v3.x-dev", "putyourlightson/craft-generate-test-spec": "v2.x-dev", - "putyourlightson/craft-sprig": "^3.0.0-beta.1", + "putyourlightson/craft-sprig": "^3.0", "vlucas/phpdotenv": "^5.4.1" }, "repositories": [ diff --git a/src/controllers/ComponentsController.php b/src/controllers/ComponentsController.php index e52eef7..29cb593 100644 --- a/src/controllers/ComponentsController.php +++ b/src/controllers/ComponentsController.php @@ -131,7 +131,7 @@ private function runActionInternal(string $action): array $modelId = $this->getModelId(); } - $message = $success ? $variables['flashes']['success'] ?? '' : $variables['flashes']['error'] ?? ''; + $message = ($success ? Craft::$app->getSession()->getSuccess() : Craft::$app->getSession()->getError()) ?: ''; $this->setSessionValues($success, $message, $modelId); return $variables;