Skip to content

feat(ids): Lower probability of same id twice on page. - OEL-3642 #666

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

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions src/components/bcl-accordion/accordion.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- title_tag (string) (default: 'h2')
- title_link: (link object) (default: {})
- title_attributes: (drupal attrs)
- id (int) (default: random(1000))
- id (int) (default: random(10000))
- flush (boolean) (default: false)
- items (array) (default: []): format: [
{
Expand All @@ -26,7 +26,7 @@
{% set _title_tag = title_tag|default('h2') %}
{% set _title_link = title_link|default({}) %}
{% set _title_attributes = title_attributes ?: create_attribute() %}
{% set _id = id|default(random(1000)) %}
{% set _id = id|default(random(10000)) %}
{% set _flush = flush ?? false %}
{% set _items = items|default([]) %}
{% set _expand_button = expand_button|default({}) %}
Expand Down
2 changes: 1 addition & 1 deletion src/components/bcl-dropdown/dropdown.html.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% apply spaceless %}

{# Parameters:
- id (string) (default: dropdown-random(1000))
- id (string) (default: dropdown-random(10000))
- trigger (link or button)
- link (boolean) (default: false)
- direction (string) (default: '')
Expand Down
4 changes: 2 additions & 2 deletions src/components/bcl-modal/modal.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{# Parameters:
- size (string) default('')
options: sm, lg, xl, fullscreen
- id (boolean) (default: modal-random(1000))
- id (boolean) (default: modal-random(10000))
- fullscreen_responsive (string) (default: '')
options: sm, md, lg, xl, xxl
- static_backdrop (boolean) (default: false)
Expand All @@ -23,7 +23,7 @@
#}

{% set _size = size|default('') %}
{% set _id = id|default('modal-' ~ random(1000)) %}
{% set _id = id|default('modal-' ~ random(10000)) %}
{% set _fullscreen_responsive = fullscreen_responsive|default('') %}
{% set _static_backdrop = static_backdrop ?? false %}
{% set _verticaly_centered = verticaly_centered ?? false %}
Expand Down
4 changes: 2 additions & 2 deletions src/compositions/bcl-file/file-translations.html.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% apply spaceless %}

{# Parameters:
- id (string) (default: language-dropdown-random(1000))
- id (string) (default: language-dropdown-random(10000))
- label (string) (default: '')
- icon_path (string) (default: '')
- items (string) (default: [])
Expand All @@ -15,7 +15,7 @@
]
#}

{% set _id = id|default('language-dropdown' ~ random(1000)) %}
{% set _id = id|default('language-dropdown' ~ random(10000)) %}
{% set _label = label|default('') %}
{% set _icon_path = icon_path|default('') %}
{% set _items = items|default([]) %}
Expand Down
4 changes: 2 additions & 2 deletions src/compositions/bcl-gallery/gallery.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{#
Parameters:
- id (string) (default: gallery-random(1000))
- id (string) (default: gallery-random(10000))
- title (string) (default: '')
- title_tag (string) (default: 'h2')
- title_link: (link object) (default: {})
Expand All @@ -28,7 +28,7 @@ Parameters:
carousel
#}

{% set _id = id|default('gallery-' ~ random(1000)) %}
{% set _id = id|default('gallery-' ~ random(10000)) %}
{% set _title = title|default('') %}
{% set _title_tag = title_tag|default('h2') %}
{% set _title_link = title_link|default({}) %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{% apply spaceless %}

{# Parameters:
- id (string) (default: collapse-random(1000), optional)
- id (string) (default: collapse-random(10000), optional)
- message (alert object) (default: {})
- expandable (button object) (default: {})
- languages (link[]) (default: [])
#}

{% set _id = id|default('collapse-' ~ random(1000)) %}
{% set _id = id|default('collapse-' ~ random(10000)) %}
{% set _message = message|default({}) %}
{% set _expandable = expandable|default({}) %}
{% set _languages = languages|default([]) %}
Expand Down
4 changes: 2 additions & 2 deletions src/compositions/bcl-timeline/timeline.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{#
Parameters:
- id: (integer) (default: random(1000))
- id: (integer) (default: random(10000))
- title: (string) (default: '')
- title_tag: (string) (default: 'h2')
- title_link: (link object) (default: {})
Expand All @@ -25,7 +25,7 @@ Parameters:
- icon_path (string) (default: ''): file containing the svg icons
#}

{% set _id = id|default(random(1000)) %}
{% set _id = id|default(random(10000)) %}
{% set _title = title|default('') %}
{% set _title_tag = title_tag|default('h2') %}
{% set _title_link = title_link|default({}) %}
Expand Down
Loading