Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blacklistPage and whitelistPage do not support RegExp #100

Closed
evheniyrz opened this issue Apr 27, 2021 · 2 comments
Closed

blacklistPage and whitelistPage do not support RegExp #100

evheniyrz opened this issue Apr 27, 2021 · 2 comments
Assignees

Comments

@evheniyrz
Copy link

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

CookieConsent and Library Versions?

- cookieconsent version: 3.1.1
- ngx-cookieconsent version: 2.2.3

OS Version?

Windows 10 64-bit

Angular, Node and al Versions?

Angular 10

Repro steps

  1. Create a cookie consent config.
  2. Try to add whitelistPage or blacklistPage to configuration with RegExp value.

The log given by the failure

Type 'RegExp' is not assignable to type 'string' .ts(2322)

Desired functionality

a regular expression can be added to a whitelist Page or blacklist Page by the documentation

 /**
     * Simple whitelist for pages. specify page by:
     * - using a string : '/index.html'           (matches '/index.html' exactly) OR
     * - using RegExp   : /\/page_[\d]+\.html/    (matched '/page_1.html' and '/page_2.html' etc)
     *
     */
    whitelistPage?: string[]; !!!!!!!!!! why only : string[]
    /**
     * Simple blacklist for pages. specify page by:
     * - using a string : '/index.html'           (matches '/index.html' exactly) OR
     * - using RegExp   : /\/page_[\d]+\.html/    (matched '/page_1.html' and '/page_2.html' etc)
     *
     */
    blacklistPage?: string[]; !!!!!!!!! why only : string[]

thanks for consideration

@tinesoft tinesoft self-assigned this Apr 30, 2021
@tinesoft
Copy link
Owner

tinesoft commented Apr 30, 2021

Hi @evheniyrz !

First of all, thanks for using the library and for issuing the 100th issue! 🎊
I will fix that ASAP, stay tuned.

Cheers!

github-actions bot pushed a commit that referenced this issue Oct 8, 2022
# [3.0.0](v2.2.3...v3.0.0) (2022-10-08)

### Bug Fixes

* **core:** add `rel="noopener"` in html templates with `target="_blank"` ([4907c35](4907c35))
* add missing generic type to angular module ([7a44f3f](7a44f3f))
* **bundling:** missing external dependency 'rxjs/operators' ([baa7af8](baa7af8))
* **demo:** workaround for StackBlitz not supporting external scripts ([845af1a](845af1a)), closes [#69](#69)
* cookieconsent may be undefined ([290cac3](290cac3))

### Code Refactoring

* **core:** rename `initialize$` subscription into `initializing$` ([7233aa0](7233aa0))

### Features

* **config:** allow `whitelistPage`/  `blacklistPage` to accept RegExp[] ([8c95e6d](8c95e6d)), closes [#100](#100)
* **core:** add `initialized$` and `initializationError$` subscriptions ([a994f5e](a994f5e))
* **core:** improve `WindowService` to work on both browser and server ([cdb5e0a](cdb5e0a))
* **core:** loosen version of angular peerDependencies to v12 or higher ([ad9b4a2](ad9b4a2))
* **core:** migrate to Angular 12 and Nx workspace ([0d36a56](0d36a56))
* **core:** migrate to Angular 13 and Nx 13 ([c398496](c398496))

### BREAKING CHANGES

* **core:** `initialize$`  has been renamed to better reflect when this event is triggered

Use `initialized$` to get notify when the `cookieconsent` **has done** initializing successfully

***
[skip ci]
@github-actions
Copy link

github-actions bot commented Oct 8, 2022

🎉 This issue has been resolved in version 3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants