Skip to content

Commit

Permalink
Added all generated resources files to the package. Fixes the [Missin…
Browse files Browse the repository at this point in the history
…g assets bug](#30)
  • Loading branch information
PavlosIsaris committed Oct 28, 2024
1 parent 401de0b commit ab5c88e
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 15 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@ phpstan.neon
testbench.yaml
vendor
node_modules
public
public/*
storage

# Do not ignore the public directory or the generated files
!/public/cookies-consent.js
!/public/cookies-consent.css
!/public/cookie.png
24 changes: 21 additions & 3 deletions how-to-upgrade-to-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,24 @@ not 100% backward compatible with the v1 configuration file.
So, in order to update to the new configuration file, you should save your current configuration file (e.g.
`config/cookies-consent.php`) to a safe place.

### Step 1: Update the Plugin
### Step 1: Backup any changes made to the styles file

The v.1 of the plugin had a styles file that was published to `public/vendor/cookies_consent/css/style.css`. If you have
made any changes to this file, you should back it up before updating the plugin.

The v2 of the plugin has a new styles file, which is published to
`public/vendor/cookies_consent/css/cookies-consent.css`. You should transfer any changes you made to the old styles file
to the new one.

### Step 2: Update the Plugin

First, update the plugin to the latest version. You can do this by running the following command:

```bash
composer update scify/laravel-cookies-consent
```

### Step 2: Update the Configuration file
### Step 3: Update the Configuration file

1. Publish the new configuration file by running the following command:

Expand All @@ -58,7 +67,8 @@ php artisan vendor:publish --tag=cookies-consent-config --force

**CAUTION**: The `--force` flag is necessary in order to overwrite the existing configuration file.

2. Go over the "Explanation of the configuration file" in the [README.md](README.md) file, in order to understand the new structure
2. Go over the "Explanation of the configuration file" in the [README.md](README.md) file, in order to understand the
new structure
of the configuration file.

3. Compare the new configuration file (`config/cookies-consent.php`) with your old configuration file. You should copy
Expand All @@ -73,3 +83,11 @@ php artisan vendor:publish --tag=cookies-consent-config --force

6. Make sure that the `cookies` array in the new configuration file contains the necessary information about each cookie
(e.g. name, description, duration, etc.).

### Step 4: Update the styles file (if necessary)

If you have made any changes to the styles file in the v1 version of the plugin, you should transfer these changes to
the new styles file.

Old styles file: `public/vendor/cookies_consent/css/style.css`
New styles file: `public/vendor/cookies_consent/css/cookies-consent.css`
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "laravel-cookies-consent",
"version": "2.0.0",
"version": "2.0.1",
"description": "<p align=\"center\"> <img src=\"logo.jpg\" alt=\"logo\" width=\"400\"> </p>",
"main": "index.js",
"directories": {
Expand Down
Binary file added public/cookie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/cookies-consent.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions public/cookies-consent.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 14 additions & 8 deletions resources/scss/cookies-consent.scss
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,6 @@
background-color: #f8f9fa;
color: #000;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);

Expand All @@ -513,13 +512,20 @@

.cookie-actions {
button#accept-all-cookies, button#accept-selected-cookies {
/*Query for non-mobile */
@media (min-width: 576px) {
border-right: 0;
}
/* Query for mobile */
@media (max-width: 575.98px) {
border-bottom: 0;
border-bottom: 1px solid #ccc; // Default style
}
}

/* Query for mobile */
@media (max-width: 575.98px) {
width: calc(100% - 20px);
left: 10px;
right: 10px;
padding: 10px;

.cookie-actions {
button#accept-all-cookies, button#accept-selected-cookies {
border-bottom: 0; // Mobile-specific style
}
}
}
Expand Down

0 comments on commit ab5c88e

Please sign in to comment.