<commit_before>{% extends 'OroUIBundle:actions:view.html.twig' %}
{% import 'OroDataGridBundle::macros.html.twig' as dataGrid %}
{% import 'OroUIBundle::macros.html.twig' as UI %}

{% oro_title_set({params : {"%role%": entity.label }}) %}

{% set gridName = 'role-view-users-grid' %}

{% block pageHeader %}
    {% set breadcrumbs = {
        'entity': entity,
        'indexPath': path('oro_user_role_index'),
        'indexLabel': 'oro.user.role.entity_plural_label'|trans,
        'entityTitle': entity.label|default('N/A'|trans)
    } %}
    {{ parent() }}
{% endblock pageHeader %}

{% block navButtonContainer %}
    {% block navButtons %}
        {% placeholder view_navButtons with {entity: entity} %}
        {% if entity.id is defined and is_granted('DELETE', entity) %}
            {{ UI.deleteButton({
                'dataUrl': path('oro_api_delete_role', {'id': entity.id}),
                'dataRedirect': path('oro_user_role_index'),
                'aCss': 'no-hash remove-button',
                'dataId': entity.id,
                'id': 'btn-remove-role',
                'entity_label': 'oro.user.role.entity_label'|trans,
                'disabled': not allow_delete
            })
            }}
        {% endif %}
    {% endblock navButtons %}
{% endblock navButtonContainer %}

{% block content_data %}
    {% set dataBlocks = [
        {
            'title': 'General'|trans,
            'class': 'active',
            'subblocks': [
                {'data' : [
                    UI.renderProperty('oro.user.role.role.label'|trans, entity.label)
                ]}
            ]
        }
    ] %}

    {% set additionalBlock %}
        {% if (entity.organization is defined) %}
            {{ UI.renderHtmlProperty('oro.user.role.organization.label'|trans, entity.organization) }}
        {% endif %}
        {{ UI.renderHtmlProperty('oro.user.role.extend_description.label'|trans, entity.extendDescription) }}
    {% endset %}

    {% set rolePermissionsGrid %}
        <div {{ UI.renderPageComponentAttributes({
            module: 'orouser/js/components/role/entity-category-tabs-component',
            options: tabsOptions
        }) }}></div>
        {{ dataGrid.renderGrid('role-permission-grid', {role: entity}, { cssClass: 'inner-permissions-grid', themeOptions: {readonly: true} }) }}
        <div {{ UI.renderPageComponentAttributes({
            module: 'orouser/js/components/role/capability-set-component',
            options: capabilitySetOptions
        }) }}></div>
    {% endset %}

    {% set dataBlocks = dataBlocks|merge([{
        'title': 'Additional'|trans,
        'subblocks': [{
            'data': [
                additionalBlock<commit_msg>BAP-16184: Fields validation on user/role/view page<commit_after>{% extends 'OroUIBundle:actions:view.html.twig' %}
{% import 'OroDataGridBundle::macros.html.twig' as dataGrid %}
{% import 'OroUIBundle::macros.html.twig' as UI %}

{% oro_title_set({params : {"%role%": entity.label }}) %}

{% set gridName = 'role-view-users-grid' %}

{% block pageHeader %}
    {% set breadcrumbs = {
        'entity': entity,
        'indexPath': path('oro_user_role_index'),
        'indexLabel': 'oro.user.role.entity_plural_label'|trans,
        'entityTitle': entity.label|default('N/A'|trans)
    } %}
    {{ parent() }}
{% endblock pageHeader %}

{% block navButtonContainer %}
    {% block navButtons %}
        {% placeholder view_navButtons with {entity: entity} %}
        {% if entity.id is defined and is_granted('DELETE', entity) %}
            {{ UI.deleteButton({
                'dataUrl': path('oro_api_delete_role', {'id': entity.id}),
                'dataRedirect': path('oro_user_role_index'),
                'aCss': 'no-hash remove-button',
                'dataId': entity.id,
                'id': 'btn-remove-role',
                'entity_label': 'oro.user.role.entity_label'|trans,
                'disabled': not allow_delete
            })
            }}
        {% endif %}
    {% endblock navButtons %}
{% endblock navButtonContainer %}

{% block content_data %}
    {% set dataBlocks = [
        {
            'title': 'General'|trans,
            'class': 'active',
            'subblocks': [
                {'data' : [
                    UI.renderProperty('oro.user.role.role.label'|trans, entity.label)
                ]}
            ]
        }
    ] %}

    {% set additionalBlock %}
        {% if (entity.organization is defined) %}
            {{ UI.renderProperty('oro.user.role.organization.label'|trans, entity.organization) }}
        {% endif %}
        {{ UI.renderHtmlProperty('oro.user.role.extend_description.label'|trans, entity.extendDescription|oro_html_sanitize) }}
    {% endset %}

    {% set rolePermissionsGrid %}
        <div {{ UI.renderPageComponentAttributes({
            module: 'orouser/js/components/role/entity-category-tabs-component',
            options: tabsOptions
        }) }}></div>
        {{ dataGrid.renderGrid('role-permission-grid', {role: entity}, { cssClass: 'inner-permissions-grid', themeOptions: {readonly: true} }) }}
        <div {{ UI.renderPageComponentAttributes({
            module: 'orouser/js/components/role/capability-set-component',
            options: capabilitySetOptions
        }) }}></div>
    {% endset %}

    {% set dataBlocks = dataBlocks|merge([{
        'title': 'Additional'|trans,
        'subblocks': [{
            'data': [
                additionalBlock
{'fraction_non_alphanumeric': 0.15775009160864786, 'fraction_numerical': 0.0009160864785635764, 'mean_word_length': 2.306480920654149, 'pattern_counts': {'":': 2, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3521089', 'n_tokens_mistral': 1695, 'n_tokens_neox': 1565, 'n_words': 262}